@depay/widgets 12.6.0 → 12.6.1

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.
@@ -7,7 +7,7 @@ z=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="functio
7
7
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
8
8
  e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new I(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var p={};function f(){}function m(){}function y(){}var g={};l(g,s,(function(){return this}));var v=Object.getPrototypeOf,w=v&&v(v(k([])));w&&w!==i&&o.call(w,s)&&(g=w);var b=y.prototype=f.prototype=Object.create(g);function M(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,n){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var i;this._invoke=function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=y,l(b,"constructor",y),l(y,"constructor",m),m.displayName=l(y,c,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},r.awrap=function(e){return{__await:e}},M(A.prototype),l(A.prototype,u,(function(){return this})),r.AsyncIterator=A,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new A(d(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},M(b),l(b,c,"Generator"),l(b,s,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},r.values=k,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(pa)),pa.exports}var ga,va={exports:{}};var wa,ba={exports:{}};function Ma(){return wa||(wa=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(ba)),ba.exports}var Aa,Ea={exports:{}};function Na(){return Aa||(Aa=1,function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(Ea)),Ea.exports}var Ta,Ia,ka={exports:{}},La={exports:{}};function xa(){return Ta||(Ta=1,function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(La)),La.exports}function Sa(){return Ia||(Ia=1,function(e){var t=xa();e.exports=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports}(ka)),ka.exports}var ja,Ca,Da={exports:{}},Oa={exports:{}};function za(){return ja||(ja=1,function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(Oa)),Oa.exports}function _a(){return Ca||(Ca=1,function(e){var t=ma().default,n=za();e.exports=function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Da)),Da.exports}var Pa,Ba={exports:{}};function Ra(){return Pa||(Pa=1,function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Ba)),Ba.exports}var Ua,Wa={exports:{}};function Qa(){return Ua||(Ua=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(h=1,u=new Array(d-1);h<d;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(Wa)),Wa.exports}!function(e){var t=ua.exports;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(function(){if(ha)return da;ha=1;var e=ya()();da=e;try{regeneratorRuntime=e}catch(t){"object"===("undefined"==typeof globalThis?"undefined":_(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return da}()),r=t((ga||(ga=1,function(e){function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports}(va)),va.exports)),i=t(ma()),o=t(Ma()),a=t(Na()),s=t(Sa()),u=t(_a()),c=t(Ra()),l=Qa();function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var h=function(e){(0,s.default)(p,e);var t,u,c,l,h=d(p);function p(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,o.default)(this,p);var a=r.autoconnect,s=void 0===a||a,u=r.reconnect,c=void 0===u||u,l=r.reconnect_interval,d=void 0===l?1e3:l,f=r.max_reconnects,m=void 0===f?5:f,y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(r,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=h.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=n,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_timer_id=void 0,t.reconnect_interval=d,t.max_reconnects=m,t.rest_options=y,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,a.default)(p,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,n,r){var o=this;return r||"object"!==(0,i.default)(n)||(r=n,n=null),new Promise((function(i,a){if(!o.ready)return a(new Error("socket not ready"));var s=o.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:s};o.socket.send(JSON.stringify(u),r,(function(e){if(e)return a(e);o.queue[s]={promise:[i,a]},n&&(o.queue[s].timeout=setTimeout((function(){delete o.queue[s],a(new Error("reply timeout"))}),n))}))}))}},{key:"login",value:(l=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(c=(0,r.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"notify",value:function(e,t){var n=this;return new Promise((function(r,i){if(!n.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};n.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);r()}))}))}},{key:"subscribe",value:(u=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var n=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){n.ready=!0,n.emit("open"),n.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=Ee.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&n.listeners(t.notification).length){if(!Object.keys(t.params).length)return n.emit(t.notification);var r=[t.notification];if(t.params.constructor===Object)r.push(t.params);else for(var i=0;i<t.params.length;i++)r.push(t.params[i]);return Promise.resolve().then((function(){n.emit.apply(n,r)}))}if(!n.queue[t.id])return t.method&&t.params?Promise.resolve().then((function(){n.emit(t.method,t.params)})):void 0;"error"in t=="result"in t&&n.queue[t.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),n.queue[t.id].timeout&&clearTimeout(n.queue[t.id].timeout),t.error?n.queue[t.id].promise[1](t.error):n.queue[t.id].promise[0](t.result),delete n.queue[t.id]})),this.socket.addEventListener("error",(function(e){return n.emit("error",e)})),this.socket.addEventListener("close",(function(r){var i=r.code,o=r.reason;n.ready&&setTimeout((function(){return n.emit("close",i,o)}),0),n.ready=!1,n.socket=void 0,1e3!==i&&(n.current_reconnects++,n.reconnect&&(n.max_reconnects>n.current_reconnects||0===n.max_reconnects)&&(n.reconnect_timer_id=setTimeout((function(){return n._connect(e,t)}),n.reconnect_interval)))}))}}]),p}(l.EventEmitter);e.default=h}(sa);var Ya=j(sa),Fa={};!function(e){var t=ua.exports;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){return new u(e,t)};var n=t(Ma()),r=t(Na()),i=t(Sa()),o=t(_a()),a=t(Ra());function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.default)(e);if(t){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}var u=function(e){(0,i.default)(o,e);var t=s(o);function o(e,r,i){var a;return(0,n.default)(this,o),(a=t.call(this)).socket=new window.WebSocket(e,i),a.socket.onopen=function(){return a.emit("open")},a.socket.onmessage=function(e){return a.emit("message",e.data)},a.socket.onerror=function(e){return a.emit("error",e)},a.socket.onclose=function(e){a.emit("close",e.code,e.reason)},a}return(0,r.default)(o,[{key:"send",value:function(e,t,n){var r=n||t;try{this.socket.send(e),r()}catch(e){r(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,n){this.socket.addEventListener(e,t,n)}}]),o}(Qa().EventEmitter)}(Fa);for(var Va=j(Fa),Ha=[],Ga=[],qa=[],Za=BigInt(0),Ja=BigInt(1),Xa=BigInt(2),Ka=BigInt(7),$a=BigInt(256),es=BigInt(113),ts=0,ns=Ja,rs=1,is=0;ts<24;ts++){var os=[is,(2*rs+3*is)%5];rs=os[0],is=os[1],Ha.push(2*(5*is+rs)),Ga.push((ts+1)*(ts+2)/2%64);for(var as=Za,ss=0;ss<7;ss++)(ns=(ns<<Ja^(ns>>Ka)*es)%$a)&Xa&&(as^=Ja<<(Ja<<BigInt(ss))-Ja);qa.push(as)}var us=$(kt(qa,!0),2),cs=us[0],ls=us[1],ds=function(e,t,n){return n>32?St(e,t,n):Lt(e,t,n)},hs=function(e,t,n){return n>32?jt(e,t,n):xt(e,t,n)};var ps=function(e){Y(n,bt);var t=X(n);function n(e,r,i){var o,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(R(this,n),(o=t.call(this)).blockLen=e,o.suffix=r,o.outputLen=i,o.enableXOF=s,o.rounds=u,o.pos=0,o.posOut=0,o.finished=!1,o.destroyed=!1,ct(i),0>=o.blockLen||o.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");return o.state=new Uint8Array(200),o.state32=(a=o.state,new Uint32Array(a.buffer,a.byteOffset,Math.floor(a.byteLength/4))),o}return W(n,[{key:"keccak",value:function(){!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=new Uint32Array(10),r=24-t;r<24;r++){for(var i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(var o=0;o<10;o+=2)for(var a=(o+8)%10,s=(o+2)%10,u=n[s],c=n[s+1],l=ds(u,c,1)^n[a],d=hs(u,c,1)^n[a+1],h=0;h<50;h+=10)e[o+h]^=l,e[o+h+1]^=d;for(var p=e[2],f=e[3],m=0;m<24;m++){var y=Ga[m],g=ds(p,f,y),v=hs(p,f,y),w=Ha[m];p=e[w],f=e[w+1],e[w]=g,e[w+1]=v}for(var b=0;b<50;b+=10){for(var M=0;M<10;M++)n[M]=e[b+M];for(var A=0;A<10;A++)e[b+A]^=~n[(A+2)%10]&n[(A+4)%10]}e[0]^=cs[r],e[1]^=ls[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}},{key:"update",value:function(e){dt(this);for(var t=this.blockLen,n=this.state,r=(e=vt(e)).length,i=0;i<r;){for(var o=Math.min(t-this.pos,r-i),a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}},{key:"finish",value:function(){if(!this.finished){this.finished=!0;var e=this.state,t=this.suffix,n=this.pos,r=this.blockLen;e[n]^=t,0!=(128&t)&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}}},{key:"writeInto",value:function(e){dt(this,!1),lt(e),this.finish();for(var t=this.state,n=this.blockLen,r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();var o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}},{key:"xofInto",value:function(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}},{key:"xof",value:function(e){return ct(e),this.xofInto(new Uint8Array(e))}},{key:"digestInto",value:function(e){if(ht(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}},{key:"digest",value:function(){return this.digestInto(new Uint8Array(this.outputLen))}},{key:"destroy",value:function(){this.destroyed=!0,this.state.fill(0)}},{key:"_cloneInto",value:function(e){var t=this.blockLen,r=this.suffix,i=this.outputLen,o=this.rounds,a=this.enableXOF;return e||(e=new n(t,r,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}]),n}(),fs=function(e,t,n){return Mt((function(){return new ps(t,e,n)}))}(1,136,32);var ms=$t,ys=Kt,gs={Err:function(e){Y(n,q(Error));var t=X(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return R(this,n),t.call(this,e)}return W(n)}(),_parseInt:function(e){var t=gs.Err;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");var n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ms(r),l:e.subarray(n+2)}},toSig:function(e){var t=gs.Err,n="string"==typeof e?ys(e):e;if(!Vt(n))throw new Error("ui8a expected");var r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");var i=gs._parseInt(n.subarray(2)),o=i.d,a=i.l,s=gs._parseInt(a),u=s.d;if(s.l.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:u}},hexFromSig:function(e){var t=function(e){return 8&Number.parseInt(e[0],16)?"00"+e:e},n=function(e){var t=e.toString(16);return 1&t.length?"0".concat(t):t},r=t(n(e.s)),i=t(n(e.r)),o=r.length/2,a=i.length/2,s=n(o),u=n(a);return"30".concat(n(a+o+4),"02").concat(u).concat(i,"02").concat(s).concat(r)}},vs=BigInt(0),ws=BigInt(1);BigInt(2);var bs=BigInt(3);function Ms(e){var t=function(e){var t=Dn(e);dn(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});var n=t.endo,r=t.Fp,i=t.a;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==_(n)||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze(O({},t))}(e),n=t.Fp,r=t.toBytes||function(e,t,r){var i=t.toAffine();return on(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))},i=t.fromBytes||function(e){var t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}};function o(e){var r=t.a,i=t.b,o=n.sqr(e),a=n.mul(o,e);return n.add(n.add(a,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"==typeof e&&vs<e&&e<t.n}function s(e){if(!a(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(e){var n,r=t.allowedPrivateKeyLengths,i=t.nByteLength,o=t.wrapPrivateKey,a=t.n;if(r&&"bigint"!=typeof e){if(Vt(e)&&(e=Gt(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*i,"0")}try{n="bigint"==typeof e?e:$t(rn("private key",e,i))}catch(t){throw new Error("private key must be ".concat(i," bytes, hex or bigint, not ").concat(_(e)))}return o&&(n=bn(n,a)),s(n),n}var c=new Map;function l(e){if(!(e instanceof d))throw new Error("ProjectivePoint expected")}var d=function(){function e(t,r,i){if(R(this,e),this.px=t,this.py=r,this.pz=i,null==t||!n.isValid(t))throw new Error("x required");if(null==r||!n.isValid(r))throw new Error("y required");if(null==i||!n.isValid(i))throw new Error("z required")}return W(e,[{key:"x",get:function(){return this.toAffine().x}},{key:"y",get:function(){return this.toAffine().y}},{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,c.delete(this)}},{key:"assertValidity",value:function(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}var e=this.toAffine(),r=e.x,i=e.y;if(!n.isValid(r)||!n.isValid(i))throw new Error("bad point: x or y not FE");var a=n.sqr(i),s=o(r);if(!n.eql(a,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}},{key:"hasEvenY",value:function(){var e=this.toAffine().y;if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}},{key:"equals",value:function(e){l(e);var t=this.px,r=this.py,i=this.pz,o=e.px,a=e.py,s=e.pz,u=n.eql(n.mul(t,s),n.mul(o,i)),c=n.eql(n.mul(r,s),n.mul(a,i));return u&&c}},{key:"negate",value:function(){return new e(this.px,n.neg(this.py),this.pz)}},{key:"double",value:function(){var r=t.a,i=t.b,o=n.mul(i,bs),a=this.px,s=this.py,u=this.pz,c=n.ZERO,l=n.ZERO,d=n.ZERO,h=n.mul(a,a),p=n.mul(s,s),f=n.mul(u,u),m=n.mul(a,s);return m=n.add(m,m),d=n.mul(a,u),d=n.add(d,d),c=n.mul(r,d),l=n.mul(o,f),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(m,c),d=n.mul(o,d),f=n.mul(r,f),m=n.sub(h,f),m=n.mul(r,m),m=n.add(m,d),d=n.add(h,h),h=n.add(d,h),h=n.add(h,f),h=n.mul(h,m),l=n.add(l,h),f=n.mul(s,u),f=n.add(f,f),h=n.mul(f,m),c=n.sub(c,h),d=n.mul(f,p),d=n.add(d,d),new e(c,l,d=n.add(d,d))}},{key:"add",value:function(r){l(r);var i=this.px,o=this.py,a=this.pz,s=r.px,u=r.py,c=r.pz,d=n.ZERO,h=n.ZERO,p=n.ZERO,f=t.a,m=n.mul(t.b,bs),y=n.mul(i,s),g=n.mul(o,u),v=n.mul(a,c),w=n.add(i,o),b=n.add(s,u);w=n.mul(w,b),b=n.add(y,g),w=n.sub(w,b),b=n.add(i,a);var M=n.add(s,c);return b=n.mul(b,M),M=n.add(y,v),b=n.sub(b,M),M=n.add(o,a),d=n.add(u,c),M=n.mul(M,d),d=n.add(g,v),M=n.sub(M,d),p=n.mul(f,b),d=n.mul(m,v),p=n.add(d,p),d=n.sub(g,p),p=n.add(g,p),h=n.mul(d,p),g=n.add(y,y),g=n.add(g,y),v=n.mul(f,v),b=n.mul(m,b),g=n.add(g,v),v=n.sub(y,v),v=n.mul(f,v),b=n.add(b,v),y=n.mul(g,b),h=n.add(h,y),y=n.mul(M,b),d=n.mul(w,d),d=n.sub(d,y),y=n.mul(w,g),p=n.mul(M,p),new e(d,h,p=n.add(p,y))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"is0",value:function(){return this.equals(e.ZERO)}},{key:"wNAF",value:function(t){return p.wNAFCached(this,c,t,(function(t){var r=n.invertBatch(t.map((function(e){return e.pz})));return t.map((function(e,t){return e.toAffine(r[t])})).map(e.fromAffine)}))}},{key:"multiplyUnsafe",value:function(r){var i=e.ZERO;if(r===vs)return i;if(s(r),r===ws)return this;var o=t.endo;if(!o)return p.unsafeLadder(this,r);for(var a=o.splitScalar(r),u=a.k1neg,c=a.k1,l=a.k2neg,d=a.k2,h=i,f=i,m=this;c>vs||d>vs;)c&ws&&(h=h.add(m)),d&ws&&(f=f.add(m)),m=m.double(),c>>=ws,d>>=ws;return u&&(h=h.negate()),l&&(f=f.negate()),f=new e(n.mul(f.px,o.beta),f.py,f.pz),h.add(f)}},{key:"multiply",value:function(r){s(r);var i,o,a=r,u=t.endo;if(u){var c=u.splitScalar(a),l=c.k1neg,d=c.k1,h=c.k2neg,f=c.k2,m=this.wNAF(d),y=m.p,g=m.f,v=this.wNAF(f),w=v.p,b=v.f;y=p.constTimeNegate(l,y),w=p.constTimeNegate(h,w),w=new e(n.mul(w.px,u.beta),w.py,w.pz),i=y.add(w),o=g.add(b)}else{var M=this.wNAF(a);i=M.p,o=M.f}return e.normalizeZ([i,o])[0]}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=e.BASE,o=function(e,t){return t!==vs&&t!==ws&&e.equals(i)?e.multiply(t):e.multiplyUnsafe(t)},a=o(this,n).add(o(t,r));return a.is0()?void 0:a}},{key:"toAffine",value:function(e){var t=this.px,r=this.py,i=this.pz,o=this.is0();null==e&&(e=o?n.ONE:n.inv(i));var a=n.mul(t,e),s=n.mul(r,e),u=n.mul(i,e);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:a,y:s}}},{key:"isTorsionFree",value:function(){var n=t.h,r=t.isTorsionFree;if(n===ws)return!0;if(r)return r(e,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}},{key:"clearCofactor",value:function(){var n=t.h,r=t.clearCofactor;return n===ws?this:r?r(e,this):this.multiplyUnsafe(t.h)}},{key:"toRawBytes",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.assertValidity(),r(e,this,t)}},{key:"toHex",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Gt(this.toRawBytes(e))}}],[{key:"fromAffine",value:function(t){var r=t||{},i=r.x,o=r.y;if(!t||!n.isValid(i)||!n.isValid(o))throw new Error("invalid affine point");if(t instanceof e)throw new Error("projective point not allowed");var a=function(e){return n.eql(e,n.ZERO)};return a(i)&&a(o)?e.ZERO:new e(i,o,n.ONE)}},{key:"normalizeZ",value:function(t){var r=n.invertBatch(t.map((function(e){return e.pz})));return t.map((function(e,t){return e.toAffine(r[t])})).map(e.fromAffine)}},{key:"fromHex",value:function(t){var n=e.fromAffine(i(rn("pointHex",t)));return n.assertValidity(),n}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(u(t))}}]),e}();d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);var h=t.nBitLength,p=Cn(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:a}}function As(e){var t,n=(dn(t=Dn(e),{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze(O({lowS:!0},t))),r=n.Fp,i=n.n,o=r.BYTES+1,a=2*r.BYTES+1;function s(e){return bn(e,i)}function u(e){return En(e,i)}var c=Ms(O(O({},n),{},{toBytes:function(e,t,n){var i=t.toAffine(),o=r.toBytes(i.x),a=on;return n?a(Uint8Array.from([t.hasEvenY()?2:3]),o):a(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes:function(e){var t=e.length,n=e[0],i=e.subarray(1);if(t!==o||2!==n&&3!==n){if(t===a&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw new Error("Point of length ".concat(t," was invalid. Expected ").concat(o," compressed bytes or ").concat(a," uncompressed bytes"))}var s=$t(i);if(!(vs<(u=s)&&u<r.ORDER))throw new Error("Point is not on curve");var u,c=h(s),l=r.sqrt(c);return 1==(1&n)!==((l&ws)===ws)&&(l=r.neg(l)),{x:s,y:l}}})),l=c.ProjectivePoint,d=c.normPrivateKeyToScalar,h=c.weierstrassEquation,p=c.isWithinCurveOrder,f=function(e){return Gt(tn(e,n.nByteLength))};function m(e){return e>i>>ws}var y=function(e,t,n){return $t(e.slice(t,n))},g=function(){function e(t,n,r){R(this,e),this.r=t,this.s=n,this.recovery=r,this.assertValidity()}return W(e,[{key:"assertValidity",value:function(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}},{key:"addRecoveryBit",value:function(t){return new e(this.r,this.s,t)}},{key:"recoverPublicKey",value:function(e){var t=this.r,i=this.s,o=this.recovery,a=M(rn("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");var c=2===o||3===o?t+n.n:t;if(c>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");var d=0==(1&o)?"02":"03",h=l.fromHex(d+f(c)),p=u(c),m=s(-a*p),y=s(i*p),g=l.BASE.multiplyAndAddUnsafe(h,m,y);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}},{key:"hasHighS",value:function(){return m(this.s)}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,s(-this.s),this.recovery):this}},{key:"toDERRawBytes",value:function(){return Kt(this.toDERHex())}},{key:"toDERHex",value:function(){return gs.hexFromSig({r:this.r,s:this.s})}},{key:"toCompactRawBytes",value:function(){return Kt(this.toCompactHex())}},{key:"toCompactHex",value:function(){return f(this.r)+f(this.s)}}],[{key:"fromCompact",value:function(t){var r=n.nByteLength;return t=rn("compactSignature",t,2*r),new e(y(t,0,r),y(t,r,2*r))}},{key:"fromDER",value:function(t){var n=gs.toSig(rn("DER",t));return new e(n.r,n.s)}}]),e}(),v={isValidPrivateKey:function(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:function(){var e=xn(n.n);return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.length,i=Ln(t),o=xn(t);if(r<16||r<o||r>1024)throw new Error("expected ".concat(o,"-1024 bytes of input, got ").concat(r));var a=bn(n?$t(e):en(e),t-fn)+fn;return n?nn(a,i):tn(a,i)}(n.randomBytes(e),n.n)},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function w(e){var t=Vt(e),n="string"==typeof e,r=(t||n)&&e.length;return t?r===o||r===a:n?r===2*o||r===2*a:e instanceof l}var b=n.bits2int||function(e){var t=$t(e),r=8*e.length-n.nBitLength;return r>0?t>>BigInt(r):t},M=n.bits2int_modN||function(e){return s(b(e))},A=an(n.nBitLength);function E(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(vs<=e&&e<A))throw new Error("bigint expected < 2^".concat(n.nBitLength));return tn(e,n.nByteLength)}function N(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;if(["recovered","canonical"].some((function(e){return e in i})))throw new Error("sign() legacy options not supported");var o=n.hash,a=n.randomBytes,c=i.lowS,h=i.prehash,f=i.extraEntropy;null==c&&(c=!0),e=rn("msgHash",e),h&&(e=rn("prehashed msgHash",o(e)));var y=M(e),v=d(t),w=[E(v),E(y)];if(null!=f){var A=!0===f?a(r.BYTES):f;w.push(rn("extraEntropy",A))}var N=on.apply(hn,w),I=y;return{seed:N,k2sig:function(e){var t=b(e);if(p(t)){var n=u(t),r=l.BASE.multiply(t).toAffine(),i=s(r.x);if(i!==vs){var o=s(n*s(I+i*v));if(o!==vs){var a=(r.x===i?0:2)|Number(r.y&ws),d=o;return c&&m(o)&&(d=function(e){return m(e)?s(-e):e}(o),a^=1),new g(i,d,a)}}}}}}var T={lowS:n.lowS,prehash:!1},I={lowS:n.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:n,getPublicKey:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(w(e))throw new Error("first arg must be private key");if(!w(t))throw new Error("second arg must be public key");return l.fromHex(t).multiply(d(e)).toRawBytes(n)},sign:function(e,t){var r=N(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:T),i=r.seed,o=r.k2sig,a=n;return cn(a.hash.outputLen,a.nByteLength,a.hmac)(i,o)},verify:function(e,t,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:I,a=e;if(t=rn("msgHash",t),r=rn("publicKey",r),"strict"in o)throw new Error("options.strict was renamed to lowS");var c,d=o.lowS,h=o.prehash,p=void 0;try{if("string"==typeof a||Vt(a))try{p=g.fromDER(a)}catch(e){if(!(e instanceof gs.Err))throw e;p=g.fromCompact(a)}else{if("object"!==_(a)||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");var f=a.r,m=a.s;p=new g(f,m)}c=l.fromHex(r)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(d&&p.hasHighS())return!1;h&&(t=n.hash(t));var y=p,v=y.r,w=y.s,b=M(t),A=u(w),E=s(b*A),N=s(v*A),T=null===(i=l.BASE.multiplyAndAddUnsafe(c,E,N))||void 0===i?void 0:i.toAffine();return!!T&&s(T.x)===v},ProjectivePoint:l,Signature:g,utils:v}}BigInt(4);var Es=function(e){Y(n,bt);var t=X(n);function n(e,r){var i;R(this,n),(i=t.call(this)).finished=!1,i.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");ct(e.outputLen),ct(e.blockLen)}(e);var o=vt(r);if(i.iHash=e.create(),"function"!=typeof i.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");i.blockLen=i.iHash.blockLen,i.outputLen=i.iHash.outputLen;var a=i.blockLen,s=new Uint8Array(a);s.set(o.length>a?e.create().update(o).digest():o);for(var u=0;u<s.length;u++)s[u]^=54;i.iHash.update(s),i.oHash=e.create();for(var c=0;c<s.length;c++)s[c]^=106;return i.oHash.update(s),s.fill(0),i}return W(n,[{key:"update",value:function(e){return dt(this),this.iHash.update(e),this}},{key:"digestInto",value:function(e){dt(this),lt(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}},{key:"digest",value:function(){var e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}},{key:"_cloneInto",value:function(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));var t=this.oHash,n=this.iHash,r=this.finished,i=this.destroyed,o=this.blockLen,a=this.outputLen;return e.finished=r,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}},{key:"destroy",value:function(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}]),n}(),Ns=function(e,t,n){return new Es(e,t).update(n).digest()};Ns.create=function(e,t){return new Es(e,t)};
9
9
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
10
- var Ts=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Is=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ks=BigInt(1),Ls=BigInt(2),xs=function(e,t){return(e+t/Ls)/t};var Ss,js,Cs,Ds=kn(Ts,void 0,void 0,{sqrt:function(e){var t=Ts,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,d=An(l,n,t)*l%t,h=An(d,n,t)*l%t,p=An(h,Ls,t)*c%t,f=An(p,i,t)*p%t,m=An(f,o,t)*f%t,y=An(m,s,t)*m%t,g=An(y,u,t)*y%t,v=An(g,s,t)*m%t,w=An(v,n,t)*l%t,b=An(w,a,t)*f%t,M=An(b,r,t)*c%t,A=An(M,Ls,t);if(!Ds.eql(Ds.sqr(A),e))throw new Error("Cannot find square root");return A}}),Os=(Ss={a:BigInt(0),b:BigInt(7),Fp:Ds,n:Is,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:function(e){var t=Is,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ks*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),s=xs(o*e,t),u=xs(-r*e,t),c=bn(e-s*n-u*i,t),l=bn(-s*r-u*o,t),d=c>a,h=l>a;if(d&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}}}},js=hr,Cs=function(e){return As(O(O({},Ss),function(e){return{hash:e,hmac:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ns(e,t,wt.apply(void 0,r))},randomBytes:At}}(e)))},Object.freeze(O(O({},Cs(js)),{},{create:Cs})));BigInt(0),Os.ProjectivePoint;var zs=["commitment"],_s=["encoding"],Ps=["commitment"],Bs=["commitment"],Rs=Xn.utils.randomPrivateKey,Us=function(){var e=Xn.utils.randomPrivateKey(),t=Ws(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},Ws=Xn.getPublicKey;function Qs(e){try{return Xn.ExtendedPoint.fromHex(e),!0}catch(e){return!1}}var Ys,Fs=function(e,t){return Xn.sign(e,t.slice(0,32))},Vs=Xn.verify,Hs=function(e){return Ee.isBuffer(e)?e:e instanceof Uint8Array?Ee.from(e.buffer,e.byteOffset,e.byteLength):Ee.from(e)},Gs=function(){function e(t){R(this,e),Object.assign(this,t)}return W(e,[{key:"encode",value:function(){return Ee.from(qr(Zs,this))}}],[{key:"decode",value:function(e){return Xr(Zs,this,e)}},{key:"decodeUnchecked",value:function(e){return zr(Zs,this,e)}}]),e}(),qs=function(e){Y(n,Gs);var t=X(n);function n(e){var r;if(R(this,n),(r=t.call(this,e)).enum="",1!==Object.keys(e).length)throw new Error("Enum can only take single value");return Object.keys(e).map((function(e){r.enum=e})),r}return W(n)}(),Zs=new Map,Js=32;var Xs=1,Ks=function(e,t){Y(a,Gs);var n,r,i,o=X(a);function a(e){var t;if(R(this,a),(t=o.call(this,{}))._bn=void 0,function(e){return void 0!==e._bn}(e))t._bn=e._bn;else{if("string"==typeof e){var n=ar.decode(e);if(n.length!=Js)throw new Error("Invalid public key input");t._bn=new nr(n)}else t._bn=new nr(e);if(t._bn.byteLength()>Js)throw new Error("Invalid public key input")}return t}return W(a,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return ar.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(Ee);if(e.length===Js)return e;var t=Ee.alloc(32);return e.copy(t,32-e.length),t}},{key:t,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var e=new a(Xs);return Xs+=1,new a(e.toBuffer())}},{key:"createWithSeed",value:(i=B(z().mark((function e(t,n,r){var i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Ee.concat([t.toBuffer(),Ee.from(n),r.toBuffer()]),o=hr(i),e.abrupt("return",new a(o));case 3:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createProgramAddressSync",value:function(e,t){var n=Ee.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=Ee.concat([n,Hs(e)])})),n=Ee.concat([n,t.toBuffer(),Ee.from("ProgramDerivedAddress")]);var r=hr(n);if(Qs(r))throw new Error("Invalid seeds, address must fall off the curve");return new a(r)}},{key:"createProgramAddress",value:(r=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"findProgramAddressSync",value:function(e,t){for(var n,r=255;0!=r;){try{var i=e.concat(Ee.from([r]));n=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:(n=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.findProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"isOnCurve",value:function(e){return Qs(new a(e).toBytes())}}]),a}(0,Symbol.toStringTag);Ys=Ks,Ks.default=new Ys("11111111111111111111111111111111"),Zs.set(Ks,{kind:"struct",fields:[["_bn","u256"]]});var $s=function(){function e(t){if(R(this,e),this._publicKey=void 0,this._secretKey=void 0,t){var n=Hs(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=Hs(Rs()),this._publicKey=Hs(Ws(this._secretKey))}return W(e,[{key:"publicKey",get:function(){return new Ks(this._publicKey)}},{key:"secretKey",get:function(){return Ee.concat([this._secretKey,this._publicKey],64)}}]),e}(),eu=new Ks("BPFLoader1111111111111111111111111111111111"),tu=1232,nu=127,ru=64,iu=function(e){Y(n,q(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: block height exceeded."))).signature=void 0,r.signature=e,r}return W(n)}();Object.defineProperty(iu.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var ou=function(e){Y(n,q(Error));var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,"Transaction was not confirmed in ".concat(r.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools."))).signature=void 0,i.signature=e,i}return W(n)}();Object.defineProperty(ou.prototype,"name",{value:"TransactionExpiredTimeoutError"});var au=function(e){Y(n,q(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: the nonce is no longer valid."))).signature=void 0,r.signature=e,r}return W(n)}();Object.defineProperty(au.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var su=function(){function e(t,n){R(this,e),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}return W(e,[{key:"keySegments",value:function(){var e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}},{key:"get",value:function(e){var t,n=ae(this.keySegments());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e<r.length)return r[e];e-=r.length}}catch(e){n.e(e)}finally{n.f()}}},{key:"length",get:function(){return this.keySegments().flat().length}},{key:"compileInstructions",value:function(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");var t=new Map;this.keySegments().flat().forEach((function(e,n){t.set(e.toBase58(),n)}));var n=function(e){var n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((function(e){return{programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((function(e){return n(e.pubkey)})),data:e.data}}))}}]),e}(),uu=function(){return Fi(32,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey")},cu=function(){return Fi(64,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature")},lu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=Qi([Ri("length"),Ri("lengthPadding"),Fi(_i(Ri(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=function(e,t){return n(e,t).chars.toString()},i.encode=function(e,t,n){var i={chars:Ee.from(e,"utf8")};return r(i,t,n)},i.alloc=function(e){return Ri().span+Ri().span+Ee.from(e,"utf8").length},i};function du(e,t){var n=function e(n){if(n.span>=0)return n.span;if("function"==typeof n.alloc)return n.alloc(t[n.property]);if("count"in n&&"elementLayout"in n){var r=t[n.property];if(Array.isArray(r))return r.length*e(n.elementLayout)}else if("fields"in n)return du({layout:n},t[n.property]);return 0},r=0;return e.layout.fields.forEach((function(e){r+=n(e)})),r}function hu(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0==(128&r))break}return t}function pu(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}function fu(e,t){if(!e)throw new Error(t||"Assertion failed")}var mu=function(){function e(t,n){R(this,e),this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}return W(e,[{key:"getMessageComponents",value:function(){var e=ee(this.keyMetaMap.entries());fu(e.length<=256,"Max static account keys length exceeded");var t=e.filter((function(e){var t=$(e,2)[1];return t.isSigner&&t.isWritable})),n=e.filter((function(e){var t=$(e,2)[1];return t.isSigner&&!t.isWritable})),r=e.filter((function(e){var t=$(e,2)[1];return!t.isSigner&&t.isWritable})),i=e.filter((function(e){var t=$(e,2)[1];return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};return fu(t.length>0,"Expected at least one writable signer key"),fu($(t[0],1)[0]===this.payer.toBase58(),"Expected first writable signer key to be the fee payer"),[o,[].concat(ee(t.map((function(e){var t=$(e,1)[0];return new Ks(t)}))),ee(n.map((function(e){var t=$(e,1)[0];return new Ks(t)}))),ee(r.map((function(e){var t=$(e,1)[0];return new Ks(t)}))),ee(i.map((function(e){var t=$(e,1)[0];return new Ks(t)}))))]}},{key:"extractTableLookup",value:function(e){var t=$(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&e.isWritable})),2),n=t[0],r=t[1],i=$(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&!e.isWritable})),2),o=i[0],a=i[1];if(0!==n.length||0!==o.length)return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:a}]}},{key:"drainKeysFoundInLookupTable",value:function(e,t){var n,r=this,i=new Array,o=new Array,a=ae(this.keyMetaMap.entries());try{var s=function(){var a=$(n.value,2),s=a[0],u=a[1];if(t(u)){var c=new Ks(s),l=e.findIndex((function(e){return e.equals(c)}));l>=0&&(fu(l<256,"Max lookup table index exceeded"),i.push(l),o.push(c),r.keyMetaMap.delete(s))}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return[i,o]}}],[{key:"compile",value:function(t,n){var r=new Map,i=function(e){var t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=i(n);o.isSigner=!0,o.isWritable=!0;var a,s=ae(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i(u.programId).isInvoked=!0;var c,l=ae(u.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,h=i(d.pubkey);h.isSigner||(h.isSigner=d.isSigner),h.isWritable||(h.isWritable=d.isWritable)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}return new e(n,r)}}]),e}(),yu=function(){function e(t){var n=this;R(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new Ks(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return W(e,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:ar.decode(e.data)}}))}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new su(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(e){return e<this.header.numRequiredSignatures}},{key:"isAccountWritable",value:function(e){var t=this.header.numRequiredSignatures;return e>=this.header.numRequiredSignatures?e-t<this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts:e<t-this.header.numReadonlySignedAccounts}},{key:"isProgramId",value:function(e){return this.indexToProgramIds.has(e)}},{key:"programIds",value:function(){return ee(this.indexToProgramIds.values())}},{key:"nonProgramIds",value:function(){var e=this;return this.accountKeys.filter((function(t,n){return!e.isProgramId(n)}))}},{key:"serialize",value:function(){var e=this.accountKeys.length,t=[];pu(t,e);var n=this.instructions.map((function(e){var t=e.accounts,n=e.programIdIndex,r=Array.from(ar.decode(e.data)),i=[];pu(i,t.length);var o=[];return pu(o,r.length),{programIdIndex:n,keyIndicesCount:Ee.from(i),keyIndices:t,dataLength:Ee.from(o),data:r}})),r=[];pu(r,n.length);var i=Ee.alloc(tu);Ee.from(r).copy(i);var o=r.length;n.forEach((function(e){var t=Qi([Pi("programIdIndex"),Fi(e.keyIndicesCount.length,"keyIndicesCount"),Yi(Pi("keyIndex"),e.keyIndices.length,"keyIndices"),Fi(e.dataLength.length,"dataLength"),Yi(Pi("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);var a=Qi([Fi(1,"numRequiredSignatures"),Fi(1,"numReadonlySignedAccounts"),Fi(1,"numReadonlyUnsignedAccounts"),Fi(t.length,"keyCount"),Yi(uu("key"),e,"keys"),uu("recentBlockhash")]),s={numRequiredSignatures:Ee.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Ee.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Ee.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Ee.from(t),keys:this.accountKeys.map((function(e){return Hs(e.toBytes())})),recentBlockhash:ar.decode(this.recentBlockhash)},u=Ee.alloc(2048),c=a.encode(s,u);return i.copy(u,c),u.slice(0,c+i.length)}}],[{key:"compile",value:function(t){var n=$(mu.compile(t.instructions,t.payerKey).getMessageComponents(),2),r=n[0],i=n[1],o=new su(i).compileInstructions(t.instructions).map((function(e){return{programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:ar.encode(e.data)}}));return new e({header:r,accountKeys:i,recentBlockhash:t.recentBlockhash,instructions:o})}},{key:"from",value:function(t){var n=ee(t),r=n.shift();if(r!==(r&nu))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");for(var i=n.shift(),o=n.shift(),a=hu(n),s=[],u=0;u<a;u++){var c=n.slice(0,Js);n=n.slice(Js),s.push(new Ks(Ee.from(c)))}for(var l=n.slice(0,Js),d=hu(n=n.slice(Js)),h=[],p=0;p<d;p++){var f=n.shift(),m=hu(n),y=n.slice(0,m),g=hu(n=n.slice(m)),v=n.slice(0,g),w=ar.encode(Ee.from(v));n=n.slice(g),h.push({programIdIndex:f,accounts:y,data:w})}return new e({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:o},recentBlockhash:ar.encode(Ee.from(l)),accountKeys:s,instructions:h})}}]),e}(),gu=function(){function e(t){R(this,e),this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}return W(e,[{key:"version",get:function(){return 0}},{key:"numAccountKeysFromLookups",get:function(){var e,t=0,n=ae(this.addressTableLookups);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.readonlyIndexes.length+r.writableIndexes.length}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getAccountKeys",value:function(e){var t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new su(this.staticAccountKeys,t)}},{key:"isAccountSigner",value:function(e){return e<this.header.numRequiredSignatures}},{key:"isAccountWritable",value:function(e){var t=this.header.numRequiredSignatures,n=this.staticAccountKeys.length;if(e>=n){var r=e-n,i=this.addressTableLookups.reduce((function(e,t){return e+t.writableIndexes.length}),0);return r<i}return e>=this.header.numRequiredSignatures?e-t<n-t-this.header.numReadonlyUnsignedAccounts:e<t-this.header.numReadonlySignedAccounts}},{key:"resolveAddressTableLookups",value:function(e){var t,n={writable:[],readonly:[]},r=ae(this.addressTableLookups);try{var i=function(){var r=t.value,i=e.find((function(e){return e.key.equals(r.accountKey)}));if(!i)throw new Error("Failed to find address lookup table account for table key ".concat(r.accountKey.toBase58()));var o,a=ae(r.writableIndexes);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!(s<i.state.addresses.length))throw new Error("Failed to find address for index ".concat(s," in address lookup table ").concat(r.accountKey.toBase58()));n.writable.push(i.state.addresses[s])}}catch(e){a.e(e)}finally{a.f()}var u,c=ae(r.readonlyIndexes);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(!(l<i.state.addresses.length))throw new Error("Failed to find address for index ".concat(l," in address lookup table ").concat(r.accountKey.toBase58()));n.readonly.push(i.state.addresses[l])}}catch(e){c.e(e)}finally{c.f()}};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return n}},{key:"serialize",value:function(){var e=Array();pu(e,this.staticAccountKeys.length);var t=this.serializeInstructions(),n=Array();pu(n,this.compiledInstructions.length);var r=this.serializeAddressTableLookups(),i=Array();pu(i,this.addressTableLookups.length);var o=Qi([Pi("prefix"),Qi([Pi("numRequiredSignatures"),Pi("numReadonlySignedAccounts"),Pi("numReadonlyUnsignedAccounts")],"header"),Fi(e.length,"staticAccountKeysLength"),Yi(uu(),this.staticAccountKeys.length,"staticAccountKeys"),uu("recentBlockhash"),Fi(n.length,"instructionsLength"),Fi(t.length,"serializedInstructions"),Fi(i.length,"addressTableLookupsLength"),Fi(r.length,"serializedAddressTableLookups")]),a=new Uint8Array(tu),s=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map((function(e){return e.toBytes()})),recentBlockhash:ar.decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:r},a);return a.slice(0,s)}},{key:"serializeInstructions",value:function(){var e,t=0,n=new Uint8Array(tu),r=ae(this.compiledInstructions);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=Array();pu(o,i.accountKeyIndexes.length);var a=Array();pu(a,i.data.length),t+=Qi([Pi("programIdIndex"),Fi(o.length,"encodedAccountKeyIndexesLength"),Yi(Pi(),i.accountKeyIndexes.length,"accountKeyIndexes"),Fi(a.length,"encodedDataLength"),Fi(i.data.length,"data")]).encode({programIdIndex:i.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(o),accountKeyIndexes:i.accountKeyIndexes,encodedDataLength:new Uint8Array(a),data:i.data},n,t)}}catch(e){r.e(e)}finally{r.f()}return n.slice(0,t)}},{key:"serializeAddressTableLookups",value:function(){var e,t=0,n=new Uint8Array(tu),r=ae(this.addressTableLookups);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=Array();pu(o,i.writableIndexes.length);var a=Array();pu(a,i.readonlyIndexes.length),t+=Qi([uu("accountKey"),Fi(o.length,"encodedWritableIndexesLength"),Yi(Pi(),i.writableIndexes.length,"writableIndexes"),Fi(a.length,"encodedReadonlyIndexesLength"),Yi(Pi(),i.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:i.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(o),writableIndexes:i.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(a),readonlyIndexes:i.readonlyIndexes},n,t)}}catch(e){r.e(e)}finally{r.f()}return n.slice(0,t)}}],[{key:"compile",value:function(t){var n,r=mu.compile(t.instructions,t.payerKey),i=new Array,o={writable:new Array,readonly:new Array},a=ae(t.addressLookupTableAccounts||[]);try{for(a.s();!(n=a.n()).done;){var s=n.value,u=r.extractTableLookup(s);if(void 0!==u){var c,l,d=$(u,2),h=d[0],p=d[1],f=p.writable,m=p.readonly;i.push(h),(c=o.writable).push.apply(c,ee(f)),(l=o.readonly).push.apply(l,ee(m))}}}catch(e){a.e(e)}finally{a.f()}var y=$(r.getMessageComponents(),2),g=y[0],v=y[1],w=new su(v,o).compileInstructions(t.instructions);return new e({header:g,staticAccountKeys:v,recentBlockhash:t.recentBlockhash,compiledInstructions:w,addressTableLookups:i})}},{key:"deserialize",value:function(t){var n=ee(t),r=n.shift(),i=r&nu;fu(r!==i,"Expected versioned message but received legacy message");fu(0===i,"Expected versioned message with version 0 but found version ".concat(i));for(var o={numRequiredSignatures:n.shift(),numReadonlySignedAccounts:n.shift(),numReadonlyUnsignedAccounts:n.shift()},a=[],s=hu(n),u=0;u<s;u++)a.push(new Ks(n.splice(0,Js)));for(var c=ar.encode(n.splice(0,Js)),l=hu(n),d=[],h=0;h<l;h++){var p=n.shift(),f=hu(n),m=n.splice(0,f),y=hu(n),g=new Uint8Array(n.splice(0,y));d.push({programIdIndex:p,accountKeyIndexes:m,data:g})}for(var v=hu(n),w=[],b=0;b<v;b++){var M=new Ks(n.splice(0,Js)),A=hu(n),E=n.splice(0,A),N=hu(n),T=n.splice(0,N);w.push({accountKey:M,writableIndexes:E,readonlyIndexes:T})}return new e({header:o,staticAccountKeys:a,recentBlockhash:c,compiledInstructions:d,addressTableLookups:w})}}]),e}(),vu={deserializeMessageVersion:function(e){var t=e[0],n=t&nu;return n===t?"legacy":n},deserialize:function(e){var t=vu.deserializeMessageVersion(e);if("legacy"===t)return yu.from(e);if(0===t)return gu.deserialize(e);throw new Error("Transaction message version ".concat(t," deserialization is not supported"))}},wu=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({}),bu=Ee.alloc(ru).fill(0),Mu=function(){function e(t){R(this,e),this.keys=void 0,this.programId=void 0,this.data=Ee.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}return W(e,[{key:"toJSON",value:function(){return{keys:this.keys.map((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;return{pubkey:t.toJSON(),isSigner:n,isWritable:r}})),programId:this.programId.toJSON(),data:ee(this.data)}}}]),e}(),Au=function(){function e(t){if(R(this,e),this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){var n=t.minContextSlot,r=t.nonceInfo;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){var i=t.blockhash,o=t.lastValidBlockHeight;this.recentBlockhash=i,this.lastValidBlockHeight=o}else{var a=t.recentBlockhash,s=t.nonceInfo;s&&(this.nonceInfo=s),this.recentBlockhash=a}}var t;return W(e,[{key:"signature",get:function(){return this.signatures.length>0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((function(e){return e.toJSON()})),signers:this.signatures.map((function(e){return e.publicKey.toJSON()}))}}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0===n.length)throw new Error("No instructions");return n.forEach((function(t){"instructions"in t?e.instructions=e.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?e.instructions.push(t):e.instructions.push(new Mu(t))})),this}},{key:"compileMessage",value:function(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;var e,t,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction].concat(ee(this.instructions)):this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(var r=0;r<t.length;r++)if(void 0===t[r].programId)throw new Error("Transaction instruction index ".concat(r," has undefined program id"));var i=[],o=[];t.forEach((function(e){e.keys.forEach((function(e){o.push(O({},e))}));var t=e.programId.toString();i.includes(t)||i.push(t)})),i.forEach((function(e){o.push({pubkey:new Ks(e),isSigner:!1,isWritable:!1})}));var a=[];o.forEach((function(e){var t=e.pubkey.toString(),n=a.findIndex((function(e){return e.pubkey.toString()===t}));n>-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)})),a.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));var s=a.findIndex((function(e){return e.pubkey.equals(n)}));if(s>-1){var u=$(a.splice(s,1),1)[0];u.isSigner=!0,u.isWritable=!0,a.unshift(u)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});var c,l=ae(this.signatures);try{var d=function(){var e=c.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}var h=0,p=0,f=0,m=[],y=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(m.push(t.toString()),h+=1,r||(p+=1)):(y.push(t.toString()),r||(f+=1))}));var g=m.concat(y),v=t.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:g.indexOf(n.toString()),accounts:e.keys.map((function(e){return g.indexOf(e.pubkey.toString())})),data:ar.encode(t)}}));return v.forEach((function(e){fu(e.programIdIndex>=0),e.accounts.forEach((function(e){return fu(e>=0)}))})),new yu({header:{numRequiredSignatures:h,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:f},accountKeys:g,recentBlockhash:e,instructions:v})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){var n=this.signatures.every((function(e,n){return t[n].equals(e.publicKey)}));if(n)return e}return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:(t=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFeeForMessage(this.compileMessage());case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("No signers");var r=new Set;this.signatures=t.filter((function(e){var t=e.toString();return!r.has(t)&&(r.add(t),!0)})).map((function(e){return{signature:null,publicKey:e}}))}},{key:"sign",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("No signers");for(var r=new Set,i=[],o=0,a=t;o<a.length;o++){var s=a[o],u=s.publicKey.toString();r.has(u)||(r.add(u),i.push(s))}this.signatures=i.map((function(e){return{signature:null,publicKey:e.publicKey}}));var c=this._compile();this._partialSign.apply(this,[c].concat(i))}},{key:"partialSign",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("No signers");for(var r=new Set,i=[],o=0,a=t;o<a.length;o++){var s=a[o],u=s.publicKey.toString();r.has(u)||(r.add(u),i.push(s))}var c=this._compile();this._partialSign.apply(this,[c].concat(i))}},{key:"_partialSign",value:function(e){for(var t=this,n=e.serialize(),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];i.forEach((function(e){var r=Fs(n,e.secretKey);t._addSignature(e.publicKey,Hs(r))}))}},{key:"addSignature",value:function(e,t){this._compile(),this._addSignature(e,t)}},{key:"_addSignature",value:function(e,t){fu(64===t.length);var n=this.signatures.findIndex((function(t){return e.equals(t.publicKey)}));if(n<0)throw new Error("unknown signer: ".concat(e.toString()));this.signatures[n].signature=Ee.from(t)}},{key:"verifySignatures",value:function(e){return this._verifySignatures(this.serializeMessage(),void 0===e||e)}},{key:"_verifySignatures",value:function(e,t){var n,r=ae(this.signatures);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.signature,a=i.publicKey;if(null===o){if(t)return!1}else if(!Vs(o,e,a.toBytes()))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},{key:"serialize",value:function(e){var t=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=t.requireAllSignatures,r=t.verifySignatures,i=this.serializeMessage();if(r&&!this._verifySignatures(i,n))throw new Error("Signature verification failed");return this._serialize(i)}},{key:"_serialize",value:function(e){var t=this.signatures,n=[];pu(n,t.length);var r=n.length+64*t.length+e.length,i=Ee.alloc(r);return fu(t.length<256),Ee.from(n).copy(i,0),t.forEach((function(e,t){var r=e.signature;null!==r&&(fu(64===r.length,"signature has invalid length"),Ee.from(r).copy(i,n.length+64*t))})),e.copy(i,n.length+64*t.length),fu(i.length<=tu,"Transaction too large: ".concat(i.length," > ").concat(tu)),i}},{key:"keys",get:function(){return fu(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return fu(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return fu(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=ee(t),r=hu(n),i=[],o=0;o<r;o++){var a=n.slice(0,ru);n=n.slice(ru),i.push(ar.encode(Ee.from(a)))}return e.populate(yu.from(n),i)}},{key:"populate",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var i={signature:e==ar.encode(bu)?null:ar.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Mu({keys:n,programId:t.accountKeys[e.programIdIndex],data:ar.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}]),e}(),Eu=function(){function e(t){R(this,e),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}return W(e,[{key:"compileToLegacyMessage",value:function(){return yu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(e){return gu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}],[{key:"decompile",value:function(t,n){var r=t.header,i=t.compiledInstructions,o=t.recentBlockhash,a=r.numRequiredSignatures,s=r.numReadonlySignedAccounts,u=r.numReadonlyUnsignedAccounts,c=a-s;fu(c>0,"Message header is invalid");var l=t.staticAccountKeys.length-a-u;fu(l>=0,"Message header is invalid");var d=t.getAccountKeys(n),h=d.get(0);if(void 0===h)throw new Error("Failed to decompile message because no account keys were found");var p,f=[],m=ae(i);try{for(m.s();!(p=m.n()).done;){var y,g=p.value,v=[],w=ae(g.accountKeyIndexes);try{for(w.s();!(y=w.n()).done;){var b=y.value,M=d.get(b);if(void 0===M)throw new Error("Failed to find key for account key index ".concat(b));var A=void 0;A=b<a?b<c:b<d.staticAccountKeys.length?b-a<l:b-d.staticAccountKeys.length<d.accountKeysFromLookups.writable.length,v.push({pubkey:M,isSigner:b<r.numRequiredSignatures,isWritable:A})}}catch(e){w.e(e)}finally{w.f()}var E=d.get(g.programIdIndex);if(void 0===E)throw new Error("Failed to find program id for program id index ".concat(g.programIdIndex));f.push(new Mu({programId:E,data:Hs(g.data),keys:v}))}}catch(e){m.e(e)}finally{m.f()}return new e({payerKey:h,instructions:f,recentBlockhash:o})}}]),e}(),Nu=function(){function e(t,n){if(R(this,e),this.signatures=void 0,this.message=void 0,void 0!==n)fu(n.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{for(var r=[],i=0;i<t.header.numRequiredSignatures;i++)r.push(new Uint8Array(ru));this.signatures=r}this.message=t}return W(e,[{key:"version",get:function(){return this.message.version}},{key:"serialize",value:function(){var e=this.message.serialize(),t=Array();pu(t,this.signatures.length);var n=Qi([Fi(t.length,"encodedSignaturesLength"),Yi(cu(),this.signatures.length,"signatures"),Fi(e.length,"serializedMessage")]),r=new Uint8Array(2048),i=n.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},r);return r.slice(0,i)}},{key:"sign",value:function(e){var t,n=this,r=this.message.serialize(),i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures),o=ae(e);try{var a=function(){var e=t.value,o=i.findIndex((function(t){return t.equals(e.publicKey)}));fu(o>=0,"Cannot sign with non signer key ".concat(e.publicKey.toBase58())),n.signatures[o]=Fs(r,e.secretKey)};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}},{key:"addSignature",value:function(e,t){fu(64===t.byteLength,"Signature must be 64 bytes long");var n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((function(t){return t.equals(e)}));fu(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}],[{key:"deserialize",value:function(t){for(var n=ee(t),r=[],i=hu(n),o=0;o<i;o++)r.push(new Uint8Array(n.splice(0,ru)));return new e(vu.deserialize(new Uint8Array(n)),r)}}]),e}(),Tu=new Ks("SysvarC1ock11111111111111111111111111111111"),Iu=new Ks("SysvarEpochSchedu1e111111111111111111111111"),ku=new Ks("Sysvar1nstructions1111111111111111111111111"),Lu=new Ks("SysvarRecentB1ockHashes11111111111111111111"),xu=new Ks("SysvarRent111111111111111111111111111111111"),Su=new Ks("SysvarRewards111111111111111111111111111111"),ju=new Ks("SysvarS1otHashes111111111111111111111111111"),Cu=new Ks("SysvarS1otHistory11111111111111111111111111"),Du=new Ks("SysvarStakeHistory1111111111111111111111111");function Ou(e,t,n,r){return zu.apply(this,arguments)}function zu(){return zu=B(z().mark((function e(t,n,r,i){var o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},e.next=3,t.sendTransaction(n,r,o);case 3:if(a=e.sent,null==n.recentBlockhash||null==n.lastValidBlockHeight){e.next=10;break}return e.next=7,t.confirmTransaction({abortSignal:null==i?void 0:i.abortSignal,signature:a,blockhash:n.recentBlockhash,lastValidBlockHeight:n.lastValidBlockHeight},i&&i.commitment);case 7:s=e.sent.value,e.next=22;break;case 10:if(null==n.minNonceContextSlot||null==n.nonceInfo){e.next=18;break}return u=n.nonceInfo.nonceInstruction,c=u.keys[0].pubkey,e.next=15,t.confirmTransaction({abortSignal:null==i?void 0:i.abortSignal,minContextSlot:n.minNonceContextSlot,nonceAccountPubkey:c,nonceValue:n.nonceInfo.nonce,signature:a},i&&i.commitment);case 15:s=e.sent.value,e.next=22;break;case 18:return null!=(null==i?void 0:i.abortSignal)&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),e.next=21,t.confirmTransaction(a,i&&i.commitment);case 21:s=e.sent.value;case 22:if(!s.err){e.next=24;break}throw new Error("Transaction ".concat(a," failed (").concat(JSON.stringify(s),")"));case 24:return e.abrupt("return",a);case 25:case"end":return e.stop()}}),e)}))),zu.apply(this,arguments)}function _u(e){return new Promise((function(t){return setTimeout(t,e)}))}function Pu(e,t){var n=e.layout.span>=0?e.layout.span:du(e,t),r=Ee.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function Bu(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Ru,Uu=Ui("lamportsPerSignature"),Wu=Qi([Ri("version"),Ri("state"),uu("authorizedPubkey"),uu("nonce"),Qi([Uu],"feeCalculator")]),Qu=Wu.span,Yu=function(){function e(t){R(this,e),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}return W(e,null,[{key:"fromAccountData",value:function(t){var n=Wu.decode(Hs(t),0);return new e({authorizedPubkey:new Ks(n.authorizedPubkey),nonce:new Ks(n.nonce).toString(),feeCalculator:n.feeCalculator})}}]),e}(),Fu=(Ru=8,function(e){var t=Fi(Ru,e),n=function(e){return{decode:e.decode.bind(e),encode:e.encode.bind(e)}}(t),r=n.encode,i=n.decode,o=t;return o.decode=function(e,t){var n=i(e,t);return Hi(Ee.from(n))},o.encode=function(e,t,n){var i=Gi(e,Ru);return r(i,t,n)},o}),Vu=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(Hu);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a SystemInstruction");return t}},{key:"decodeCreateAccount",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.Create,e.data),n=t.lamports,r=t.space,i=t.programId;return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:n,space:r,programId:new Ks(i)}}},{key:"decodeTransfer",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.Transfer,e.data).lamports;return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}},{key:"decodeTransferWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Hu.TransferWithSeed,e.data),n=t.lamports,r=t.seed,i=t.programId;return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:n,seed:r,programId:new Ks(i)}}},{key:"decodeAllocate",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.Allocate,e.data).space;return{accountPubkey:e.keys[0].pubkey,space:t}}},{key:"decodeAllocateWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.AllocateWithSeed,e.data),n=t.base,r=t.seed,i=t.space,o=t.programId;return{accountPubkey:e.keys[0].pubkey,basePubkey:new Ks(n),seed:r,space:i,programId:new Ks(o)}}},{key:"decodeAssign",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.Assign,e.data).programId;return{accountPubkey:e.keys[0].pubkey,programId:new Ks(t)}}},{key:"decodeAssignWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.AssignWithSeed,e.data),n=t.base,r=t.seed,i=t.programId;return{accountPubkey:e.keys[0].pubkey,basePubkey:new Ks(n),seed:r,programId:new Ks(i)}}},{key:"decodeCreateWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.CreateWithSeed,e.data),n=t.base,r=t.seed,i=t.lamports,o=t.space,a=t.programId;return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Ks(n),seed:r,lamports:i,space:o,programId:new Ks(a)}}},{key:"decodeNonceInitialize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Hu.InitializeNonceAccount,e.data).authorized;return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Ks(t)}}},{key:"decodeNonceAdvance",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Bu(Hu.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"decodeNonceWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Bu(Hu.WithdrawNonceAccount,e.data).lamports;return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}},{key:"decodeNonceAuthorize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.AuthorizeNonceAccount,e.data).authorized;return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Ks(t)}}},{key:"checkProgramId",value:function(e){if(!e.equals(Gu.programId))throw new Error("invalid instruction; programId is not SystemProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),Hu=Object.freeze({Create:{index:0,layout:Qi([Ri("instruction"),Wi("lamports"),Wi("space"),uu("programId")])},Assign:{index:1,layout:Qi([Ri("instruction"),uu("programId")])},Transfer:{index:2,layout:Qi([Ri("instruction"),Fu("lamports")])},CreateWithSeed:{index:3,layout:Qi([Ri("instruction"),uu("base"),lu("seed"),Wi("lamports"),Wi("space"),uu("programId")])},AdvanceNonceAccount:{index:4,layout:Qi([Ri("instruction")])},WithdrawNonceAccount:{index:5,layout:Qi([Ri("instruction"),Wi("lamports")])},InitializeNonceAccount:{index:6,layout:Qi([Ri("instruction"),uu("authorized")])},AuthorizeNonceAccount:{index:7,layout:Qi([Ri("instruction"),uu("authorized")])},Allocate:{index:8,layout:Qi([Ri("instruction"),Wi("space")])},AllocateWithSeed:{index:9,layout:Qi([Ri("instruction"),uu("base"),lu("seed"),Wi("space"),uu("programId")])},AssignWithSeed:{index:10,layout:Qi([Ri("instruction"),uu("base"),lu("seed"),uu("programId")])},TransferWithSeed:{index:11,layout:Qi([Ri("instruction"),Fu("lamports"),lu("seed"),uu("programId")])},UpgradeNonceAccount:{index:12,layout:Qi([Ri("instruction")])}}),Gu=function(){function e(){R(this,e)}return W(e,null,[{key:"createAccount",value:function(e){var t=Pu(Hu.Create,{lamports:e.lamports,space:e.space,programId:Hs(e.programId.toBuffer())});return new Mu({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}},{key:"transfer",value:function(e){var t,n;"basePubkey"in e?(t=Pu(Hu.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=Pu(Hu.Transfer,{lamports:BigInt(e.lamports)}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]);return new Mu({keys:n,programId:this.programId,data:t})}},{key:"assign",value:function(e){var t,n;"basePubkey"in e?(t=Pu(Hu.AssignWithSeed,{base:Hs(e.basePubkey.toBuffer()),seed:e.seed,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Pu(Hu.Assign,{programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new Mu({keys:n,programId:this.programId,data:t})}},{key:"createAccountWithSeed",value:function(e){var t=Pu(Hu.CreateWithSeed,{base:Hs(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&n.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Mu({keys:n,programId:this.programId,data:t})}},{key:"createNonceAccount",value:function(t){var n=new Au;"basePubkey"in t&&"seed"in t?n.add(e.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:Qu,programId:this.programId})):n.add(e.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:Qu,programId:this.programId}));var r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}},{key:"nonceInitialize",value:function(e){var t=Pu(Hu.InitializeNonceAccount,{authorized:Hs(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:xu,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new Mu(n)}},{key:"nonceAdvance",value:function(e){var t=Pu(Hu.AdvanceNonceAccount),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new Mu(n)}},{key:"nonceWithdraw",value:function(e){var t=Pu(Hu.WithdrawNonceAccount,{lamports:e.lamports});return new Mu({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:xu,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"nonceAuthorize",value:function(e){var t=Pu(Hu.AuthorizeNonceAccount,{authorized:Hs(e.newAuthorizedPubkey.toBuffer())});return new Mu({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"allocate",value:function(e){var t,n;"basePubkey"in e?(t=Pu(Hu.AllocateWithSeed,{base:Hs(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Pu(Hu.Allocate,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new Mu({keys:n,programId:this.programId,data:t})}}]),e}();Gu.programId=new Ks("11111111111111111111111111111111");var qu=function(){function e(){R(this,e)}var t;return W(e,null,[{key:"getMinNumSignatures",value:function(t){return 2*(Math.ceil(t/e.chunkSize)+1+1)}},{key:"load",value:(t=B(z().mark((function t(n,r,i,o,a){var s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.getMinimumBalanceForRentExemption(a.length);case 2:return s=t.sent,t.next=5,n.getAccountInfo(i.publicKey,"confirmed");case 5:if(u=t.sent,c=null,null===u){t.next=16;break}if(!u.executable){t.next=11;break}return console.error("Program load failed, account is already executable"),t.abrupt("return",!1);case 11:u.data.length!==a.length&&(c=c||new Au).add(Gu.allocate({accountPubkey:i.publicKey,space:a.length})),u.owner.equals(o)||(c=c||new Au).add(Gu.assign({accountPubkey:i.publicKey,programId:o})),u.lamports<s&&(c=c||new Au).add(Gu.transfer({fromPubkey:r.publicKey,toPubkey:i.publicKey,lamports:s-u.lamports})),t.next=17;break;case 16:c=(new Au).add(Gu.createAccount({fromPubkey:r.publicKey,newAccountPubkey:i.publicKey,lamports:s>0?s:1,space:a.length,programId:o}));case 17:if(null===c){t.next=20;break}return t.next=20,Ou(n,c,[r,i],{commitment:"confirmed"});case 20:l=Qi([Ri("instruction"),Ri("offset"),Ri("bytesLength"),Ri("bytesLengthPadding"),Yi(Pi("byte"),_i(Ri(),-8),"bytes")]),d=e.chunkSize,h=0,p=a,f=[];case 25:if(!(p.length>0)){t.next=39;break}if(m=p.slice(0,d),y=Ee.alloc(d+16),l.encode({instruction:0,offset:h,bytes:m,bytesLength:0,bytesLengthPadding:0},y),g=(new Au).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:y}),f.push(Ou(n,g,[r,i],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return t.next=35,_u(250);case 35:h+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(f);case 41:return v=Qi([Ri("instruction")]),w=Ee.alloc(v.span),v.encode({instruction:1},w),b=(new Au).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:xu,isSigner:!1,isWritable:!1}],programId:o,data:w}),M="processed",t.next=48,n.sendTransaction(b,[r,i],{preflightCommitment:M});case 48:return A=t.sent,t.next=51,n.confirmTransaction({signature:A,lastValidBlockHeight:b.lastValidBlockHeight,blockhash:b.recentBlockhash},M);case 51:if(E=t.sent,N=E.context,!(T=E.value).err){t.next=56;break}throw new Error("Transaction ".concat(A," failed (").concat(JSON.stringify(T),")"));case 56:return t.prev=57,t.next=60,n.getSlot({commitment:M});case 60:if(!(t.sent>N.slot)){t.next=63;break}return t.abrupt("break",71);case 63:t.next=67;break;case 65:t.prev=65,t.t0=t.catch(57);case 67:return t.next=69,new Promise((function(e){return setTimeout(e,Math.round(200))}));case 69:t.next=56;break;case 71:return t.abrupt("return",!0);case 72:case"end":return t.stop()}}),t,null,[[57,65]])}))),function(e,n,r,i,o){return t.apply(this,arguments)})}]),e}();qu.chunkSize=932;var Zu=new Ks("BPFLoader2111111111111111111111111111111111"),Ju=function(){function e(){R(this,e)}return W(e,null,[{key:"getMinNumSignatures",value:function(e){return qu.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return qu.load(e,t,n,i,r)}}]),e}();function Xu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ku=Object.prototype.toString,$u=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function ec(e,t){var n,r,i,o,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(_(e)){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return ec(e.toJSON(),t);if("[object Array]"===(u=Ku.call(e))){for(i="[",r=e.length-1,n=0;n<r;n++)i+=ec(e[n],!0)+",";return r>-1&&(i+=ec(e[n],!0)),i+"]"}if("[object Object]"===u){for(r=(o=$u(e).sort()).length,i="",n=0;n<r;)void 0!==(s=ec(e[a=o[n]],!1))&&(i&&(i+=","),i+=JSON.stringify(a)+":"+s),n++;return"{"+i+"}"}return JSON.stringify(e);case"function":case"undefined":return t?null:void 0;case"string":return JSON.stringify(e);default:return isFinite(e)?e:null}}var tc=Xu((function(e){var t=ec(e,!1);if(void 0!==t)return""+t}));function nc(e){for(var t=0;e>1;)e/=2,t++;return t}var rc=function(){function e(t,n,r,i,o){R(this,e),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=o}return W(e,[{key:"getEpoch",value:function(e){return this.getEpochAndSlotIndex(e)[0]}},{key:"getEpochAndSlotIndex",value:function(e){if(e<this.firstNormalSlot){var t=nc(function(e){return 0===e?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-nc(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}var n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch);return[this.firstNormalEpoch+r,n%this.slotsPerEpoch]}},{key:"getFirstSlotInEpoch",value:function(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}},{key:"getSlotsInEpoch",value:function(e){return e<this.firstNormalEpoch?Math.pow(2,e+nc(32)):this.slotsPerEpoch}}]),e}(),ic=function(e){Y(n,q(Error));var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,e)).logs=void 0,i.logs=r,i}return W(n)}(),oc=function(e){Y(n,q(Error));var t=X(n);function n(e,r){var i,o=e.code,a=e.message,s=e.data;return R(this,n),(i=t.call(this,null!=r?"".concat(r,": ").concat(a):a)).code=void 0,i.data=void 0,i.code=o,i.data=s,i.name="SolanaJSONRPCError",i}return W(n)}(),ac=globalThis.fetch,sc=function(e){Y(n,Ya);var t=X(n);function n(e,r,i){var o;R(this,n);return(o=t.call(this,(function(e){var t=Va(e,O({autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3},r));return o.underlyingSocket="socket"in t?t.socket:t,t}),e,r,i)).underlyingSocket=void 0,o}return W(n,[{key:"call",value:function(){for(var e,t,r=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return 1===r?(t=K(F(n.prototype),"call",this)).call.apply(t,[this].concat(o)):Promise.reject(new Error("Tried to call a JSON-RPC method `"+o[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}},{key:"notify",value:function(){for(var e,t,r=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return 1===r?(t=K(F(n.prototype),"notify",this)).call.apply(t,[this].concat(o)):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+o[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}}]),n}();var uc=function(){function e(t){R(this,e),this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}return W(e,[{key:"isActive",value:function(){var e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}}],[{key:"deserialize",value:function(e){var t=function(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.typeIndex!==e.index)throw new Error("invalid account data; account type mismatch ".concat(n.typeIndex," != ").concat(e.index));return n}(cc,e),n=e.length-56;fu(n>=0,"lookup table is invalid"),fu(n%32==0,"lookup table is invalid");var r=n/32,i=Qi([Yi(uu(),r,"addresses")]).decode(e.slice(56)).addresses;return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:0!==t.authority.length?new Ks(t.authority[0]):void 0,addresses:i.map((function(e){return new Ks(e)}))}}}]),e}(),cc={index:1,layout:Qi([Ri("typeIndex"),Fu("deactivationSlot"),Ui("lastExtendedSlot"),Pi("lastExtendedStartIndex"),Pi(),Yi(uu(),_i(Pi(),-1),"authority")])},lc=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;var dc=No(po(Ks),wo(),(function(e){return new Ks(e)})),hc=bo([wo(),fo("base64")]),pc=No(po(Ee),hc,(function(e){return Ee.from(e[0],"base64")}));function fc(e){var t,n;if("string"==typeof e)t=e;else if(e){t=e.commitment,n=Z(e,zs)}return{commitment:t,config:n}}function mc(e){return Ao([Mo({jsonrpc:fo("2.0"),id:wo(),result:e}),Mo({jsonrpc:fo("2.0"),id:wo(),error:Mo({code:Eo(),message:wo(),data:go(co("any",(function(){return!0})))})})])}var yc=mc(Eo());function gc(e){return No(mc(e),yc,(function(t){return"error"in t?t:O(O({},t),{},{result:ao(t.result,e)})}))}function vc(e){return gc(Mo({context:Mo({slot:yo()}),value:e}))}function wc(e){return Mo({context:Mo({slot:yo()}),value:e})}function bc(e,t){return 0===e?new gu({header:t.header,staticAccountKeys:t.accountKeys.map((function(e){return new Ks(e)})),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:ar.decode(e.data)}})),addressTableLookups:t.addressTableLookups}):new yu(t)}var Mc=Mo({foundation:yo(),foundationTerm:yo(),initial:yo(),taper:yo(),terminal:yo()}),Ac=gc(lo(mo(Mo({epoch:yo(),effectiveSlot:yo(),amount:yo(),postBalance:yo(),commission:go(mo(yo()))})))),Ec=lo(Mo({slot:yo(),prioritizationFee:yo()})),Nc=Mo({total:yo(),validator:yo(),foundation:yo(),epoch:yo()}),Tc=Mo({epoch:yo(),slotIndex:yo(),slotsInEpoch:yo(),absoluteSlot:yo(),blockHeight:go(yo()),transactionCount:go(yo())}),Ic=Mo({slotsPerEpoch:yo(),leaderScheduleSlotOffset:yo(),warmup:ho(),firstNormalEpoch:yo(),firstNormalSlot:yo()}),kc=vo(wo(),lo(yo())),Lc=mo(Ao([Mo({}),wo()])),xc=Mo({err:Lc}),Sc=fo("receivedSignature"),jc=Mo({"solana-core":wo(),"feature-set":go(yo())}),Cc=vc(Mo({err:mo(Ao([Mo({}),wo()])),logs:mo(lo(wo())),accounts:go(mo(lo(mo(Mo({executable:ho(),owner:wo(),lamports:yo(),data:lo(wo()),rentEpoch:go(yo())}))))),unitsConsumed:go(yo()),returnData:go(mo(Mo({programId:wo(),data:bo([wo(),fo("base64")])})))})),Dc=vc(Mo({byIdentity:vo(wo(),lo(yo())),range:Mo({firstSlot:yo(),lastSlot:yo()})}));var Oc=gc(Mc),zc=gc(Nc),_c=gc(Ec),Pc=gc(Tc),Bc=gc(Ic),Rc=gc(kc),Uc=gc(yo()),Wc=vc(Mo({total:yo(),circulating:yo(),nonCirculating:yo(),nonCirculatingAccounts:lo(dc)})),Qc=Mo({amount:wo(),uiAmount:mo(yo()),decimals:yo(),uiAmountString:go(wo())}),Yc=vc(lo(Mo({address:dc,amount:wo(),uiAmount:mo(yo()),decimals:yo(),uiAmountString:go(wo())}))),Fc=vc(lo(Mo({pubkey:dc,account:Mo({executable:ho(),owner:dc,lamports:yo(),data:pc,rentEpoch:yo()})}))),Vc=Mo({program:wo(),parsed:Eo(),space:yo()}),Hc=vc(lo(Mo({pubkey:dc,account:Mo({executable:ho(),owner:dc,lamports:yo(),data:Vc,rentEpoch:yo()})}))),Gc=vc(lo(Mo({lamports:yo(),address:dc}))),qc=Mo({executable:ho(),owner:dc,lamports:yo(),data:pc,rentEpoch:yo()}),Zc=Mo({pubkey:dc,account:qc}),Jc=No(Ao([po(Ee),Vc]),Ao([hc,Vc]),(function(e){return Array.isArray(e)?ao(e,pc):e})),Xc=Mo({executable:ho(),owner:dc,lamports:yo(),data:Jc,rentEpoch:yo()}),Kc=Mo({pubkey:dc,account:Xc}),$c=Mo({state:Ao([fo("active"),fo("inactive"),fo("activating"),fo("deactivating")]),active:yo(),inactive:yo()}),el=gc(lo(Mo({signature:wo(),slot:yo(),err:Lc,memo:mo(wo()),blockTime:go(mo(yo()))}))),tl=gc(lo(Mo({signature:wo(),slot:yo(),err:Lc,memo:mo(wo()),blockTime:go(mo(yo()))}))),nl=Mo({subscription:yo(),result:wc(qc)}),rl=Mo({pubkey:dc,account:qc}),il=Mo({subscription:yo(),result:wc(rl)}),ol=Mo({parent:yo(),slot:yo(),root:yo()}),al=Mo({subscription:yo(),result:ol}),sl=Ao([Mo({type:Ao([fo("firstShredReceived"),fo("completed"),fo("optimisticConfirmation"),fo("root")]),slot:yo(),timestamp:yo()}),Mo({type:fo("createdBank"),parent:yo(),slot:yo(),timestamp:yo()}),Mo({type:fo("frozen"),slot:yo(),timestamp:yo(),stats:Mo({numTransactionEntries:yo(),numSuccessfulTransactions:yo(),numFailedTransactions:yo(),maxTransactionsPerEntry:yo()})}),Mo({type:fo("dead"),slot:yo(),timestamp:yo(),err:wo()})]),ul=Mo({subscription:yo(),result:sl}),cl=Mo({subscription:yo(),result:wc(Ao([xc,Sc]))}),ll=Mo({subscription:yo(),result:yo()}),dl=Mo({pubkey:wo(),gossip:mo(wo()),tpu:mo(wo()),rpc:mo(wo()),version:mo(wo())}),hl=Mo({votePubkey:wo(),nodePubkey:wo(),activatedStake:yo(),epochVoteAccount:ho(),epochCredits:lo(bo([yo(),yo(),yo()])),commission:yo(),lastVote:yo(),rootSlot:mo(yo())}),pl=gc(Mo({current:lo(hl),delinquent:lo(hl)})),fl=Ao([fo("processed"),fo("confirmed"),fo("finalized")]),ml=Mo({slot:yo(),confirmations:mo(yo()),err:Lc,confirmationStatus:go(fl)}),yl=vc(lo(mo(ml))),gl=gc(yo()),vl=Mo({accountKey:dc,writableIndexes:lo(yo()),readonlyIndexes:lo(yo())}),wl=Mo({signatures:lo(wo()),message:Mo({accountKeys:lo(wo()),header:Mo({numRequiredSignatures:yo(),numReadonlySignedAccounts:yo(),numReadonlyUnsignedAccounts:yo()}),instructions:lo(Mo({accounts:lo(yo()),data:wo(),programIdIndex:yo()})),recentBlockhash:wo(),addressTableLookups:go(lo(vl))})}),bl=Mo({pubkey:dc,signer:ho(),writable:ho(),source:go(Ao([fo("transaction"),fo("lookupTable")]))}),Ml=Mo({accountKeys:lo(bl),signatures:lo(wo())}),Al=Mo({parsed:Eo(),program:wo(),programId:dc}),El=Mo({accounts:lo(dc),data:wo(),programId:dc}),Nl=No(Ao([El,Al]),Ao([Mo({parsed:Eo(),program:wo(),programId:wo()}),Mo({accounts:lo(wo()),data:wo(),programId:wo()})]),(function(e){return ao(e,"accounts"in e?El:Al)})),Tl=Mo({signatures:lo(wo()),message:Mo({accountKeys:lo(bl),instructions:lo(Nl),recentBlockhash:wo(),addressTableLookups:go(mo(lo(vl)))})}),Il=Mo({accountIndex:yo(),mint:wo(),owner:go(wo()),uiTokenAmount:Qc}),kl=Mo({writable:lo(dc),readonly:lo(dc)}),Ll=Mo({err:Lc,fee:yo(),innerInstructions:go(mo(lo(Mo({index:yo(),instructions:lo(Mo({accounts:lo(yo()),data:wo(),programIdIndex:yo()}))})))),preBalances:lo(yo()),postBalances:lo(yo()),logMessages:go(mo(lo(wo()))),preTokenBalances:go(mo(lo(Il))),postTokenBalances:go(mo(lo(Il))),loadedAddresses:go(kl),computeUnitsConsumed:go(yo())}),xl=Mo({err:Lc,fee:yo(),innerInstructions:go(mo(lo(Mo({index:yo(),instructions:lo(Nl)})))),preBalances:lo(yo()),postBalances:lo(yo()),logMessages:go(mo(lo(wo()))),preTokenBalances:go(mo(lo(Il))),postTokenBalances:go(mo(lo(Il))),loadedAddresses:go(kl),computeUnitsConsumed:go(yo())}),Sl=Ao([fo(0),fo("legacy")]),jl=Mo({pubkey:wo(),lamports:yo(),postBalance:mo(yo()),rewardType:mo(wo()),commission:go(mo(yo()))}),Cl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:wl,meta:mo(Ll),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Dl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Ol=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:Ml,meta:mo(Ll),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),zl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:Tl,meta:mo(xl),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),_l=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:Ml,meta:mo(xl),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Pl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Bl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:wl,meta:mo(Ll)})),rewards:go(lo(jl)),blockTime:mo(yo())}))),Rl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),signatures:lo(wo()),blockTime:mo(yo())}))),Ul=gc(mo(Mo({slot:yo(),meta:mo(Ll),blockTime:go(mo(yo())),transaction:wl,version:go(Sl)}))),Wl=gc(mo(Mo({slot:yo(),transaction:Tl,meta:mo(xl),blockTime:go(mo(yo())),version:go(Sl)}))),Ql=vc(Mo({blockhash:wo(),feeCalculator:Mo({lamportsPerSignature:yo()})})),Yl=vc(Mo({blockhash:wo(),lastValidBlockHeight:yo()})),Fl=vc(ho()),Vl=gc(lo(Mo({slot:yo(),numTransactions:yo(),numSlots:yo(),samplePeriodSecs:yo()}))),Hl=vc(mo(Mo({feeCalculator:Mo({lamportsPerSignature:yo()})}))),Gl=gc(wo()),ql=gc(wo()),Zl=Mo({err:Lc,logs:lo(wo()),signature:wo()}),Jl=Mo({result:wc(Zl),subscription:yo()}),Xl={"solana-client":"js/".concat("0.0.0-development")},Kl=function(){function e(t,n){var r,i,o,a,s,u,c,l=this;R(this,e),this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(r={},function(){var e=B(z().mark((function e(t){var n,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(t),o=i.commitment,a=i.config,s=l._buildArgs([],o,void 0,a),u=tc(s),r[u]=null!==(n=r[u])&&void 0!==n?n:B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l._rpcRequest("getBlockHeight",s);case 3:if(t=e.sent,!("error"in(n=ao(t,gc(yo()))))){e.next=7;break}throw new oc(n.error,"failed to get block height information");case 7:return e.abrupt("return",n.result);case 8:return e.prev=8,delete r[u],e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[0,,8,11]])})))(),e.next=6,r[u];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n&&"string"==typeof n?this._commitment=n:n&&(this._commitment=n.commitment,this._confirmTransactionInitialTimeout=n.confirmTransactionInitialTimeout,i=n.wsEndpoint,o=n.httpHeaders,a=n.fetch,s=n.fetchMiddleware,u=n.disableRetryOnRateLimit,c=n.httpAgent),this._rpcEndpoint=function(e){if(!1===/^https?:/.test(e))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}(t),this._rpcWsEndpoint=i||function(e){var t=e.match(lc);if(null==t)throw TypeError("Failed to validate endpoint URL `".concat(e,"`"));var n=$(t,4);n[0];var r=n[1],i=n[2],o=n[3],a=e.startsWith("https:")?"wss:":"ws:",s=null==i?null:parseInt(i.slice(1),10),u=null==s?"":":".concat(s+1);return"".concat(a,"//").concat(r).concat(u).concat(o)}(t),this._rpcClient=function(e,t,n,r,i,o){var a,s=n||ac;null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),r&&(a=function(){var e=B(z().mark((function e(t,n){var i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,i){try{r(t,n,(function(t,n){return e([t,n])}))}catch(e){i(e)}}));case 2:return i=e.sent,e.next=5,s.apply(void 0,ee(i));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());var u=new aa(function(){var n=B(z().mark((function n(r,o){var u,c,l,d,h;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:u={method:"POST",body:r,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},t||{},Xl)},n.prev=1,c=5,d=500;case 4:if(!a){n.next=10;break}return n.next=7,a(e,u);case 7:l=n.sent,n.next=13;break;case 10:return n.next=12,s(e,u);case 12:l=n.sent;case 13:if(429===l.status){n.next=15;break}return n.abrupt("break",26);case 15:if(!0!==i){n.next=17;break}return n.abrupt("break",26);case 17:if(0!=(c-=1)){n.next=20;break}return n.abrupt("break",26);case 20:return console.log("Server responded with ".concat(l.status," ").concat(l.statusText,". Retrying after ").concat(d,"ms delay...")),n.next=23,_u(d);case 23:d*=2;case 24:n.next=4;break;case 26:return n.next=28,l.text();case 28:h=n.sent,l.ok?o(null,h):o(new Error("".concat(l.status," ").concat(l.statusText,": ").concat(h))),n.next=35;break;case 32:n.prev=32,n.t0=n.catch(1),n.t0 instanceof Error&&o(n.t0);case 35:case"end":return n.stop()}}),n,null,[[1,32]])})));return function(e,t){return n.apply(this,arguments)}}(),{});return u}(t,o,a,s,u,c),this._rpcRequest=function(e){return function(t,n){return new Promise((function(r,i){e.request(t,n,(function(e,t){e?i(e):r(t)}))}))}}(this._rpcClient),this._rpcBatchRequest=function(e){return function(t){return new Promise((function(n,r){0===t.length&&n([]);var i=t.map((function(t){return e.request(t.methodName,t.args)}));e.request(i,(function(e,t){e?r(e):n(t)}))}))}}(this._rpcClient),this._rpcWebSocket=new sc(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}var t,n,r,i,o,a,s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T,I,k,L,x,S,j,C,D,P,U,Q,Y,F,V,H,G,q,J,X,K,te,ne,re,ie,oe,ae,se,ue,ce,le,de,he,pe,fe,me,ye,ge,ve,we,be,Me,Ae,Ne,Te,Ie,ke,Le,xe,Se,je,Ce,De,Oe,ze,_e,Pe,Be,Re,Ue,We,Qe,Ye,Fe,Ve;return W(e,[{key:"commitment",get:function(){return this._commitment}},{key:"rpcEndpoint",get:function(){return this._rpcEndpoint}},{key:"getBalanceAndContext",value:(Ve=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,void 0,o),e.next=4,this._rpcRequest("getBalance",a);case 4:if(s=e.sent,!("error"in(u=ao(s,vc(yo()))))){e.next=8;break}throw new oc(u.error,"failed to get balance for ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ve.apply(this,arguments)})},{key:"getBalance",value:(Fe=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBalanceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get balance of account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return Fe.apply(this,arguments)})},{key:"getBlockTime",value:(Ye=B(z().mark((function e(t){var n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getBlockTime",[t]);case 2:if(n=e.sent,!("error"in(r=ao(n,gc(mo(yo())))))){e.next=6;break}throw new oc(r.error,"failed to get block time for slot ".concat(t));case 6:return e.abrupt("return",r.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return Ye.apply(this,arguments)})},{key:"getMinimumLedgerSlot",value:(Qe=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("minimumLedgerSlot",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(yo()))))){e.next=6;break}throw new oc(n.error,"failed to get minimum ledger slot");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return Qe.apply(this,arguments)})},{key:"getFirstAvailableBlock",value:(We=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getFirstAvailableBlock",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,Uc)))){e.next=6;break}throw new oc(n.error,"failed to get first available block");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return We.apply(this,arguments)})},{key:"getSupply",value:(Ue=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},n="string"==typeof t?{commitment:t}:t?O(O({},t),{},{commitment:t&&t.commitment||this.commitment}):{commitment:this.commitment},e.next=4,this._rpcRequest("getSupply",[n]);case 4:if(r=e.sent,!("error"in(i=ao(r,Wc)))){e.next=8;break}throw new oc(i.error,"failed to get supply");case 8:return e.abrupt("return",i.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return Ue.apply(this,arguments)})},{key:"getTokenSupply",value:(Re=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t.toBase58()],n),e.next=3,this._rpcRequest("getTokenSupply",r);case 3:if(i=e.sent,!("error"in(o=ao(i,vc(Qc))))){e.next=7;break}throw new oc(o.error,"failed to get token supply");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return Re.apply(this,arguments)})},{key:"getTokenAccountBalance",value:(Be=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t.toBase58()],n),e.next=3,this._rpcRequest("getTokenAccountBalance",r);case 3:if(i=e.sent,!("error"in(o=ao(i,vc(Qc))))){e.next=7;break}throw new oc(o.error,"failed to get token account balance");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return Be.apply(this,arguments)})},{key:"getTokenAccountsByOwner",value:(Pe=B(z().mark((function e(t,n,r){var i,o,a,s,u,c,l;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(r),o=i.commitment,a=i.config,s=[t.toBase58()],"mint"in n?s.push({mint:n.mint.toBase58()}):s.push({programId:n.programId.toBase58()}),u=this._buildArgs(s,o,"base64",a),e.next=6,this._rpcRequest("getTokenAccountsByOwner",u);case 6:if(c=e.sent,!("error"in(l=ao(c,Fc)))){e.next=10;break}throw new oc(l.error,"failed to get token accounts owned by account ".concat(t.toBase58()));case 10:return e.abrupt("return",l.result);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Pe.apply(this,arguments)})},{key:"getParsedTokenAccountsByOwner",value:(_e=B(z().mark((function e(t,n,r){var i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[t.toBase58()],"mint"in n?i.push({mint:n.mint.toBase58()}):i.push({programId:n.programId.toBase58()}),o=this._buildArgs(i,r,"jsonParsed"),e.next=5,this._rpcRequest("getTokenAccountsByOwner",o);case 5:if(a=e.sent,!("error"in(s=ao(a,Hc)))){e.next=9;break}throw new oc(s.error,"failed to get token accounts owned by account ".concat(t.toBase58()));case 9:return e.abrupt("return",s.result);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return _e.apply(this,arguments)})},{key:"getLargestAccounts",value:(ze=B(z().mark((function e(t){var n,r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=O(O({},t),{},{commitment:t&&t.commitment||this.commitment}),r=n.filter||n.commitment?[n]:[],e.next=4,this._rpcRequest("getLargestAccounts",r);case 4:if(i=e.sent,!("error"in(o=ao(i,Gc)))){e.next=8;break}throw new oc(o.error,"failed to get largest accounts");case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ze.apply(this,arguments)})},{key:"getTokenLargestAccounts",value:(Oe=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t.toBase58()],n),e.next=3,this._rpcRequest("getTokenLargestAccounts",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Yc)))){e.next=7;break}throw new oc(o.error,"failed to get token largest accounts");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return Oe.apply(this,arguments)})},{key:"getAccountInfoAndContext",value:(De=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,"base64",o),e.next=4,this._rpcRequest("getAccountInfo",a);case 4:if(s=e.sent,!("error"in(u=ao(s,vc(mo(qc)))))){e.next=8;break}throw new oc(u.error,"failed to get info about account ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return De.apply(this,arguments)})},{key:"getParsedAccountInfo",value:(Ce=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,"jsonParsed",o),e.next=4,this._rpcRequest("getAccountInfo",a);case 4:if(s=e.sent,!("error"in(u=ao(s,vc(mo(Xc)))))){e.next=8;break}throw new oc(u.error,"failed to get info about account ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ce.apply(this,arguments)})},{key:"getAccountInfo",value:(je=B(z().mark((function e(t,n){var r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getAccountInfoAndContext(t,n);case 3:return r=e.sent,e.abrupt("return",r.value);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("failed to get info about account "+t.toBase58()+": "+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return je.apply(this,arguments)})},{key:"getMultipleParsedAccounts",value:(Se=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return e.toBase58()})),s=this._buildArgs([a],i,"jsonParsed",o),e.next=5,this._rpcRequest("getMultipleAccounts",s);case 5:if(u=e.sent,!("error"in(c=ao(u,vc(lo(mo(Xc))))))){e.next=9;break}throw new oc(c.error,"failed to get info for accounts ".concat(a));case 9:return e.abrupt("return",c.result);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return Se.apply(this,arguments)})},{key:"getMultipleAccountsInfoAndContext",value:(xe=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return e.toBase58()})),s=this._buildArgs([a],i,"base64",o),e.next=5,this._rpcRequest("getMultipleAccounts",s);case 5:if(u=e.sent,!("error"in(c=ao(u,vc(lo(mo(qc))))))){e.next=9;break}throw new oc(c.error,"failed to get info for accounts ".concat(a));case 9:return e.abrupt("return",c.result);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return xe.apply(this,arguments)})},{key:"getMultipleAccountsInfo",value:(Le=B(z().mark((function e(t,n){var r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getMultipleAccountsInfoAndContext(t,n);case 2:return r=e.sent,e.abrupt("return",r.value);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return Le.apply(this,arguments)})},{key:"getStakeActivation",value:(ke=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(n),o=i.commitment,a=i.config,s=this._buildArgs([t.toBase58()],o,void 0,O(O({},a),{},{epoch:null!=r?r:null==a?void 0:a.epoch})),e.next=4,this._rpcRequest("getStakeActivation",s);case 4:if(u=e.sent,!("error"in(c=ao(u,gc($c))))){e.next=8;break}throw new oc(c.error,"failed to get Stake Activation ".concat(t.toBase58()));case 8:return e.abrupt("return",c.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ke.apply(this,arguments)})},{key:"getProgramAccounts",value:(Ie=B(z().mark((function e(t,n){var r,i,o,a,s,u,c,l,d,h;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,s=(a=o||{}).encoding,u=Z(a,_s),c=this._buildArgs([t.toBase58()],i,s||"base64",u),e.next=5,this._rpcRequest("getProgramAccounts",c);case 5:if(l=e.sent,d=lo(Zc),!("error"in(h=!0===u.withContext?ao(l,vc(d)):ao(l,gc(d))))){e.next=10;break}throw new oc(h.error,"failed to get accounts owned by program ".concat(t.toBase58()));case 10:return e.abrupt("return",h.result);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ie.apply(this,arguments)})},{key:"getParsedProgramAccounts",value:(Te=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,"jsonParsed",o),e.next=4,this._rpcRequest("getProgramAccounts",a);case 4:if(s=e.sent,!("error"in(u=ao(s,gc(lo(Kc)))))){e.next=8;break}throw new oc(u.error,"failed to get accounts owned by program ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return Te.apply(this,arguments)})},{key:"confirmTransaction",value:(Ne=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=4;break}r=t,e.next=8;break;case 4:if(null===(i=(o=t).abortSignal)||void 0===i||!i.aborted){e.next=7;break}return e.abrupt("return",Promise.reject(o.abortSignal.reason));case 7:r=o.signature;case 8:e.prev=8,a=ar.decode(r),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(8),new Error("signature must be base58 encoded: "+r);case 15:if(fu(64===a.length,"signature has invalid length"),"string"!=typeof t){e.next=22;break}return e.next=19,this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:n||this.commitment,signature:r});case 19:return e.abrupt("return",e.sent);case 22:if(!("lastValidBlockHeight"in t)){e.next=28;break}return e.next=25,this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:n||this.commitment,strategy:t});case 25:return e.abrupt("return",e.sent);case 28:return e.next=30,this.confirmTransactionUsingDurableNonceStrategy({commitment:n||this.commitment,strategy:t});case 30:return e.abrupt("return",e.sent);case 31:case"end":return e.stop()}}),e,this,[[8,12]])}))),function(e,t){return Ne.apply(this,arguments)})},{key:"getCancellationPromise",value:function(e){return new Promise((function(t,n){null!=e&&(e.aborted?n(e.reason):e.addEventListener("abort",(function(){n(e.reason)})))}))}},{key:"getTransactionConfirmationPromise",value:function(e){var t,n,r=this,i=e.commitment,o=e.signature,a=!1;return{abortConfirmation:function(){n&&(n(),n=void 0),null!=t&&(r.removeSignatureListener(t),t=void 0)},confirmationPromise:new Promise((function(e,s){try{t=r.onSignature(o,(function(n,r){t=void 0;var i={context:r,value:n};e({__type:wu.PROCESSED,response:i})}),i);var u=new Promise((function(e){null==t?e():n=r._onSubscriptionStateChange(t,(function(t){"subscribed"===t&&e()}))}));B(z().mark((function t(){var n,c,l;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u;case 2:if(!a){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,r.getSignatureStatus(o);case 6:if(n=t.sent,!a){t.next=9;break}return t.abrupt("return");case 9:if(null!=n){t.next=11;break}return t.abrupt("return");case 11:if(c=n.context,null!=(l=n.value)){t.next=14;break}return t.abrupt("return");case 14:if(null==l||!l.err){t.next=18;break}s(l.err),t.next=29;break;case 18:t.t0=i,t.next="confirmed"===t.t0||"single"===t.t0||"singleGossip"===t.t0?21:"finalized"===t.t0||"max"===t.t0||"root"===t.t0?24:("processed"===t.t0||t.t0,27);break;case 21:if("processed"!==l.confirmationStatus){t.next=23;break}return t.abrupt("return");case 23:return t.abrupt("break",27);case 24:if("processed"!==l.confirmationStatus&&"confirmed"!==l.confirmationStatus){t.next=26;break}return t.abrupt("return");case 26:return t.abrupt("break",27);case 27:a=!0,e({__type:wu.PROCESSED,response:{context:c,value:l}});case 29:case"end":return t.stop()}}),t)})))()}catch(e){s(e)}}))}}},{key:"confirmTransactionUsingBlockHeightExceedanceStrategy",value:(Ae=B(z().mark((function e(t){var n,r,i,o,a,s,u,c,l,d,h,p,f,m=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commitment,r=t.strategy,i=r.abortSignal,o=r.lastValidBlockHeight,a=r.signature,s=!1,u=new Promise((function(e){var t=function(){var e=B(z().mark((function e(){var t;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.getBlockHeight(n);case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",-1);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();B(z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:if(r=n.sent,!s){n.next=5;break}return n.abrupt("return");case 5:if(!(r<=o)){n.next=17;break}return n.next=8,_u(1e3);case 8:if(!s){n.next=10;break}return n.abrupt("return");case 10:return n.next=12,t();case 12:if(r=n.sent,!s){n.next=15;break}return n.abrupt("return");case 15:n.next=5;break;case 17:e({__type:wu.BLOCKHEIGHT_EXCEEDED});case 18:case"end":return n.stop()}}),n)})))()})),c=this.getTransactionConfirmationPromise({commitment:n,signature:a}),l=c.abortConfirmation,d=c.confirmationPromise,h=this.getCancellationPromise(i),e.prev=5,e.next=8,Promise.race([h,d,u]);case 8:if((f=e.sent).__type!==wu.PROCESSED){e.next=13;break}p=f.response,e.next=14;break;case 13:throw new iu(a);case 14:return e.prev=14,s=!0,l(),e.finish(14);case 18:return e.abrupt("return",p);case 19:case"end":return e.stop()}}),e,this,[[5,,14,18]])}))),function(e){return Ae.apply(this,arguments)})},{key:"confirmTransactionUsingDurableNonceStrategy",value:(Me=B(z().mark((function e(t){var n,r,i,o,a,s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commitment,r=t.strategy,i=r.abortSignal,o=r.minContextSlot,a=r.nonceAccountPubkey,s=r.nonceValue,u=r.signature,c=!1,l=new Promise((function(e){var t=s,r=null,i=function(){var e=B(z().mark((function e(){var i,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,E.getNonceAndContext(a,{commitment:n,minContextSlot:o});case 3:return i=e.sent,s=i.context,u=i.value,r=s.slot,e.abrupt("return",null==u?void 0:u.nonce);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",t);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}();B(z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i();case 2:if(t=n.sent,!c){n.next=5;break}return n.abrupt("return");case 5:if(s===t){n.next=9;break}return e({__type:wu.NONCE_INVALID,slotInWhichNonceDidAdvance:r}),n.abrupt("return");case 9:return n.next=11,_u(2e3);case 11:if(!c){n.next=13;break}return n.abrupt("return");case 13:return n.next=15,i();case 15:if(t=n.sent,!c){n.next=18;break}return n.abrupt("return");case 18:n.next=5;break;case 20:case"end":return n.stop()}}),n)})))()})),d=this.getTransactionConfirmationPromise({commitment:n,signature:u}),h=d.abortConfirmation,p=d.confirmationPromise,f=this.getCancellationPromise(i),e.prev=5,e.next=8,Promise.race([f,p,l]);case 8:if((y=e.sent).__type!==wu.PROCESSED){e.next=13;break}m=y.response,e.next=47;break;case 13:return e.next=16,this.getSignatureStatus(u);case 16:if(null!=(b=e.sent)){e.next=19;break}return e.abrupt("break",27);case 19:if(!(b.context.slot<(null!==(w=y.slotInWhichNonceDidAdvance)&&void 0!==w?w:o))){e.next=23;break}return e.next=22,_u(400);case 22:return e.abrupt("continue",13);case 23:return v=b,e.abrupt("break",27);case 27:if(null===(g=v)||void 0===g||!g.value){e.next=46;break}M=n||"finalized",A=v.value.confirmationStatus,e.t0=M,e.next="processed"===e.t0||"recent"===e.t0?33:"confirmed"===e.t0||"single"===e.t0||"singleGossip"===e.t0?36:"finalized"===e.t0||"max"===e.t0||"root"===e.t0?39:42;break;case 33:if("processed"===A||"confirmed"===A||"finalized"===A){e.next=35;break}throw new au(u);case 35:case 38:case 41:return e.abrupt("break",43);case 36:if("confirmed"===A||"finalized"===A){e.next=38;break}throw new au(u);case 39:if("finalized"===A){e.next=41;break}throw new au(u);case 42:case 43:m={context:v.context,value:{err:v.value.err}},e.next=47;break;case 46:throw new au(u);case 47:return e.prev=47,c=!0,h(),e.finish(47);case 51:return e.abrupt("return",m);case 52:case"end":return e.stop()}}),e,this,[[5,,47,51]])}))),function(e){return Me.apply(this,arguments)})},{key:"confirmTransactionUsingLegacyTimeoutStrategy",value:(be=B(z().mark((function e(t){var n,r,i,o,a,s,u,c,l,d=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commitment,r=t.signature,o=new Promise((function(e){var t=d._confirmTransactionInitialTimeout||6e4;switch(n){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":t=d._confirmTransactionInitialTimeout||3e4}i=setTimeout((function(){return e({__type:wu.TIMED_OUT,timeoutMs:t})}),t)})),a=this.getTransactionConfirmationPromise({commitment:n,signature:r}),s=a.abortConfirmation,u=a.confirmationPromise,e.prev=3,e.next=6,Promise.race([u,o]);case 6:if((l=e.sent).__type!==wu.PROCESSED){e.next=11;break}c=l.response,e.next=12;break;case 11:throw new ou(r,l.timeoutMs/1e3);case 12:return e.prev=12,clearTimeout(i),s(),e.finish(12);case 16:return e.abrupt("return",c);case 17:case"end":return e.stop()}}),e,this,[[3,,12,16]])}))),function(e){return be.apply(this,arguments)})},{key:"getClusterNodes",value:(we=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getClusterNodes",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(lo(dl)))))){e.next=6;break}throw new oc(n.error,"failed to get cluster nodes");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return we.apply(this,arguments)})},{key:"getVoteAccounts",value:(ve=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._buildArgs([],t),e.next=3,this._rpcRequest("getVoteAccounts",n);case 3:if(r=e.sent,!("error"in(i=ao(r,pl)))){e.next=7;break}throw new oc(i.error,"failed to get vote accounts");case 7:return e.abrupt("return",i.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return ve.apply(this,arguments)})},{key:"getSlot",value:(ge=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getSlot",o);case 4:if(a=e.sent,!("error"in(s=ao(a,gc(yo()))))){e.next=8;break}throw new oc(s.error,"failed to get slot");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ge.apply(this,arguments)})},{key:"getSlotLeader",value:(ye=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getSlotLeader",o);case 4:if(a=e.sent,!("error"in(s=ao(a,gc(wo()))))){e.next=8;break}throw new oc(s.error,"failed to get slot leader");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ye.apply(this,arguments)})},{key:"getSlotLeaders",value:(me=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[t,n],e.next=3,this._rpcRequest("getSlotLeaders",r);case 3:if(i=e.sent,!("error"in(o=ao(i,gc(lo(dc)))))){e.next=7;break}throw new oc(o.error,"failed to get slot leaders");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return me.apply(this,arguments)})},{key:"getSignatureStatus",value:(fe=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSignatureStatuses([t],n);case 2:return r=e.sent,i=r.context,fu(1===(o=r.value).length),a=o[0],e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return fe.apply(this,arguments)})},{key:"getSignatureStatuses",value:(pe=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[t],n&&r.push(n),e.next=4,this._rpcRequest("getSignatureStatuses",r);case 4:if(i=e.sent,!("error"in(o=ao(i,yl)))){e.next=8;break}throw new oc(o.error,"failed to get signature status");case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return pe.apply(this,arguments)})},{key:"getTransactionCount",value:(he=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getTransactionCount",o);case 4:if(a=e.sent,!("error"in(s=ao(a,gc(yo()))))){e.next=8;break}throw new oc(s.error,"failed to get transaction count");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return he.apply(this,arguments)})},{key:"getTotalSupply",value:(de=B(z().mark((function e(t){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0});case 2:return n=e.sent,e.abrupt("return",n.value.total);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return de.apply(this,arguments)})},{key:"getInflationGovernor",value:(le=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._buildArgs([],t),e.next=3,this._rpcRequest("getInflationGovernor",n);case 3:if(r=e.sent,!("error"in(i=ao(r,Oc)))){e.next=7;break}throw new oc(i.error,"failed to get inflation");case 7:return e.abrupt("return",i.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return le.apply(this,arguments)})},{key:"getInflationReward",value:(ce=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(r),o=i.commitment,a=i.config,s=this._buildArgs([t.map((function(e){return e.toBase58()}))],o,void 0,O(O({},a),{},{epoch:null!=n?n:null==a?void 0:a.epoch})),e.next=4,this._rpcRequest("getInflationReward",s);case 4:if(u=e.sent,!("error"in(c=ao(u,Ac)))){e.next=8;break}throw new oc(c.error,"failed to get inflation reward");case 8:return e.abrupt("return",c.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ce.apply(this,arguments)})},{key:"getInflationRate",value:(ue=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getInflationRate",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,zc)))){e.next=6;break}throw new oc(n.error,"failed to get inflation rate");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return ue.apply(this,arguments)})},{key:"getEpochInfo",value:(se=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getEpochInfo",o);case 4:if(a=e.sent,!("error"in(s=ao(a,Pc)))){e.next=8;break}throw new oc(s.error,"failed to get epoch info");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return se.apply(this,arguments)})},{key:"getEpochSchedule",value:(ae=B(z().mark((function e(){var t,n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getEpochSchedule",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,Bc)))){e.next=6;break}throw new oc(n.error,"failed to get epoch schedule");case 6:return r=n.result,e.abrupt("return",new rc(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot));case 8:case"end":return e.stop()}}),e,this)}))),function(){return ae.apply(this,arguments)})},{key:"getLeaderSchedule",value:(oe=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getLeaderSchedule",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,Rc)))){e.next=6;break}throw new oc(n.error,"failed to get leader schedule");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return oe.apply(this,arguments)})},{key:"getMinimumBalanceForRentExemption",value:(ie=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t],n),e.next=3,this._rpcRequest("getMinimumBalanceForRentExemption",r);case 3:if(i=e.sent,!("error"in(o=ao(i,gl)))){e.next=8;break}return console.warn("Unable to fetch minimum balance for rent exemption"),e.abrupt("return",0);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return ie.apply(this,arguments)})},{key:"getRecentBlockhashAndContext",value:(re=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._buildArgs([],t),e.next=3,this._rpcRequest("getRecentBlockhash",n);case 3:if(r=e.sent,!("error"in(i=ao(r,Ql)))){e.next=7;break}throw new oc(i.error,"failed to get recent blockhash");case 7:return e.abrupt("return",i.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return re.apply(this,arguments)})},{key:"getRecentPerformanceSamples",value:(ne=B(z().mark((function e(t){var n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]);case 2:if(n=e.sent,!("error"in(r=ao(n,Vl)))){e.next=6;break}throw new oc(r.error,"failed to get recent performance samples");case 6:return e.abrupt("return",r.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return ne.apply(this,arguments)})},{key:"getFeeCalculatorForBlockhash",value:(te=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t],n),e.next=3,this._rpcRequest("getFeeCalculatorForBlockhash",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Hl)))){e.next=7;break}throw new oc(o.error,"failed to get fee calculator");case 7:return a=o.result,s=a.context,u=a.value,e.abrupt("return",{context:s,value:null!==u?u.feeCalculator:null});case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"getFeeForMessage",value:(K=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Hs(t.serialize()).toString("base64"),i=this._buildArgs([r],n),e.next=4,this._rpcRequest("getFeeForMessage",i);case 4:if(o=e.sent,!("error"in(a=ao(o,vc(mo(yo())))))){e.next=8;break}throw new oc(a.error,"failed to get fee for message");case 8:if(null!==a.result){e.next=10;break}throw new Error("invalid blockhash");case 10:return e.abrupt("return",a.result);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"getRecentPrioritizationFees",value:(X=B(z().mark((function e(t){var n,r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null==t||null===(n=t.lockedWritableAccounts)||void 0===n?void 0:n.map((function(e){return e.toBase58()})),i=null!=r&&r.length?[r]:[],e.next=4,this._rpcRequest("getRecentPrioritizationFees",i);case 4:if(o=e.sent,!("error"in(a=ao(o,_c)))){e.next=8;break}throw new oc(a.error,"failed to get recent prioritization fees");case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"getRecentBlockhash",value:(J=B(z().mark((function e(t){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getRecentBlockhashAndContext(t);case 3:return n=e.sent,e.abrupt("return",n.value);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("failed to get recent blockhash: "+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e){return J.apply(this,arguments)})},{key:"getLatestBlockhash",value:(q=B(z().mark((function e(t){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getLatestBlockhashAndContext(t);case 3:return n=e.sent,e.abrupt("return",n.value);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("failed to get recent blockhash: "+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e){return q.apply(this,arguments)})},{key:"getLatestBlockhashAndContext",value:(G=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getLatestBlockhash",o);case 4:if(a=e.sent,!("error"in(s=ao(a,Yl)))){e.next=8;break}throw new oc(s.error,"failed to get latest blockhash");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"isBlockhashValid",value:(H=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t],i,void 0,o),e.next=4,this._rpcRequest("isBlockhashValid",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Fl)))){e.next=8;break}throw new oc(u.error,"failed to determine if the blockhash `"+t+"`is valid");case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getVersion",value:(V=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getVersion",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(jc))))){e.next=6;break}throw new oc(n.error,"failed to get version");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return V.apply(this,arguments)})},{key:"getGenesisHash",value:(F=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getGenesisHash",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(wo()))))){e.next=6;break}throw new oc(n.error,"failed to get genesis hash");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"getBlock",value:(Y=B(z().mark((function e(t,n){var r,i,o,a,s,u,c,l,d;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,void 0,o),e.next=4,this._rpcRequest("getBlock",a);case 4:s=e.sent,e.prev=5,e.t0=null==o?void 0:o.transactionDetails,e.next="accounts"===e.t0?9:"none"===e.t0?13:17;break;case 9:if(!("error"in(u=ao(s,Ol)))){e.next=12;break}throw u.error;case 12:return e.abrupt("return",u.result);case 13:if(!("error"in(c=ao(s,Dl)))){e.next=16;break}throw c.error;case 16:return e.abrupt("return",c.result);case 17:if(!("error"in(l=ao(s,Cl)))){e.next=20;break}throw l.error;case 20:return d=l.result,e.abrupt("return",d?O(O({},d),{},{transactions:d.transactions.map((function(e){var t=e.transaction,n=e.meta,r=e.version;return{meta:n,transaction:O(O({},t),{},{message:bc(r,t.message)}),version:r}}))}):null);case 22:e.next=27;break;case 24:throw e.prev=24,e.t1=e.catch(5),new oc(e.t1,"failed to get confirmed block");case 27:case"end":return e.stop()}}),e,this,[[5,24]])}))),function(e,t){return Y.apply(this,arguments)})},{key:"getParsedBlock",value:(Q=B(z().mark((function e(t,n){var r,i,o,a,s,u,c,l;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,"jsonParsed",o),e.next=4,this._rpcRequest("getBlock",a);case 4:s=e.sent,e.prev=5,e.t0=null==o?void 0:o.transactionDetails,e.next="accounts"===e.t0?9:"none"===e.t0?13:17;break;case 9:if(!("error"in(u=ao(s,_l)))){e.next=12;break}throw u.error;case 12:return e.abrupt("return",u.result);case 13:if(!("error"in(c=ao(s,Pl)))){e.next=16;break}throw c.error;case 16:return e.abrupt("return",c.result);case 17:if(!("error"in(l=ao(s,zl)))){e.next=20;break}throw l.error;case 20:return e.abrupt("return",l.result);case 21:e.next=26;break;case 23:throw e.prev=23,e.t1=e.catch(5),new oc(e.t1,"failed to get block");case 26:case"end":return e.stop()}}),e,this,[[5,23]])}))),function(e,t){return Q.apply(this,arguments)})},{key:"getBlockProduction",value:(U=B(z().mark((function e(t){var n,r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t?r=t:t&&(i=t.commitment,o=Z(t,Ps),r=i,n=o),a=this._buildArgs([],r,"base64",n),e.next=4,this._rpcRequest("getBlockProduction",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Dc)))){e.next=8;break}throw new oc(u.error,"failed to get block production information");case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"getTransaction",value:(P=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,void 0,o),e.next=4,this._rpcRequest("getTransaction",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Ul)))){e.next=8;break}throw new oc(u.error,"failed to get transaction");case 8:if(c=u.result){e.next=11;break}return e.abrupt("return",c);case 11:return e.abrupt("return",O(O({},c),{},{transaction:O(O({},c.transaction),{},{message:bc(c.version,c.transaction.message)})}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getParsedTransaction",value:(D=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,"jsonParsed",o),e.next=4,this._rpcRequest("getTransaction",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Wl)))){e.next=8;break}throw new oc(u.error,"failed to get transaction");case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getParsedTransactions",value:(C=B(z().mark((function e(t,n){var r,i,o,a,s,u,c=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return{methodName:"getTransaction",args:c._buildArgsAtLeastConfirmed([e],i,"jsonParsed",o)}})),e.next=4,this._rpcBatchRequest(a);case 4:return s=e.sent,u=s.map((function(e){var t=ao(e,Wl);if("error"in t)throw new oc(t.error,"failed to get transactions");return t.result})),e.abrupt("return",u);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getTransactions",value:(j=B(z().mark((function e(t,n){var r,i,o,a,s,u,c=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return{methodName:"getTransaction",args:c._buildArgsAtLeastConfirmed([e],i,void 0,o)}})),e.next=4,this._rpcBatchRequest(a);case 4:return s=e.sent,u=s.map((function(e){var t=ao(e,Ul);if("error"in t)throw new oc(t.error,"failed to get transactions");var n=t.result;return n?O(O({},n),{},{transaction:O(O({},n.transaction),{},{message:bc(n.version,n.transaction.message)})}):n})),e.abrupt("return",u);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"getConfirmedBlock",value:(S=B(z().mark((function e(t,n){var r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n),e.next=3,this._rpcRequest("getConfirmedBlock",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Bl)))){e.next=7;break}throw new oc(o.error,"failed to get confirmed block");case 7:if(a=o.result){e.next=10;break}throw new Error("Confirmed block "+t+" not found");case 10:return s=O(O({},a),{},{transactions:a.transactions.map((function(e){var t=e.transaction,n=e.meta,r=new yu(t.message);return{meta:n,transaction:O(O({},t),{},{message:r})}}))}),e.abrupt("return",O(O({},s),{},{transactions:s.transactions.map((function(e){var t=e.transaction;return{meta:e.meta,transaction:Au.populate(t.message,t.signatures)}}))}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getBlocks",value:(x=B(z().mark((function e(t,n,r){var i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed(void 0!==n?[t,n]:[t],r),e.next=3,this._rpcRequest("getBlocks",i);case 3:if(o=e.sent,!("error"in(a=ao(o,gc(lo(yo())))))){e.next=7;break}throw new oc(a.error,"failed to get blocks");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return x.apply(this,arguments)})},{key:"getBlockSignatures",value:(L=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n,void 0,{transactionDetails:"signatures",rewards:!1}),e.next=3,this._rpcRequest("getBlock",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Rl)))){e.next=7;break}throw new oc(o.error,"failed to get block");case 7:if(a=o.result){e.next=10;break}throw new Error("Block "+t+" not found");case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getConfirmedBlockSignatures",value:(k=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n,void 0,{transactionDetails:"signatures",rewards:!1}),e.next=3,this._rpcRequest("getConfirmedBlock",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Rl)))){e.next=7;break}throw new oc(o.error,"failed to get confirmed block");case 7:if(a=o.result){e.next=10;break}throw new Error("Confirmed block "+t+" not found");case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getConfirmedTransaction",value:(I=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n),e.next=3,this._rpcRequest("getConfirmedTransaction",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Ul)))){e.next=7;break}throw new oc(o.error,"failed to get transaction");case 7:if(a=o.result){e.next=10;break}return e.abrupt("return",a);case 10:return s=new yu(a.transaction.message),u=a.transaction.signatures,e.abrupt("return",O(O({},a),{},{transaction:Au.populate(s,u)}));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getParsedConfirmedTransaction",value:(T=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed"),e.next=3,this._rpcRequest("getConfirmedTransaction",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Wl)))){e.next=7;break}throw new oc(o.error,"failed to get confirmed transaction");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getParsedConfirmedTransactions",value:(N=B(z().mark((function e(t,n){var r,i,o,a=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.map((function(e){return{methodName:"getConfirmedTransaction",args:a._buildArgsAtLeastConfirmed([e],n,"jsonParsed")}})),e.next=3,this._rpcBatchRequest(r);case 3:return i=e.sent,o=i.map((function(e){var t=ao(e,Wl);if("error"in t)throw new oc(t.error,"failed to get confirmed transactions");return t.result})),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress",value:(E=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={},e.next=3,this.getFirstAvailableBlock();case 3:o=e.sent;case 4:if("until"in i){e.next=24;break}if(!(--n<=0||n<o)){e.next=8;break}return e.abrupt("break",24);case 8:return e.prev=8,e.next=11,this.getConfirmedBlockSignatures(n,"finalized");case 11:(a=e.sent).signatures.length>0&&(i.until=a.signatures[a.signatures.length-1].toString()),e.next=22;break;case 15:if(e.prev=15,e.t0=e.catch(8),!(e.t0 instanceof Error&&e.t0.message.includes("skipped"))){e.next=21;break}return e.abrupt("continue",4);case 21:throw e.t0;case 22:e.next=4;break;case 24:return e.next=26,this.getSlot("finalized");case 26:s=e.sent;case 27:if("before"in i){e.next=47;break}if(!(++r>s)){e.next=31;break}return e.abrupt("break",47);case 31:return e.prev=31,e.next=34,this.getConfirmedBlockSignatures(r);case 34:(u=e.sent).signatures.length>0&&(i.before=u.signatures[u.signatures.length-1].toString()),e.next=45;break;case 38:if(e.prev=38,e.t1=e.catch(31),!(e.t1 instanceof Error&&e.t1.message.includes("skipped"))){e.next=44;break}return e.abrupt("continue",27);case 44:throw e.t1;case 45:e.next=27;break;case 47:return e.next=49,this.getConfirmedSignaturesForAddress2(t,i);case 49:return c=e.sent,e.abrupt("return",c.map((function(e){return e.signature})));case 51:case"end":return e.stop()}}),e,this,[[8,15],[31,38]])}))),function(e,t,n){return E.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress2",value:(A=B(z().mark((function e(t,n,r){var i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",i);case 3:if(o=e.sent,!("error"in(a=ao(o,el)))){e.next=7;break}throw new oc(a.error,"failed to get confirmed signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return A.apply(this,arguments)})},{key:"getSignaturesForAddress",value:(M=B(z().mark((function e(t,n,r){var i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getSignaturesForAddress",i);case 3:if(o=e.sent,!("error"in(a=ao(o,tl)))){e.next=7;break}throw new oc(a.error,"failed to get signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return M.apply(this,arguments)})},{key:"getAddressLookupTable",value:(b=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=new uc({key:t,state:uc.deserialize(o.data)})),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getNonceAndContext",value:(w=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=Yu.fromAccountData(o.data)),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getNonce",value:(v=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNonceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"requestAirdrop",value:(g=B(z().mark((function e(t,n){var r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("requestAirdrop",[t.toBase58(),n]);case 2:if(r=e.sent,!("error"in(i=ao(r,Gl)))){e.next=6;break}throw new oc(i.error,"airdrop to ".concat(t.toBase58()," failed"));case 6:return e.abrupt("return",i.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_blockhashWithExpiryBlockHeight",value:(y=B(z().mark((function e(t){var n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=10;break}case 1:if(!this._pollingBlockhash){e.next=6;break}return e.next=4,_u(100);case 4:e.next=1;break;case 6:if(n=Date.now()-this._blockhashInfo.lastFetch,r=n>=3e4,null===this._blockhashInfo.latestBlockhash||r){e.next=10;break}return e.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return e.next=12,this._pollNewBlockhash();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"_pollNewBlockhash",value:(m=B(z().mark((function e(){var t,n,r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null,i=0;case 6:if(!(i<50)){e.next=18;break}return e.next=9,this.getLatestBlockhash("finalized");case 9:if(o=e.sent,r===o.blockhash){e.next=13;break}return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",o);case 13:return e.next=15,_u(200);case 15:i++,e.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 19:return e.prev=19,this._pollingBlockhash=!1,e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[1,,19,22]])}))),function(){return m.apply(this,arguments)})},{key:"getStakeMinimumDelegation",value:(f=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,"base64",i),e.next=4,this._rpcRequest("getStakeMinimumDelegation",o);case 4:if(a=e.sent,!("error"in(s=ao(a,vc(yo()))))){e.next=8;break}throw new oc(s.error,"failed to get stake minimum delegation");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"simulateTransaction",value:(p=B(z().mark((function e(t,n,r){var i,o,a,s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T,I,k,L,x;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("message"in t)){e.next=17;break}if(i=t.serialize(),o=Ee.from(i).toString("base64"),!Array.isArray(n)&&void 0===r){e.next=6;break}throw new Error("Invalid arguments");case 6:return(a=n||{}).encoding="base64","commitment"in a||(a.commitment=this.commitment),s=[o,a],e.next=12,this._rpcRequest("simulateTransaction",s);case 12:if(u=e.sent,!("error"in(c=ao(u,Cc)))){e.next=16;break}throw new Error("failed to simulate transaction: "+c.error.message);case 16:return e.abrupt("return",c.result);case 17:if(t instanceof Au?(d=t,(l=new Au).feePayer=d.feePayer,l.instructions=t.instructions,l.nonceInfo=d.nonceInfo,l.signatures=d.signatures):(l=Au.populate(t))._message=l._json=void 0,void 0===n||Array.isArray(n)){e.next=20;break}throw new Error("Invalid arguments");case 20:if(h=n,!l.nonceInfo||!h){e.next=25;break}(p=l).sign.apply(p,ee(h)),e.next=45;break;case 25:f=this._disableBlockhashCaching;case 26:return e.next=28,this._blockhashWithExpiryBlockHeight(f);case 28:if(y=e.sent,l.lastValidBlockHeight=y.lastValidBlockHeight,l.recentBlockhash=y.blockhash,h){e.next=33;break}return e.abrupt("break",45);case 33:if((m=l).sign.apply(m,ee(h)),l.signature){e.next=36;break}throw new Error("!signature");case 36:if(g=l.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(g)||this._blockhashInfo.transactionSignatures.includes(g)){e.next=42;break}return this._blockhashInfo.simulatedSignatures.push(g),e.abrupt("break",45);case 42:f=!0;case 43:e.next=26;break;case 45:return v=l._compile(),w=v.serialize(),b=l._serialize(w),M=b.toString("base64"),A={encoding:"base64",commitment:this.commitment},r&&(E=(Array.isArray(r)?r:v.nonProgramIds()).map((function(e){return e.toBase58()})),A.accounts={encoding:"base64",addresses:E}),h&&(A.sigVerify=!0),N=[M,A],e.next=55,this._rpcRequest("simulateTransaction",N);case 55:if(T=e.sent,!("error"in(I=ao(T,Cc)))){e.next=60;break}throw"data"in I.error&&(k=I.error.data.logs)&&Array.isArray(k)&&(x=(L="\n ")+k.join(L),console.error(I.error.message,x)),new ic("failed to simulate transaction: "+I.error.message,k);case 60:return e.abrupt("return",I.result);case 61:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"sendTransaction",value:(h=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("version"in t)){e.next=7;break}if(!n||!Array.isArray(n)){e.next=3;break}throw new Error("Invalid arguments");case 3:return i=t.serialize(),e.next=6,this.sendRawTransaction(i,n);case 6:return e.abrupt("return",e.sent);case 7:if(void 0!==n&&Array.isArray(n)){e.next=9;break}throw new Error("Invalid arguments");case 9:if(o=n,!t.nonceInfo){e.next=14;break}t.sign.apply(t,ee(o)),e.next=32;break;case 14:a=this._disableBlockhashCaching;case 15:return e.next=17,this._blockhashWithExpiryBlockHeight(a);case 17:if(s=e.sent,t.lastValidBlockHeight=s.lastValidBlockHeight,t.recentBlockhash=s.blockhash,t.sign.apply(t,ee(o)),t.signature){e.next=23;break}throw new Error("!signature");case 23:if(u=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(u)){e.next=29;break}return this._blockhashInfo.transactionSignatures.push(u),e.abrupt("break",32);case 29:a=!0;case 30:e.next=15;break;case 32:return c=t.serialize(),e.next=35,this.sendRawTransaction(c,r);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:(d=B(z().mark((function e(t,n){var r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Hs(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendEncodedTransaction",value:(l=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={encoding:"base64"},i=n&&n.skipPreflight,o=n&&n.preflightCommitment||this.commitment,n&&null!=n.maxRetries&&(r.maxRetries=n.maxRetries),n&&null!=n.minContextSlot&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),o&&(r.preflightCommitment=o),a=[t,r],e.next=10,this._rpcRequest("sendTransaction",a);case 10:if(s=e.sent,!("error"in(u=ao(s,ql)))){e.next=15;break}throw"data"in u.error&&(c=u.error.data.logs),new ic("failed to send transaction: "+u.error.message,c);case 15:return e.abrupt("return",u.result);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){B(z().mark((function t(){return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._rpcWebSocket.notify("ping");case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){var t=this;this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((function(e){var n=$(e,2),r=n[0],i=n[1];t._setSubscription(r,O(O({},i),{},{state:"pending"}))}))):this._updateSubscriptions()}},{key:"_setSubscription",value:function(e,t){var n,r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){var i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach((function(e){try{e(t.state)}catch(e){}}))}}},{key:"_onSubscriptionStateChange",value:function(e,t){var n,r=this,i=this._subscriptionHashByClientSubscriptionId[e];if(null==i)return function(){};var o=(n=this._subscriptionStateChangeCallbacksByHash)[i]||(n[i]=new Set);return o.add(t),function(){o.delete(t),0===o.size&&delete r._subscriptionStateChangeCallbacksByHash[i]}}},{key:"_updateSubscriptions",value:(c=B(z().mark((function e(){var t,n,r=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Object.keys(this._subscriptionsByHash).length){e.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){r._rpcWebSocketIdleTimeout=null;try{r._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)),e.abrupt("return");case 3:if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){e.next=7;break}return this._rpcWebSocket.connect(),e.abrupt("return");case 7:return t=this._rpcWebSocketGeneration,n=function(){return t===r._rpcWebSocketGeneration},e.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var e=B(z().mark((function e(t){var i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=r._subscriptionsByHash[t])){e.next=3;break}return e.abrupt("return");case 3:e.t0=i.state,e.next="pending"===e.t0||"unsubscribed"===e.t0?6:"subscribed"===e.t0?15:19;break;case 6:if(0!==i.callbacks.size){e.next=12;break}return delete r._subscriptionsByHash[t],"unsubscribed"===i.state&&delete r._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],e.next=11,r._updateSubscriptions();case 11:return e.abrupt("return");case 12:return e.next=14,B(z().mark((function e(){var o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.args,a=i.method,e.prev=1,r._setSubscription(t,O(O({},i),{},{state:"subscribing"})),e.next=5,r._rpcWebSocket.call(a,o);case 5:return s=e.sent,r._setSubscription(t,O(O({},i),{},{serverSubscriptionId:s,state:"subscribed"})),r._subscriptionCallbacksByServerSubscriptionId[s]=i.callbacks,e.next=10,r._updateSubscriptions();case 10:e.next=20;break;case 12:if(e.prev=12,e.t0=e.catch(1),e.t0 instanceof Error&&console.error("".concat(a," error for argument"),o,e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,O(O({},i),{},{state:"pending"})),e.next=20,r._updateSubscriptions();case 20:case"end":return e.stop()}}),e,null,[[1,12]])})))();case 14:case 18:return e.abrupt("break",19);case 15:if(0!==i.callbacks.size){e.next=18;break}return e.next=18,B(z().mark((function e(){var o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.serverSubscriptionId,a=i.unsubscribeMethod,!r._subscriptionsAutoDisposedByRpc.has(o)){e.next=5;break}r._subscriptionsAutoDisposedByRpc.delete(o),e.next=21;break;case 5:return r._setSubscription(t,O(O({},i),{},{state:"unsubscribing"})),r._setSubscription(t,O(O({},i),{},{state:"unsubscribing"})),e.prev=7,e.next=10,r._rpcWebSocket.call(a,[o]);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),e.t0 instanceof Error&&console.error("".concat(a," error:"),e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,O(O({},i),{},{state:"subscribed"})),e.next=20,r._updateSubscriptions();case 20:return e.abrupt("return");case 21:return r._setSubscription(t,O(O({},i),{},{state:"unsubscribed"})),e.next=24,r._updateSubscriptions();case 24:case"end":return e.stop()}}),e,null,[[7,12]])})))();case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_handleServerNotification",value:function(e,t){var n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((function(e){try{e.apply(void 0,ee(t))}catch(e){console.error(e)}}))}},{key:"_wsOnAccountNotification",value:function(e){var t=ao(e,nl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_makeSubscription",value:function(e,t){var n=this,r=this._nextClientSubscriptionId++,i=tc([e.method,t],!0),o=this._subscriptionsByHash[i];return void 0===o?this._subscriptionsByHash[i]=O(O({},e),{},{args:t,callbacks:new Set([e.callback]),state:"pending"}):o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=B(z().mark((function t(){var o;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete n._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete n._subscriptionHashByClientSubscriptionId[r],fu(void 0!==(o=n._subscriptionsByHash[i]),"Could not find a `Subscription` when tearing down client subscription #".concat(r)),o.callbacks.delete(e.callback),t.next=7,n._updateSubscriptions();case 7:case"end":return t.stop()}}),t)}))),this._updateSubscriptions(),r}},{key:"onAccountChange",value:function(e,t,n){var r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}},{key:"removeAccountChangeListener",value:(u=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_wsOnProgramAccountNotification",value:function(e){var t=ao(e,il),n=t.result,r=t.subscription;this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}},{key:"onProgramAccountChange",value:function(e,t,n,r){var i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}},{key:"removeProgramAccountChangeListener",value:(s=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"program account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"onLogs",value:function(e,t,n){var r=this._buildArgs(["object"===_(e)?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}},{key:"removeOnLogsListener",value:(a=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"logs");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_wsOnLogsNotification",value:function(e){var t=ao(e,Jl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_wsOnSlotNotification",value:function(e){var t=ao(e,al),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotChange",value:function(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:(o=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_wsOnSlotUpdatesNotification",value:function(e){var t=ao(e,ul),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotUpdate",value:function(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:(i=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot update");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_unsubscribeClientSubscription",value:(r=B(z().mark((function e(t,n){var r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t])){e.next=6;break}return e.next=4,r();case 4:e.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(t,"` for '").concat(n,"' events ")+"could not be found.");case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var o={};n&&(o.encoding=n),i&&(o.commitment=i),r&&(o=Object.assign(o,r)),e.push(o)}return e}},{key:"_buildArgsAtLeastConfirmed",value:function(e,t,n,r){var i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}},{key:"_wsOnSignatureNotification",value:function(e){var t=ao(e,cl),n=t.result,r=t.subscription;"receivedSignature"!==n.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===n.value?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}},{key:"onSignature",value:function(e,t,n){var r=this,i=this._buildArgs([e],n||this._commitment||"finalized"),o=this._makeSubscription({callback:function(e,n){if("status"===e.type){t(e.result,n);try{r.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return o}},{key:"onSignatureWithOptions",value:function(e,t,n){var r=this,i=O(O({},n),{},{commitment:n&&n.commitment||this._commitment||"finalized"}),o=i.commitment,a=Z(i,Bs),s=this._buildArgs([e],o,void 0,a),u=this._makeSubscription({callback:function(e,n){t(e,n);try{r.removeSignatureListener(u)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return u}},{key:"removeSignatureListener",value:(n=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"signature result");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_wsOnRootNotification",value:function(e){var t=ao(e,ll),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onRootChange",value:function(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:(t=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"root change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),$l=function(){function e(t){R(this,e),this._keypair=void 0,this._keypair=null!=t?t:Us()}return W(e,[{key:"publicKey",get:function(){return new Ks(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new e(Us())}},{key:"fromSecretKey",value:function(t,n){if(64!==t.byteLength)throw new Error("bad secret key size");var r=t.slice(32,64);if(!n||!n.skipValidation)for(var i=t.slice(0,32),o=Ws(i),a=0;a<32;a++)if(r[a]!==o[a])throw new Error("provided secretKey is invalid");return new e({publicKey:r,secretKey:t})}},{key:"fromSeed",value:function(t){var n=Ws(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}}]),e}(),ed=Object.freeze({CreateLookupTable:{index:0,layout:Qi([Ri("instruction"),Fu("recentSlot"),Pi("bumpSeed")])},FreezeLookupTable:{index:1,layout:Qi([Ri("instruction")])},ExtendLookupTable:{index:2,layout:Qi([Ri("instruction"),Fu(),Yi(uu(),_i(Ri(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Qi([Ri("instruction")])},CloseLookupTable:{index:4,layout:Qi([Ri("instruction")])}}),td=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(ed);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return t}},{key:"decodeCreateLookupTable",value:function(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);var t=Bu(ed.CreateLookupTable,e.data).recentSlot;return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}},{key:"decodeExtendLookupTable",value:function(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error("invalid instruction; found ".concat(e.keys.length," keys, expected at least 2"));var t=Bu(ed.ExtendLookupTable,e.data).addresses;return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map((function(e){return new Ks(e)}))}}},{key:"decodeCloseLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(nd.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),nd=function(){function e(){R(this,e)}return W(e,null,[{key:"createLookupTable",value:function(e){var t=$(Ks.findProgramAddressSync([e.authority.toBuffer(),Gi(BigInt(e.recentSlot),8)],this.programId),2),n=t[0],r=t[1],i=Pu(ed.CreateLookupTable,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Gu.programId,isSigner:!1,isWritable:!1}];return[new Mu({programId:this.programId,keys:o,data:i}),n]}},{key:"freezeLookupTable",value:function(e){var t=Pu(ed.FreezeLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Mu({programId:this.programId,keys:n,data:t})}},{key:"extendLookupTable",value:function(e){var t=Pu(ed.ExtendLookupTable,{addresses:e.addresses.map((function(e){return e.toBytes()}))}),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&n.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Gu.programId,isSigner:!1,isWritable:!1}),new Mu({programId:this.programId,keys:n,data:t})}},{key:"deactivateLookupTable",value:function(e){var t=Pu(ed.DeactivateLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Mu({programId:this.programId,keys:n,data:t})}},{key:"closeLookupTable",value:function(e){var t=Pu(ed.CloseLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Mu({programId:this.programId,keys:n,data:t})}}]),e}();nd.programId=new Ks("AddressLookupTab1e1111111111111111111111111");var rd=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Pi("instruction").decode(e.data),r=0,i=Object.entries(id);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return t}},{key:"decodeRequestUnits",value:function(e){this.checkProgramId(e.programId);var t=Bu(id.RequestUnits,e.data);return{units:t.units,additionalFee:t.additionalFee}}},{key:"decodeRequestHeapFrame",value:function(e){return this.checkProgramId(e.programId),{bytes:Bu(id.RequestHeapFrame,e.data).bytes}}},{key:"decodeSetComputeUnitLimit",value:function(e){return this.checkProgramId(e.programId),{units:Bu(id.SetComputeUnitLimit,e.data).units}}},{key:"decodeSetComputeUnitPrice",value:function(e){return this.checkProgramId(e.programId),{microLamports:Bu(id.SetComputeUnitPrice,e.data).microLamports}}},{key:"checkProgramId",value:function(e){if(!e.equals(od.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}]),e}(),id=Object.freeze({RequestUnits:{index:0,layout:Qi([Pi("instruction"),Ri("units"),Ri("additionalFee")])},RequestHeapFrame:{index:1,layout:Qi([Pi("instruction"),Ri("bytes")])},SetComputeUnitLimit:{index:2,layout:Qi([Pi("instruction"),Ri("units")])},SetComputeUnitPrice:{index:3,layout:Qi([Pi("instruction"),Fu("microLamports")])}}),od=function(){function e(){R(this,e)}return W(e,null,[{key:"requestUnits",value:function(e){var t=Pu(id.RequestUnits,e);return new Mu({keys:[],programId:this.programId,data:t})}},{key:"requestHeapFrame",value:function(e){var t=Pu(id.RequestHeapFrame,e);return new Mu({keys:[],programId:this.programId,data:t})}},{key:"setComputeUnitLimit",value:function(e){var t=Pu(id.SetComputeUnitLimit,e);return new Mu({keys:[],programId:this.programId,data:t})}},{key:"setComputeUnitPrice",value:function(e){var t=Pu(id.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new Mu({keys:[],programId:this.programId,data:t})}}]),e}();od.programId=new Ks("ComputeBudget111111111111111111111111111111");var ad=Qi([Pi("numSignatures"),Pi("padding"),Bi("signatureOffset"),Bi("signatureInstructionIndex"),Bi("publicKeyOffset"),Bi("publicKeyInstructionIndex"),Bi("messageDataOffset"),Bi("messageDataSize"),Bi("messageInstructionIndex")]),sd=function(){function e(){R(this,e)}return W(e,null,[{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.instructionIndex;fu(32===n.length,"Public Key must be ".concat(32," bytes but received ").concat(n.length," bytes")),fu(64===i.length,"Signature must be ".concat(64," bytes but received ").concat(i.length," bytes"));var a=ad.span,s=a+n.length,u=s+i.length,c=Ee.alloc(u+r.length),l=null==o?65535:o;return ad.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:l,publicKeyOffset:a,publicKeyInstructionIndex:l,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:l},c),c.fill(n,a),c.fill(i,s),c.fill(r,u),new Mu({keys:[],programId:e.programId,data:c})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;fu(64===t.length,"Private key must be ".concat(64," bytes but received ").concat(t.length," bytes"));try{var i=$l.fromSecretKey(t),o=i.publicKey.toBytes(),a=Fs(n,i.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:a,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();sd.programId=new Ks("Ed25519SigVerify111111111111111111111111111");Os.utils.isValidPrivateKey;var ud,cd=Os.getPublicKey,ld=Qi([Pi("numSignatures"),Bi("signatureOffset"),Pi("signatureInstructionIndex"),Bi("ethAddressOffset"),Pi("ethAddressInstructionIndex"),Bi("messageDataOffset"),Bi("messageDataSize"),Pi("messageInstructionIndex"),Fi(20,"ethAddress"),Fi(64,"signature"),Pi("recoveryId")]),dd=function(){function e(){R(this,e)}return W(e,null,[{key:"publicKeyToEthAddress",value:function(e){fu(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return Ee.from(fs(Hs(e))).slice(-20)}catch(e){throw new Error("Error constructing Ethereum address: ".concat(e))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.recoveryId,a=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,i=t.message,o=t.signature,a=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;fu(20===(n="string"==typeof r?r.startsWith("0x")?Ee.from(r.substr(2),"hex"):Ee.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,l=c+o.length+1,d=Ee.alloc(ld.span+i.length);return ld.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:u,signature:Hs(o),ethAddress:Hs(n),recoveryId:a},d),d.fill(Hs(i),ld.span),new Mu({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;fu(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var i=Hs(t),o=cd(i,!1).slice(1),a=function(e,t){var n=Os.sign(e,t);return[n.toCompactRawBytes(),n.recovery]}(Ee.from(fs(Hs(n))),i),s=$(a,2),u=s[0],c=s[1];return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();dd.programId=new Ks("KeccakSecp256k11111111111111111111111111111");var hd=new Ks("StakeConfig11111111111111111111111111111111"),pd=W((function e(t,n){R(this,e),this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=n})),fd=W((function e(t,n,r){R(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));ud=fd,fd.default=new ud(0,0,Ks.default);var md=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(yd);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a StakeInstruction");return t}},{key:"decodeInitialize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(yd.Initialize,e.data),n=t.authorized,r=t.lockup;return{stakePubkey:e.keys[0].pubkey,authorized:new pd(new Ks(n.staker),new Ks(n.withdrawer)),lockup:new fd(r.unixTimestamp,r.epoch,new Ks(r.custodian))}}},{key:"decodeDelegate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),Bu(yd.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}},{key:"decodeAuthorize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(yd.Authorize,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Ks(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(i.custodianPubkey=e.keys[3].pubkey),i}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(yd.AuthorizeWithSeed,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i=t.authoritySeed,o=t.authorityOwner,a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new Ks(o),newAuthorizedPubkey:new Ks(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}},{key:"decodeSplit",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(yd.Split,e.data).lamports;return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}},{key:"decodeMerge",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Bu(yd.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Bu(yd.Withdraw,e.data).lamports,n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}},{key:"decodeDeactivate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Bu(yd.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(vd.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),yd=Object.freeze({Initialize:{index:0,layout:Qi([Ri("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"authorized";return Qi([uu("staker"),uu("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return Qi([Wi("unixTimestamp"),Wi("epoch"),uu("custodian")],e)}()])},Authorize:{index:1,layout:Qi([Ri("instruction"),uu("newAuthorized"),Ri("stakeAuthorizationType")])},Delegate:{index:2,layout:Qi([Ri("instruction")])},Split:{index:3,layout:Qi([Ri("instruction"),Wi("lamports")])},Withdraw:{index:4,layout:Qi([Ri("instruction"),Wi("lamports")])},Deactivate:{index:5,layout:Qi([Ri("instruction")])},Merge:{index:7,layout:Qi([Ri("instruction")])},AuthorizeWithSeed:{index:8,layout:Qi([Ri("instruction"),uu("newAuthorized"),Ri("stakeAuthorizationType"),lu("authoritySeed"),uu("authorityOwner")])}}),gd=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),vd=function(){function e(){R(this,e)}return W(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||fd.default,i=Pu(yd.Initialize,{authorized:{staker:Hs(n.staker.toBuffer()),withdrawer:Hs(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:Hs(r.custodian.toBuffer())}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:xu,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Mu(o)}},{key:"createAccountWithSeed",value:function(e){var t=new Au;t.add(Gu.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new Au;t.add(Gu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Pu(yd.Delegate);return(new Au).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:Du,isSigner:!1,isWritable:!1},{pubkey:hd,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,o=e.custodianPubkey,a=Pu(yd.Authorize,{newAuthorized:Hs(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Au).add({keys:s,programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,o=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,s=e.custodianPubkey,u=Pu(yd.AuthorizeWithSeed,{newAuthorized:Hs(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:Hs(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Tu,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new Au).add({keys:c,programId:this.programId,data:u})}},{key:"splitInstruction",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,o=Pu(yd.Split,{lamports:i});return new Mu({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"split",value:function(e){var t=new Au;return t.add(Gu.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}},{key:"splitWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.basePubkey,o=e.seed,a=e.lamports,s=new Au;return s.add(Gu.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,i=Pu(yd.Merge);return(new Au).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:Du,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,o=e.custodianPubkey,a=Pu(yd.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:Du,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Au).add({keys:s,programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Pu(yd.Deactivate);return(new Au).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}();vd.programId=new Ks("Stake11111111111111111111111111111111111111"),vd.space=200;var wd=W((function e(t,n,r,i){R(this,e),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i})),bd=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(Md);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a VoteInstruction");return t}},{key:"decodeInitializeAccount",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);var t=Bu(Md.InitializeAccount,e.data).voteInit;return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new wd(new Ks(t.nodePubkey),new Ks(t.authorizedVoter),new Ks(t.authorizedWithdrawer),t.commission)}}},{key:"decodeAuthorize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Md.Authorize,e.data),n=t.newAuthorized,r=t.voteAuthorizationType;return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Ks(n),voteAuthorizationType:{index:r}}}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Md.AuthorizeWithSeed,e.data).voteAuthorizeWithSeedArgs,n=t.currentAuthorityDerivedKeyOwnerPubkey,r=t.currentAuthorityDerivedKeySeed,i=t.newAuthorized,o=t.voteAuthorizationType;return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Ks(n),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new Ks(i),voteAuthorizationType:{index:o},votePubkey:e.keys[0].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Md.Withdraw,e.data).lamports;return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(Ed.programId))throw new Error("invalid instruction; programId is not VoteProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),Md=Object.freeze({InitializeAccount:{index:0,layout:Qi([Ri("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteInit";return Qi([uu("nodePubkey"),uu("authorizedVoter"),uu("authorizedWithdrawer"),Pi("commission")],e)}()])},Authorize:{index:1,layout:Qi([Ri("instruction"),uu("newAuthorized"),Ri("voteAuthorizationType")])},Withdraw:{index:3,layout:Qi([Ri("instruction"),Wi("lamports")])},AuthorizeWithSeed:{index:10,layout:Qi([Ri("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return Qi([Ri("voteAuthorizationType"),uu("currentAuthorityDerivedKeyOwnerPubkey"),lu("currentAuthorityDerivedKeySeed"),uu("newAuthorized")],e)}()])}}),Ad=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Ed=function(){function e(){R(this,e)}return W(e,null,[{key:"initializeAccount",value:function(e){var t=e.votePubkey,n=e.nodePubkey,r=e.voteInit,i=Pu(Md.InitializeAccount,{voteInit:{nodePubkey:Hs(r.nodePubkey.toBuffer()),authorizedVoter:Hs(r.authorizedVoter.toBuffer()),authorizedWithdrawer:Hs(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:xu,isSigner:!1,isWritable:!1},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Mu(o)}},{key:"createAccount",value:function(e){var t=new Au;return t.add(Gu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}},{key:"authorize",value:function(e){var t=e.votePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.voteAuthorizationType,o=Pu(Md.Authorize,{newAuthorized:Hs(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Au).add({keys:a,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.currentAuthorityDerivedKeyBasePubkey,n=e.currentAuthorityDerivedKeyOwnerPubkey,r=e.currentAuthorityDerivedKeySeed,i=e.newAuthorizedPubkey,o=e.voteAuthorizationType,a=e.votePubkey,s=Pu(Md.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Hs(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:Hs(i.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new Au).add({keys:u,programId:this.programId,data:s})}},{key:"withdraw",value:function(e){var t=e.votePubkey,n=e.authorizedWithdrawerPubkey,r=e.lamports,i=e.toPubkey,o=Pu(Md.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Au).add({keys:a,programId:this.programId,data:o})}},{key:"safeWithdraw",value:function(t,n,r){if(t.lamports>n-r)throw new Error("Withdraw will leave vote account with insuffcient funds.");return e.withdraw(t)}}]),e}();Ed.programId=new Ks("Vote111111111111111111111111111111111111111"),Ed.space=3731;var Nd=new Ks("Va1idator1nfo111111111111111111111111111111"),Td=Mo({name:wo(),website:go(wo()),details:go(wo()),keybaseUsername:go(wo())}),Id=function(){function e(t,n){R(this,e),this.key=void 0,this.info=void 0,this.key=t,this.info=n}return W(e,null,[{key:"fromConfigData",value:function(t){var n=ee(t);if(2!==hu(n))return null;for(var r=[],i=0;i<2;i++){var o=new Ks(n.slice(0,Js)),a=1===(n=n.slice(Js)).slice(0,1)[0];n=n.slice(1),r.push({publicKey:o,isSigner:a})}if(r[0].publicKey.equals(Nd)&&r[1].isSigner){var s=lu().decode(Ee.from(n)),u=JSON.parse(s);return oo(u,Td),new e(r[1].publicKey,u)}return null}}]),e}(),kd=new Ks("Vote111111111111111111111111111111111111111"),Ld=Qi([uu("nodePubkey"),uu("authorizedWithdrawer"),Pi("commission"),Ui(),Yi(Qi([Ui("slot"),Ri("confirmationCount")]),_i(Ri(),-8),"votes"),Pi("rootSlotValid"),Ui("rootSlot"),Ui(),Yi(Qi([Ui("epoch"),uu("authorizedVoter")]),_i(Ri(),-8),"authorizedVoters"),Qi([Yi(Qi([uu("authorizedPubkey"),Ui("epochOfLastAuthorizedSwitch"),Ui("targetEpoch")]),32,"buf"),Ui("idx"),Pi("isEmpty")],"priorVoters"),Ui(),Yi(Qi([Ui("epoch"),Ui("credits"),Ui("prevCredits")]),_i(Ri(),-8),"epochCredits"),Qi([Ui("slot"),Ui("timestamp")],"lastTimestamp")]),xd=function(){function e(t){R(this,e),this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}return W(e,null,[{key:"fromAccountData",value:function(t){var n=Ld.decode(Hs(t),4),r=n.rootSlot;return n.rootSlotValid||(r=null),new e({nodePubkey:new Ks(n.nodePubkey),authorizedWithdrawer:new Ks(n.authorizedWithdrawer),commission:n.commission,votes:n.votes,rootSlot:r,authorizedVoters:n.authorizedVoters.map(Sd),priorVoters:Cd(n.priorVoters),epochCredits:n.epochCredits,lastTimestamp:n.lastTimestamp})}}]),e}();function Sd(e){var t=e.authorizedVoter;return{epoch:e.epoch,authorizedVoter:new Ks(t)}}function jd(e){var t=e.authorizedPubkey,n=e.epochOfLastAuthorizedSwitch,r=e.targetEpoch;return{authorizedPubkey:new Ks(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function Cd(e){var t=e.buf,n=e.idx;return e.isEmpty?[]:[].concat(ee(t.slice(n+1).map(jd)),ee(t.slice(0,n).map(jd)))}var Dd={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function Od(){return Od=B(z().mark((function e(t,n,r,i){var o,a,s,u,c,l,d;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,a=i):a=r,s=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment,minContextSlot:a.minContextSlot},e.next=4,t.sendRawTransaction(n,s);case 4:return u=e.sent,c=a&&a.commitment,l=o?t.confirmTransaction(o,c):t.confirmTransaction(u,c),e.next=9,l;case 9:if(!(d=e.sent.value).err){e.next=12;break}throw new Error("Raw transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}}),e)}))),Od.apply(this,arguments)}var zd=Object.freeze({__proto__:null,Account:$s,AddressLookupTableAccount:uc,AddressLookupTableInstruction:td,AddressLookupTableProgram:nd,Authorized:pd,BLOCKHASH_CACHE_TIMEOUT_MS:3e4,BPF_LOADER_DEPRECATED_PROGRAM_ID:eu,BPF_LOADER_PROGRAM_ID:Zu,BpfLoader:Ju,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:id,ComputeBudgetInstruction:rd,ComputeBudgetProgram:od,Connection:Kl,Ed25519Program:sd,Enum:qs,EpochSchedule:rc,FeeCalculatorLayout:Uu,Keypair:$l,LAMPORTS_PER_SOL:1e9,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:ed,Loader:qu,Lockup:fd,MAX_SEED_LENGTH:32,Message:yu,MessageAccountKeys:su,MessageV0:gu,NONCE_ACCOUNT_LENGTH:Qu,NonceAccount:Yu,PACKET_DATA_SIZE:tu,PUBLIC_KEY_LENGTH:Js,PublicKey:Ks,SIGNATURE_LENGTH_IN_BYTES:ru,SOLANA_SCHEMA:Zs,STAKE_CONFIG_ID:hd,STAKE_INSTRUCTION_LAYOUTS:yd,SYSTEM_INSTRUCTION_LAYOUTS:Hu,SYSVAR_CLOCK_PUBKEY:Tu,SYSVAR_EPOCH_SCHEDULE_PUBKEY:Iu,SYSVAR_INSTRUCTIONS_PUBKEY:ku,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Lu,SYSVAR_RENT_PUBKEY:xu,SYSVAR_REWARDS_PUBKEY:Su,SYSVAR_SLOT_HASHES_PUBKEY:ju,SYSVAR_SLOT_HISTORY_PUBKEY:Cu,SYSVAR_STAKE_HISTORY_PUBKEY:Du,Secp256k1Program:dd,SendTransactionError:ic,SolanaJSONRPCError:oc,SolanaJSONRPCErrorCode:{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},StakeAuthorizationLayout:gd,StakeInstruction:md,StakeProgram:vd,Struct:Gs,SystemInstruction:Vu,SystemProgram:Gu,Transaction:Au,TransactionExpiredBlockheightExceededError:iu,TransactionExpiredNonceInvalidError:au,TransactionExpiredTimeoutError:ou,TransactionInstruction:Mu,TransactionMessage:Eu,TransactionStatus:wu,VALIDATOR_INFO_KEY:Nd,VERSION_PREFIX_MASK:nu,VOTE_PROGRAM_ID:kd,ValidatorInfo:Id,VersionedMessage:vu,VersionedTransaction:Nu,VoteAccount:xd,VoteAuthorizationLayout:Ad,VoteInit:wd,VoteInstruction:bd,VoteProgram:Ed,clusterApiUrl:function(e,t){var n=!1===t?"http":"https";if(!e)return Dd[n].devnet;var r=Dd[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r},sendAndConfirmRawTransaction:function(e,t,n,r){return Od.apply(this,arguments)},sendAndConfirmTransaction:Ou}),_d=C(zd),Pd={};Object.defineProperty(Pd,"__esModule",{value:!0});var Bd={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND"},Rd=function(e){Y(n,q(Error));var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0],s=i[1],u=i[2];return(e=t.call(this,s)).code=a,e.data=u,e.name="SolanaMobileWalletAdapterError",e}return W(n)}(),Ud=function(e){Y(n,q(Error));var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0],s=i[1],u=i[2],c=i[3];return(e=t.call(this,u)).code=s,e.data=c,e.jsonRpcMessageId=a,e.name="SolanaMobileWalletAdapterProtocolError",e}return W(n)}();function Wd(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Qd(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,crypto.subtle.exportKey("raw",e);case 2:return r=n.sent,n.next=5,crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},t,r);case 5:return i=n.sent,(o=new Uint8Array(r.byteLength+i.byteLength)).set(new Uint8Array(r),0),o.set(new Uint8Array(i),r.byteLength),n.abrupt("return",o);case 10:case"end":return n.stop()}}),n)})))}var Yd=4;function Fd(e){if(e>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");var t=new ArrayBuffer(Yd);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}function Vd(){return Wd(this,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}function Hd(){return Wd(this,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}var Gd,qd=12;function Zd(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a,s;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=JSON.stringify(e),i=Fd(e.id),o=new Uint8Array(qd),crypto.getRandomValues(o),n.next=6,crypto.subtle.encrypt(Xd(i,o),t,(new TextEncoder).encode(r));case 6:return a=n.sent,(s=new Uint8Array(i.byteLength+o.byteLength+a.byteLength)).set(new Uint8Array(i),0),s.set(new Uint8Array(o),i.byteLength),s.set(new Uint8Array(a),i.byteLength+o.byteLength),n.abrupt("return",s);case 12:case"end":return n.stop()}}),n)})))}function Jd(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a,s,u;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.slice(0,Yd),i=e.slice(Yd,Yd+qd),o=e.slice(Yd+qd),n.next=5,crypto.subtle.decrypt(Xd(r,i),t,o);case 5:if(a=n.sent,s=Kd().decode(a),u=JSON.parse(s),!Object.hasOwnProperty.call(u,"error")){n.next=10;break}throw new Ud(u.id,u.error.code,u.error.message);case 10:return n.abrupt("return",u);case 11:case"end":return n.stop()}}),n)})))}function Xd(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}function Kd(){return void 0===Gd&&(Gd=new TextDecoder("utf-8")),Gd}function $d(e,t,n){return Wd(this,void 0,void 0,z().mark((function r(){var i,o,a,s,u,c,l;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e,{name:"ECDH",namedCurve:"P-256"},!1,[])]);case 2:return i=r.sent,o=$(i,2),a=o[0],s=o[1],r.next=8,crypto.subtle.deriveBits({name:"ECDH",public:s},n,256);case 8:return u=r.sent,r.next=11,crypto.subtle.importKey("raw",u,"HKDF",!1,["deriveKey"]);case 11:return c=r.sent,r.next=14,crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(a),info:new Uint8Array},c,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"]);case 14:return l=r.sent,r.abrupt("return",l);case 16:case"end":return r.stop()}}),r)})))}function eh(e){if(e<49152||e>65535)throw new Rd(Bd.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,"Association port number must be between 49152 and 65535. ".concat(e," given."),{port:e});return e}function th(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i<r;i++)t+=String.fromCharCode(n[i]);return window.btoa(t)}var nh="solana-wallet";function rh(e){return e.replace(/(^\/+|\/+$)/g,"").split("/")}function ih(e,t){var n=null;if(t){try{n=new URL(t)}catch(e){}if("https:"!==(null==n?void 0:n.protocol))throw new Rd(Bd.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||(n=new URL("".concat(nh,":/")));var r=e.startsWith("/")?e:[].concat(ee(rh(n.pathname)),ee(rh(e))).join("/");return new URL(r,n)}function oh(e,t,n){return Wd(this,void 0,void 0,z().mark((function r(){var i,o,a,s;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=eh(t),r.next=3,crypto.subtle.exportKey("raw",e);case 3:return o=r.sent,a=th(o),(s=ih("v1/associate/local",n)).searchParams.set("association",a.replace(/[/+=]/g,(function(e){return{"/":"_","+":"-","=":"."}[e]}))),s.searchParams.set("port","".concat(i)),r.abrupt("return",s);case 9:case"end":return r.stop()}}),r)})))}var ah={Firefox:0,Other:1};var sh=null;function uh(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=eh(49152+Math.floor(16384*Math.random())),n.next=3,oh(e,r,t);case 3:if("https:"!==(i=n.sent).protocol){n.next=8;break}window.location.assign(i),n.next=26;break;case 8:n.prev=8,o=-1!==navigator.userAgent.indexOf("Firefox/")?ah.Firefox:ah.Other,n.t0=o,n.next=n.t0===ah.Firefox?13:n.t0===ah.Other?15:20;break;case 13:return s=i,null==sh&&((sh=document.createElement("iframe")).style.display="none",document.body.appendChild(sh)),sh.contentWindow.location.href=s.toString(),n.abrupt("break",21);case 15:return a=new Promise((function(e,t){function n(){clearTimeout(i),window.removeEventListener("blur",r)}function r(){n(),e()}window.addEventListener("blur",r);var i=setTimeout((function(){n(),t()}),2e3)})),window.location.assign(i),n.next=19,a;case 19:return n.abrupt("break",21);case 20:case 21:n.next=26;break;case 23:throw n.prev=23,n.t1=n.catch(8),new Rd(Bd.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.");case 26:return n.abrupt("return",r);case 27:case"end":return n.stop()}var s}),n,null,[[8,23]])})))}var ch=[150,150,200,500,500,750,750,1e3],lh=3e4;function dh(){if("undefined"==typeof window||!0!==window.isSecureContext)throw new Rd(Bd.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function hh(e){var t;try{t=new URL(e)}catch(e){throw new Rd(Bd.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if("https:"!==t.protocol)throw new Rd(Bd.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}Pd.SolanaMobileWalletAdapterError=Rd,Pd.SolanaMobileWalletAdapterErrorCode=Bd,Pd.SolanaMobileWalletAdapterProtocolError=Ud,Pd.SolanaMobileWalletAdapterProtocolErrorCode={ERROR_AUTHORIZATION_FAILED:-1,ERROR_INVALID_PAYLOADS:-2,ERROR_NOT_SIGNED:-3,ERROR_NOT_SUBMITTED:-4,ERROR_TOO_MANY_PAYLOADS:-5,ERROR_ATTEST_ORIGIN_ANDROID:-100},Pd.transact=function(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a,s,u,c,l,d=this;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return dh(),n.next=3,Vd();case 3:return r=n.sent,n.next=6,uh(r.publicKey,null==t?void 0:t.baseUri);case 6:return i=n.sent,o="ws://localhost:".concat(i,"/solana-wallet"),s=function(){var e=ee(ch);return function(){return e.length>1?e.shift():e[0]}}(),u=1,c=0,l={__type:"disconnected"},n.abrupt("return",new Promise((function(t,n){var h,p,f,m={},y=function e(){return Wd(d,void 0,void 0,z().mark((function t(){var n,r;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("connecting"===l.__type){t.next=3;break}return console.warn("Expected adapter state to be `connecting` at the moment the websocket opens. "+"Got `".concat(l.__type,"`.")),t.abrupt("return");case 3:return n=l.associationKeypair,h.removeEventListener("open",e),t.next=7,Hd();case 7:return r=t.sent,t.t0=h,t.next=11,Qd(r.publicKey,n.privateKey);case 11:t.t1=t.sent,t.t0.send.call(t.t0,t.t1),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:r.privateKey};case 14:case"end":return t.stop()}}),t)})))},g=function(e){e.wasClean?l={__type:"disconnected"}:n(new Rd(Bd.ERROR_SESSION_CLOSED,"The wallet session dropped unexpectedly (".concat(e.code,": ").concat(e.reason,")."),{closeEvent:e})),p()},v=function(e){return Wd(d,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p(),!(Date.now()-a>=lh)){e.next=5;break}n(new Rd(Bd.ERROR_SESSION_TIMEOUT,"Failed to connect to the wallet websocket on port ".concat(i,"."))),e.next=8;break;case 5:return e.next=7,new Promise((function(e){var t=s();f=window.setTimeout(e,t)}));case 7:b();case 8:case"end":return e.stop()}}),e)})))},w=function(r){return Wd(d,void 0,void 0,z().mark((function i(){var o,a,s,d,f,y,g,v;return z().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.data.arrayBuffer();case 2:o=i.sent,i.t0=l.__type,i.next="connected"===i.t0?6:"hello_req_sent"===i.t0?30:51;break;case 6:if(i.prev=6,a=o.slice(0,Yd),(s=new DataView(a).getUint32(0,!1))===c+1){i.next=11;break}throw new Error("Encrypted message has invalid sequence number");case 11:return c=s,i.next=14,Jd(o,l.sharedSecret);case 14:d=i.sent,f=m[d.id],delete m[d.id],f.resolve(d.result),i.next=29;break;case 20:if(i.prev=20,i.t1=i.catch(6),!(i.t1 instanceof Ud)){i.next=28;break}y=m[i.t1.jsonRpcMessageId],delete m[i.t1.jsonRpcMessageId],y.reject(i.t1),i.next=29;break;case 28:throw i.t1;case 29:return i.abrupt("break",51);case 30:return i.next=32,$d(o,l.associationPublicKey,l.ecdhPrivateKey);case 32:return g=i.sent,l={__type:"connected",sharedSecret:g},v=new Proxy({},{get:function(e,t){if(null==e[t]){var n=t.toString().replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())})).toLowerCase();e[t]=function(e){return Wd(this,void 0,void 0,z().mark((function r(){var i;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=u++,r.t0=h,r.next=4,Zd({id:i,jsonrpc:"2.0",method:n,params:null!=e?e:{}},g);case 4:return r.t1=r.sent,r.t0.send.call(r.t0,r.t1),r.abrupt("return",new Promise((function(e,n){m[i]={resolve:function(r){switch(t){case"authorize":case"reauthorize":var i=r.wallet_uri_base;if(null!=i)try{hh(i)}catch(e){return void n(e)}}e(r)},reject:n}})));case 7:case"end":return r.stop()}}),r)})))}}return e[t]},defineProperty:function(){return!1},deleteProperty:function(){return!1}}),i.prev=35,i.t2=t,i.next=39,e(v);case 39:i.t3=i.sent,(0,i.t2)(i.t3),i.next=46;break;case 43:i.prev=43,i.t4=i.catch(35),n(i.t4);case 46:return i.prev=46,p(),h.close(),i.finish(46);case 50:return i.abrupt("break",51);case 51:case"end":return i.stop()}}),i,null,[[6,20],[35,43,46,50]])})))},b=function(){p&&p(),l={__type:"connecting",associationKeypair:r},void 0===a&&(a=Date.now()),(h=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",y),h.addEventListener("close",g),h.addEventListener("error",v),h.addEventListener("message",w),p=function(){window.clearTimeout(f),h.removeEventListener("open",y),h.removeEventListener("close",g),h.removeEventListener("error",v),h.removeEventListener("message",w)}};b()})));case 13:case"end":return n.stop()}}),n)})))};var ph=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var i=e.charAt(r),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=r}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var n=0,r=0,i=0;e[n]===s;)r++,n++;for(var o=(e.length-n)*u+1>>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d<i)&&-1!==h;h--,d++)l+=a*c[h]>>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var f=new Uint8Array(r+(o-p)),m=r;p!==o;)f[m++]=c[p++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h<r)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var m=s.repeat(n);f<u;++f)m+=e.charAt(l[f]);return m},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+a+" character")}}},fh=ph("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Object.defineProperty(se,"__esModule",{value:!0});var mh=_d,yh=Pd;function gh(e){return e&&"object"===_(e)&&"default"in e?e:{default:e}}var vh=gh(fh);function wh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function bh(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Mh(e){var t;return window.btoa((t=String.fromCharCode).call.apply(t,[null].concat(ee(e))))}function Ah(e){return new Uint8Array(window.atob(e).split("").map((function(e){return e.charCodeAt(0)})))}function Eh(e){return Mh("version"in e?e.serialize():e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}function Nh(e){var t=e[0]*mh.SIGNATURE_LENGTH_IN_BYTES+1;return"legacy"===mh.VersionedMessage.deserializeMessageVersion(e.slice(t,e.length))?mh.Transaction.from(e):mh.VersionedTransaction.deserialize(e)}se.transact=function(e,t){return bh(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=function(t){var n=new Proxy({},{get:function(e,n){if(null==e[n])switch(n){case"signAndSendTransactions":e[n]=function(e){var n=e.minContextSlot,r=e.transactions,i=wh(e,["minContextSlot","transactions"]);return bh(this,void 0,void 0,z().mark((function e(){var o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.map(Eh),e.next=3,t.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},i),null!=n?{options:{min_context_slot:n}}:null),{payloads:o}));case 3:return a=e.sent,s=a.signatures,u=s.map(Ah).map(vh.default.encode),e.abrupt("return",u);case 7:case"end":return e.stop()}}),e)})))};break;case"signMessages":e[n]=function(e){var n=e.payloads,r=wh(e,["payloads"]);return bh(this,void 0,void 0,z().mark((function e(){var i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.map(Mh),e.next=3,t.signMessages(Object.assign(Object.assign({},r),{payloads:i}));case 3:return o=e.sent,a=o.signed_payloads,s=a.map(Ah),e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})))};break;case"signTransactions":e[n]=function(e){var n=e.transactions,r=wh(e,["transactions"]);return bh(this,void 0,void 0,z().mark((function e(){var i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.map(Eh),e.next=3,t.signTransactions(Object.assign(Object.assign({},r),{payloads:i}));case 3:return o=e.sent,a=o.signed_payloads,s=a.map(Ah),u=s.map(Nh),e.abrupt("return",u);case 8:case"end":return e.stop()}}),e)})))};break;default:e[n]=t[n]}return e[n]},defineProperty:function(){return!1},deleteProperty:function(){return!1}});return e(n)},n.next=3,yh.transact(r,t);case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),n)})))};var Th={},Ih=function(){function e(t,n){if(R(this,e),!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=n}return W(e,[{key:"makeDestinationObject",value:function(){return{}}},{key:"decode",value:function(e,t){throw new Error("Layout is abstract")}},{key:"encode",value:function(e,t,n){throw new Error("Layout is abstract")}},{key:"getSpan",value:function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function kh(e,t){return t.property?e+"["+t.property+"]":e}Th.Layout=Ih,Th.nameWithProperty=kh,Th.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ih))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Lh=function(e){Y(n,Ih);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return W(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(),xh=function(e){Y(n,Lh);var t=X(n);function n(e,r){var i;if(R(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return W(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(),Sh=function(e){Y(n,Lh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ih))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(o=t.call(this,e.span,i||e.property)).layout=e,o.offset=r,o}return W(n,[{key:"isCount",value:function(){return this.layout instanceof jh||this.layout instanceof Ch}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(),jh=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(),Ch=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(),Dh=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(),Oh=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(),zh=Math.pow(2,32);function _h(e){var t=Math.floor(e/zh);return{hi32:t,lo32:e-t*zh}}function Ph(e,t){return e*zh+t}var Bh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Ph(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(),Rh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Ph(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Uh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Ph(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(),Wh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Ph(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Qh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(),Yh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(),Fh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(),Vh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(),Hh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ih))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Lh&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Lh)&&0<e.span&&(a=r*e.span),(o=t.call(this,a,i)).elementLayout=e,o.count=r,o}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0,r=this.count;if(r instanceof Lh&&(r=r.decode(e,t)),0<this.elementLayout.span)n=r*this.elementLayout.span;else for(var i=0;i<r;)n+=this.elementLayout.getSpan(e,t+n),++i;return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=[],r=0,i=this.count;for(i instanceof Lh&&(i=i.decode(e,t));r<i;)n.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),r+=1;return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.elementLayout,i=e.reduce((function(e,i){return e+r.encode(i,t,n+e)}),0);return this.count instanceof Lh&&this.count.encode(e.length,t,n),i}}]),n}(),Gh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;if(R(this,n),!Array.isArray(e)||!e.reduce((function(e,t){return e&&t instanceof Ih}),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof r&&void 0===i&&(i=r,r=void 0);var a,s=ae(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(0>u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),i=ae(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,i=n,o=0,a=0,s=ae(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.span;if(a=0<c?c:0,void 0!==u.property){var l=e[u.property];void 0!==l&&(a=u.encode(l,t,n),0>c&&(c=u.getSpan(t,n)))}o=n,n+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=ae(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0<e.length&&(n[i.property]=e.shift())}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"layoutFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=ae(this.fields);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.property===e)return r}}catch(e){n.e(e)}finally{n.f()}}},{key:"offsetOf",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=0,r=ae(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.property===e)return n;0>i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(),qh=function(){function e(t){R(this,e),this.property=t}return W(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),Zh=function(e){Y(n,qh);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Lh&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return W(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(),Jh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;R(this,n);var a=e instanceof jh||e instanceof Ch;if(a)e=new Zh(new Sh(e));else if(e instanceof Lh&&e.isCount())e=new Zh(e);else if(!(e instanceof qh))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof Ih))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&a&&(s+=e.layout.span),(o=t.call(this,s,i)).discriminator=e,o.usesPrefixDiscriminator=a,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(J(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){var a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new Xh(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return Ee.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(),Xh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof Jh))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Ih))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}();function Kh(e){return 0>e&&(e+=4294967296),e}var $h=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof jh||e instanceof Ch))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=void 0),4<e.span)throw new RangeError("word cannot exceed 32 bits");(o=t.call(this,e.span,i)).word=e,o.msb=!!r,o.fields=[];var a=0;return o._packedSetValue=function(e){return a=Kh(e),this},o._packedGetValue=function(){return a},o}return W(n,[{key:"decode",value:function(e,t){var n=this.makeDestinationObject();void 0===t&&(t=0);var r=this.word.decode(e,t);this._packedSetValue(r);var i,o=ae(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;void 0!==a.property&&(n[a.property]=a.decode(r))}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.word.decode(t,n);this._packedSetValue(r);var i,o=ae(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(void 0!==a.property){var s=e[a.property];void 0!==s&&a.encode(s)}}}catch(e){o.e(e)}finally{o.f()}return this.word.encode(this._packedGetValue(),t,n)}},{key:"addField",value:function(e,t){var n=new ep(this,e,t);return this.fields.push(n),n}},{key:"addBoolean",value:function(e){var t=new tp(this,e);return this.fields.push(t),t}},{key:"fieldFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=ae(this.fields);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.property===e)return r}}catch(e){n.e(e)}finally{n.f()}}}]),n}(),ep=function(){function e(t,n,r){if(R(this,e),!(t instanceof $h))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<<n)-1,32===n&&(this.valueMask=4294967295),this.start=o,this.container.msb&&(this.start=i-o-n),this.wordMask=Kh(this.valueMask<<this.start),this.property=r}return W(e,[{key:"decode",value:function(){return Kh(this.container._packedGetValue()&this.wordMask)>>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==Kh(e&this.valueMask))throw new TypeError(kh("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=Kh(e<<this.start);this.container._packedSetValue(Kh(t&~this.wordMask)|n)}}]),e}(),tp=function(e){Y(n,ep);var t=X(n);function n(e,r){return R(this,n),t.call(this,e,1,r)}return W(n,[{key:"decode",value:function(e,t){return!!ep.prototype.decode.call(this,e,t)}},{key:"encode",value:function(e){return"boolean"==typeof e&&(e=+e),ep.prototype.encode.call(this,e)}}]),n}(),np=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Lh&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");var o=-1;return e instanceof Lh||(o=e),(i=t.call(this,o,r)).length=e,i}return W(n,[{key:"getSpan",value:function(e,t){var n=this.span;return 0>n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Lh&&(r=e.length),!Ee.isBuffer(e)||r!==e.length)throw new TypeError(kh("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Lh&&this.length.encode(r,t,n),r}}]),n}(),rp=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return W(n,[{key:"getSpan",value:function(e,t){if(!Ee.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;n<e.length&&0!==e[n];)n+=1;return 1+n-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);return e.slice(t,t+r-1).toString("utf-8")}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0),"string"!=typeof e&&(e=e.toString());var r=new Ee(e,"utf8"),i=r.length;if(n+i>t.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+i]=0,i+1}}]),n}(),ip=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return W(n,[{key:"getSpan",value:function(e,t){if(!Ee.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return e.slice(t,t+r).toString("utf-8")}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0),"string"!=typeof e&&(e=e.toString());var r=new Ee(e,"utf8"),i=r.length;if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");if(n+i>t.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),i}}]),n}(),op=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return W(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}();Th.ExternalLayout=Lh,Th.GreedyCount=xh,Th.OffsetLayout=Sh,Th.UInt=jh,Th.UIntBE=Ch,Th.Int=Dh,Th.IntBE=Oh,Th.Float=Qh,Th.FloatBE=Yh,Th.Double=Fh,Th.DoubleBE=Vh,Th.Sequence=Hh,Th.Structure=Gh,Th.UnionDiscriminator=qh,Th.UnionLayoutDiscriminator=Zh,Th.Union=Jh,Th.VariantLayout=Xh,Th.BitStructure=$h,Th.BitField=ep,Th.Boolean=tp,Th.Blob=np,Th.CString=rp,Th.UTF8=ip,Th.Constant=op,Th.greedy=function(e,t){return new xh(e,t)},Th.offset=function(e,t,n){return new Sh(e,t,n)},Th.u8=function(e){return new jh(1,e)},Th.u16=function(e){return new jh(2,e)},Th.u24=function(e){return new jh(3,e)},Th.u32=function(e){return new jh(4,e)},Th.u40=function(e){return new jh(5,e)},Th.u48=function(e){return new jh(6,e)},Th.nu64=function(e){return new Bh(e)},Th.u16be=function(e){return new Ch(2,e)},Th.u24be=function(e){return new Ch(3,e)},Th.u32be=function(e){return new Ch(4,e)},Th.u40be=function(e){return new Ch(5,e)},Th.u48be=function(e){return new Ch(6,e)},Th.nu64be=function(e){return new Rh(e)},Th.s8=function(e){return new Dh(1,e)},Th.s16=function(e){return new Dh(2,e)},Th.s24=function(e){return new Dh(3,e)},Th.s32=function(e){return new Dh(4,e)},Th.s40=function(e){return new Dh(5,e)},Th.s48=function(e){return new Dh(6,e)},Th.ns64=function(e){return new Uh(e)},Th.s16be=function(e){return new Oh(2,e)},Th.s24be=function(e){return new Oh(3,e)},Th.s32be=function(e){return new Oh(4,e)},Th.s40be=function(e){return new Oh(5,e)},Th.s48be=function(e){return new Oh(6,e)},Th.ns64be=function(e){return new Wh(e)},Th.f32=function(e){return new Qh(e)},Th.f32be=function(e){return new Yh(e)},Th.f64=function(e){return new Fh(e)},Th.f64be=function(e){return new Vh(e)},Th.struct=function(e,t,n){return new Gh(e,t,n)},Th.bits=function(e,t,n){return new $h(e,t,n)};var ap=Th.seq=function(e,t,n){return new Hh(e,t,n)};Th.union=function(e,t,n){return new Jh(e,t,n)},Th.unionLayoutDiscriminator=function(e,t){return new Zh(e,t)},Th.blob=function(e,t){return new np(e,t)},Th.cstr=function(e){return new rp(e)},Th.utf8=function(e,t){return new ip(e,t)},Th.const=function(e,t){return new op(e,t)};var sp={},up={exports:{}};!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===_(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:tr.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===_(e)&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===_(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(e,l,l+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){c(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?m+r:d[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===o?(n<e.length&&(e[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,p=0|a[1],f=8191&p,m=p>>>13,y=0|a[2],g=8191&y,v=y>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],E=8191&A,N=A>>>13,T=0|a[5],I=8191&T,k=T>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(m,W)|0,o=Math.imul(m,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(m,F)|0,o=o+Math.imul(m,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,W),i=(i=Math.imul(b,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var we=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(N,W)|0,o=Math.imul(N,Q),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ne=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(B,W),i=(i=Math.imul(B,Q))+Math.imul(R,W)|0,o=Math.imul(R,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Te=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Le=(c+(r=r+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(N,fe)|0))<<13)|0;c=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(R,ue)|0,o=Math.imul(R,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,de),i=(i=Math.imul(B,he))+Math.imul(R,de)|0,o=Math.imul(R,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(B,fe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(R,fe)|0))<<13)|0;return c=((o=Math.imul(R,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=we,u[4]=be,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Ne,u[9]=Te,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return y(e,t,n)}Math.imul||(m=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?f(this,e,t):n<1024?y(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,m=1;0==(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new N(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){N.call(this,e),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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},r(b,w),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(M,w),r(A,w),r(E,w),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},N.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},N.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},N.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},N.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},N.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},N.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},N.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},N.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},N.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},N.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},N.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},N.prototype.isqr=function(e){return this.imul(e,e.clone())},N.prototype.sqr=function(e){return this.mul(e,e)},N.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<f);var g=this.pow(d,new i(1).iushln(f-y-1));h=h.redMul(g),d=g.redSqr(),p=p.redMul(d),f=y}return h},N.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},N.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},N.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},N.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},r(T,N),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(up,S),function(e){var t=S&&S.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.map=e.array=e.rustEnum=e.str=e.vecU8=e.tagged=e.vec=e.bool=e.option=e.publicKey=e.i128=e.u128=e.i64=e.u64=e.struct=e.f64=e.f32=e.i32=e.u32=e.i16=e.u16=e.i8=e.u8=void 0;var n=Th,r=_d,i=t(up.exports),o=Th;Object.defineProperty(e,"u8",{enumerable:!0,get:function(){return o.u8}}),Object.defineProperty(e,"i8",{enumerable:!0,get:function(){return o.s8}}),Object.defineProperty(e,"u16",{enumerable:!0,get:function(){return o.u16}}),Object.defineProperty(e,"i16",{enumerable:!0,get:function(){return o.s16}}),Object.defineProperty(e,"u32",{enumerable:!0,get:function(){return o.u32}}),Object.defineProperty(e,"i32",{enumerable:!0,get:function(){return o.s32}}),Object.defineProperty(e,"f32",{enumerable:!0,get:function(){return o.f32}}),Object.defineProperty(e,"f64",{enumerable:!0,get:function(){return o.f64}}),Object.defineProperty(e,"struct",{enumerable:!0,get:function(){return o.struct}});var a=function(e){Y(r,e);var t=X(r);function r(e,i,o){var a;return R(this,r),(a=t.call(this,e,o)).blob=n.blob(e),a.signed=i,a}return W(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new i.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Ee,"le",this.span),t,n)}}]),r}(n.Layout);function s(e){return new a(8,!1,e)}e.u64=s,e.i64=function(e){return new a(8,!0,e)},e.u128=function(e){return new a(16,!1,e)},e.i128=function(e){return new a(16,!0,e)};var u=function(e){Y(n,e);var t=X(n);function n(e,r,i,o){var a;return R(this,n),(a=t.call(this,e.span,o)).layout=e,a.decoder=r,a.encoder=i,a}return W(n,[{key:"decode",value:function(e,t){return this.decoder(this.layout.decode(e,t))}},{key:"encode",value:function(e,t,n){return this.layout.encode(this.encoder(e),t,n)}},{key:"getSpan",value:function(e,t){return this.layout.getSpan(e,t)}}]),n}(n.Layout);e.publicKey=function(e){return new u(n.blob(32),(function(e){return new r.PublicKey(e)}),(function(e){return e.toBuffer()}),e)};var c=function(e){Y(r,e);var t=X(r);function r(e,i){var o;return R(this,r),(o=t.call(this,-1,i)).layout=e,o.discriminator=n.u8(),o}return W(r,[{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}},{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}]),r}(n.Layout);function l(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function d(e){return e?1:0}function h(e){var t=n.u32("length"),r=n.struct([t,n.blob(n.offset(t,-t.span),"data")]);return new u(r,(function(e){return e.data}),(function(e){return{data:e}}),e)}e.option=function(e,t){return new c(e,t)},e.bool=function(e){return new u(n.u8(),l,d,e)},e.vec=function(e,t){var r=n.u32("length"),i=n.struct([r,n.seq(e,n.offset(r,-r.span),"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),t)},e.tagged=function(e,t,r){var i=n.struct([s("tag"),t.replicate("data")]);return new u(i,(function(t){var n=t.tag,r=t.data;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(function(t){return{tag:e,data:t}}),r)},e.vecU8=h,e.str=function(e){return new u(h(),(function(e){return e.toString("utf-8")}),(function(e){return Ee.from(e,"utf-8")}),e)},e.rustEnum=function(e,t,r){var i=n.union(null!=r?r:n.u8(),t);return e.forEach((function(e,t){return i.addVariant(t,e,e.property)})),i},e.array=function(e,t,r){var i=n.struct([n.seq(e,t,"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),r)};var p=function(e){Y(n,e);var t=X(n);function n(e,r,i){var o;return R(this,n),(o=t.call(this,e.span+r.span,i)).keyLayout=e,o.valueLayout=r,o}return W(n,[{key:"decode",value:function(e,t){return t=t||0,[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}},{key:"encode",value:function(e,t,n){n=n||0;var r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}},{key:"getSpan",value:function(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}]),n}(n.Layout);e.map=function(e,t,r){var i=n.u32("length"),o=n.struct([i,n.seq(new p(e,t),n.offset(i,-i.span),"values")]);return new u(o,(function(e){var t=e.values;return new Map(t)}),(function(e){return{values:Array.from(e.entries())}}),r)}}(sp),se.Web3MobileWallet;var cp=se.transact,lp=tr.Buffer,dp=fr.exports,hp=sp.struct([sp.publicKey("mint"),sp.publicKey("owner"),sp.u64("amount"),sp.u32("delegateOption"),sp.publicKey("delegate"),sp.u8("state"),sp.u32("isNativeOption"),sp.u64("isNative"),sp.u64("delegatedAmount"),sp.u32("closeAuthorityOption"),sp.publicKey("closeAuthority")]);sp.array;var pp=sp.bool,fp=sp.i128;sp.i16;var mp=sp.i32,yp=sp.i64;sp.i8,sp.map;var gp=sp.option,vp=sp.publicKey,wp=sp.rustEnum,bp=sp.str,Mp=sp.struct;sp.tagged;var Ap=sp.u128,Ep=sp.u16,Np=sp.u32,Tp=sp.u64,Ip=sp.u8,kp=sp.vec;sp.vecU8;const Lp="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yOTkuMyAyMzcuNSA1MDAgMTIybDIwMC43IDExNS41LTczLjUgNDIuNkw1MDAgMjA4LjJsLTEyNy4xIDcxLjktNzMuNi00Mi42em00MDEuNCAxNDYtNzMuNS00Mi42LTEyNy4xIDczTDM3MyAzNDAuNGwtNzMuNSA0My4xdjg1LjdsMTI3LjEgNzN2MTQ1LjRsNzMuNSA0My4xIDczLjUtNDMuMVY1NDIuMWwxMjcuMS03M3YtODUuNnptMCAyMzIuMXYtODUuN2wtNzMuNSA0Mi42djg1LjdjLS4xLS42IDczLjUtNDIuNiA3My41LTQyLjZ6bTUxLjkgMjkuMy0xMjcuMSA3M3Y4NS43TDgyNi4xIDY4OFY0NTYuNGwtNzMuNSA0My4xdjE0NS40em0tNzMuNS0zMzQuNCA3My41IDQzLjF2ODUuN2w3My41LTQzLjF2LTg1LjdsLTczLjUtNDMuMS03My41IDQzLjF6TTQyNi41IDc0OS40djg1LjdsNzMuNSA0My4xIDczLjUtNDMuMXYtODUuN2wtNzMuNSA0Mi03My41LTQyek0yOTkuMyA2MTUuNmw3My41IDQzLjF2LTg2LjJMMjk5LjMgNTMwdjg1LjZ6bTEyNy4yLTMwNS4xIDczLjUgNDMuMSA3My41LTQzLjEtNzMuNS00Mi42YzAtLjUtNzMuNSA0Mi42LTczLjUgNDIuNnptLTE3OS4xIDQzLjEgNzMuNS00My4xLTczLjUtNDMuMS03My41IDQzLjF2ODUuN2w3My41IDQzLjF2LTg1Ljd6bTAgMTQ1LjQtNzMuNS00Mi42VjY4OGwyMDAuNyAxMTUuNXYtODUuN2wtMTI3LjEtNzNjLS4xLjEtLjEtMTQ1LjgtLjEtMTQ1Ljh6IiBmaWxsPSIjZjBiOTBiIi8+PC9zdmc+",xp="https://app.uniswap.org/static/media/bnb-logo.797868eb94521320b78e3967134febbe.svg";var Sp={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",platform:"evm",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:Lp,logoBackgroundColor:"#000000",logoWhiteBackground:Lp,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:xp},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://bscscan.com/tx/${e.id||e}`:t?`https://bscscan.com/token/${t}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:xp,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const jp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADxdJREFUeJztXVtzFMcVplwuP8VVeYmf7HJ+RKqSl/AQP6X8H+yqXUEIjhMnQY5jO9oVCIzA5mowdzAYG4xAGAyWLC5G3IyDL8gOASUYKrarYGZWC7qi23b6692VV6uZ7e6ZnT3di07VV6JUaLfnnG+6z+lz+vScOXUoL6SzP52/2PtlQ9p7piHlLU2k3P2JJqcjkXLO8589/OdN/tPjvx8VEP8Wv+sp/J8O/A3+Fp+Bz8JnUj/XrPjIwjT7ybxm57fJlLsy2eR2cwPe4QZksYB/Nr4D34XvxHdTP/8DJ+k0e4S/lb9Jpr2WZJNzgRtjPDaDS4DvFmPgY8GYMDZq/dStNKQzv0qmnA1c6RkqgysQIoMxYqzU+qoLWZDO/jyZdl7lir1ObdwQZLiOseMZqPVonSTS7i+4AtsTTW6O2pDR4ebEs/Bnotar8dKw2Pk1n0I76Y0W16zgdOIZqfVsnCSbvaeEB2+AkWpCBEQS/Jmp9U4u3Fl6nIdWB6gNQgb+7NABtR1qLjxcejiZdhfxKXGA3AjUswHXAXQBnVDbpSbCPeO5fAr8hlrxpgE6gW6o7ROb5N96Z3l9ePZxgUcMXEd1NxssbMk8kWxyztEr2A5AV3XjGySb3acTSLYYoFjL4EF31PYLLXwaeyiZcltnp/woEJtIrdAltT21BEkR7tnuo1dgfQC6tCbRlGh1H02k3C5qpalg/bt3WdOGDPk4lACdct1S27eiLEgPPMbDmcvkylLAgiUOc/sm2LHuITavmX48KoBun1828DNqO/tKsiX7JF+zeqmVpIqPzg2xyckc++Sfw2ImoB6POtxe6Jra3tMEb75Nxv/Hmxk2MZGbIsCpz4bZn1d45OPSIQF0Tm13IViXbJn2i+i9NcYgRQIA+zsGyMelA6Fzap8AnqktDl8RO9r7WVFKCQAs3dJHPj4tcN2TRQcizrcs1Hv+NZf1D04GEqDj/JBwDqnHqYNCiFj7fYL8Jg+9AnTQfXmYlUo5AYAtbffIx6lNAm6L2hpfbO/atcO3dGsfy+VyUgIAL66yySEE3FzNto2R2ElYtrffkHbYd7fHWbkEEeDQyUHk6cnHrQkPtonV+CKla2FWDx6+nwQRAFi5K0s+bl3ANrGmkvP5fPoH1cFfX/fYyP2cNgG6Lg6z55a55OPXJgG3UVzGn2vbug98fvW+r/FlBADePtJPPn59iKKS6lYW5ad++8q4Vu+5G2h8FQIAr663JFlUAtiqqksBZ1Uj9UPp4neLHeb0TUQmwNEzg2xemv559OE2VsX4KE2ysXoXhpOJCgGAdXttShblAZtVpayMe5Zt1A+ji5fXZdj4uL/jF4YApy4NsxdaLXQIue2iGb/Ze4r6IcLg6rejUuPrEAB47yO7kkVTJIhyAsnG41rYylUVHQIAizdZlixqyh9DC2V8HGKkHrwuELffHZiUWz4kAVBEAueS+jl1EepAqo2ndLFW64guAYBNB2xMFjmdWsbHWXbqQesC0zMMGjcBgEVv2JYs4tDpT5BvzmDAoBWBxM2tH8a0jB+FAAe77EsWwaZKxkdLE9u2fPce65dbu4oEAFp32JYscnNK7WrQ14Z+sOpAMefwiLrjVy0CdF0cYguX2rU3ANtKCWBTdS9wqWcklPGjEgDYcdiuZBEaV1U0PtqbUQ9SB6/vyoY2fjUIALy81q5kUcUWduhxRz1AVcxvdthtb2aVT60JcOT0oKg4otaHKmBjX+OLA50GN2Esx+FT8mRPLQgAIO1MrQ91ArgZ31JytDqlHpwqXlrjsbExvZg/TgKcvDTM/rjcHocQtp45/ae9FuqBqeLr/6gle2pFAAChKLVeVAFbzyRAk3OBemAq2LhfPdlTSwIA6Y12JItg62nGR9tzyq7bqljY4rK+e5WrfCgJcPzskHBOqfUkJQC39bRW9+h9Tz0oFXx8Yahqxo+DAMCGfXY4hLB5SfjnrqQekAypjRntZA8FAU5/NixK0an1JQNsXrL+m1/4ceM7/WRPJcExsas3Rtn7nQNVJ8GBj82vHppWKBLrNStVAOrzqyWjPHzEWQGEbjBW81t9bPn2LNt9tF/UE1SLBMu2Ge4QcpsL4+MyJPLBVADi68HhcMmeUrnbP8kufDUyw8ggQBHoD7Dt4D3WyX2NqASAv/L7Fnr9VYK4CAs3YlEPpBLOfxk+2QP5wRlnZy7ztTnAUKUEKGLJpj72JnfmUFoehQTbDpldPQTb8/Xfe5Z6IEHA1BxWem+N8rdd/ib7EaAUq/dkxZoelgTYtaTWYxBwJR7y/8uoB+IHnMbB26sjY+M59uU1vr5/qj6FywhQxIodWfbOh/2ioZQOAZCzMLV6CLafU7hUkXww5Wjr8j/S7Sdo+3LxyojSGx+WAFN+wtY+tp1P7V0afsIbbxtaPcRtb2T1b+Mqj90flcf8t91x1v158PoeBwGKWLy5j23kfsIxBT/h5KfDoj8RtV7LIaqFTcwBfHUt+Eg35L//G2WnqxSyhSVAKdZwP+FgV2U/Yc9R85JFIieQwH25BgymCHTt9JPxiRy7ch3xe/QQrdoEKGLlzqzICgb5CQb2Je6ZU7g0mXogAmjR5mWnJ3uwB3Dp65nxu4kEKGIZ9xN2tN9jJy5OJ6txfYm57TEDGNPwCdm0otzJTLCzX+T31uMwfJwEmNpP2NLHNu2/y453/0gEw/oSe3MK16dTD2Sqf+/N78diN3qtCDDlMG7qY2v33mWHTg6Y1ZeY294YAhw7Ozi1P19L1IIA0/yEXdxpfMeQWUAQwJAlAClUtHOrdwL8fW3GpBPGnlFOIIDp8lh3dT19EwiAJe4PprWdKziBRoWBALaB1/JpEhsothMAdYJY8w3dDhZh4HkDBuIL7J7t+qDfWgKg57BRYV85uO0xA3SQD0SCl9ZkRP9eWwjwyrqM8bUABXQYkwySpU0xhb62Lcs6z5u7E4idPpUDIn8ypeOYSAYZkg5esTPLPr0yIu2+gd1CnA3QTcvGSYA0B6IY2TpfXNLQxo5a30BDyluKI2HPUA+kCHj/qNlDDl0WKsGxevd49LAxqvGxPM2XjBV+AJpNYp/DpJ1AURBiUkkYvP9i9S9yAnjTZX+DaffoJ+H9g7CGR1j3nEKDCIS12OLGd6HGwaRoQJSEmVYU+rfVHhu+/2MR6LWbo+JMQGUmO6Lo4kSIsDFMWKfSNRRLWWnJOdrPm3aAVBSFmlgWXt7sEQc4kB+QKRBv5Pb2e7ERAIUqssbROL629eDMMSzZbFiZeLEs3NSDISjhLpeh4Umx7ssaMiD+bpMUaOgQAE6b7DYxjAkdS7ouzoxScFUdtT7LMe1giIlHw/AmORn/g6AoFlWps0OdP7p7hiUA/AuVUi74A+gU4vf5KC2XOYkkBCg9Gmbq4VBMm0gRBwkqgGX7B1A+PO+ggpKgsO4vK+VhHXwBVAAFkQuhqqk3kE07HGry8XDU5FcStIWHl40Zo9LnwH9AXZ6MAHBCZUe8EaLiFLBsL2LVbjOrgWccDze5QQTeQpX27zj6tV3hJM4r6zPsg5Lpemr7lv9eRiIA5V4dCruR+wxuLz+jQYTpLWIwHQ8MqZ0P/Pb7MdYiuQMYpMLOI87vIcRU2ZrFUnPwhNp+A7arTb5xzLdFjOlNorCTpio4+o0zhSBOpc+EZy+LKJDD33lYLyNpYPXvNPg2ibKhTRzqA3QE9wUiHAzTtgXx/po9+jUJpreTD2wTlw8HzW4UCY/e7wpYmSCc1NmDRxQQpioJOQzTbxgLbBSZXwbMbxWLmDtsj8B/3RiteA8gMnr7QtYlItEjW3JMQMVWsflZwL1OPUgZEM6FFWwrI2dQWp+H4o3NB/S2kMuBo+zUepFB2ixaEMCSdvFf/Lvy+UGZIKpAW5hiNBDF+Cae+/MlgEq7eFsujMAWbdSegdXoEoZNKFmewAwoXhhRWAasuDIGTRuitI57kNrFK18ZA7Hp0qgPz4RvHhmVACZV90ihc2lUfhYwr3GEHxrS4XsIRiEAchQmVfdUgva1cRCbLo58sayKKG4CIOdvWnVPxZckzMWRYhYwsFAkCDpXxkYlgHHVPRUQ+upYQQDLLo/W7SkYhgAoOaN+Ti0CRLk8GpJIOQeoH0IVSOfeCagiqgYBUH1sYnVPILjtIhkf0pDOPM6diAHyh1EEpufxClVEYQmA4o9Gi66Mhc1gu8gEgCTT7iLqB9KBrIooDAGM7fUXRABus6oYH5JOs4e5M/EN9UNpsF+0gq8WAd4zuLrH9/m5rWCzqhEAkkw7c23YIi4CmTl0EI1KAFHdY9UVsW4Otqqq8UtIsJz+AdWBJhNRCYD0M/Vz6AA2isX4kPxS4JyjfkgdVKoikhHgrfctC/m4bao+9ZfLwpbMEwlDGkupoFIVUSUCtJ80v7qnDB5sE6vxi5Jsdp+2yR9AFdCoTxVREAEwaxjTy08JfN3nNqmJ8adIkHJb6R9cHbt9qoiCCIBOJNTj1QFsUVPjQ/ha8xCPNfdRP7wOcFmUjAC7j9hR3TNlfG4D2KLmBCiQ4JFEyu2iVoIqyquIyglgT3VPAVz3gSXetZJEq/tossm9TK4MRbSWVBGVEwDtXqjHpwqhc657UuMXZUF64DHuiPRSK0UVOLJdTgCcPKIelzrcXuic2u7TJNmSfdIWEhSriIoEsKm6BzqGrqnt7StgpS3LAc7to+MIqntMvM/HD9CtcW9+uWBdssUxxDk+dPGiHocSoFNT1nyZiIOmloWIJqMQ6tF6+7oi9gnEZpE9O4bmwc1Bh2RxfjUkv21sT+7AIHg1396NS5CksC2LSAnoqmaJnVqJSCWLeoLZJSEYophjeewpXUpBtYpN5WW1AnQSWyWPaQKGc7Y32lRtHJvhhQ7cxrp+64NElJw3OW3URqB76522qpVu2yw4vWLTMbTohne7I5/YqUfBIUZbTiWHMjx/ttAHNR8kwVn2fJOKeogYxGZOu/b5/FnJt6vJ9yyyI8tYZvhejF25LcusVBa0N0OPO5ObWWJsGKO0FdushBckRdDqFP1u0fSYsss5vluMgY8FY7IuYVMPgrbn6H2PCxBEJBHn9Tf8s4UHz78L3zmj5fqsmCG4DAk3YiWbvGfFvYgpdz888EJL/J7Chdkerk8XEP8Wv+vJzyo8EsHf8L/FZ+Czpi5YqjP5P2ey0rAsl+yGAAAAAElFTkSuQmCC",Cp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";var Dp={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",platform:"evm",label:"Ethereum",fullName:"Ethereum Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbC1vcGFjaXR5Oi42MDJ9LnN0MCwuc3Qxe2ZpbGw6I2ZmZn08L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MTEuNCA3My4zdjMxNS41TDc3OCA1MDggNTExLjQgNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTExLjQgNzMuMyAyNDQuNyA1MDhsMjY2LjYtMTE5LjJWNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTExLjQgNzEyLjN2MjE0LjVsMjY2LjgtMzY5LjEtMjY2LjggMTU0LjZ6Ii8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTUxMS40IDkyNi43VjcxMi4zTDI0NC43IDU1Ny42bDI2Ni43IDM2OS4xeiIvPjxwYXRoIGQ9Ik01MTEuNCA2NjIuNyA3NzggNTA4IDUxMS40IDM4OC44djI3My45eiIgZmlsbD0iI2ZmZiIgZmlsbC1vcGFjaXR5PSIuMiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Im0yNDQuNyA1MDggMjY2LjYgMTU0LjdWMzg4LjhMMjQ0LjcgNTA4eiIvPjwvc3ZnPgo=",logoBackgroundColor:"#5683ec",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGltYWdlLXJlbmRlcmluZz0ib3B0aW1pemVRdWFsaXR5IiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgdGV4dC1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGU+LnN0MXtmaWxsOiM4YzhjOGN9PC9zdHlsZT48cGF0aCBkPSJtNDk5LjggNzcuNS01LjUgMTl2NTU5LjFsNS41IDUuNSAyNTkuNy0xNTMuNUw0OTkuOCA3Ny41eiIgZmlsbD0iIzM0MzQzNCIvPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Im00OTkuOCA3Ny41LTI1OS4zIDQzMEw0OTkuOCA2NjFWNzcuNXoiLz48cGF0aCBkPSJtNDk5LjggNzEwLjMtMi45IDR2MTk5LjFsMi45IDkuMSAyNTkuNy0zNjUuOC0yNTkuNyAxNTMuNnoiIGZpbGw9IiMzYzNjM2IiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNDk5LjggOTIyLjVWNzEwLjNMMjQwLjUgNTU2LjdsMjU5LjMgMzY1Ljh6Ii8+PHBhdGggZD0ibTQ5OS44IDY2MSAyNTkuNy0xNTMuNS0yNTkuNy0xMTcuOFY2NjF6IiBmaWxsPSIjMTQxNDE0Ii8+PHBhdGggZD0iTTI0MC41IDUwNy41IDQ5OS44IDY2MVYzODkuN0wyNDAuNSA1MDcuNXoiIGZpbGw9IiMzOTM5MzkiLz48L3N2Zz4K",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:jp},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",logo:Cp,logoBackgroundColor:"#FFFFFF"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://etherscan.io/tx/${e.id||e}`:t?`https://etherscan.io/token/${t}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:jp,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Cp,type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Op="https://assets.spooky.fi/tokens/FTM.png",zp="https://assets.spooky.fi/tokens/wFTM.png";var _p={name:"fantom",id:"0xfa",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00NjcgMTM1LjVjMTgtOS4zIDQ1LjEtOS4zIDYzIDBsMTgzLjQgOTdjMTAuNyA2LjEgMTYuNiAxNCAxOCAyMy4zdjQ4Ni42YzAgOS4zLTYuMSAxOS4yLTE4IDI1LjJsLTE4My4yIDk3Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTgzLjMtOTdjLTExLjktNi4xLTE3LjItMTUuOS0xOC0yNS4yVjI1NS43Yy43LTguNyA2LjctMTcuMiAxNy4yLTIzLjNMNDY3IDEzNS41em0yMzUuOCAzODkuNy0xNzIuNiA5MC45Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTcxLjktOTAuM3YyMTQuNGwxNzEuOSA5MC4zYzEwIDUuMyAyMC42IDEwLjcgMzEuMiAxMS4zaC43YzEwIDAgMjAtNS4zIDMwLjUtMTBsMTc0LTkyLjMtLjgtMjE0LjN6TTIzNy4zIDczMS4xYzAgMTguNiAyIDMxLjIgNi43IDM5LjggMy4zIDcuMyA4LjcgMTIuNiAxOC42IDE5LjJsLjcuN2MyIDEuNCA0LjcgMi42IDcuMyA0LjdsMy4zIDIgMTAuNyA2LjEtMTQuNiAyNC42LTExLjMtNy4zLTItMS40Yy0zLjMtMi02LjEtNC04LjctNS4zLTI3LjktMTguNi0zNy44LTM5LjItMzcuOC04MS42di0xLjRoMjcuMXpNNDg1IDM5Ni40Yy0xLjQuNy0yLjYuNy00IDEuNGwtMTgzLjIgOTYuOWgtLjcuN2wxODMuMyA5N2MxLjQuNyAyLjYgMS40IDQgMS40bC0uMS0xOTYuN3ptMjkuMyAwdjE5Ny44YzEuNC0uNyAyLjYtLjcgNC0xLjRsMTgzLjMtOTdoLjctLjdsLTE4My4zLTk4LjJjLTEuNC0uNS0yLjgtMS4yLTQtMS4yem0xODguNS0xMDctMTY0LjcgODYuMyAxNjQuNyA4Ni40VjI4OS40em0tNDA3LjcgMHYxNzMuM2wxNjQuNy04Ni4zLTE2NC43LTg3em0yMjIuNS0xMjhjLTkuMy01LjMtMjYuNS01LjMtMzYuNiAwbC0xODMuMiA5N2gtLjcuN2wxODMuMyA5N2M5LjMgNS4zIDI2LjUgNS4zIDM2LjYgMGwxODMuMy05N2guNy0uN2wtMTgzLjQtOTd6bTIxMi41IDkuMyAxMS4zIDcuMyAyIDEuNGMzLjMgMiA2LjEgNCA4LjcgNS4zIDI3LjkgMTguNiAzNy44IDM5LjIgMzcuOCA4MS42djEuNGgtMjguN2MwLTE4LjYtMi0zMS4yLTYuNy0zOS44LTMuMy03LjMtOC43LTEyLjYtMTguNi0xOS4ybC0uNy0uN2MtMi0xLjQtNC43LTIuNi03LjMtNC43bC0zLjMtMi0xMC43LTYuMSAxNi4yLTI0LjV6IiBmaWxsPSIjZmZmIi8+PC9zdmc+",logoBackgroundColor:"#226efb",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxjaXJjbGUgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNDI1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzE5NjlmZiIvPjxwYXRoIGQ9Ik00NzQuMSAyMTAuM2MxNC4zLTcuNCAzNS45LTcuNCA1MC4yIDBsMTQ1LjkgNzcuMmM4LjUgNC44IDEzLjIgMTEuMSAxNC4zIDE4LjV2Mzg3LjVjMCA3LjQtNC44IDE1LjMtMTQuMyAyMC4xbC0xNDUuOSA3Ny4yYy0xNC4zIDcuNC0zNS45IDcuNC01MC4yIDBsLTE0NS45LTc3LjJjLTkuNS00LjgtMTMuNy0xMi43LTE0LjMtMjAuMVYzMDZjLjUtNi45IDUuMy0xMy43IDEzLjctMTguNS4xIDAgMTQ2LjUtNzcuMiAxNDYuNS03Ny4yem0xODcuNyAzMTAuM0w1MjQuMyA1OTNjLTE0LjMgNy40LTM1LjkgNy40LTUwLjIgMGwtMTM2LjktNzEuOXYxNzAuN2wxMzYuOSA3MS45YzcuOSA0LjIgMTYuNCA4LjUgMjQuOCA5aC41YzcuOSAwIDE1LjktNC4yIDI0LjMtNy45bDEzOC41LTczLjVWNTIwLjZoLS40ek0yOTEuMiA2ODQuNWMwIDE0LjggMS42IDI0LjggNS4zIDMxLjcgMi42IDUuOCA2LjkgMTAgMTQuOCAxNS4zbC41LjVjMS42IDEuMSAzLjcgMi4xIDUuOCAzLjdsMi42IDEuNiA4LjUgNC44LTExLjYgMTkuNi05LTUuOC0xLjYtMS4xYy0yLjYtMS42LTQuOC0zLjItNi45LTQuMi0yMi4yLTE0LjgtMzAuMS0zMS4yLTMwLjEtNjV2LTEuMWgyMS43em0xOTcuMi0yNjYuNGMtMS4xLjUtMi4xLjUtMy4yIDEuMWwtMTQ1LjkgNzcuMmgtLjUuNWwxNDUuOSA3Ny4yYzEuMS41IDIuMSAxLjEgMy4yIDEuMVY0MTguMXptMjMuMiAwdjE1Ny41YzEuMS0uNSAyLjEtLjUgMy4yLTEuMWwxNDUuOS03Ny4yaC41LS41bC0xNDUuOS03OC4yYy0xLjEtLjUtMi4xLTEtMy4yLTF6TTY2MS44IDMzM2wtMTMxLjEgNjguNyAxMzEuMSA2OC43VjMzM3ptLTMyNC42IDB2MTM4bDEzMS4xLTY4LjdjMC0uMS0xMzEuMS02OS4zLTEzMS4xLTY5LjN6bTE3Ny4xLTEwMi4xYy03LjQtNC4yLTIxLjEtNC4yLTI5LjEgMGwtMTQ1LjkgNzcuMmgtLjUuNWwxNDUuOSA3Ny4yYzcuNCA0LjIgMjEuMSA0LjIgMjkuMSAwbDE0NS45LTc3LjJoLjUtLjVsLTE0NS45LTc3LjJ6bTE2OS4xIDcuNCA5IDUuOCAxLjYgMS4xYzIuNiAxLjYgNC44IDMuMiA2LjkgNC4yIDIyLjIgMTQuOCAzMC4xIDMxLjIgMzAuMSA2NXYxLjFoLTIyLjdjMC0xNC44LTEuNi0yNC44LTUuMy0zMS43LTIuNi01LjgtNi45LTEwLTE0LjgtMTUuM2wtLjUtLjVjLTEuNi0xLjEtMy43LTIuMS01LjgtMy43bC0yLjYtMS42LTguNS00LjggMTIuNi0xOS42eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Op},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",logo:zp},stables:{usd:["0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf","0x1B6382DBDEa11d97f24495C9A90b7c88469134a4"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://ftmscan.com/tx/${e.id||e}`:t?`https://ftmscan.com/token/${t}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:Op,type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:zp,type:"20"},{address:"0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",symbol:"lzUSDC",name:"LayerZero USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x1B6382DBDEa11d97f24495C9A90b7c88469134a4",symbol:"axlUSDC",name:"Axelar Wrapped USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Pp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/info/logo.png",Bp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png";var Rp={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon (POS)",fullName:"Polygon (POS) Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMzEuNSA0NTkuM2MtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnYxOTQuNGMwIDE5LjIgOS42IDM2IDI0IDQzLjJsMTY1LjYgOTZjMTQuNCA5LjYgMzMuNiA5LjYgNDggMGwxNjUuNi05NmMxNC40LTkuNiAyNC0yNCAyNC00My4ydi02OS42bC03Ni44LTQzLjJ2NjQuOGMwIDE5LjItOS42IDM2LTI0IDQzLjJsLTg2LjQgNTIuOGMtMTQuNCA5LjYtMzMuNiA5LjYtNDggMGwtODYuNC01MC40Yy0xNC40LTkuNi0yNC0yNC0yNC00My4yVjU1MC41YzAtMTkuMiA5LjYtMzYgMjQtNDMuMmw4OC44LTUwLjRjMTQuNC05LjYgMzMuNi05LjYgNDggMGwxMTIuOCA2NC44IDc2LjggNDUuNiAxMTIuOCA2NC44YzE0LjQgOS42IDMzLjYgOS42IDQ4IDBsMTY4LTk2YzE0LjQtOS42IDI0LTI0IDI0LTQzLjJ2LTE5MmMwLTE0LjQtOS42LTMxLjItMjQtNDAuOGwtMTY4LTk2Yy0xNC40LTkuNi0zMy42LTkuNi00OCAwbC0xNjUuNiA5NmMtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnY2OS42bDc2LjggNDUuNnYtNjkuNmMwLTE5LjIgOS42LTM2IDI0LTQzLjJsODguOC01Mi44YzE0LjQtOS42IDMzLjYtOS42IDQ4IDBsODguOCA1MC40YzE0LjQgOS42IDI0IDI0IDI0IDQzLjJ2MTAwLjhjMCAxOS4yLTEyIDM2LTI0IDQzLjJsLTg4LjggNTIuOGMtMTQuNCA5LjYtMzMuNiA5LjYtNDggMGwtMTEyLjgtNjkuNi03OS4yLTQzLjItMTE3LjYtNjkuNmMtMTQuNC05LjYtMzMuNi05LjYtNDggMCAwIDIuNC0xNjAuOCA5OC40LTE2My4yIDk4LjR6IiBmaWxsPSIjZmZmIi8+PC9zdmc+",logoBackgroundColor:"#824ee2",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMDkuNyA0NTljLTE2LjQgOS40LTI1LjggMjUuOC0yNS44IDQ2Ljl2MjA2LjNjMCAyMS4xIDkuNCAzNy41IDI1LjggNDYuOWwxNzUuOCAxMDMuMWMxNi40IDkuNCAzNS4yIDkuNCA1MS42IDBsMTc1LjgtMTAzLjFjMTYuNC05LjQgMjUuOC0yNS44IDI1LjgtNDYuOXYtNzIuN2wtODItNDYuOXY2OGMwIDIxLjEtOS40IDM3LjUtMjUuOCA0Ni45TDMzNyA3NjEuNGMtMTYuNCA5LjQtMzUuMiA5LjQtNTEuNiAwTDE5NCA3MDcuNWMtMTYuNC05LjQtMjUuOC0yNS44LTI1LjgtNDYuOVY1NTIuOGMwLTIxLjEgOS40LTM3LjUgMjUuOC00Ni45bDkzLjgtNTMuOWMxNC4xLTkuNCAzNS4yLTkuNCA1MS42IDBsMTE5LjUgNjggODIgNDkuMiAxMTkuNSA2OGMxNi40IDkuNCAzNS4yIDkuNCA1MS42IDBMODkwLjIgNTM0YzE2LjQtOS40IDI1LjgtMjUuOCAyNS44LTQ2LjlWMjgzLjJjMC0xNi40LTkuNC0zMi44LTI1LjgtNDIuMkw3MTIuMSAxMzcuOWMtMTYuNC05LjQtMzUuMi05LjQtNTEuNiAwTDQ4NC43IDI0MWMtMTYuNCA5LjQtMjUuOCAyNS44LTI1LjggNDYuOXY3NWw4MiA0OS4ydi03Mi43YzAtMjEuMSA5LjQtMzcuNSAyNS44LTQ2LjlsOTMuOC01Ni4zYzE2LjQtOS40IDM1LjItOS40IDUxLjYgMGw5My44IDUzLjljMTQuMSA5LjQgMjUuOCAyNS44IDI1LjggNDYuOXYxMDhjMCAyMS4xLTExLjcgMzcuNS0yNS44IDQ2LjlsLTkzLjggNTYuM2MtMTQuMSA5LjQtMzUuMiA5LjQtNTEuNiAwTDU0MSA0NzUuNGwtODItNDYuOS0xMjQuMi03Mi43Yy0xNC4xLTkuNC0zNS4yLTkuNC01MS42IDAtLjEuMS0xNzEuMiAxMDMuMi0xNzMuNSAxMDMuMnoiIGZpbGw9IiM4MjQ3ZTUiLz48L3N2Zz4=",currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Pp},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",logo:Bp},stables:{usd:["0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://polygonscan.com/tx/${e.id||e}`:t?`https://polygonscan.com/token/${t}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://polygon.meowrpc.com","https://polygon-pokt.nodies.app"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:Pp,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:Bp,type:"20"},{address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xf6261529C6C2fBEB313aB25cDEcD243613b40EB5",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Up="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDp1cmwoI1NWR0lEXzAwMDAwMDE5Njc2ODQzODE5NzI3MzAwODIwMDAwMDA1OTQ3NjMyODMzODYxMjM4OTE3Xyl9LnN0MntmaWxsOnVybCgjU1ZHSURfMDAwMDAwNjQzMjA1MjE4MTcxODM4NzM1NjAwMDAwMDMxNzkyNDIxNTkzMzkwODM5NjdfKX08L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iODE1Ljg1NiIgeTE9IjcwLjgyNCIgeDI9IjM4OC4zMzYiIHkyPSItNzQ4LjA1MiIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDE5MS40MzUpIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMGZmYTMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNkYzFmZmYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGQ9Ik0yMzcuOSA2NTcuOWM0LjktNC45IDEyLjItNy4zIDE3LjEtNy4zaDYxOS43YzEyLjIgMCAxNy4xIDE0LjcgOS44IDIyTDc2Mi4xIDc5NS4xYy00LjkgNC45LTEyLjIgNy4zLTE3LjEgNy4zSDEyNS4zYy0xMi4yIDAtMTcuMS0xNC43LTkuOC0yNC41bDEyMi40LTEyMHoiIGZpbGw9InVybCgjU1ZHSURfMV8pIi8+PGxpbmVhckdyYWRpZW50IGlkPSJTVkdJRF8wMDAwMDE1MDgxNTQ0MzI2NzI2OTc2MDQ0MDAwMDAxMzQ2MDgyNDM3MDQwMzE3MjU0M18iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iNjI4LjQ4MSIgeTE9IjE2NC4xMzQiIHgyPSIyMDAuOTYyIiB5Mj0iLTY1NC43NCIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDE5MS40MzUpIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMGZmYTMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNkYzFmZmYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGQ9Ik0yMzcuOSAyMDQuOGM0LjktNC45IDEyLjItNy4zIDE3LjEtNy4zaDYxOS43YzEyLjIgMCAxNy4xIDE0LjcgOS44IDIyTDc2Mi4xIDM0MmMtNC45IDQuOS0xMi4yIDcuMy0xNy4xIDcuM0gxMjUuM2MtMTIuMiAwLTE3LjEtMTQuNy05LjgtMjJsMTIyLjQtMTIyLjV6IiBmaWxsPSJ1cmwoI1NWR0lEXzAwMDAwMTUwODE1NDQzMjY3MjY5NzYwNDQwMDAwMDEzNDYwODI0MzcwNDAzMTcyNTQzXykiLz48bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzAwMDAwMDA3NDA5ODc3MzYzMTA0OTgxNjMwMDAwMDE1MTMzNzA1NTcwNjgwMDk3NzA5XyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSI3MjAuOTIzIiB5MT0iMTE1Ljg3IiB4Mj0iMjkzLjQwNiIgeTI9Ii03MDMuMDAzIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDAgMTkxLjQzNSkiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzAwZmZhMyIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2RjMWZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PHBhdGggZD0iTTc2Mi4xIDQzMC4xYy00LjktNC45LTEyLjItNy4zLTE3LjEtNy4zSDEyNS4zYy0xMi4yIDAtMTcuMSAxNC43LTkuOCAyMkwyMzggNTY3LjNjNC45IDQuOSAxMi4yIDcuMyAxNy4xIDcuM2g2MTkuN2MxMi4yIDAgMTcuMS0xNC43IDkuOC0yMkw3NjIuMSA0MzAuMXoiIGZpbGw9InVybCgjU1ZHSURfMDAwMDAwMDc0MDk4NzczNjMxMDQ5ODE2MzAwMDAwMTUxMzM3MDU1NzA2ODAwOTc3MDlfKSIvPjwvc3ZnPgo=",Wp="https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png";var Qp={name:"solana",networkId:"solana",namespace:"solana",label:"Solana",fullName:"Solana Mainnet Beta",logo:Up,logoBackgroundColor:"#000000",logoWhiteBackground:Up,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111",logo:Wp},wrapped:{address:"So11111111111111111111111111111111111111112",logo:Wp},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://solscan.io/tx/${e.id||e}`:t?`https://solscan.io/token/${t}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://swr.xnftdata.com/rpc-proxy"],sockets:["wss://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","wss://mainnet-beta.solflare.network"],tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:Wp,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"},{address:"DePay1miDBPWXs6PVQrdC5Vch2jemgEPaiyXLNLLa2NF",symbol:"DEPAY",name:"DePay",decimals:9,logo:"https://depay.com/favicon.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const Yp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDojMjEzMTQ3fTwvc3R5bGU+PHBhdGggZD0iTTkyIDkyaDgxNnY4MTZIOTJWOTJ6IiBmaWxsPSJub25lIi8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTE2NS44IDM0MC4xVjY2MGMwIDIwLjYgMTAuOCAzOS4yIDI4LjcgNDkuNmwyNzcuMSAxNTkuOWMxNy42IDEwLjEgMzkuNSAxMC4xIDU3LjEgMGwyNzcuMS0xNTkuOWMxNy42LTEwLjEgMjguNy0yOSAyOC43LTQ5LjZWMzQwLjFjMC0yMC42LTEwLjgtMzkuMi0yOC43LTQ5LjZsLTI3Ny4xLTE2MGMtMTcuNi0xMC4xLTM5LjUtMTAuMS01Ny4xIDBsLTI3Ny4xIDE2MGMtMTcuNiAxMC4xLTI4LjQgMjktMjguNCA0OS42aC0uM3oiLz48cGF0aCBkPSJtNTYwLjQgNTYyLTM5LjUgMTA4LjRjLTEgMi45LTEgNi4yIDAgOS41bDY3LjkgMTg2LjQgNzguNi00NS40LTk0LjMtMjU4LjhjLTIuMy02LTEwLjQtNi0xMi43LS4xem03OS4zLTE4Mi4xYy0yLjMtNS45LTEwLjQtNS45LTEyLjcgMGwtMzkuNSAxMDguNGMtMSAyLjktMSA2LjIgMCA5LjVMNjk4LjggODAzbDc4LjYtNDUuNC0xMzcuNy0zNzcuNHYtLjN6IiBmaWxsPSIjMTJhYWZmIi8+PHBhdGggZD0iTTUwMCAxNDIuNmMyIDAgMy45LjYgNS41IDEuNmwyOTkuNiAxNzNjMy42IDIgNS41IDUuOSA1LjUgOS44djM0NmMwIDMuOS0yLjMgNy44LTUuNSA5LjhsLTI5OS42IDE3M2MtMS42IDEtMy42IDEuNi01LjUgMS42cy0zLjktLjYtNS41LTEuNmwtMjk5LjYtMTczYy0zLjYtMi01LjUtNS45LTUuNS05LjhWMzI2LjdjMC0zLjkgMi4zLTcuOCA1LjUtOS44bDI5OS42LTE3M2MxLjYtMSAzLjYtMS42IDUuNS0xLjZ2LjN6bTAtNTAuNmMtMTAuOCAwLTIxLjIgMi42LTMxIDguMmwtMjk5LjYgMTczYy0xOS4yIDExLjEtMzEgMzEuMy0zMSA1My41djM0NmMwIDIyLjIgMTEuOCA0Mi40IDMxIDUzLjVsMjk5LjYgMTczYzkuNSA1LjUgMjAuMiA4LjIgMzEgOC4yczIxLjItMi42IDMxLTguMmwyOTkuNi0xNzNjMTkuMi0xMS4xIDMxLTMxLjMgMzEtNTMuNXYtMzQ2YzAtMjIuMi0xMS44LTQyLjQtMzEtNTMuNWwtMjk5LjktMTczYy05LjUtNS41LTIwLjItOC4yLTMxLTguMmguM3oiIGZpbGw9IiM5ZGNjZWQiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJtMzAxLjUgODAzLjIgMjcuOC03NS43IDU1LjUgNDYtNTEuOSA0Ny43LTMxLjQtMTh6Ii8+PHBhdGggZD0iTTQ3NC41IDMwMi4yaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOEwyMjIuOSA3NTcuNWw3OC42IDQ1LjRMNDgxLjEgMzExYzEuNi00LjYtMS42LTkuMS02LjItOS4xbC0uNC4zem0xMzMuMiAwaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOGwtMTg2IDUwOS44IDc4LjYgNDUuNEw2MTMuOSAzMTFjMS42LTQuNi0xLjYtOS4xLTYuMi05LjF2LjN6IiBmaWxsPSIjZmZmIi8+PC9zdmc+Cg==";var Fp={name:"arbitrum",id:"0xa4b1",networkId:"42161",namespace:"eip155",platform:"evm",label:"Arbitrum",fullName:"Arbitrum One",logo:Yp,logoBackgroundColor:"#2b354d",logoWhiteBackground:Yp,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp.currency.logo},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",logo:Dp.wrapped.logo},stables:{usd:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"]},explorer:"https://arbiscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://arbiscan.io/tx/${e.id||e}`:t?`https://arbiscan.io/token/${t}`:n?`https://arbiscan.io/address/${n}`:void 0,endpoints:["https://arbitrum.blockpi.network/v1/rpc/public","https://arbitrum-one.publicnode.com","https://endpoints.omniatech.io/v1/arbitrum/one/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Dp.currency.logo,type:"NATIVE"},{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Dp.wrapped.logo,type:"20"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8/logo.png",type:"20"},{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1/logo.png",type:"20"},{address:"0x912CE59144191C1204E64559FE8253a0e49E6548",symbol:"ARB",name:"Arbitrum",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Vp="https://traderjoexyz.com/static/media/avalanche.7c81486190237e87e238c029fd746008.svg",Hp="https://raw.githubusercontent.com/traderjoe-xyz/joe-tokenlists/main/logos/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png";var Gp={name:"avalanche",id:"0xa86a",networkId:"43114",namespace:"eip155",platform:"evm",label:"Avalanche",fullName:"Avalanche C-Chain",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0zNTkuMSA3NTEuMWgtOTUuM2MtMjAgMC0yOS45IDAtMzYtMy44LTYuNi00LjMtMTAuNC0xMS4zLTEwLjktMTguOS0uMy03LjEgNC42LTE1LjggMTQuNC0zM2wyMzUtNDE0LjNjMTAuMS0xNy42IDE1LjEtMjYuNCAyMS40LTI5LjYgNi45LTMuNSAxNS4xLTMuNSAyMS45IDAgNi40IDMuMyAxMS40IDEyIDIxLjQgMjkuNmw0OC40IDg0LjMuMi41YzEwLjggMTguOSAxNi4zIDI4LjUgMTguNiAzOC41IDIuNiAxMC45IDIuNiAyMi42IDAgMzMuNS0yLjQgMTAuMS03LjggMTkuOC0xOC44IDM4LjlMNDU2LjIgNjk0LjlsLS4zLjVjLTEwLjggMTktMTYuMyAyOC43LTI0LjEgMzYtOC4zIDgtMTguMyAxMy43LTI5LjMgMTYuOS05LjkgMi44LTIxLjEgMi44LTQzLjQgMi44em0yNDAuMyAwaDEzNi40YzIwLjIgMCAzMC4yIDAgMzYuMy00IDYuNi00LjMgMTAuNi0xMS4zIDEwLjktMTkuMS4zLTYuOS00LjUtMTUuMi0xMy45LTMxLjZsLTEtMS43TDY5OS44IDU3OGwtLjgtMS4yYy05LjYtMTYuMy0xNC40LTI0LjUtMjAuNy0yNy42LTYuOS0zLjYtMTUtMy42LTIxLjcgMC02LjIgMy4zLTExLjMgMTEuOC0yMS4zIDI5bC02OC4xIDExNi45LS4yLjNjLTEwLjEgMTcuMi0xNSAyNS44LTE0LjUgMzIuOC41IDcuNyA0LjUgMTQuOSAxMC45IDE5IDUuNyAzLjkgMTUuOCAzLjkgMzYgMy45eiIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#E84142",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yMzUuNiAyNTkuNWg1MjguOXY0ODFIMjM1LjZ2LTQ4MXoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNOTI4IDUwMGMwIDIzNi40LTE5MS42IDQyOC00MjggNDI4UzcyIDczNi40IDcyIDUwMCAyNjMuNiA3MiA1MDAgNzJzNDI4IDE5MS42IDQyOCA0Mjh6TTM3OC43IDY3MC4zaC04My4xYy0xNy41IDAtMjYuMSAwLTMxLjMtMy40LTUuNy0zLjctOS4xLTkuOC05LjYtMTYuNS0uMy02LjIgNC0xMy44IDEyLjYtMjguOUw0NzIuNSAyNjBjOC43LTE1LjQgMTMuMS0yMyAxOC43LTI1LjkgNi0zIDEzLjEtMyAxOS4xIDAgNS42IDIuOCAxMCAxMC41IDE4LjcgMjUuOWw0Mi4yIDczLjYuMi40YzkuNCAxNi41IDE0LjIgMjQuOCAxNi4zIDMzLjYgMi4zIDkuNiAyLjMgMTkuNiAwIDI5LjItMi4xIDguOC02LjggMTcuMi0xNi40IDM0TDQ2My42IDYyMS4ybC0uMy41Yy05LjUgMTYuNi0xNC4zIDI1LTIxIDMxLjQtNy4zIDYuOS0xNiAxMi0yNS41IDE0LjgtOC43IDIuNC0xOC41IDIuNC0zOC4xIDIuNHptMjA5LjggMGgxMTljMTcuNiAwIDI2LjQgMCAzMS43LTMuNSA1LjctMy43IDkuMi05LjkgOS42LTE2LjYuMy02LTMuOS0xMy4zLTEyLjItMjcuNWwtLjktMS41LTU5LjYtMTAyLS43LTEuMWMtOC40LTE0LjItMTIuNi0yMS4zLTE4LTI0LjEtNi0zLTEzLjEtMy0xOSAwLTUuNSAyLjgtOS45IDEwLjMtMTguNiAyNS4zbC01OS40IDEwMi0uMi40Yy04LjcgMTUtMTMgMjIuNS0xMi43IDI4LjcuNCA2LjcgMy45IDEyLjkgOS42IDE2LjYgNSAzLjMgMTMuOCAzLjMgMzEuNCAzLjN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2U4NDE0MiIvPjwvc3ZnPg==",currency:{name:"Avalanche",symbol:"AVAX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Vp},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",logo:Hp},stables:{usd:["0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"]},explorer:"https://snowtrace.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://snowtrace.io/tx/${e.id||e}`:t?`https://snowtrace.io/token/${t}`:n?`https://snowtrace.io/address/${n}`:void 0,endpoints:["https://avalanche.public-rpc.com","https://avalanche.blockpi.network/v1/rpc/public","https://avax.meowrpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"AVAX",name:"Avalanche",decimals:18,logo:Vp,type:"NATIVE"},{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",name:"Wrapped AVAX",decimals:18,logo:Hp,type:"20"},{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7/logo.png",type:"20"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E/logo.png",type:"20"},{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70/logo.png",type:"20"},{address:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const qp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAMAAAAKTh9YAAAAYFBMVEVHcEz////////////////////////////////////j++ma6qVj5nsl5lAK4zpA6mXO79aD8Zyr87uCvq0J2TkItEkOhl4EeVsKzSwLrxMNtQpjsZG42dEeuxyF2oU6wzjPwJjeAAAACnRSTlMAEUB9r9j/YO+Kf6/iMwAABD1JREFUeAHU1EESQjEMAlBIAq33v7ArV7+OLss7AZOB4IDVI/kW0nQRf+Ca7QvNwg/s7VtpGJP8oPFNybdT4aidoPHEcYZn6ymnEEOjH8KPk0zeTI+DLacpfMhpxKTGnFtDB9o8/Jisw8uxh1/OtGIrYw9Ah9pEOVWhnaoxTvWCnErR2Z3rzX59JMYOAkEYXr1gRJfIzP1PalbOpZm2aEf+tcKnCCz7bS37si/7si/7si/7si/7srvRHAE5kJHdbV4wkn076Q9RMMLu04fYnceT/An9JnhMkr19Ezwvvvee73ieOL1dfdN15yQlwas2S7vbgTn4iLfaDO0emIPPeLtgZt+AOfhcQHJGdieYg88VLG9k98AUfG7gBRu7YAo+9wpeNLEnYAY+915wkIndQ4Xn9IajgoV9hwbP6b3iqGRhF5zH537VHi3swGl87tft3tB+Ap/7Z9lFhef0z3hndmjwnP4Z32qEAs/po4//Rwao8JzeC3hiMyeACs/ppnMCUlThOf3wxjurObAKz+kHNz5arT0CNHhO5zde7NZ8UYXn9N4K2Utnt8NzOsFL+Kuz2+EJneA5nduN8bmTWsXzKqNzuyX+FZ3rL43Sud0Un/txtV7KqNY+6Hq7Kb71Gxt0W7seX5od/Z6a+8BuGASCMMwraRK4103A9z9leq+Q3zCYC+h7oy7tbr6d4zGd2zme04Ed4AEd2AEe0Kmd4wGd2jke0Kmd4wGd2jke0Kmd4wGd2jke0Kmd4wGd2Tl+B+jQzvH7j/ThnNub4Xd7Rud2gLc9pyM7wO9sz+nEDvA7e8G/0vX2IeTan/DXPdWL+cwD/hl/c3r2lT2u7XbWk31aYt9vesp9yD5Xn1ZPx7svtNtMYwfX9/hqjwAvuq8awIufZwzgxc+RZgAvfn43gBe/N5lxPLAD+sTs2HgnS53jnS51jHfC1CneKVOHeCdNneGdNnWEd+LUCd6pUwd4p04d4J06dYB3tekAL64nSAAvr+PgeGYHdI6ndkDneGoHdI4HdkAvxw/V7IsiegU8sIdSejk+VbIvyumveBY8twdQh51A8PL691x8PBf3HRD8oO33QPhR2mfD8EnZ3wTxXthXRvFe18+H8anbPsqkOVfnnJ6DF/RmPdE5vs69aQiYnoH3rXuzXukcP6jmE3C8734uxAgfgSvM4+D4RcV37SmgZ+BT6/kz0yd6KT5+kcex9bel+fDPupXP+MOs8byl6esGYfRxbDPnanG0OVf+8ODeH9Ks5f+mE50vJlp37d23EQQhFATRr6Yg/4RPuSe9o6tmIni7gN2222677bbbbrvttttuu5sw/7EP1j7kfhO6m5Wbak90Jw7d54NeGsV9jb0y1B+f+P5qpHB08XvD8M4zrq9N7pqje/L8jj/twXa8XOl4uSoe4/363RnvlyOo/LE1R8JnZfywrB7pGLY0Xa/gV5AhY9e5oJHCAAAAAElFTkSuQmCC",Zp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAYAAAA9kO9qAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0PSURBVHgB7d1LbFzVHcfx37l3/CDGxgkhxEnU2K1EgxoUN0kVUglhIhbdVAo7dpCiSl2BqbqphIRpuy5u95SwY1XSWlXVIhFXtGqjJsXQSJRCsXklaQiJ8zCxPTP3cv53cuOxZ8bjmbmP8z/n/5GMHcfjmPHXZ86ce++xQpJGxwdRwChCtQ9Q+nU4qt87CIVhCLGeEHP6v/NQag5h8DY8TKOEGcxMziMhCp2iwD0c1V/kE/QnUNxCJGdavxzHmRdfQYfajz2K3HsGKhyHBC7SN6dznUY5eEGP9nNoQ+uxS+Qib6GawL9++QJa1FrsB8fH9D/0sn5rGELka04PuMdwenJ6ozfwN/qB2D/+vP7ZOA4ZzYUZdIfqSQx9Fzj/979s5AbNR3aatvieHs3DoxDCSOqEnssfa7Zys37s0VKiOqmXhUYhhMlCvUwZhI+sF3zj2CV0wU2T4L2GN6Spi4QuOFG612jKXV/9J6j0ZFThRxCCnz2NnrTWTmMqy4snIQRnSk9n1ixL1k5jKuvoQvBGHdPzziqrY4/W0uWAkbDCMDw1Xv2OlWnM6PgwfDULIewxj3I4Eq/OrIzsvpqAEHYZrB7dq6cxD0MI2yg8E8/dK7HvH38SMlcXdqpcb4E49sqFF0LY6VbfqnKil7oCIewVPVH1omtGhbBbdG20hwBjEMJ2AcWuvH0QwnYK+zyE4TCEsF2oaGSXy+yEA3TntPQ4DCHsN+xBCEdI7MIZErtwhsQunCGxC2dI7MIZErtwhsQunCGxC2dI7MIZErtwhsQunCGxC2dI7MIZErtwRgEWU30loK9c+cOCj3DB6v/dtqltS7ffDi/2wFZWffcpbv/IJXh7r8Hfe70SexWKPZjdhPKpzdGLzd/Y9dD9Uzh0BR69VIUeo/somO1D6c0tCN6y50I2hQPPhmCORqauxz9D4cjnLd2u9MY9KL6605noC9+/EN1PaweB9dB9Q/cR3VfcsY+9nW/gWsWpIRRf+hpspUa+RM/T/4OnX7eLol987n7WAwPb2Cnurqdn9cPxZSTBhm9mPfRo1/XUxx0NBtWWX9qN0tR2cMRyNYa+cT2/eDex0KPPqadCvfpzqjpzWK4Kj51D99MfJhY66X7qo+jRlCOWsdNI1clDciM2Be8/9AW6n/gEaaDg6UkuN+xip1Gl1SeirbAheH/0Krp/OIc09fz0v4k+YmSBVewUYBYPoZyD976xgMLjn0INpBui0scv6BGWE1ax06qLl1GAHIOn0D09qvt7biAL9Airdic/nUwLq9iznidyCj4KXb/438l2q/2uR9ObUiaNTex+g6N9aeMQfBx69PaORWTJPyKxJ45iz4vJwVeHrrYupz5XX4vm7mpkARywiT3v0EwMvjr0SH8RefBHeMzb2cTuGXCHmhR8Tej0Pj2y54HLk3g+I7sha7omBF8v9EhPgDxI7BbLM/iGoedpyQcHbGIPDDtBK4/gm4a+lM+3M7zK47IINrGbeDZilsFvZEQPr3UhD3ShBwd8Yp/dBBNlEfxGpy7huV7kIfjkDnDAJvbSqc0wVZrBtzJHD68X9Oie7ZSCHnHz+iFrFZ85+9kBoy+YTiP4dp6MBu/diSwV/3gvuGC1GlOaMvuOTTL4dlddyu/chTDDJ6rlv20BF8xiHzJuVWatJILvaHlRhx68M4AsFF/dxeoyRlaxhws+ln/9dZiuk+CTWEePRveU5+7xrgOcsDuoRHN3DndyO8EndsBIj+6l3w2lNp2h5050cTo3LI+g0sOnbcEnfWSUVmZKJ5IPPg6d4y4MPnYcngBDNMIT2vnLZHQKLO2+RTuQocFqUmqnANz0EX5wZ3QSnUrgvJnwcjcWJ/YYe8yjGbaxExuCT/1cl2VPx9kXxa46OCuy/O8BLP38Pr2mzuMAUj2sYyecg8/spC4dPB3SD/7T33L0wWe9KP15G5Z/sxuY7wZnVuz1SLoe/zS6INt08c5jqr+U29mL9G+rHYt6erMQnRZMf7799ekfDFzqRqBfwvf6EdzwUT6tf0Cv898D15rYCZvg9dy3+Id7jQ8oLCprQidWnc/OZpVmyzK6jp4H+s3dZMi20Il1F2+wCV6HbmrwNoZOrLxSSYJvn62hE2svy5PgW2dz6MTqa1Al+I2zPXRi/QXXEnxzLoROnNhdQIJvzJXQiTNbaUjwtVwKnTi1b4wEv8K10IlzmyRJ8G6GTpzcEczl4F0NnTi7/R234NWmzi/idjl04vRej6yCf/R9qJ4OfmnvTc/p0InzG5tyCR67+tB94FRbwUvoFbKLL3gF3/PAmy0Ffzv0mzx22k2TxH4Lh+DDzVug+pY2HLyEvprEXsX44H0fwcBdUL1fNg1eQq8lsa9BwZemtsNYd1QueG4WvIReS2KvI9rWzdRNVLtXLnpuFHxAu+pK6DUk9jpom73gbD9MFPau3sqiXvDhZzy2kM6axN4ABc9FTfBlBVFLYm9Abcvn1yw2VS7Xffft4PuuAr35/NY800nsddDejP7eazBSg9hJHLw/fBGilsReh8l7z6jFm+v/faGI3u+9Dm/7FxCrSexr0EZLhSOfw1Tqxo3mH6OD3/SD30vwa0jsVTjsKKYWmscefVzvsgS/hsR+C4vQr1xed85e8/ES/CoSO/jsEen9/wJaJcGvcD52LqGrS/p5xHJ7y6ESfIXTsXMJnSL3znX2dUrwDsfOKXT/ww+QBNeDdzJ2dqEvJ3c01+XgnYvd5dBjrgbvVOwS+goXg3cmdgm9lmvBOxG7hN6YS8FbH7uE3pwrwVsdu4S+cS4Eb23sEnrrbA/eytgl9PbZHLx1sUvonbM1eKtiZ/Mbrq8pY0OP2Ri8NbGzCf1iDxZ/sg9Lf3oAprMteCtiZxX6c/dHr5dPHsTSyQMwnU3Bs4+dY+gxCT5brGPnHHpMgs8O29htCD0mwWeDZew2hR7jFrwavA5u2MVeOHTZutBjvIKf0q87/6VmWeIX+1Mfw3TthB7jErynR/auw2fBCavYaacub5vZo0knoce4BN99+B1Wozuv2A2fviQReoxD8DSd4TS6s4nd23vN6FE9ydBjHILv+vZ74IJN7IVDV2CqNEKPmR48zd25rMywiV2NtP/bndOUZugx04P3R86BAz6xGziFySL0mMnBezKyJ8u0+XqWocdMDd7r57EiI7v4tiGP0GNcliVNxCZ2U34vaZ6hx0wLPrie333RCj6xX+xG3kwIPWZS8MH8ZnDAJvbg7ADyZFLoMVOCD84PggM2sZdO5Td6mBh6LO/gg/l+BBfuBgd8pjGzfbnM200OPZZn8OXZIXDB6Amqj9LUvcgSh9BjeQW/pP9dLlgtPZamhjIb3TmFHss6+OJb9yHU0xguWMVOo3vx1R1IG8fQYxT84m/HkDaaq3Ma1Qm7g0o0upfeuAdp4Rx6rDjzzdSDX5p6mNWoTlgeQS2+tBvB7CYkzYbQY2kGv/j6gyi9vxPc+NhxeALcFD2U/7oVatdNeLsWkQT64Vn62R4rQo8FF7YivNIPf+Q8VGHjvxm7kXCxR4/oD6F46lvgSOHAsyEYS2KngdLUdv1cYKcxpyQkjc5KvOPYFLzN7Z+dGJy/Gzdfe4TNmno97GMndPovRV84cqml25X1UVmKPO+js1mhq4q6x860FD09EV1+cz+K/9wD7qyIPUbR0+V7/qEr8Pdeh+orrfp7GrlpulLWR2PLb2y1diRvxh8+F4VPmx35Q6s3PApLXQg+H0B5Ti8EvDuiX6e/+pUVq2Kv5/ZFH3rZ0tW4m4l2COitbJ/NbYWlFdZ/9216wpkWeuKJRfvvJ7l4QzhDYhfOkNiFMyR24QyJXThDYhfOkNiFMyR24QyJXThDYhfOkNiFMyR24QyJXThDYhfOkNiFMyj2OQhhvzkPIeYhhO105zr28G0IYTsVfuRBYQZC2C7EjKdn7RK7sJ+HaQ+lKHaZtwu7lWhkn5mk0GV0Fzabps4r6+xh+AqEsNdx+k8l9gAnIFMZYaNQH0c682I0mFdip6lMGP4KQthGhdPxmyunCwSYhIzuwjZlvBC/uRK7jO7CNkqHPjM5F/9x9YlgNLqHcq6MsAB1fPrFiep3rY6dRncvPAYhuKvTsV/zQef+MYedDyr9GDAGITii6cvpyeO1727kwI9f048FRyEEK+EJnJl8rN7fNL54oxwco5NnIAQX1GsZDafhat0bj44PwlMn9UeNQgiTUehB+Mit01/qWv+yPLohfQKoExDCWHrq0iR0sv7IXu3g+ARC9TyEMEn0ZHT1EmPjD23FwfExBOplfathCJEnWken5cXTk9MbvUlrscdklBd5oWumPX2kv6QPgDaZtqzVXuxkdHwYvtLR42EZ6UXqOog81n7s1faPP6k/0xNyIEokigJX4Yx+/Up0GnqbkceSiT1GS5UFvUwZYEx/5n36ixzW/8SgjPyiqeicrHC+sgGAmtGRvx1dMtph4NW+AiZycfiu2QTRAAAAAElFTkSuQmCC";var Jp={name:"gnosis",id:"0x64",networkId:"100",namespace:"eip155",label:"Gnosis",fullName:"Gnosis Chain",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojZmZmfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMzMS45IDU1Ni41YzIzLjUgMCA0Ni40LTcuOCA2NS0yMi4yTDI0OCAzODUuNGMtMzUuOSA0Ni40LTI3LjQgMTEyLjkgMTguOSAxNDguOCAxOC42IDE0IDQxLjUgMjEuOSA2NSAyMS45di40em00NDIuMy0xMDYuMWMwLTIzLjUtNy44LTQ2LjQtMjIuMi02NUw2MDMuMiA1MzQuMmM0Ni40IDM1LjkgMTEyLjkgMjcuNCAxNDguOC0xOC45IDE0LjMtMTguNiAyMi4yLTQxLjQgMjIuMi02NC45eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Im04NDkuMiAyODguNS02NS45IDY1LjljNTIuOSA2My42IDQ0LjcgMTU4LTE4LjkgMjExLjItNTUuNiA0Ni43LTEzNi42IDQ2LjctMTkyLjIgMEw1MDAgNjM3LjdsLTcyLjEtNzIuMWMtNjMuNiA1Mi45LTE1OCA0NC43LTIxMS4yLTE4LjktNDYuNy01NS42LTQ2LjctMTM2LjYgMC0xOTIuMmwtMzMuNi0zMy42LTMyLTMyLjNDMTEyLjMgMzUyLjIgOTIgNDI1LjMgOTIgNTAwYzAgMjI1LjIgMTgyLjggNDA4IDQwOCA0MDhzNDA4LTE4Mi44IDQwOC00MDhjLjMtNzQuNC0yMC42LTE0Ny44LTU4LjgtMjExLjV6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTc5NS4xIDIxOC4zYy0xNTUuNC0xNjIuOC00MTMuNi0xNjktNTc2LjQtMTMuNy00LjkgNC42LTkuNSA5LjEtMTMuNyAxMy43LTEwLjEgMTAuOC0xOS42IDIxLjktMjguNyAzMy4zTDUwMCA1NzUuNGwzMjMuOC0zMjMuOGMtOC44LTExLjctMTguNi0yMi44LTI4LjctMzMuM3pNNTAwIDE0NS4yYzk1LjMgMCAxODQuMSAzNi45IDI1MSAxMDMuOEw1MDAgNTAwIDI0OSAyNDljNjYuNi02Ny4yIDE1NS43LTEwMy44IDI1MS0xMDMuOHoiLz48L3N2Zz4K",logoBackgroundColor:"#406958",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojM2U2OTU3fTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMyNC4yIDU1OS4xYzI0LjYgMCA0OC41LTguMiA2Ny45LTIzLjJMMjM2LjUgMzgwLjJjLTM3LjUgNDguNS0yOC43IDExOC4xIDE5LjggMTU1LjYgMTkuNSAxNC43IDQzLjMgMjIuOSA2Ny45IDIyLjl2LjR6TTc4Ni43IDQ0OC4xYzAtMjQuNi04LjItNDguNS0yMy4yLTY3LjlMNjA3LjkgNTM1LjhjNDguNSAzNy41IDExOC4xIDI4LjcgMTU1LjYtMTkuOCAxNS0xOS40IDIzLjItNDMuMyAyMy4yLTY3Ljl6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0ibTg2NS4yIDI3OC44LTY4LjkgNjguOWM1NS4zIDY2LjYgNDYuOCAxNjUuMi0xOS44IDIyMC44LTU4LjQgNDguOC0xNDIuNyA0OC44LTIwMSAwTDUwMCA2NDRsLTc1LjQtNzUuNGMtNjYuNiA1NS4zLTE2NS4yIDQ2LjgtMjIwLjgtMTkuOC00OC44LTU4LjQtNDguOC0xNDIuNyAwLTIwMWwtMzUuMi0zNS4yLTMzLjQtMzMuOGMtNDAuNiA2Ni42LTYxLjggMTQzLTYxLjggMjIxLjIgMCAyMzUuNSAxOTEuMSA0MjYuNiA0MjYuNiA0MjYuNlM5MjYuNiA3MzUuNSA5MjYuNiA1MDBjLjQtNzcuOC0yMS41LTE1NC42LTYxLjQtMjIxLjJ6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTgwOC42IDIwNS41QzY0Ni4xIDM1LjEgMzc2LjEgMjguNyAyMDUuOCAxOTEuMWMtNS4xIDQuOC05LjkgOS42LTE0LjMgMTQuMy0xMC42IDExLjMtMjAuNSAyMi45LTMwIDM0LjhMNTAwIDU3OC44bDMzOC42LTMzOC42Yy05LjItMTIuMi0xOS41LTIzLjgtMzAtMzQuN3pNNTAwIDEyOWM5OS43IDAgMTkyLjUgMzguNiAyNjIuNSAxMDguNUw1MDAgNTAwIDIzNy41IDIzNy41QzMwNy4yIDE2Ny4yIDQwMC4zIDEyOSA1MDAgMTI5eiIvPjwvc3ZnPgo=",currency:{name:"xDAI",symbol:"xDAI",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:qp},wrapped:{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",logo:Zp},stables:{usd:["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83"]},explorer:"https://gnosisscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://gnosisscan.io/tx/${e.id||e}`:t?`https://gnosisscan.io/token/${t}`:n?`https://gnosisscan.io/address/${n}`:void 0,endpoints:["https://rpc.gnosis.gateway.fm","https://rpc.gnosischain.com","https://gnosis.blockpi.network/v1/rpc/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"xDAI",name:"xDAI",decimals:18,logo:qp,type:"NATIVE"},{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",symbol:"WXDAI",name:"Wrapped XDAI",decimals:18,logo:Zp,type:"20"},{address:"0x4ECaBa5870353805a9F068101A40E0f32ed605C6",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",symbol:"GNO",name:"Gnosis",decimals:18,logo:"https://cdn.sushi.com/image/upload/f_auto,c_limit,w_16,q_auto/tokens/100/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb.jpg",type:"20"},{address:"0xD057604A14982FE8D88c5fC25Aac3267eA142a08",symbol:"HOPR",name:"HOPR",decimals:18,logo:"https://hoprnet.org/assets/icons/hopr_icon.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var Xp={name:"optimism",id:"0xa",networkId:"10",namespace:"eip155",label:"Optimism",fullName:"Optimism",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00ODcuMSAzOTUuN2MtNS4yLTE1LjgtMTMuMi0zMS43LTI2LjQtNDIuMi0xMy4yLTEwLjUtMjYuNC0yMS4yLTQ0LjktMjYuNC0xOC41LTUuMi0zNy04LTU4LjEtOC00Ny41IDAtODcuMSAxMC41LTExNi4xIDM0LjQtMjkgMjMuOC00Ny41IDU4LjEtNjAuNyAxMDIuOS0yLjYgMTUuOC04IDI5LTEwLjUgNDQuOS0yLjYgMTMuMi01LjIgMjktOCA0Mi4yLTIuNiAyMy44LTIuNiA0Mi4yIDIuNiA2MC43IDUuMiAxNS44IDEzLjIgMzEuNyAyNi40IDQyLjIgMTMuMiAxMC41IDI2LjQgMjEuMiA0NC45IDI2LjQgMTguNCA1LjIgMzcgOCA1OC4xIDggNDcuNSAwIDg3LjEtMTAuNSAxMTYuMS0zNC40czQ3LjUtNTguMSA2MC43LTEwMi45YzIuNi0xMy4yIDUuMi0yOSAxMC41LTQyLjIgMi42LTEzLjIgNS4yLTI5IDgtNDQuOSAyLjgtMjMuOCAyLjgtNDQuOC0yLjYtNjAuN3ptLTkyLjQgNjAuOGMtMi42IDEzLjItNS4yIDI2LjQtOCAzOS41LTIuNiAxMy4yLTUuMiAyNi40LTEwLjUgNDIuMi01LjIgMjMuOC0xNS44IDM5LjUtMjkgNTAuMi0xMy4yIDEwLjUtMjkgMTUuOC00Ny41IDE1LjgtMTguNCAwLTMxLjctNS4yLTM5LjUtMTUuOC04LTEwLjUtMTAuNS0yOS01LjItNTAuMiAyLjYtMTUuOCA1LjItMjkgOC00Mi4yIDIuNi0xMy4yIDUuMi0yNi40IDEwLjUtMzkuNSA1LjItMjMuOCAxNS44LTM5LjUgMjktNTAuMiAxMy4yLTEwLjUgMjktMTUuOCA0Ny41LTE1LjggMTguNCAwIDMxLjcgNS4yIDM5LjUgMTUuOCA3LjkgMTAuNiAxMC41IDI2LjMgNS4yIDUwLjJ6bTQ0MC45LTY4LjZjLTUuMi0xNS44LTEzLjItMjYuNC0yMy44LTM3cy0yMy44LTE1LjgtNDIuMi0yMS4yYy0xNS44LTUuMi0zNC40LTgtNTUuNC04SDU3OS43Yy0yLjYgMC01LjIgMC0xMC41IDIuNi0yLjYgMi42LTUuMiA1LjItNS4yIDhsLTY4LjYgMzI3LjRjMCAyLjYgMCA4IDIuNiA4IDIuNiAyLjYgNS4yIDIuNiA4IDIuNmg2OC42YzIuNiAwIDggMCAxMC41LTIuNnM1LjItNS4yIDUuMi04bDIzLjgtMTEwLjloNjguNmM0Mi4yIDAgNzYuNi04IDEwMi45LTI2LjQgMjYuNC0xOC40IDQyLjItNDcuNSA1MC4yLTg0LjYgNS4xLTE4LjQgNS4xLTM2LjctLjItNDkuOXpNNzQzLjEgNDM4Yy0yLjYgMTUuOC0xMC41IDI2LjQtMjEuMiAzNC40cy0yMy44IDEwLjUtMzcgMTAuNWgtNTguMWwxOC40LTg5LjdoNjAuN2MxMy4yIDAgMjEuMiAyLjYgMjYuNCA1LjIgNS4yIDUuMiAxMC41IDEwLjUgMTAuNSAxNS44IDMgNS4yIDMgMTMuMi4zIDIzLjh6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",logoBackgroundColor:"#FF0420",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxjaXJjbGUgY3g9IjUwMCIgY3k9IjUwMCIgcj0iMzk2LjYiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNTAwIDg5Ni42YzIxOS4xIDAgMzk2LjYtMTc3LjYgMzk2LjYtMzk2LjZTNzE5LjEgMTAzLjQgNTAwIDEwMy40IDEwMy40IDI4MC45IDEwMy40IDUwMCAyODAuOSA4OTYuNiA1MDAgODk2LjZ6TTM1MC43IDYwOWMxMC45IDMuNCAyMi42IDUuMSAzNS4zIDUuMSAyOS4xIDAgNTIuNC02LjcgNjkuNi0yMC4yIDE3LjMtMTMuNyAyOS4zLTM0LjMgMzYuMi02MS44IDItOC42IDMuOS0xNy4zIDUuNy0yNS45IDItOC42IDMuNy0xNy40IDUuMS0yNi4yIDIuNC0xMy43IDItMjUuNi0xLjItMzUuOS0zLTEwLjItOC4zLTE4LjktMTYtMjUuOS03LjQtNy0xNi42LTEyLjMtMjcuNC0xNS43LTEwLjctMy42LTIyLjMtNS40LTM1LTUuNC0yOS4zIDAtNTIuNyA3LTY5LjkgMjEuMXMtMjkuMiAzNC43LTM1LjkgNjEuOGMtMiA4LjgtNCAxNy42LTYgMjYuMi0xLjggOC42LTMuNSAxNy4zLTUuMSAyNS45LTIuMiAxMy43LTEuOCAyNS42IDEuMiAzNS45IDMuMiAxMC4yIDguNSAxOC44IDE2IDI1LjYgNy40IDYuOCAxNi42IDExLjkgMjcuNCAxNS40em02Ny44LTQ4Yy04LjIgNi40LTE3LjggOS42LTI4LjYgOS42LTExLjEgMC0xOS0zLjItMjMuOC05LjYtNC44LTYuNC02LTE2LjctMy42LTMwLjcgMS42LTguOCAzLjItMTcuMiA0LjgtMjUgMS44LTcuOCAzLjgtMTYgNi0yNC40IDMuNC0xNC4xIDkuMS0yNC4zIDE3LjItMzAuNyA4LjItNi40IDE3LjgtOS42IDI4LjYtOS42czE4LjggMy4yIDIzLjggOS42IDYuMiAxNi43IDMuNiAzMC43Yy0xLjQgOC40LTMgMTYuNi00LjggMjQuNC0xLjYgNy44LTMuNSAxNi4yLTUuNyAyNS0zLjQgMTQtOS4yIDI0LjMtMTcuNSAzMC43em05MS43IDQ4YzEuMiAxLjQgMi44IDIuMSA0LjggMi4xaDQxYzIuMiAwIDQuMS0uNyA1LjctMi4xIDEuOC0xLjQgMi45LTMuMiAzLjMtNS40bDEzLjktNjZoNDAuN2MyNS45IDAgNDYuNS01LjUgNjEuOC0xNi42IDE1LjUtMTEuMSAyNS43LTI4LjEgMzAuNy01MS4yIDIuNC0xMS43IDIuMy0yMS44LS4zLTMwLjQtMi42LTguOC03LjItMTYuMi0xMy45LTIyLTYuNi01LjgtMTUtMTAuMS0yNS0xMy05LjgtMi44LTIwLjktNC4yLTMzLjItNC4yaC04MC4yYy0yIDAtMy45LjctNS43IDIuMS0xLjggMS40LTIuOSAzLjItMy4zIDUuNEw1MDkgNjAzLjVjLS40IDIuMiAwIDQgMS4yIDUuNXptMTExLjItMTEzLjFoLTM0LjdsMTEuOC01NGgzNi4yYzcuMiAwIDEyLjYgMS4yIDE2IDMuNiAzLjYgMi40IDUuNyA1LjYgNi4zIDkuNi42IDQgLjQgOC42LS42IDEzLjktMiA5LTYuMyAxNS44LTEzIDIwLjItNi40IDQuNS0xMy44IDYuNy0yMiA2Ljd6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmMDQyMCIvPjwvc3ZnPg==",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Dp.wrapped.logo},stables:{usd:["0x94b008aA00579c1307B0EF2c499aD98a8ce58e58","0x7F5c764cBc14f9669B88837ca1490cCa17c31607"]},explorer:"https://optimistic.etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://optimistic.etherscan.io/tx/${e.id||e}`:t?`https://optimistic.etherscan.io/token/${t}`:n?`https://optimistic.etherscan.io/address/${n}`:void 0,endpoints:["https://optimism.blockpi.network/v1/rpc/public","https://optimism.meowrpc.com","https://optimism.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Dp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Dp.wrapped.logo,type:"20"},{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png",type:"20"},{address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x4200000000000000000000000000000000000042",symbol:"OP",name:"Optimism",decimals:18,logo:"https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var Kp={name:"base",id:"0x2105",networkId:"8453",namespace:"eip155",label:"Base",fullName:"Base",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguNiA4NDJDNjg4IDg0MiA4NDIgNjg4LjkgODQyIDQ5OS41UzY4OCAxNTcgNDk4LjYgMTU3QzMxOSAxNTcgMTcxLjIgMjk1LjEgMTU3IDQ3MC4zaDQ1My4xdjU3LjVIMTU3QzE3MiA3MDMuOSAzMTkgODQyIDQ5OC42IDg0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#0052FF",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguOSA4NDVDNjkwLjEgODQ1IDg0NSA2OTAuMyA4NDUgNDk5LjVTNjkwLjEgMTU0IDQ5OC45IDE1NEMzMTcuNiAxNTQgMTY4LjggMjkzLjMgMTU0IDQ3MC41aDQ1Ny40djU4LjFIMTU0QzE2OC44IDcwNS44IDMxNy42IDg0NSA0OTguOSA4NDV6IiBmaWxsPSIjMDA1MmZmIi8+PC9zdmc+",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Dp.wrapped.logo},stables:{usd:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"]},explorer:"https://basescan.org",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://basescan.org/tx/${e.id||e}`:t?`https://basescan.org/token/${t}`:n?`https://basescan.org/address/${n}`:void 0,endpoints:["https://base.blockpi.network/v1/rpc/public","https://base.meowrpc.com","https://mainnet.base.org"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Dp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Dp.wrapped.logo,type:"20"},{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",symbol:"USDbC",name:"USD Base Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const $p=[Dp,Sp,Rp,Qp,_p,Fp,Gp,Jp,Xp,Kp];var ef={ethereum:Dp,bsc:Sp,polygon:Rp,solana:Qp,fantom:_p,arbitrum:Fp,avalanche:Gp,gnosis:Jp,optimism:Xp,base:Kp,all:$p,findById:function(e){let t=e;t.match("0x0")&&(t=t.replace(/0x0+/,"0x"));let n=$p.find((e=>e.id&&e.id.toLowerCase()==t.toLowerCase()));return n},findByNetworkId:function(e){e=e.toString();let t=$p.find((t=>t.networkId==e));return t},findByName:function(e){return $p.find((t=>t.name==e))}},tf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function rf(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var of=function(e){var t=pf(e),n=t[0],r=t[1];return 3*(n+r)/4-r},af=function(e){var t,n,r=pf(e),i=r[0],o=r[1],a=new lf(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n<u;n+=4)t=cf[e.charCodeAt(n)]<<18|cf[e.charCodeAt(n+1)]<<12|cf[e.charCodeAt(n+2)]<<6|cf[e.charCodeAt(n+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=cf[e.charCodeAt(n)]<<2|cf[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=cf[e.charCodeAt(n)]<<10|cf[e.charCodeAt(n+1)]<<4|cf[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},sf=function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(ff(e,a,a+o>s?s:a+o));1===r?(t=e[n-1],i.push(uf[t>>2]+uf[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(uf[t>>10]+uf[t>>4&63]+uf[t<<2&63]+"="));return i.join("")},uf=[],cf=[],lf="undefined"!=typeof Uint8Array?Uint8Array:Array,df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hf=0;hf<64;++hf)uf[hf]=df[hf],cf[df.charCodeAt(hf)]=hf;function pf(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function ff(e,t,n){for(var r,i,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(uf[(i=r)>>18&63]+uf[i>>12&63]+uf[i>>6&63]+uf[63&i]);return o.join("")}cf["-".charCodeAt(0)]=62,cf["_".charCodeAt(0)]=63;var mf={byteLength:of,toByteArray:af,fromByteArray:sf},yf=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},gf=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*m},vf=rf((function(e,t){const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50;const r=2147483647;function i(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|h(e,t);let r=i(n);const a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(H(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);const a=function(e){if(o.isBuffer(e)){const t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||G(e.length)?i(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return s(e),i(e<0?0:0|d(e))}function c(e){const t=e.length<0?0:0|d(e.length),n=i(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function l(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,o.prototype),r}function d(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(i)return r?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){let o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function g(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(G(r))return a;e[n+a]=r}return a}function v(e,t,n,r){return V(Y(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return V(F(t),e,n,r)}function M(e,t,n,r){return V(function(e,t){let n,r,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?mf.fromByteArray(e):mf.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}(r)}t.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,n){return a(e,t,n)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)}(e,t,n)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=o.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(H(t,Uint8Array))i+t.length>r.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)f(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const u=Math.min(a,s),c=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<u;++e)if(c[e]!==l[e]){a=c[e],s=l[e];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return w(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function I(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=q[e[r]];return i}function L(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function x(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i){R(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function C(e,t,n,r,i){R(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,r,i){return t=+t,n>>>=0,i||D(e,0,n,4),gf(e,t,n,r,23,4),n+4}function z(e,t,n,r,i){return t=+t,n>>>=0,i||D(e,0,n,8),gf(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),yf(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),yf(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),yf(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),yf(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){S(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){S(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Z((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Z((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);S(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);S(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Z((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Z((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const a=o.isBuffer(e)?e:o.from(e,r),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};const _={};function P(e,t,n){_[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function B(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function R(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new _.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){U(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,i,o)}function U(e,t){if("number"!=typeof e)throw new _.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw U(e,n),new _.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new _.ERR_BUFFER_OUT_OF_BOUNDS;throw new _.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=B(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(e){return mf.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}const q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}})),wf=rf((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:vf.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(e,l,l+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){c(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[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(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?m+r:d[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===o?(n<e.length&&(e[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,p=0|a[1],f=8191&p,m=p>>>13,y=0|a[2],g=8191&y,v=y>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],E=8191&A,N=A>>>13,T=0|a[5],I=8191&T,k=T>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(m,W)|0,o=Math.imul(m,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(m,F)|0,o=o+Math.imul(m,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,W),i=(i=Math.imul(b,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var we=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(N,W)|0,o=Math.imul(N,Q),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ne=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(B,W),i=(i=Math.imul(B,Q))+Math.imul(R,W)|0,o=Math.imul(R,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Te=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Le=(c+(r=r+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(N,fe)|0))<<13)|0;c=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(R,ue)|0,o=Math.imul(R,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,de),i=(i=Math.imul(B,he))+Math.imul(R,de)|0,o=Math.imul(R,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(B,fe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(R,fe)|0))<<13)|0;return c=((o=Math.imul(R,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=we,u[4]=be,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Ne,u[9]=Te,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return y(e,t,n)}Math.imul||(m=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?f(this,e,t):n<1024?y(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,m=1;0==(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new N(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){N.call(this,e),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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},r(b,w),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(M,w),r(A,w),r(E,w),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},N.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},N.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},N.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},N.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},N.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},N.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},N.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},N.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},N.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},N.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},N.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},N.prototype.isqr=function(e){return this.imul(e,e.clone())},N.prototype.sqr=function(e){return this.mul(e,e)},N.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<f);var g=this.pow(d,new i(1).iushln(f-y-1));h=h.redMul(g),d=g.redSqr(),p=p.redMul(d),f=y}return h},N.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},N.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},N.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},N.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},r(T,N),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,tf)}));
10
+ var Ts=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Is=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ks=BigInt(1),Ls=BigInt(2),xs=function(e,t){return(e+t/Ls)/t};var Ss,js,Cs,Ds=kn(Ts,void 0,void 0,{sqrt:function(e){var t=Ts,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,d=An(l,n,t)*l%t,h=An(d,n,t)*l%t,p=An(h,Ls,t)*c%t,f=An(p,i,t)*p%t,m=An(f,o,t)*f%t,y=An(m,s,t)*m%t,g=An(y,u,t)*y%t,v=An(g,s,t)*m%t,w=An(v,n,t)*l%t,b=An(w,a,t)*f%t,M=An(b,r,t)*c%t,A=An(M,Ls,t);if(!Ds.eql(Ds.sqr(A),e))throw new Error("Cannot find square root");return A}}),Os=(Ss={a:BigInt(0),b:BigInt(7),Fp:Ds,n:Is,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:function(e){var t=Is,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ks*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),s=xs(o*e,t),u=xs(-r*e,t),c=bn(e-s*n-u*i,t),l=bn(-s*r-u*o,t),d=c>a,h=l>a;if(d&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}}}},js=hr,Cs=function(e){return As(O(O({},Ss),function(e){return{hash:e,hmac:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ns(e,t,wt.apply(void 0,r))},randomBytes:At}}(e)))},Object.freeze(O(O({},Cs(js)),{},{create:Cs})));BigInt(0),Os.ProjectivePoint;var zs=["commitment"],_s=["encoding"],Ps=["commitment"],Bs=["commitment"],Rs=Xn.utils.randomPrivateKey,Us=function(){var e=Xn.utils.randomPrivateKey(),t=Ws(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},Ws=Xn.getPublicKey;function Qs(e){try{return Xn.ExtendedPoint.fromHex(e),!0}catch(e){return!1}}var Ys,Fs=function(e,t){return Xn.sign(e,t.slice(0,32))},Vs=Xn.verify,Hs=function(e){return Ee.isBuffer(e)?e:e instanceof Uint8Array?Ee.from(e.buffer,e.byteOffset,e.byteLength):Ee.from(e)},Gs=function(){function e(t){R(this,e),Object.assign(this,t)}return W(e,[{key:"encode",value:function(){return Ee.from(qr(Zs,this))}}],[{key:"decode",value:function(e){return Xr(Zs,this,e)}},{key:"decodeUnchecked",value:function(e){return zr(Zs,this,e)}}]),e}(),qs=function(e){Y(n,Gs);var t=X(n);function n(e){var r;if(R(this,n),(r=t.call(this,e)).enum="",1!==Object.keys(e).length)throw new Error("Enum can only take single value");return Object.keys(e).map((function(e){r.enum=e})),r}return W(n)}(),Zs=new Map,Js=32;var Xs=1,Ks=function(e,t){Y(a,Gs);var n,r,i,o=X(a);function a(e){var t;if(R(this,a),(t=o.call(this,{}))._bn=void 0,function(e){return void 0!==e._bn}(e))t._bn=e._bn;else{if("string"==typeof e){var n=ar.decode(e);if(n.length!=Js)throw new Error("Invalid public key input");t._bn=new nr(n)}else t._bn=new nr(e);if(t._bn.byteLength()>Js)throw new Error("Invalid public key input")}return t}return W(a,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return ar.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(Ee);if(e.length===Js)return e;var t=Ee.alloc(32);return e.copy(t,32-e.length),t}},{key:t,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var e=new a(Xs);return Xs+=1,new a(e.toBuffer())}},{key:"createWithSeed",value:(i=B(z().mark((function e(t,n,r){var i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Ee.concat([t.toBuffer(),Ee.from(n),r.toBuffer()]),o=hr(i),e.abrupt("return",new a(o));case 3:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createProgramAddressSync",value:function(e,t){var n=Ee.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=Ee.concat([n,Hs(e)])})),n=Ee.concat([n,t.toBuffer(),Ee.from("ProgramDerivedAddress")]);var r=hr(n);if(Qs(r))throw new Error("Invalid seeds, address must fall off the curve");return new a(r)}},{key:"createProgramAddress",value:(r=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"findProgramAddressSync",value:function(e,t){for(var n,r=255;0!=r;){try{var i=e.concat(Ee.from([r]));n=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:(n=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.findProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"isOnCurve",value:function(e){return Qs(new a(e).toBytes())}}]),a}(0,Symbol.toStringTag);Ys=Ks,Ks.default=new Ys("11111111111111111111111111111111"),Zs.set(Ks,{kind:"struct",fields:[["_bn","u256"]]});var $s=function(){function e(t){if(R(this,e),this._publicKey=void 0,this._secretKey=void 0,t){var n=Hs(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=Hs(Rs()),this._publicKey=Hs(Ws(this._secretKey))}return W(e,[{key:"publicKey",get:function(){return new Ks(this._publicKey)}},{key:"secretKey",get:function(){return Ee.concat([this._secretKey,this._publicKey],64)}}]),e}(),eu=new Ks("BPFLoader1111111111111111111111111111111111"),tu=1232,nu=127,ru=64,iu=function(e){Y(n,q(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: block height exceeded."))).signature=void 0,r.signature=e,r}return W(n)}();Object.defineProperty(iu.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var ou=function(e){Y(n,q(Error));var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,"Transaction was not confirmed in ".concat(r.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools."))).signature=void 0,i.signature=e,i}return W(n)}();Object.defineProperty(ou.prototype,"name",{value:"TransactionExpiredTimeoutError"});var au=function(e){Y(n,q(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: the nonce is no longer valid."))).signature=void 0,r.signature=e,r}return W(n)}();Object.defineProperty(au.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var su=function(){function e(t,n){R(this,e),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}return W(e,[{key:"keySegments",value:function(){var e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}},{key:"get",value:function(e){var t,n=ae(this.keySegments());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e<r.length)return r[e];e-=r.length}}catch(e){n.e(e)}finally{n.f()}}},{key:"length",get:function(){return this.keySegments().flat().length}},{key:"compileInstructions",value:function(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");var t=new Map;this.keySegments().flat().forEach((function(e,n){t.set(e.toBase58(),n)}));var n=function(e){var n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((function(e){return{programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((function(e){return n(e.pubkey)})),data:e.data}}))}}]),e}(),uu=function(){return Fi(32,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey")},cu=function(){return Fi(64,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature")},lu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=Qi([Ri("length"),Ri("lengthPadding"),Fi(_i(Ri(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=function(e,t){return n(e,t).chars.toString()},i.encode=function(e,t,n){var i={chars:Ee.from(e,"utf8")};return r(i,t,n)},i.alloc=function(e){return Ri().span+Ri().span+Ee.from(e,"utf8").length},i};function du(e,t){var n=function e(n){if(n.span>=0)return n.span;if("function"==typeof n.alloc)return n.alloc(t[n.property]);if("count"in n&&"elementLayout"in n){var r=t[n.property];if(Array.isArray(r))return r.length*e(n.elementLayout)}else if("fields"in n)return du({layout:n},t[n.property]);return 0},r=0;return e.layout.fields.forEach((function(e){r+=n(e)})),r}function hu(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0==(128&r))break}return t}function pu(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}function fu(e,t){if(!e)throw new Error(t||"Assertion failed")}var mu=function(){function e(t,n){R(this,e),this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}return W(e,[{key:"getMessageComponents",value:function(){var e=ee(this.keyMetaMap.entries());fu(e.length<=256,"Max static account keys length exceeded");var t=e.filter((function(e){var t=$(e,2)[1];return t.isSigner&&t.isWritable})),n=e.filter((function(e){var t=$(e,2)[1];return t.isSigner&&!t.isWritable})),r=e.filter((function(e){var t=$(e,2)[1];return!t.isSigner&&t.isWritable})),i=e.filter((function(e){var t=$(e,2)[1];return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};return fu(t.length>0,"Expected at least one writable signer key"),fu($(t[0],1)[0]===this.payer.toBase58(),"Expected first writable signer key to be the fee payer"),[o,[].concat(ee(t.map((function(e){var t=$(e,1)[0];return new Ks(t)}))),ee(n.map((function(e){var t=$(e,1)[0];return new Ks(t)}))),ee(r.map((function(e){var t=$(e,1)[0];return new Ks(t)}))),ee(i.map((function(e){var t=$(e,1)[0];return new Ks(t)}))))]}},{key:"extractTableLookup",value:function(e){var t=$(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&e.isWritable})),2),n=t[0],r=t[1],i=$(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&!e.isWritable})),2),o=i[0],a=i[1];if(0!==n.length||0!==o.length)return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:a}]}},{key:"drainKeysFoundInLookupTable",value:function(e,t){var n,r=this,i=new Array,o=new Array,a=ae(this.keyMetaMap.entries());try{var s=function(){var a=$(n.value,2),s=a[0],u=a[1];if(t(u)){var c=new Ks(s),l=e.findIndex((function(e){return e.equals(c)}));l>=0&&(fu(l<256,"Max lookup table index exceeded"),i.push(l),o.push(c),r.keyMetaMap.delete(s))}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return[i,o]}}],[{key:"compile",value:function(t,n){var r=new Map,i=function(e){var t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=i(n);o.isSigner=!0,o.isWritable=!0;var a,s=ae(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i(u.programId).isInvoked=!0;var c,l=ae(u.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,h=i(d.pubkey);h.isSigner||(h.isSigner=d.isSigner),h.isWritable||(h.isWritable=d.isWritable)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}return new e(n,r)}}]),e}(),yu=function(){function e(t){var n=this;R(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new Ks(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return W(e,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:ar.decode(e.data)}}))}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new su(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(e){return e<this.header.numRequiredSignatures}},{key:"isAccountWritable",value:function(e){var t=this.header.numRequiredSignatures;return e>=this.header.numRequiredSignatures?e-t<this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts:e<t-this.header.numReadonlySignedAccounts}},{key:"isProgramId",value:function(e){return this.indexToProgramIds.has(e)}},{key:"programIds",value:function(){return ee(this.indexToProgramIds.values())}},{key:"nonProgramIds",value:function(){var e=this;return this.accountKeys.filter((function(t,n){return!e.isProgramId(n)}))}},{key:"serialize",value:function(){var e=this.accountKeys.length,t=[];pu(t,e);var n=this.instructions.map((function(e){var t=e.accounts,n=e.programIdIndex,r=Array.from(ar.decode(e.data)),i=[];pu(i,t.length);var o=[];return pu(o,r.length),{programIdIndex:n,keyIndicesCount:Ee.from(i),keyIndices:t,dataLength:Ee.from(o),data:r}})),r=[];pu(r,n.length);var i=Ee.alloc(tu);Ee.from(r).copy(i);var o=r.length;n.forEach((function(e){var t=Qi([Pi("programIdIndex"),Fi(e.keyIndicesCount.length,"keyIndicesCount"),Yi(Pi("keyIndex"),e.keyIndices.length,"keyIndices"),Fi(e.dataLength.length,"dataLength"),Yi(Pi("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);var a=Qi([Fi(1,"numRequiredSignatures"),Fi(1,"numReadonlySignedAccounts"),Fi(1,"numReadonlyUnsignedAccounts"),Fi(t.length,"keyCount"),Yi(uu("key"),e,"keys"),uu("recentBlockhash")]),s={numRequiredSignatures:Ee.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Ee.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Ee.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Ee.from(t),keys:this.accountKeys.map((function(e){return Hs(e.toBytes())})),recentBlockhash:ar.decode(this.recentBlockhash)},u=Ee.alloc(2048),c=a.encode(s,u);return i.copy(u,c),u.slice(0,c+i.length)}}],[{key:"compile",value:function(t){var n=$(mu.compile(t.instructions,t.payerKey).getMessageComponents(),2),r=n[0],i=n[1],o=new su(i).compileInstructions(t.instructions).map((function(e){return{programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:ar.encode(e.data)}}));return new e({header:r,accountKeys:i,recentBlockhash:t.recentBlockhash,instructions:o})}},{key:"from",value:function(t){var n=ee(t),r=n.shift();if(r!==(r&nu))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");for(var i=n.shift(),o=n.shift(),a=hu(n),s=[],u=0;u<a;u++){var c=n.slice(0,Js);n=n.slice(Js),s.push(new Ks(Ee.from(c)))}for(var l=n.slice(0,Js),d=hu(n=n.slice(Js)),h=[],p=0;p<d;p++){var f=n.shift(),m=hu(n),y=n.slice(0,m),g=hu(n=n.slice(m)),v=n.slice(0,g),w=ar.encode(Ee.from(v));n=n.slice(g),h.push({programIdIndex:f,accounts:y,data:w})}return new e({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:o},recentBlockhash:ar.encode(Ee.from(l)),accountKeys:s,instructions:h})}}]),e}(),gu=function(){function e(t){R(this,e),this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}return W(e,[{key:"version",get:function(){return 0}},{key:"numAccountKeysFromLookups",get:function(){var e,t=0,n=ae(this.addressTableLookups);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.readonlyIndexes.length+r.writableIndexes.length}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getAccountKeys",value:function(e){var t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new su(this.staticAccountKeys,t)}},{key:"isAccountSigner",value:function(e){return e<this.header.numRequiredSignatures}},{key:"isAccountWritable",value:function(e){var t=this.header.numRequiredSignatures,n=this.staticAccountKeys.length;if(e>=n){var r=e-n,i=this.addressTableLookups.reduce((function(e,t){return e+t.writableIndexes.length}),0);return r<i}return e>=this.header.numRequiredSignatures?e-t<n-t-this.header.numReadonlyUnsignedAccounts:e<t-this.header.numReadonlySignedAccounts}},{key:"resolveAddressTableLookups",value:function(e){var t,n={writable:[],readonly:[]},r=ae(this.addressTableLookups);try{var i=function(){var r=t.value,i=e.find((function(e){return e.key.equals(r.accountKey)}));if(!i)throw new Error("Failed to find address lookup table account for table key ".concat(r.accountKey.toBase58()));var o,a=ae(r.writableIndexes);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!(s<i.state.addresses.length))throw new Error("Failed to find address for index ".concat(s," in address lookup table ").concat(r.accountKey.toBase58()));n.writable.push(i.state.addresses[s])}}catch(e){a.e(e)}finally{a.f()}var u,c=ae(r.readonlyIndexes);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(!(l<i.state.addresses.length))throw new Error("Failed to find address for index ".concat(l," in address lookup table ").concat(r.accountKey.toBase58()));n.readonly.push(i.state.addresses[l])}}catch(e){c.e(e)}finally{c.f()}};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return n}},{key:"serialize",value:function(){var e=Array();pu(e,this.staticAccountKeys.length);var t=this.serializeInstructions(),n=Array();pu(n,this.compiledInstructions.length);var r=this.serializeAddressTableLookups(),i=Array();pu(i,this.addressTableLookups.length);var o=Qi([Pi("prefix"),Qi([Pi("numRequiredSignatures"),Pi("numReadonlySignedAccounts"),Pi("numReadonlyUnsignedAccounts")],"header"),Fi(e.length,"staticAccountKeysLength"),Yi(uu(),this.staticAccountKeys.length,"staticAccountKeys"),uu("recentBlockhash"),Fi(n.length,"instructionsLength"),Fi(t.length,"serializedInstructions"),Fi(i.length,"addressTableLookupsLength"),Fi(r.length,"serializedAddressTableLookups")]),a=new Uint8Array(tu),s=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map((function(e){return e.toBytes()})),recentBlockhash:ar.decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:r},a);return a.slice(0,s)}},{key:"serializeInstructions",value:function(){var e,t=0,n=new Uint8Array(tu),r=ae(this.compiledInstructions);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=Array();pu(o,i.accountKeyIndexes.length);var a=Array();pu(a,i.data.length),t+=Qi([Pi("programIdIndex"),Fi(o.length,"encodedAccountKeyIndexesLength"),Yi(Pi(),i.accountKeyIndexes.length,"accountKeyIndexes"),Fi(a.length,"encodedDataLength"),Fi(i.data.length,"data")]).encode({programIdIndex:i.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(o),accountKeyIndexes:i.accountKeyIndexes,encodedDataLength:new Uint8Array(a),data:i.data},n,t)}}catch(e){r.e(e)}finally{r.f()}return n.slice(0,t)}},{key:"serializeAddressTableLookups",value:function(){var e,t=0,n=new Uint8Array(tu),r=ae(this.addressTableLookups);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=Array();pu(o,i.writableIndexes.length);var a=Array();pu(a,i.readonlyIndexes.length),t+=Qi([uu("accountKey"),Fi(o.length,"encodedWritableIndexesLength"),Yi(Pi(),i.writableIndexes.length,"writableIndexes"),Fi(a.length,"encodedReadonlyIndexesLength"),Yi(Pi(),i.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:i.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(o),writableIndexes:i.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(a),readonlyIndexes:i.readonlyIndexes},n,t)}}catch(e){r.e(e)}finally{r.f()}return n.slice(0,t)}}],[{key:"compile",value:function(t){var n,r=mu.compile(t.instructions,t.payerKey),i=new Array,o={writable:new Array,readonly:new Array},a=ae(t.addressLookupTableAccounts||[]);try{for(a.s();!(n=a.n()).done;){var s=n.value,u=r.extractTableLookup(s);if(void 0!==u){var c,l,d=$(u,2),h=d[0],p=d[1],f=p.writable,m=p.readonly;i.push(h),(c=o.writable).push.apply(c,ee(f)),(l=o.readonly).push.apply(l,ee(m))}}}catch(e){a.e(e)}finally{a.f()}var y=$(r.getMessageComponents(),2),g=y[0],v=y[1],w=new su(v,o).compileInstructions(t.instructions);return new e({header:g,staticAccountKeys:v,recentBlockhash:t.recentBlockhash,compiledInstructions:w,addressTableLookups:i})}},{key:"deserialize",value:function(t){var n=ee(t),r=n.shift(),i=r&nu;fu(r!==i,"Expected versioned message but received legacy message");fu(0===i,"Expected versioned message with version 0 but found version ".concat(i));for(var o={numRequiredSignatures:n.shift(),numReadonlySignedAccounts:n.shift(),numReadonlyUnsignedAccounts:n.shift()},a=[],s=hu(n),u=0;u<s;u++)a.push(new Ks(n.splice(0,Js)));for(var c=ar.encode(n.splice(0,Js)),l=hu(n),d=[],h=0;h<l;h++){var p=n.shift(),f=hu(n),m=n.splice(0,f),y=hu(n),g=new Uint8Array(n.splice(0,y));d.push({programIdIndex:p,accountKeyIndexes:m,data:g})}for(var v=hu(n),w=[],b=0;b<v;b++){var M=new Ks(n.splice(0,Js)),A=hu(n),E=n.splice(0,A),N=hu(n),T=n.splice(0,N);w.push({accountKey:M,writableIndexes:E,readonlyIndexes:T})}return new e({header:o,staticAccountKeys:a,recentBlockhash:c,compiledInstructions:d,addressTableLookups:w})}}]),e}(),vu={deserializeMessageVersion:function(e){var t=e[0],n=t&nu;return n===t?"legacy":n},deserialize:function(e){var t=vu.deserializeMessageVersion(e);if("legacy"===t)return yu.from(e);if(0===t)return gu.deserialize(e);throw new Error("Transaction message version ".concat(t," deserialization is not supported"))}},wu=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({}),bu=Ee.alloc(ru).fill(0),Mu=function(){function e(t){R(this,e),this.keys=void 0,this.programId=void 0,this.data=Ee.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}return W(e,[{key:"toJSON",value:function(){return{keys:this.keys.map((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;return{pubkey:t.toJSON(),isSigner:n,isWritable:r}})),programId:this.programId.toJSON(),data:ee(this.data)}}}]),e}(),Au=function(){function e(t){if(R(this,e),this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){var n=t.minContextSlot,r=t.nonceInfo;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){var i=t.blockhash,o=t.lastValidBlockHeight;this.recentBlockhash=i,this.lastValidBlockHeight=o}else{var a=t.recentBlockhash,s=t.nonceInfo;s&&(this.nonceInfo=s),this.recentBlockhash=a}}var t;return W(e,[{key:"signature",get:function(){return this.signatures.length>0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((function(e){return e.toJSON()})),signers:this.signatures.map((function(e){return e.publicKey.toJSON()}))}}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0===n.length)throw new Error("No instructions");return n.forEach((function(t){"instructions"in t?e.instructions=e.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?e.instructions.push(t):e.instructions.push(new Mu(t))})),this}},{key:"compileMessage",value:function(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;var e,t,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction].concat(ee(this.instructions)):this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(var r=0;r<t.length;r++)if(void 0===t[r].programId)throw new Error("Transaction instruction index ".concat(r," has undefined program id"));var i=[],o=[];t.forEach((function(e){e.keys.forEach((function(e){o.push(O({},e))}));var t=e.programId.toString();i.includes(t)||i.push(t)})),i.forEach((function(e){o.push({pubkey:new Ks(e),isSigner:!1,isWritable:!1})}));var a=[];o.forEach((function(e){var t=e.pubkey.toString(),n=a.findIndex((function(e){return e.pubkey.toString()===t}));n>-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)})),a.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));var s=a.findIndex((function(e){return e.pubkey.equals(n)}));if(s>-1){var u=$(a.splice(s,1),1)[0];u.isSigner=!0,u.isWritable=!0,a.unshift(u)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});var c,l=ae(this.signatures);try{var d=function(){var e=c.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}var h=0,p=0,f=0,m=[],y=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(m.push(t.toString()),h+=1,r||(p+=1)):(y.push(t.toString()),r||(f+=1))}));var g=m.concat(y),v=t.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:g.indexOf(n.toString()),accounts:e.keys.map((function(e){return g.indexOf(e.pubkey.toString())})),data:ar.encode(t)}}));return v.forEach((function(e){fu(e.programIdIndex>=0),e.accounts.forEach((function(e){return fu(e>=0)}))})),new yu({header:{numRequiredSignatures:h,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:f},accountKeys:g,recentBlockhash:e,instructions:v})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){var n=this.signatures.every((function(e,n){return t[n].equals(e.publicKey)}));if(n)return e}return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:(t=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFeeForMessage(this.compileMessage());case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("No signers");var r=new Set;this.signatures=t.filter((function(e){var t=e.toString();return!r.has(t)&&(r.add(t),!0)})).map((function(e){return{signature:null,publicKey:e}}))}},{key:"sign",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("No signers");for(var r=new Set,i=[],o=0,a=t;o<a.length;o++){var s=a[o],u=s.publicKey.toString();r.has(u)||(r.add(u),i.push(s))}this.signatures=i.map((function(e){return{signature:null,publicKey:e.publicKey}}));var c=this._compile();this._partialSign.apply(this,[c].concat(i))}},{key:"partialSign",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("No signers");for(var r=new Set,i=[],o=0,a=t;o<a.length;o++){var s=a[o],u=s.publicKey.toString();r.has(u)||(r.add(u),i.push(s))}var c=this._compile();this._partialSign.apply(this,[c].concat(i))}},{key:"_partialSign",value:function(e){for(var t=this,n=e.serialize(),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];i.forEach((function(e){var r=Fs(n,e.secretKey);t._addSignature(e.publicKey,Hs(r))}))}},{key:"addSignature",value:function(e,t){this._compile(),this._addSignature(e,t)}},{key:"_addSignature",value:function(e,t){fu(64===t.length);var n=this.signatures.findIndex((function(t){return e.equals(t.publicKey)}));if(n<0)throw new Error("unknown signer: ".concat(e.toString()));this.signatures[n].signature=Ee.from(t)}},{key:"verifySignatures",value:function(e){return this._verifySignatures(this.serializeMessage(),void 0===e||e)}},{key:"_verifySignatures",value:function(e,t){var n,r=ae(this.signatures);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.signature,a=i.publicKey;if(null===o){if(t)return!1}else if(!Vs(o,e,a.toBytes()))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},{key:"serialize",value:function(e){var t=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=t.requireAllSignatures,r=t.verifySignatures,i=this.serializeMessage();if(r&&!this._verifySignatures(i,n))throw new Error("Signature verification failed");return this._serialize(i)}},{key:"_serialize",value:function(e){var t=this.signatures,n=[];pu(n,t.length);var r=n.length+64*t.length+e.length,i=Ee.alloc(r);return fu(t.length<256),Ee.from(n).copy(i,0),t.forEach((function(e,t){var r=e.signature;null!==r&&(fu(64===r.length,"signature has invalid length"),Ee.from(r).copy(i,n.length+64*t))})),e.copy(i,n.length+64*t.length),fu(i.length<=tu,"Transaction too large: ".concat(i.length," > ").concat(tu)),i}},{key:"keys",get:function(){return fu(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return fu(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return fu(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=ee(t),r=hu(n),i=[],o=0;o<r;o++){var a=n.slice(0,ru);n=n.slice(ru),i.push(ar.encode(Ee.from(a)))}return e.populate(yu.from(n),i)}},{key:"populate",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var i={signature:e==ar.encode(bu)?null:ar.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Mu({keys:n,programId:t.accountKeys[e.programIdIndex],data:ar.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}]),e}(),Eu=function(){function e(t){R(this,e),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}return W(e,[{key:"compileToLegacyMessage",value:function(){return yu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(e){return gu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}],[{key:"decompile",value:function(t,n){var r=t.header,i=t.compiledInstructions,o=t.recentBlockhash,a=r.numRequiredSignatures,s=r.numReadonlySignedAccounts,u=r.numReadonlyUnsignedAccounts,c=a-s;fu(c>0,"Message header is invalid");var l=t.staticAccountKeys.length-a-u;fu(l>=0,"Message header is invalid");var d=t.getAccountKeys(n),h=d.get(0);if(void 0===h)throw new Error("Failed to decompile message because no account keys were found");var p,f=[],m=ae(i);try{for(m.s();!(p=m.n()).done;){var y,g=p.value,v=[],w=ae(g.accountKeyIndexes);try{for(w.s();!(y=w.n()).done;){var b=y.value,M=d.get(b);if(void 0===M)throw new Error("Failed to find key for account key index ".concat(b));var A=void 0;A=b<a?b<c:b<d.staticAccountKeys.length?b-a<l:b-d.staticAccountKeys.length<d.accountKeysFromLookups.writable.length,v.push({pubkey:M,isSigner:b<r.numRequiredSignatures,isWritable:A})}}catch(e){w.e(e)}finally{w.f()}var E=d.get(g.programIdIndex);if(void 0===E)throw new Error("Failed to find program id for program id index ".concat(g.programIdIndex));f.push(new Mu({programId:E,data:Hs(g.data),keys:v}))}}catch(e){m.e(e)}finally{m.f()}return new e({payerKey:h,instructions:f,recentBlockhash:o})}}]),e}(),Nu=function(){function e(t,n){if(R(this,e),this.signatures=void 0,this.message=void 0,void 0!==n)fu(n.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{for(var r=[],i=0;i<t.header.numRequiredSignatures;i++)r.push(new Uint8Array(ru));this.signatures=r}this.message=t}return W(e,[{key:"version",get:function(){return this.message.version}},{key:"serialize",value:function(){var e=this.message.serialize(),t=Array();pu(t,this.signatures.length);var n=Qi([Fi(t.length,"encodedSignaturesLength"),Yi(cu(),this.signatures.length,"signatures"),Fi(e.length,"serializedMessage")]),r=new Uint8Array(2048),i=n.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},r);return r.slice(0,i)}},{key:"sign",value:function(e){var t,n=this,r=this.message.serialize(),i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures),o=ae(e);try{var a=function(){var e=t.value,o=i.findIndex((function(t){return t.equals(e.publicKey)}));fu(o>=0,"Cannot sign with non signer key ".concat(e.publicKey.toBase58())),n.signatures[o]=Fs(r,e.secretKey)};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}},{key:"addSignature",value:function(e,t){fu(64===t.byteLength,"Signature must be 64 bytes long");var n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((function(t){return t.equals(e)}));fu(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}],[{key:"deserialize",value:function(t){for(var n=ee(t),r=[],i=hu(n),o=0;o<i;o++)r.push(new Uint8Array(n.splice(0,ru)));return new e(vu.deserialize(new Uint8Array(n)),r)}}]),e}(),Tu=new Ks("SysvarC1ock11111111111111111111111111111111"),Iu=new Ks("SysvarEpochSchedu1e111111111111111111111111"),ku=new Ks("Sysvar1nstructions1111111111111111111111111"),Lu=new Ks("SysvarRecentB1ockHashes11111111111111111111"),xu=new Ks("SysvarRent111111111111111111111111111111111"),Su=new Ks("SysvarRewards111111111111111111111111111111"),ju=new Ks("SysvarS1otHashes111111111111111111111111111"),Cu=new Ks("SysvarS1otHistory11111111111111111111111111"),Du=new Ks("SysvarStakeHistory1111111111111111111111111");function Ou(e,t,n,r){return zu.apply(this,arguments)}function zu(){return zu=B(z().mark((function e(t,n,r,i){var o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},e.next=3,t.sendTransaction(n,r,o);case 3:if(a=e.sent,null==n.recentBlockhash||null==n.lastValidBlockHeight){e.next=10;break}return e.next=7,t.confirmTransaction({abortSignal:null==i?void 0:i.abortSignal,signature:a,blockhash:n.recentBlockhash,lastValidBlockHeight:n.lastValidBlockHeight},i&&i.commitment);case 7:s=e.sent.value,e.next=22;break;case 10:if(null==n.minNonceContextSlot||null==n.nonceInfo){e.next=18;break}return u=n.nonceInfo.nonceInstruction,c=u.keys[0].pubkey,e.next=15,t.confirmTransaction({abortSignal:null==i?void 0:i.abortSignal,minContextSlot:n.minNonceContextSlot,nonceAccountPubkey:c,nonceValue:n.nonceInfo.nonce,signature:a},i&&i.commitment);case 15:s=e.sent.value,e.next=22;break;case 18:return null!=(null==i?void 0:i.abortSignal)&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),e.next=21,t.confirmTransaction(a,i&&i.commitment);case 21:s=e.sent.value;case 22:if(!s.err){e.next=24;break}throw new Error("Transaction ".concat(a," failed (").concat(JSON.stringify(s),")"));case 24:return e.abrupt("return",a);case 25:case"end":return e.stop()}}),e)}))),zu.apply(this,arguments)}function _u(e){return new Promise((function(t){return setTimeout(t,e)}))}function Pu(e,t){var n=e.layout.span>=0?e.layout.span:du(e,t),r=Ee.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function Bu(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Ru,Uu=Ui("lamportsPerSignature"),Wu=Qi([Ri("version"),Ri("state"),uu("authorizedPubkey"),uu("nonce"),Qi([Uu],"feeCalculator")]),Qu=Wu.span,Yu=function(){function e(t){R(this,e),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}return W(e,null,[{key:"fromAccountData",value:function(t){var n=Wu.decode(Hs(t),0);return new e({authorizedPubkey:new Ks(n.authorizedPubkey),nonce:new Ks(n.nonce).toString(),feeCalculator:n.feeCalculator})}}]),e}(),Fu=(Ru=8,function(e){var t=Fi(Ru,e),n=function(e){return{decode:e.decode.bind(e),encode:e.encode.bind(e)}}(t),r=n.encode,i=n.decode,o=t;return o.decode=function(e,t){var n=i(e,t);return Hi(Ee.from(n))},o.encode=function(e,t,n){var i=Gi(e,Ru);return r(i,t,n)},o}),Vu=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(Hu);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a SystemInstruction");return t}},{key:"decodeCreateAccount",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.Create,e.data),n=t.lamports,r=t.space,i=t.programId;return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:n,space:r,programId:new Ks(i)}}},{key:"decodeTransfer",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.Transfer,e.data).lamports;return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}},{key:"decodeTransferWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Hu.TransferWithSeed,e.data),n=t.lamports,r=t.seed,i=t.programId;return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:n,seed:r,programId:new Ks(i)}}},{key:"decodeAllocate",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.Allocate,e.data).space;return{accountPubkey:e.keys[0].pubkey,space:t}}},{key:"decodeAllocateWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.AllocateWithSeed,e.data),n=t.base,r=t.seed,i=t.space,o=t.programId;return{accountPubkey:e.keys[0].pubkey,basePubkey:new Ks(n),seed:r,space:i,programId:new Ks(o)}}},{key:"decodeAssign",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.Assign,e.data).programId;return{accountPubkey:e.keys[0].pubkey,programId:new Ks(t)}}},{key:"decodeAssignWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);var t=Bu(Hu.AssignWithSeed,e.data),n=t.base,r=t.seed,i=t.programId;return{accountPubkey:e.keys[0].pubkey,basePubkey:new Ks(n),seed:r,programId:new Ks(i)}}},{key:"decodeCreateWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.CreateWithSeed,e.data),n=t.base,r=t.seed,i=t.lamports,o=t.space,a=t.programId;return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Ks(n),seed:r,lamports:i,space:o,programId:new Ks(a)}}},{key:"decodeNonceInitialize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Hu.InitializeNonceAccount,e.data).authorized;return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Ks(t)}}},{key:"decodeNonceAdvance",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Bu(Hu.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"decodeNonceWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Bu(Hu.WithdrawNonceAccount,e.data).lamports;return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}},{key:"decodeNonceAuthorize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(Hu.AuthorizeNonceAccount,e.data).authorized;return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Ks(t)}}},{key:"checkProgramId",value:function(e){if(!e.equals(Gu.programId))throw new Error("invalid instruction; programId is not SystemProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),Hu=Object.freeze({Create:{index:0,layout:Qi([Ri("instruction"),Wi("lamports"),Wi("space"),uu("programId")])},Assign:{index:1,layout:Qi([Ri("instruction"),uu("programId")])},Transfer:{index:2,layout:Qi([Ri("instruction"),Fu("lamports")])},CreateWithSeed:{index:3,layout:Qi([Ri("instruction"),uu("base"),lu("seed"),Wi("lamports"),Wi("space"),uu("programId")])},AdvanceNonceAccount:{index:4,layout:Qi([Ri("instruction")])},WithdrawNonceAccount:{index:5,layout:Qi([Ri("instruction"),Wi("lamports")])},InitializeNonceAccount:{index:6,layout:Qi([Ri("instruction"),uu("authorized")])},AuthorizeNonceAccount:{index:7,layout:Qi([Ri("instruction"),uu("authorized")])},Allocate:{index:8,layout:Qi([Ri("instruction"),Wi("space")])},AllocateWithSeed:{index:9,layout:Qi([Ri("instruction"),uu("base"),lu("seed"),Wi("space"),uu("programId")])},AssignWithSeed:{index:10,layout:Qi([Ri("instruction"),uu("base"),lu("seed"),uu("programId")])},TransferWithSeed:{index:11,layout:Qi([Ri("instruction"),Fu("lamports"),lu("seed"),uu("programId")])},UpgradeNonceAccount:{index:12,layout:Qi([Ri("instruction")])}}),Gu=function(){function e(){R(this,e)}return W(e,null,[{key:"createAccount",value:function(e){var t=Pu(Hu.Create,{lamports:e.lamports,space:e.space,programId:Hs(e.programId.toBuffer())});return new Mu({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}},{key:"transfer",value:function(e){var t,n;"basePubkey"in e?(t=Pu(Hu.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=Pu(Hu.Transfer,{lamports:BigInt(e.lamports)}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]);return new Mu({keys:n,programId:this.programId,data:t})}},{key:"assign",value:function(e){var t,n;"basePubkey"in e?(t=Pu(Hu.AssignWithSeed,{base:Hs(e.basePubkey.toBuffer()),seed:e.seed,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Pu(Hu.Assign,{programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new Mu({keys:n,programId:this.programId,data:t})}},{key:"createAccountWithSeed",value:function(e){var t=Pu(Hu.CreateWithSeed,{base:Hs(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&n.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Mu({keys:n,programId:this.programId,data:t})}},{key:"createNonceAccount",value:function(t){var n=new Au;"basePubkey"in t&&"seed"in t?n.add(e.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:Qu,programId:this.programId})):n.add(e.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:Qu,programId:this.programId}));var r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}},{key:"nonceInitialize",value:function(e){var t=Pu(Hu.InitializeNonceAccount,{authorized:Hs(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:xu,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new Mu(n)}},{key:"nonceAdvance",value:function(e){var t=Pu(Hu.AdvanceNonceAccount),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new Mu(n)}},{key:"nonceWithdraw",value:function(e){var t=Pu(Hu.WithdrawNonceAccount,{lamports:e.lamports});return new Mu({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:xu,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"nonceAuthorize",value:function(e){var t=Pu(Hu.AuthorizeNonceAccount,{authorized:Hs(e.newAuthorizedPubkey.toBuffer())});return new Mu({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"allocate",value:function(e){var t,n;"basePubkey"in e?(t=Pu(Hu.AllocateWithSeed,{base:Hs(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Hs(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Pu(Hu.Allocate,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new Mu({keys:n,programId:this.programId,data:t})}}]),e}();Gu.programId=new Ks("11111111111111111111111111111111");var qu=function(){function e(){R(this,e)}var t;return W(e,null,[{key:"getMinNumSignatures",value:function(t){return 2*(Math.ceil(t/e.chunkSize)+1+1)}},{key:"load",value:(t=B(z().mark((function t(n,r,i,o,a){var s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.getMinimumBalanceForRentExemption(a.length);case 2:return s=t.sent,t.next=5,n.getAccountInfo(i.publicKey,"confirmed");case 5:if(u=t.sent,c=null,null===u){t.next=16;break}if(!u.executable){t.next=11;break}return console.error("Program load failed, account is already executable"),t.abrupt("return",!1);case 11:u.data.length!==a.length&&(c=c||new Au).add(Gu.allocate({accountPubkey:i.publicKey,space:a.length})),u.owner.equals(o)||(c=c||new Au).add(Gu.assign({accountPubkey:i.publicKey,programId:o})),u.lamports<s&&(c=c||new Au).add(Gu.transfer({fromPubkey:r.publicKey,toPubkey:i.publicKey,lamports:s-u.lamports})),t.next=17;break;case 16:c=(new Au).add(Gu.createAccount({fromPubkey:r.publicKey,newAccountPubkey:i.publicKey,lamports:s>0?s:1,space:a.length,programId:o}));case 17:if(null===c){t.next=20;break}return t.next=20,Ou(n,c,[r,i],{commitment:"confirmed"});case 20:l=Qi([Ri("instruction"),Ri("offset"),Ri("bytesLength"),Ri("bytesLengthPadding"),Yi(Pi("byte"),_i(Ri(),-8),"bytes")]),d=e.chunkSize,h=0,p=a,f=[];case 25:if(!(p.length>0)){t.next=39;break}if(m=p.slice(0,d),y=Ee.alloc(d+16),l.encode({instruction:0,offset:h,bytes:m,bytesLength:0,bytesLengthPadding:0},y),g=(new Au).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:y}),f.push(Ou(n,g,[r,i],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return t.next=35,_u(250);case 35:h+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(f);case 41:return v=Qi([Ri("instruction")]),w=Ee.alloc(v.span),v.encode({instruction:1},w),b=(new Au).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:xu,isSigner:!1,isWritable:!1}],programId:o,data:w}),M="processed",t.next=48,n.sendTransaction(b,[r,i],{preflightCommitment:M});case 48:return A=t.sent,t.next=51,n.confirmTransaction({signature:A,lastValidBlockHeight:b.lastValidBlockHeight,blockhash:b.recentBlockhash},M);case 51:if(E=t.sent,N=E.context,!(T=E.value).err){t.next=56;break}throw new Error("Transaction ".concat(A," failed (").concat(JSON.stringify(T),")"));case 56:return t.prev=57,t.next=60,n.getSlot({commitment:M});case 60:if(!(t.sent>N.slot)){t.next=63;break}return t.abrupt("break",71);case 63:t.next=67;break;case 65:t.prev=65,t.t0=t.catch(57);case 67:return t.next=69,new Promise((function(e){return setTimeout(e,Math.round(200))}));case 69:t.next=56;break;case 71:return t.abrupt("return",!0);case 72:case"end":return t.stop()}}),t,null,[[57,65]])}))),function(e,n,r,i,o){return t.apply(this,arguments)})}]),e}();qu.chunkSize=932;var Zu=new Ks("BPFLoader2111111111111111111111111111111111"),Ju=function(){function e(){R(this,e)}return W(e,null,[{key:"getMinNumSignatures",value:function(e){return qu.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return qu.load(e,t,n,i,r)}}]),e}();function Xu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ku=Object.prototype.toString,$u=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function ec(e,t){var n,r,i,o,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(_(e)){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return ec(e.toJSON(),t);if("[object Array]"===(u=Ku.call(e))){for(i="[",r=e.length-1,n=0;n<r;n++)i+=ec(e[n],!0)+",";return r>-1&&(i+=ec(e[n],!0)),i+"]"}if("[object Object]"===u){for(r=(o=$u(e).sort()).length,i="",n=0;n<r;)void 0!==(s=ec(e[a=o[n]],!1))&&(i&&(i+=","),i+=JSON.stringify(a)+":"+s),n++;return"{"+i+"}"}return JSON.stringify(e);case"function":case"undefined":return t?null:void 0;case"string":return JSON.stringify(e);default:return isFinite(e)?e:null}}var tc=Xu((function(e){var t=ec(e,!1);if(void 0!==t)return""+t}));function nc(e){for(var t=0;e>1;)e/=2,t++;return t}var rc=function(){function e(t,n,r,i,o){R(this,e),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=o}return W(e,[{key:"getEpoch",value:function(e){return this.getEpochAndSlotIndex(e)[0]}},{key:"getEpochAndSlotIndex",value:function(e){if(e<this.firstNormalSlot){var t=nc(function(e){return 0===e?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-nc(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}var n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch);return[this.firstNormalEpoch+r,n%this.slotsPerEpoch]}},{key:"getFirstSlotInEpoch",value:function(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}},{key:"getSlotsInEpoch",value:function(e){return e<this.firstNormalEpoch?Math.pow(2,e+nc(32)):this.slotsPerEpoch}}]),e}(),ic=function(e){Y(n,q(Error));var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,e)).logs=void 0,i.logs=r,i}return W(n)}(),oc=function(e){Y(n,q(Error));var t=X(n);function n(e,r){var i,o=e.code,a=e.message,s=e.data;return R(this,n),(i=t.call(this,null!=r?"".concat(r,": ").concat(a):a)).code=void 0,i.data=void 0,i.code=o,i.data=s,i.name="SolanaJSONRPCError",i}return W(n)}(),ac=globalThis.fetch,sc=function(e){Y(n,Ya);var t=X(n);function n(e,r,i){var o;R(this,n);return(o=t.call(this,(function(e){var t=Va(e,O({autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3},r));return o.underlyingSocket="socket"in t?t.socket:t,t}),e,r,i)).underlyingSocket=void 0,o}return W(n,[{key:"call",value:function(){for(var e,t,r=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return 1===r?(t=K(F(n.prototype),"call",this)).call.apply(t,[this].concat(o)):Promise.reject(new Error("Tried to call a JSON-RPC method `"+o[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}},{key:"notify",value:function(){for(var e,t,r=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return 1===r?(t=K(F(n.prototype),"notify",this)).call.apply(t,[this].concat(o)):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+o[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}}]),n}();var uc=function(){function e(t){R(this,e),this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}return W(e,[{key:"isActive",value:function(){var e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}}],[{key:"deserialize",value:function(e){var t=function(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.typeIndex!==e.index)throw new Error("invalid account data; account type mismatch ".concat(n.typeIndex," != ").concat(e.index));return n}(cc,e),n=e.length-56;fu(n>=0,"lookup table is invalid"),fu(n%32==0,"lookup table is invalid");var r=n/32,i=Qi([Yi(uu(),r,"addresses")]).decode(e.slice(56)).addresses;return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:0!==t.authority.length?new Ks(t.authority[0]):void 0,addresses:i.map((function(e){return new Ks(e)}))}}}]),e}(),cc={index:1,layout:Qi([Ri("typeIndex"),Fu("deactivationSlot"),Ui("lastExtendedSlot"),Pi("lastExtendedStartIndex"),Pi(),Yi(uu(),_i(Pi(),-1),"authority")])},lc=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;var dc=No(po(Ks),wo(),(function(e){return new Ks(e)})),hc=bo([wo(),fo("base64")]),pc=No(po(Ee),hc,(function(e){return Ee.from(e[0],"base64")}));function fc(e){var t,n;if("string"==typeof e)t=e;else if(e){t=e.commitment,n=Z(e,zs)}return{commitment:t,config:n}}function mc(e){return Ao([Mo({jsonrpc:fo("2.0"),id:wo(),result:e}),Mo({jsonrpc:fo("2.0"),id:wo(),error:Mo({code:Eo(),message:wo(),data:go(co("any",(function(){return!0})))})})])}var yc=mc(Eo());function gc(e){return No(mc(e),yc,(function(t){return"error"in t?t:O(O({},t),{},{result:ao(t.result,e)})}))}function vc(e){return gc(Mo({context:Mo({slot:yo()}),value:e}))}function wc(e){return Mo({context:Mo({slot:yo()}),value:e})}function bc(e,t){return 0===e?new gu({header:t.header,staticAccountKeys:t.accountKeys.map((function(e){return new Ks(e)})),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:ar.decode(e.data)}})),addressTableLookups:t.addressTableLookups}):new yu(t)}var Mc=Mo({foundation:yo(),foundationTerm:yo(),initial:yo(),taper:yo(),terminal:yo()}),Ac=gc(lo(mo(Mo({epoch:yo(),effectiveSlot:yo(),amount:yo(),postBalance:yo(),commission:go(mo(yo()))})))),Ec=lo(Mo({slot:yo(),prioritizationFee:yo()})),Nc=Mo({total:yo(),validator:yo(),foundation:yo(),epoch:yo()}),Tc=Mo({epoch:yo(),slotIndex:yo(),slotsInEpoch:yo(),absoluteSlot:yo(),blockHeight:go(yo()),transactionCount:go(yo())}),Ic=Mo({slotsPerEpoch:yo(),leaderScheduleSlotOffset:yo(),warmup:ho(),firstNormalEpoch:yo(),firstNormalSlot:yo()}),kc=vo(wo(),lo(yo())),Lc=mo(Ao([Mo({}),wo()])),xc=Mo({err:Lc}),Sc=fo("receivedSignature"),jc=Mo({"solana-core":wo(),"feature-set":go(yo())}),Cc=vc(Mo({err:mo(Ao([Mo({}),wo()])),logs:mo(lo(wo())),accounts:go(mo(lo(mo(Mo({executable:ho(),owner:wo(),lamports:yo(),data:lo(wo()),rentEpoch:go(yo())}))))),unitsConsumed:go(yo()),returnData:go(mo(Mo({programId:wo(),data:bo([wo(),fo("base64")])})))})),Dc=vc(Mo({byIdentity:vo(wo(),lo(yo())),range:Mo({firstSlot:yo(),lastSlot:yo()})}));var Oc=gc(Mc),zc=gc(Nc),_c=gc(Ec),Pc=gc(Tc),Bc=gc(Ic),Rc=gc(kc),Uc=gc(yo()),Wc=vc(Mo({total:yo(),circulating:yo(),nonCirculating:yo(),nonCirculatingAccounts:lo(dc)})),Qc=Mo({amount:wo(),uiAmount:mo(yo()),decimals:yo(),uiAmountString:go(wo())}),Yc=vc(lo(Mo({address:dc,amount:wo(),uiAmount:mo(yo()),decimals:yo(),uiAmountString:go(wo())}))),Fc=vc(lo(Mo({pubkey:dc,account:Mo({executable:ho(),owner:dc,lamports:yo(),data:pc,rentEpoch:yo()})}))),Vc=Mo({program:wo(),parsed:Eo(),space:yo()}),Hc=vc(lo(Mo({pubkey:dc,account:Mo({executable:ho(),owner:dc,lamports:yo(),data:Vc,rentEpoch:yo()})}))),Gc=vc(lo(Mo({lamports:yo(),address:dc}))),qc=Mo({executable:ho(),owner:dc,lamports:yo(),data:pc,rentEpoch:yo()}),Zc=Mo({pubkey:dc,account:qc}),Jc=No(Ao([po(Ee),Vc]),Ao([hc,Vc]),(function(e){return Array.isArray(e)?ao(e,pc):e})),Xc=Mo({executable:ho(),owner:dc,lamports:yo(),data:Jc,rentEpoch:yo()}),Kc=Mo({pubkey:dc,account:Xc}),$c=Mo({state:Ao([fo("active"),fo("inactive"),fo("activating"),fo("deactivating")]),active:yo(),inactive:yo()}),el=gc(lo(Mo({signature:wo(),slot:yo(),err:Lc,memo:mo(wo()),blockTime:go(mo(yo()))}))),tl=gc(lo(Mo({signature:wo(),slot:yo(),err:Lc,memo:mo(wo()),blockTime:go(mo(yo()))}))),nl=Mo({subscription:yo(),result:wc(qc)}),rl=Mo({pubkey:dc,account:qc}),il=Mo({subscription:yo(),result:wc(rl)}),ol=Mo({parent:yo(),slot:yo(),root:yo()}),al=Mo({subscription:yo(),result:ol}),sl=Ao([Mo({type:Ao([fo("firstShredReceived"),fo("completed"),fo("optimisticConfirmation"),fo("root")]),slot:yo(),timestamp:yo()}),Mo({type:fo("createdBank"),parent:yo(),slot:yo(),timestamp:yo()}),Mo({type:fo("frozen"),slot:yo(),timestamp:yo(),stats:Mo({numTransactionEntries:yo(),numSuccessfulTransactions:yo(),numFailedTransactions:yo(),maxTransactionsPerEntry:yo()})}),Mo({type:fo("dead"),slot:yo(),timestamp:yo(),err:wo()})]),ul=Mo({subscription:yo(),result:sl}),cl=Mo({subscription:yo(),result:wc(Ao([xc,Sc]))}),ll=Mo({subscription:yo(),result:yo()}),dl=Mo({pubkey:wo(),gossip:mo(wo()),tpu:mo(wo()),rpc:mo(wo()),version:mo(wo())}),hl=Mo({votePubkey:wo(),nodePubkey:wo(),activatedStake:yo(),epochVoteAccount:ho(),epochCredits:lo(bo([yo(),yo(),yo()])),commission:yo(),lastVote:yo(),rootSlot:mo(yo())}),pl=gc(Mo({current:lo(hl),delinquent:lo(hl)})),fl=Ao([fo("processed"),fo("confirmed"),fo("finalized")]),ml=Mo({slot:yo(),confirmations:mo(yo()),err:Lc,confirmationStatus:go(fl)}),yl=vc(lo(mo(ml))),gl=gc(yo()),vl=Mo({accountKey:dc,writableIndexes:lo(yo()),readonlyIndexes:lo(yo())}),wl=Mo({signatures:lo(wo()),message:Mo({accountKeys:lo(wo()),header:Mo({numRequiredSignatures:yo(),numReadonlySignedAccounts:yo(),numReadonlyUnsignedAccounts:yo()}),instructions:lo(Mo({accounts:lo(yo()),data:wo(),programIdIndex:yo()})),recentBlockhash:wo(),addressTableLookups:go(lo(vl))})}),bl=Mo({pubkey:dc,signer:ho(),writable:ho(),source:go(Ao([fo("transaction"),fo("lookupTable")]))}),Ml=Mo({accountKeys:lo(bl),signatures:lo(wo())}),Al=Mo({parsed:Eo(),program:wo(),programId:dc}),El=Mo({accounts:lo(dc),data:wo(),programId:dc}),Nl=No(Ao([El,Al]),Ao([Mo({parsed:Eo(),program:wo(),programId:wo()}),Mo({accounts:lo(wo()),data:wo(),programId:wo()})]),(function(e){return ao(e,"accounts"in e?El:Al)})),Tl=Mo({signatures:lo(wo()),message:Mo({accountKeys:lo(bl),instructions:lo(Nl),recentBlockhash:wo(),addressTableLookups:go(mo(lo(vl)))})}),Il=Mo({accountIndex:yo(),mint:wo(),owner:go(wo()),uiTokenAmount:Qc}),kl=Mo({writable:lo(dc),readonly:lo(dc)}),Ll=Mo({err:Lc,fee:yo(),innerInstructions:go(mo(lo(Mo({index:yo(),instructions:lo(Mo({accounts:lo(yo()),data:wo(),programIdIndex:yo()}))})))),preBalances:lo(yo()),postBalances:lo(yo()),logMessages:go(mo(lo(wo()))),preTokenBalances:go(mo(lo(Il))),postTokenBalances:go(mo(lo(Il))),loadedAddresses:go(kl),computeUnitsConsumed:go(yo())}),xl=Mo({err:Lc,fee:yo(),innerInstructions:go(mo(lo(Mo({index:yo(),instructions:lo(Nl)})))),preBalances:lo(yo()),postBalances:lo(yo()),logMessages:go(mo(lo(wo()))),preTokenBalances:go(mo(lo(Il))),postTokenBalances:go(mo(lo(Il))),loadedAddresses:go(kl),computeUnitsConsumed:go(yo())}),Sl=Ao([fo(0),fo("legacy")]),jl=Mo({pubkey:wo(),lamports:yo(),postBalance:mo(yo()),rewardType:mo(wo()),commission:go(mo(yo()))}),Cl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:wl,meta:mo(Ll),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Dl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Ol=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:Ml,meta:mo(Ll),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),zl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:Tl,meta:mo(xl),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),_l=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:Ml,meta:mo(xl),version:go(Sl)})),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Pl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),rewards:go(lo(jl)),blockTime:mo(yo()),blockHeight:mo(yo())}))),Bl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),transactions:lo(Mo({transaction:wl,meta:mo(Ll)})),rewards:go(lo(jl)),blockTime:mo(yo())}))),Rl=gc(mo(Mo({blockhash:wo(),previousBlockhash:wo(),parentSlot:yo(),signatures:lo(wo()),blockTime:mo(yo())}))),Ul=gc(mo(Mo({slot:yo(),meta:mo(Ll),blockTime:go(mo(yo())),transaction:wl,version:go(Sl)}))),Wl=gc(mo(Mo({slot:yo(),transaction:Tl,meta:mo(xl),blockTime:go(mo(yo())),version:go(Sl)}))),Ql=vc(Mo({blockhash:wo(),feeCalculator:Mo({lamportsPerSignature:yo()})})),Yl=vc(Mo({blockhash:wo(),lastValidBlockHeight:yo()})),Fl=vc(ho()),Vl=gc(lo(Mo({slot:yo(),numTransactions:yo(),numSlots:yo(),samplePeriodSecs:yo()}))),Hl=vc(mo(Mo({feeCalculator:Mo({lamportsPerSignature:yo()})}))),Gl=gc(wo()),ql=gc(wo()),Zl=Mo({err:Lc,logs:lo(wo()),signature:wo()}),Jl=Mo({result:wc(Zl),subscription:yo()}),Xl={"solana-client":"js/".concat("0.0.0-development")},Kl=function(){function e(t,n){var r,i,o,a,s,u,c,l=this;R(this,e),this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(r={},function(){var e=B(z().mark((function e(t){var n,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(t),o=i.commitment,a=i.config,s=l._buildArgs([],o,void 0,a),u=tc(s),r[u]=null!==(n=r[u])&&void 0!==n?n:B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l._rpcRequest("getBlockHeight",s);case 3:if(t=e.sent,!("error"in(n=ao(t,gc(yo()))))){e.next=7;break}throw new oc(n.error,"failed to get block height information");case 7:return e.abrupt("return",n.result);case 8:return e.prev=8,delete r[u],e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[0,,8,11]])})))(),e.next=6,r[u];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n&&"string"==typeof n?this._commitment=n:n&&(this._commitment=n.commitment,this._confirmTransactionInitialTimeout=n.confirmTransactionInitialTimeout,i=n.wsEndpoint,o=n.httpHeaders,a=n.fetch,s=n.fetchMiddleware,u=n.disableRetryOnRateLimit,c=n.httpAgent),this._rpcEndpoint=function(e){if(!1===/^https?:/.test(e))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}(t),this._rpcWsEndpoint=i||function(e){var t=e.match(lc);if(null==t)throw TypeError("Failed to validate endpoint URL `".concat(e,"`"));var n=$(t,4);n[0];var r=n[1],i=n[2],o=n[3],a=e.startsWith("https:")?"wss:":"ws:",s=null==i?null:parseInt(i.slice(1),10),u=null==s?"":":".concat(s+1);return"".concat(a,"//").concat(r).concat(u).concat(o)}(t),this._rpcClient=function(e,t,n,r,i,o){var a,s=n||ac;null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),r&&(a=function(){var e=B(z().mark((function e(t,n){var i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,i){try{r(t,n,(function(t,n){return e([t,n])}))}catch(e){i(e)}}));case 2:return i=e.sent,e.next=5,s.apply(void 0,ee(i));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());var u=new aa(function(){var n=B(z().mark((function n(r,o){var u,c,l,d,h;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:u={method:"POST",body:r,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},t||{},Xl)},n.prev=1,c=5,d=500;case 4:if(!a){n.next=10;break}return n.next=7,a(e,u);case 7:l=n.sent,n.next=13;break;case 10:return n.next=12,s(e,u);case 12:l=n.sent;case 13:if(429===l.status){n.next=15;break}return n.abrupt("break",26);case 15:if(!0!==i){n.next=17;break}return n.abrupt("break",26);case 17:if(0!=(c-=1)){n.next=20;break}return n.abrupt("break",26);case 20:return console.log("Server responded with ".concat(l.status," ").concat(l.statusText,". Retrying after ").concat(d,"ms delay...")),n.next=23,_u(d);case 23:d*=2;case 24:n.next=4;break;case 26:return n.next=28,l.text();case 28:h=n.sent,l.ok?o(null,h):o(new Error("".concat(l.status," ").concat(l.statusText,": ").concat(h))),n.next=35;break;case 32:n.prev=32,n.t0=n.catch(1),n.t0 instanceof Error&&o(n.t0);case 35:case"end":return n.stop()}}),n,null,[[1,32]])})));return function(e,t){return n.apply(this,arguments)}}(),{});return u}(t,o,a,s,u,c),this._rpcRequest=function(e){return function(t,n){return new Promise((function(r,i){e.request(t,n,(function(e,t){e?i(e):r(t)}))}))}}(this._rpcClient),this._rpcBatchRequest=function(e){return function(t){return new Promise((function(n,r){0===t.length&&n([]);var i=t.map((function(t){return e.request(t.methodName,t.args)}));e.request(i,(function(e,t){e?r(e):n(t)}))}))}}(this._rpcClient),this._rpcWebSocket=new sc(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}var t,n,r,i,o,a,s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T,I,k,L,x,S,j,C,D,P,U,Q,Y,F,V,H,G,q,J,X,K,te,ne,re,ie,oe,ae,se,ue,ce,le,de,he,pe,fe,me,ye,ge,ve,we,be,Me,Ae,Ne,Te,Ie,ke,Le,xe,Se,je,Ce,De,Oe,ze,_e,Pe,Be,Re,Ue,We,Qe,Ye,Fe,Ve;return W(e,[{key:"commitment",get:function(){return this._commitment}},{key:"rpcEndpoint",get:function(){return this._rpcEndpoint}},{key:"getBalanceAndContext",value:(Ve=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,void 0,o),e.next=4,this._rpcRequest("getBalance",a);case 4:if(s=e.sent,!("error"in(u=ao(s,vc(yo()))))){e.next=8;break}throw new oc(u.error,"failed to get balance for ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ve.apply(this,arguments)})},{key:"getBalance",value:(Fe=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBalanceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get balance of account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return Fe.apply(this,arguments)})},{key:"getBlockTime",value:(Ye=B(z().mark((function e(t){var n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getBlockTime",[t]);case 2:if(n=e.sent,!("error"in(r=ao(n,gc(mo(yo())))))){e.next=6;break}throw new oc(r.error,"failed to get block time for slot ".concat(t));case 6:return e.abrupt("return",r.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return Ye.apply(this,arguments)})},{key:"getMinimumLedgerSlot",value:(Qe=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("minimumLedgerSlot",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(yo()))))){e.next=6;break}throw new oc(n.error,"failed to get minimum ledger slot");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return Qe.apply(this,arguments)})},{key:"getFirstAvailableBlock",value:(We=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getFirstAvailableBlock",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,Uc)))){e.next=6;break}throw new oc(n.error,"failed to get first available block");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return We.apply(this,arguments)})},{key:"getSupply",value:(Ue=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},n="string"==typeof t?{commitment:t}:t?O(O({},t),{},{commitment:t&&t.commitment||this.commitment}):{commitment:this.commitment},e.next=4,this._rpcRequest("getSupply",[n]);case 4:if(r=e.sent,!("error"in(i=ao(r,Wc)))){e.next=8;break}throw new oc(i.error,"failed to get supply");case 8:return e.abrupt("return",i.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return Ue.apply(this,arguments)})},{key:"getTokenSupply",value:(Re=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t.toBase58()],n),e.next=3,this._rpcRequest("getTokenSupply",r);case 3:if(i=e.sent,!("error"in(o=ao(i,vc(Qc))))){e.next=7;break}throw new oc(o.error,"failed to get token supply");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return Re.apply(this,arguments)})},{key:"getTokenAccountBalance",value:(Be=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t.toBase58()],n),e.next=3,this._rpcRequest("getTokenAccountBalance",r);case 3:if(i=e.sent,!("error"in(o=ao(i,vc(Qc))))){e.next=7;break}throw new oc(o.error,"failed to get token account balance");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return Be.apply(this,arguments)})},{key:"getTokenAccountsByOwner",value:(Pe=B(z().mark((function e(t,n,r){var i,o,a,s,u,c,l;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(r),o=i.commitment,a=i.config,s=[t.toBase58()],"mint"in n?s.push({mint:n.mint.toBase58()}):s.push({programId:n.programId.toBase58()}),u=this._buildArgs(s,o,"base64",a),e.next=6,this._rpcRequest("getTokenAccountsByOwner",u);case 6:if(c=e.sent,!("error"in(l=ao(c,Fc)))){e.next=10;break}throw new oc(l.error,"failed to get token accounts owned by account ".concat(t.toBase58()));case 10:return e.abrupt("return",l.result);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Pe.apply(this,arguments)})},{key:"getParsedTokenAccountsByOwner",value:(_e=B(z().mark((function e(t,n,r){var i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[t.toBase58()],"mint"in n?i.push({mint:n.mint.toBase58()}):i.push({programId:n.programId.toBase58()}),o=this._buildArgs(i,r,"jsonParsed"),e.next=5,this._rpcRequest("getTokenAccountsByOwner",o);case 5:if(a=e.sent,!("error"in(s=ao(a,Hc)))){e.next=9;break}throw new oc(s.error,"failed to get token accounts owned by account ".concat(t.toBase58()));case 9:return e.abrupt("return",s.result);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return _e.apply(this,arguments)})},{key:"getLargestAccounts",value:(ze=B(z().mark((function e(t){var n,r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=O(O({},t),{},{commitment:t&&t.commitment||this.commitment}),r=n.filter||n.commitment?[n]:[],e.next=4,this._rpcRequest("getLargestAccounts",r);case 4:if(i=e.sent,!("error"in(o=ao(i,Gc)))){e.next=8;break}throw new oc(o.error,"failed to get largest accounts");case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ze.apply(this,arguments)})},{key:"getTokenLargestAccounts",value:(Oe=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t.toBase58()],n),e.next=3,this._rpcRequest("getTokenLargestAccounts",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Yc)))){e.next=7;break}throw new oc(o.error,"failed to get token largest accounts");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return Oe.apply(this,arguments)})},{key:"getAccountInfoAndContext",value:(De=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,"base64",o),e.next=4,this._rpcRequest("getAccountInfo",a);case 4:if(s=e.sent,!("error"in(u=ao(s,vc(mo(qc)))))){e.next=8;break}throw new oc(u.error,"failed to get info about account ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return De.apply(this,arguments)})},{key:"getParsedAccountInfo",value:(Ce=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,"jsonParsed",o),e.next=4,this._rpcRequest("getAccountInfo",a);case 4:if(s=e.sent,!("error"in(u=ao(s,vc(mo(Xc)))))){e.next=8;break}throw new oc(u.error,"failed to get info about account ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ce.apply(this,arguments)})},{key:"getAccountInfo",value:(je=B(z().mark((function e(t,n){var r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getAccountInfoAndContext(t,n);case 3:return r=e.sent,e.abrupt("return",r.value);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("failed to get info about account "+t.toBase58()+": "+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return je.apply(this,arguments)})},{key:"getMultipleParsedAccounts",value:(Se=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return e.toBase58()})),s=this._buildArgs([a],i,"jsonParsed",o),e.next=5,this._rpcRequest("getMultipleAccounts",s);case 5:if(u=e.sent,!("error"in(c=ao(u,vc(lo(mo(Xc))))))){e.next=9;break}throw new oc(c.error,"failed to get info for accounts ".concat(a));case 9:return e.abrupt("return",c.result);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return Se.apply(this,arguments)})},{key:"getMultipleAccountsInfoAndContext",value:(xe=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return e.toBase58()})),s=this._buildArgs([a],i,"base64",o),e.next=5,this._rpcRequest("getMultipleAccounts",s);case 5:if(u=e.sent,!("error"in(c=ao(u,vc(lo(mo(qc))))))){e.next=9;break}throw new oc(c.error,"failed to get info for accounts ".concat(a));case 9:return e.abrupt("return",c.result);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return xe.apply(this,arguments)})},{key:"getMultipleAccountsInfo",value:(Le=B(z().mark((function e(t,n){var r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getMultipleAccountsInfoAndContext(t,n);case 2:return r=e.sent,e.abrupt("return",r.value);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return Le.apply(this,arguments)})},{key:"getStakeActivation",value:(ke=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(n),o=i.commitment,a=i.config,s=this._buildArgs([t.toBase58()],o,void 0,O(O({},a),{},{epoch:null!=r?r:null==a?void 0:a.epoch})),e.next=4,this._rpcRequest("getStakeActivation",s);case 4:if(u=e.sent,!("error"in(c=ao(u,gc($c))))){e.next=8;break}throw new oc(c.error,"failed to get Stake Activation ".concat(t.toBase58()));case 8:return e.abrupt("return",c.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ke.apply(this,arguments)})},{key:"getProgramAccounts",value:(Ie=B(z().mark((function e(t,n){var r,i,o,a,s,u,c,l,d,h;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,s=(a=o||{}).encoding,u=Z(a,_s),c=this._buildArgs([t.toBase58()],i,s||"base64",u),e.next=5,this._rpcRequest("getProgramAccounts",c);case 5:if(l=e.sent,d=lo(Zc),!("error"in(h=!0===u.withContext?ao(l,vc(d)):ao(l,gc(d))))){e.next=10;break}throw new oc(h.error,"failed to get accounts owned by program ".concat(t.toBase58()));case 10:return e.abrupt("return",h.result);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ie.apply(this,arguments)})},{key:"getParsedProgramAccounts",value:(Te=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t.toBase58()],i,"jsonParsed",o),e.next=4,this._rpcRequest("getProgramAccounts",a);case 4:if(s=e.sent,!("error"in(u=ao(s,gc(lo(Kc)))))){e.next=8;break}throw new oc(u.error,"failed to get accounts owned by program ".concat(t.toBase58()));case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return Te.apply(this,arguments)})},{key:"confirmTransaction",value:(Ne=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=4;break}r=t,e.next=8;break;case 4:if(null===(i=(o=t).abortSignal)||void 0===i||!i.aborted){e.next=7;break}return e.abrupt("return",Promise.reject(o.abortSignal.reason));case 7:r=o.signature;case 8:e.prev=8,a=ar.decode(r),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(8),new Error("signature must be base58 encoded: "+r);case 15:if(fu(64===a.length,"signature has invalid length"),"string"!=typeof t){e.next=22;break}return e.next=19,this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:n||this.commitment,signature:r});case 19:return e.abrupt("return",e.sent);case 22:if(!("lastValidBlockHeight"in t)){e.next=28;break}return e.next=25,this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:n||this.commitment,strategy:t});case 25:return e.abrupt("return",e.sent);case 28:return e.next=30,this.confirmTransactionUsingDurableNonceStrategy({commitment:n||this.commitment,strategy:t});case 30:return e.abrupt("return",e.sent);case 31:case"end":return e.stop()}}),e,this,[[8,12]])}))),function(e,t){return Ne.apply(this,arguments)})},{key:"getCancellationPromise",value:function(e){return new Promise((function(t,n){null!=e&&(e.aborted?n(e.reason):e.addEventListener("abort",(function(){n(e.reason)})))}))}},{key:"getTransactionConfirmationPromise",value:function(e){var t,n,r=this,i=e.commitment,o=e.signature,a=!1;return{abortConfirmation:function(){n&&(n(),n=void 0),null!=t&&(r.removeSignatureListener(t),t=void 0)},confirmationPromise:new Promise((function(e,s){try{t=r.onSignature(o,(function(n,r){t=void 0;var i={context:r,value:n};e({__type:wu.PROCESSED,response:i})}),i);var u=new Promise((function(e){null==t?e():n=r._onSubscriptionStateChange(t,(function(t){"subscribed"===t&&e()}))}));B(z().mark((function t(){var n,c,l;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u;case 2:if(!a){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,r.getSignatureStatus(o);case 6:if(n=t.sent,!a){t.next=9;break}return t.abrupt("return");case 9:if(null!=n){t.next=11;break}return t.abrupt("return");case 11:if(c=n.context,null!=(l=n.value)){t.next=14;break}return t.abrupt("return");case 14:if(null==l||!l.err){t.next=18;break}s(l.err),t.next=29;break;case 18:t.t0=i,t.next="confirmed"===t.t0||"single"===t.t0||"singleGossip"===t.t0?21:"finalized"===t.t0||"max"===t.t0||"root"===t.t0?24:("processed"===t.t0||t.t0,27);break;case 21:if("processed"!==l.confirmationStatus){t.next=23;break}return t.abrupt("return");case 23:return t.abrupt("break",27);case 24:if("processed"!==l.confirmationStatus&&"confirmed"!==l.confirmationStatus){t.next=26;break}return t.abrupt("return");case 26:return t.abrupt("break",27);case 27:a=!0,e({__type:wu.PROCESSED,response:{context:c,value:l}});case 29:case"end":return t.stop()}}),t)})))()}catch(e){s(e)}}))}}},{key:"confirmTransactionUsingBlockHeightExceedanceStrategy",value:(Ae=B(z().mark((function e(t){var n,r,i,o,a,s,u,c,l,d,h,p,f,m=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commitment,r=t.strategy,i=r.abortSignal,o=r.lastValidBlockHeight,a=r.signature,s=!1,u=new Promise((function(e){var t=function(){var e=B(z().mark((function e(){var t;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.getBlockHeight(n);case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",-1);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();B(z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:if(r=n.sent,!s){n.next=5;break}return n.abrupt("return");case 5:if(!(r<=o)){n.next=17;break}return n.next=8,_u(1e3);case 8:if(!s){n.next=10;break}return n.abrupt("return");case 10:return n.next=12,t();case 12:if(r=n.sent,!s){n.next=15;break}return n.abrupt("return");case 15:n.next=5;break;case 17:e({__type:wu.BLOCKHEIGHT_EXCEEDED});case 18:case"end":return n.stop()}}),n)})))()})),c=this.getTransactionConfirmationPromise({commitment:n,signature:a}),l=c.abortConfirmation,d=c.confirmationPromise,h=this.getCancellationPromise(i),e.prev=5,e.next=8,Promise.race([h,d,u]);case 8:if((f=e.sent).__type!==wu.PROCESSED){e.next=13;break}p=f.response,e.next=14;break;case 13:throw new iu(a);case 14:return e.prev=14,s=!0,l(),e.finish(14);case 18:return e.abrupt("return",p);case 19:case"end":return e.stop()}}),e,this,[[5,,14,18]])}))),function(e){return Ae.apply(this,arguments)})},{key:"confirmTransactionUsingDurableNonceStrategy",value:(Me=B(z().mark((function e(t){var n,r,i,o,a,s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commitment,r=t.strategy,i=r.abortSignal,o=r.minContextSlot,a=r.nonceAccountPubkey,s=r.nonceValue,u=r.signature,c=!1,l=new Promise((function(e){var t=s,r=null,i=function(){var e=B(z().mark((function e(){var i,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,E.getNonceAndContext(a,{commitment:n,minContextSlot:o});case 3:return i=e.sent,s=i.context,u=i.value,r=s.slot,e.abrupt("return",null==u?void 0:u.nonce);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",t);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}();B(z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i();case 2:if(t=n.sent,!c){n.next=5;break}return n.abrupt("return");case 5:if(s===t){n.next=9;break}return e({__type:wu.NONCE_INVALID,slotInWhichNonceDidAdvance:r}),n.abrupt("return");case 9:return n.next=11,_u(2e3);case 11:if(!c){n.next=13;break}return n.abrupt("return");case 13:return n.next=15,i();case 15:if(t=n.sent,!c){n.next=18;break}return n.abrupt("return");case 18:n.next=5;break;case 20:case"end":return n.stop()}}),n)})))()})),d=this.getTransactionConfirmationPromise({commitment:n,signature:u}),h=d.abortConfirmation,p=d.confirmationPromise,f=this.getCancellationPromise(i),e.prev=5,e.next=8,Promise.race([f,p,l]);case 8:if((y=e.sent).__type!==wu.PROCESSED){e.next=13;break}m=y.response,e.next=47;break;case 13:return e.next=16,this.getSignatureStatus(u);case 16:if(null!=(b=e.sent)){e.next=19;break}return e.abrupt("break",27);case 19:if(!(b.context.slot<(null!==(w=y.slotInWhichNonceDidAdvance)&&void 0!==w?w:o))){e.next=23;break}return e.next=22,_u(400);case 22:return e.abrupt("continue",13);case 23:return v=b,e.abrupt("break",27);case 27:if(null===(g=v)||void 0===g||!g.value){e.next=46;break}M=n||"finalized",A=v.value.confirmationStatus,e.t0=M,e.next="processed"===e.t0||"recent"===e.t0?33:"confirmed"===e.t0||"single"===e.t0||"singleGossip"===e.t0?36:"finalized"===e.t0||"max"===e.t0||"root"===e.t0?39:42;break;case 33:if("processed"===A||"confirmed"===A||"finalized"===A){e.next=35;break}throw new au(u);case 35:case 38:case 41:return e.abrupt("break",43);case 36:if("confirmed"===A||"finalized"===A){e.next=38;break}throw new au(u);case 39:if("finalized"===A){e.next=41;break}throw new au(u);case 42:case 43:m={context:v.context,value:{err:v.value.err}},e.next=47;break;case 46:throw new au(u);case 47:return e.prev=47,c=!0,h(),e.finish(47);case 51:return e.abrupt("return",m);case 52:case"end":return e.stop()}}),e,this,[[5,,47,51]])}))),function(e){return Me.apply(this,arguments)})},{key:"confirmTransactionUsingLegacyTimeoutStrategy",value:(be=B(z().mark((function e(t){var n,r,i,o,a,s,u,c,l,d=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commitment,r=t.signature,o=new Promise((function(e){var t=d._confirmTransactionInitialTimeout||6e4;switch(n){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":t=d._confirmTransactionInitialTimeout||3e4}i=setTimeout((function(){return e({__type:wu.TIMED_OUT,timeoutMs:t})}),t)})),a=this.getTransactionConfirmationPromise({commitment:n,signature:r}),s=a.abortConfirmation,u=a.confirmationPromise,e.prev=3,e.next=6,Promise.race([u,o]);case 6:if((l=e.sent).__type!==wu.PROCESSED){e.next=11;break}c=l.response,e.next=12;break;case 11:throw new ou(r,l.timeoutMs/1e3);case 12:return e.prev=12,clearTimeout(i),s(),e.finish(12);case 16:return e.abrupt("return",c);case 17:case"end":return e.stop()}}),e,this,[[3,,12,16]])}))),function(e){return be.apply(this,arguments)})},{key:"getClusterNodes",value:(we=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getClusterNodes",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(lo(dl)))))){e.next=6;break}throw new oc(n.error,"failed to get cluster nodes");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return we.apply(this,arguments)})},{key:"getVoteAccounts",value:(ve=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._buildArgs([],t),e.next=3,this._rpcRequest("getVoteAccounts",n);case 3:if(r=e.sent,!("error"in(i=ao(r,pl)))){e.next=7;break}throw new oc(i.error,"failed to get vote accounts");case 7:return e.abrupt("return",i.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return ve.apply(this,arguments)})},{key:"getSlot",value:(ge=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getSlot",o);case 4:if(a=e.sent,!("error"in(s=ao(a,gc(yo()))))){e.next=8;break}throw new oc(s.error,"failed to get slot");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ge.apply(this,arguments)})},{key:"getSlotLeader",value:(ye=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getSlotLeader",o);case 4:if(a=e.sent,!("error"in(s=ao(a,gc(wo()))))){e.next=8;break}throw new oc(s.error,"failed to get slot leader");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ye.apply(this,arguments)})},{key:"getSlotLeaders",value:(me=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[t,n],e.next=3,this._rpcRequest("getSlotLeaders",r);case 3:if(i=e.sent,!("error"in(o=ao(i,gc(lo(dc)))))){e.next=7;break}throw new oc(o.error,"failed to get slot leaders");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return me.apply(this,arguments)})},{key:"getSignatureStatus",value:(fe=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSignatureStatuses([t],n);case 2:return r=e.sent,i=r.context,fu(1===(o=r.value).length),a=o[0],e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return fe.apply(this,arguments)})},{key:"getSignatureStatuses",value:(pe=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[t],n&&r.push(n),e.next=4,this._rpcRequest("getSignatureStatuses",r);case 4:if(i=e.sent,!("error"in(o=ao(i,yl)))){e.next=8;break}throw new oc(o.error,"failed to get signature status");case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return pe.apply(this,arguments)})},{key:"getTransactionCount",value:(he=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getTransactionCount",o);case 4:if(a=e.sent,!("error"in(s=ao(a,gc(yo()))))){e.next=8;break}throw new oc(s.error,"failed to get transaction count");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return he.apply(this,arguments)})},{key:"getTotalSupply",value:(de=B(z().mark((function e(t){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0});case 2:return n=e.sent,e.abrupt("return",n.value.total);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return de.apply(this,arguments)})},{key:"getInflationGovernor",value:(le=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._buildArgs([],t),e.next=3,this._rpcRequest("getInflationGovernor",n);case 3:if(r=e.sent,!("error"in(i=ao(r,Oc)))){e.next=7;break}throw new oc(i.error,"failed to get inflation");case 7:return e.abrupt("return",i.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return le.apply(this,arguments)})},{key:"getInflationReward",value:(ce=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fc(r),o=i.commitment,a=i.config,s=this._buildArgs([t.map((function(e){return e.toBase58()}))],o,void 0,O(O({},a),{},{epoch:null!=n?n:null==a?void 0:a.epoch})),e.next=4,this._rpcRequest("getInflationReward",s);case 4:if(u=e.sent,!("error"in(c=ao(u,Ac)))){e.next=8;break}throw new oc(c.error,"failed to get inflation reward");case 8:return e.abrupt("return",c.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ce.apply(this,arguments)})},{key:"getInflationRate",value:(ue=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getInflationRate",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,zc)))){e.next=6;break}throw new oc(n.error,"failed to get inflation rate");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return ue.apply(this,arguments)})},{key:"getEpochInfo",value:(se=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getEpochInfo",o);case 4:if(a=e.sent,!("error"in(s=ao(a,Pc)))){e.next=8;break}throw new oc(s.error,"failed to get epoch info");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return se.apply(this,arguments)})},{key:"getEpochSchedule",value:(ae=B(z().mark((function e(){var t,n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getEpochSchedule",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,Bc)))){e.next=6;break}throw new oc(n.error,"failed to get epoch schedule");case 6:return r=n.result,e.abrupt("return",new rc(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot));case 8:case"end":return e.stop()}}),e,this)}))),function(){return ae.apply(this,arguments)})},{key:"getLeaderSchedule",value:(oe=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getLeaderSchedule",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,Rc)))){e.next=6;break}throw new oc(n.error,"failed to get leader schedule");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return oe.apply(this,arguments)})},{key:"getMinimumBalanceForRentExemption",value:(ie=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t],n),e.next=3,this._rpcRequest("getMinimumBalanceForRentExemption",r);case 3:if(i=e.sent,!("error"in(o=ao(i,gl)))){e.next=8;break}return console.warn("Unable to fetch minimum balance for rent exemption"),e.abrupt("return",0);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return ie.apply(this,arguments)})},{key:"getRecentBlockhashAndContext",value:(re=B(z().mark((function e(t){var n,r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._buildArgs([],t),e.next=3,this._rpcRequest("getRecentBlockhash",n);case 3:if(r=e.sent,!("error"in(i=ao(r,Ql)))){e.next=7;break}throw new oc(i.error,"failed to get recent blockhash");case 7:return e.abrupt("return",i.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return re.apply(this,arguments)})},{key:"getRecentPerformanceSamples",value:(ne=B(z().mark((function e(t){var n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]);case 2:if(n=e.sent,!("error"in(r=ao(n,Vl)))){e.next=6;break}throw new oc(r.error,"failed to get recent performance samples");case 6:return e.abrupt("return",r.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return ne.apply(this,arguments)})},{key:"getFeeCalculatorForBlockhash",value:(te=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgs([t],n),e.next=3,this._rpcRequest("getFeeCalculatorForBlockhash",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Hl)))){e.next=7;break}throw new oc(o.error,"failed to get fee calculator");case 7:return a=o.result,s=a.context,u=a.value,e.abrupt("return",{context:s,value:null!==u?u.feeCalculator:null});case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"getFeeForMessage",value:(K=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Hs(t.serialize()).toString("base64"),i=this._buildArgs([r],n),e.next=4,this._rpcRequest("getFeeForMessage",i);case 4:if(o=e.sent,!("error"in(a=ao(o,vc(mo(yo())))))){e.next=8;break}throw new oc(a.error,"failed to get fee for message");case 8:if(null!==a.result){e.next=10;break}throw new Error("invalid blockhash");case 10:return e.abrupt("return",a.result);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"getRecentPrioritizationFees",value:(X=B(z().mark((function e(t){var n,r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null==t||null===(n=t.lockedWritableAccounts)||void 0===n?void 0:n.map((function(e){return e.toBase58()})),i=null!=r&&r.length?[r]:[],e.next=4,this._rpcRequest("getRecentPrioritizationFees",i);case 4:if(o=e.sent,!("error"in(a=ao(o,_c)))){e.next=8;break}throw new oc(a.error,"failed to get recent prioritization fees");case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"getRecentBlockhash",value:(J=B(z().mark((function e(t){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getRecentBlockhashAndContext(t);case 3:return n=e.sent,e.abrupt("return",n.value);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("failed to get recent blockhash: "+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e){return J.apply(this,arguments)})},{key:"getLatestBlockhash",value:(q=B(z().mark((function e(t){var n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getLatestBlockhashAndContext(t);case 3:return n=e.sent,e.abrupt("return",n.value);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("failed to get recent blockhash: "+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e){return q.apply(this,arguments)})},{key:"getLatestBlockhashAndContext",value:(G=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,void 0,i),e.next=4,this._rpcRequest("getLatestBlockhash",o);case 4:if(a=e.sent,!("error"in(s=ao(a,Yl)))){e.next=8;break}throw new oc(s.error,"failed to get latest blockhash");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"isBlockhashValid",value:(H=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgs([t],i,void 0,o),e.next=4,this._rpcRequest("isBlockhashValid",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Fl)))){e.next=8;break}throw new oc(u.error,"failed to determine if the blockhash `"+t+"`is valid");case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getVersion",value:(V=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getVersion",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(jc))))){e.next=6;break}throw new oc(n.error,"failed to get version");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return V.apply(this,arguments)})},{key:"getGenesisHash",value:(F=B(z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("getGenesisHash",[]);case 2:if(t=e.sent,!("error"in(n=ao(t,gc(wo()))))){e.next=6;break}throw new oc(n.error,"failed to get genesis hash");case 6:return e.abrupt("return",n.result);case 7:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"getBlock",value:(Y=B(z().mark((function e(t,n){var r,i,o,a,s,u,c,l,d;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,void 0,o),e.next=4,this._rpcRequest("getBlock",a);case 4:s=e.sent,e.prev=5,e.t0=null==o?void 0:o.transactionDetails,e.next="accounts"===e.t0?9:"none"===e.t0?13:17;break;case 9:if(!("error"in(u=ao(s,Ol)))){e.next=12;break}throw u.error;case 12:return e.abrupt("return",u.result);case 13:if(!("error"in(c=ao(s,Dl)))){e.next=16;break}throw c.error;case 16:return e.abrupt("return",c.result);case 17:if(!("error"in(l=ao(s,Cl)))){e.next=20;break}throw l.error;case 20:return d=l.result,e.abrupt("return",d?O(O({},d),{},{transactions:d.transactions.map((function(e){var t=e.transaction,n=e.meta,r=e.version;return{meta:n,transaction:O(O({},t),{},{message:bc(r,t.message)}),version:r}}))}):null);case 22:e.next=27;break;case 24:throw e.prev=24,e.t1=e.catch(5),new oc(e.t1,"failed to get confirmed block");case 27:case"end":return e.stop()}}),e,this,[[5,24]])}))),function(e,t){return Y.apply(this,arguments)})},{key:"getParsedBlock",value:(Q=B(z().mark((function e(t,n){var r,i,o,a,s,u,c,l;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,"jsonParsed",o),e.next=4,this._rpcRequest("getBlock",a);case 4:s=e.sent,e.prev=5,e.t0=null==o?void 0:o.transactionDetails,e.next="accounts"===e.t0?9:"none"===e.t0?13:17;break;case 9:if(!("error"in(u=ao(s,_l)))){e.next=12;break}throw u.error;case 12:return e.abrupt("return",u.result);case 13:if(!("error"in(c=ao(s,Pl)))){e.next=16;break}throw c.error;case 16:return e.abrupt("return",c.result);case 17:if(!("error"in(l=ao(s,zl)))){e.next=20;break}throw l.error;case 20:return e.abrupt("return",l.result);case 21:e.next=26;break;case 23:throw e.prev=23,e.t1=e.catch(5),new oc(e.t1,"failed to get block");case 26:case"end":return e.stop()}}),e,this,[[5,23]])}))),function(e,t){return Q.apply(this,arguments)})},{key:"getBlockProduction",value:(U=B(z().mark((function e(t){var n,r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t?r=t:t&&(i=t.commitment,o=Z(t,Ps),r=i,n=o),a=this._buildArgs([],r,"base64",n),e.next=4,this._rpcRequest("getBlockProduction",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Dc)))){e.next=8;break}throw new oc(u.error,"failed to get block production information");case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"getTransaction",value:(P=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,void 0,o),e.next=4,this._rpcRequest("getTransaction",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Ul)))){e.next=8;break}throw new oc(u.error,"failed to get transaction");case 8:if(c=u.result){e.next=11;break}return e.abrupt("return",c);case 11:return e.abrupt("return",O(O({},c),{},{transaction:O(O({},c.transaction),{},{message:bc(c.version,c.transaction.message)})}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getParsedTransaction",value:(D=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=this._buildArgsAtLeastConfirmed([t],i,"jsonParsed",o),e.next=4,this._rpcRequest("getTransaction",a);case 4:if(s=e.sent,!("error"in(u=ao(s,Wl)))){e.next=8;break}throw new oc(u.error,"failed to get transaction");case 8:return e.abrupt("return",u.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getParsedTransactions",value:(C=B(z().mark((function e(t,n){var r,i,o,a,s,u,c=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return{methodName:"getTransaction",args:c._buildArgsAtLeastConfirmed([e],i,"jsonParsed",o)}})),e.next=4,this._rpcBatchRequest(a);case 4:return s=e.sent,u=s.map((function(e){var t=ao(e,Wl);if("error"in t)throw new oc(t.error,"failed to get transactions");return t.result})),e.abrupt("return",u);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getTransactions",value:(j=B(z().mark((function e(t,n){var r,i,o,a,s,u,c=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fc(n),i=r.commitment,o=r.config,a=t.map((function(e){return{methodName:"getTransaction",args:c._buildArgsAtLeastConfirmed([e],i,void 0,o)}})),e.next=4,this._rpcBatchRequest(a);case 4:return s=e.sent,u=s.map((function(e){var t=ao(e,Ul);if("error"in t)throw new oc(t.error,"failed to get transactions");var n=t.result;return n?O(O({},n),{},{transaction:O(O({},n.transaction),{},{message:bc(n.version,n.transaction.message)})}):n})),e.abrupt("return",u);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"getConfirmedBlock",value:(S=B(z().mark((function e(t,n){var r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n),e.next=3,this._rpcRequest("getConfirmedBlock",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Bl)))){e.next=7;break}throw new oc(o.error,"failed to get confirmed block");case 7:if(a=o.result){e.next=10;break}throw new Error("Confirmed block "+t+" not found");case 10:return s=O(O({},a),{},{transactions:a.transactions.map((function(e){var t=e.transaction,n=e.meta,r=new yu(t.message);return{meta:n,transaction:O(O({},t),{},{message:r})}}))}),e.abrupt("return",O(O({},s),{},{transactions:s.transactions.map((function(e){var t=e.transaction;return{meta:e.meta,transaction:Au.populate(t.message,t.signatures)}}))}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getBlocks",value:(x=B(z().mark((function e(t,n,r){var i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed(void 0!==n?[t,n]:[t],r),e.next=3,this._rpcRequest("getBlocks",i);case 3:if(o=e.sent,!("error"in(a=ao(o,gc(lo(yo())))))){e.next=7;break}throw new oc(a.error,"failed to get blocks");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return x.apply(this,arguments)})},{key:"getBlockSignatures",value:(L=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n,void 0,{transactionDetails:"signatures",rewards:!1}),e.next=3,this._rpcRequest("getBlock",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Rl)))){e.next=7;break}throw new oc(o.error,"failed to get block");case 7:if(a=o.result){e.next=10;break}throw new Error("Block "+t+" not found");case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getConfirmedBlockSignatures",value:(k=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n,void 0,{transactionDetails:"signatures",rewards:!1}),e.next=3,this._rpcRequest("getConfirmedBlock",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Rl)))){e.next=7;break}throw new oc(o.error,"failed to get confirmed block");case 7:if(a=o.result){e.next=10;break}throw new Error("Confirmed block "+t+" not found");case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getConfirmedTransaction",value:(I=B(z().mark((function e(t,n){var r,i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n),e.next=3,this._rpcRequest("getConfirmedTransaction",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Ul)))){e.next=7;break}throw new oc(o.error,"failed to get transaction");case 7:if(a=o.result){e.next=10;break}return e.abrupt("return",a);case 10:return s=new yu(a.transaction.message),u=a.transaction.signatures,e.abrupt("return",O(O({},a),{},{transaction:Au.populate(s,u)}));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getParsedConfirmedTransaction",value:(T=B(z().mark((function e(t,n){var r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed"),e.next=3,this._rpcRequest("getConfirmedTransaction",r);case 3:if(i=e.sent,!("error"in(o=ao(i,Wl)))){e.next=7;break}throw new oc(o.error,"failed to get confirmed transaction");case 7:return e.abrupt("return",o.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getParsedConfirmedTransactions",value:(N=B(z().mark((function e(t,n){var r,i,o,a=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.map((function(e){return{methodName:"getConfirmedTransaction",args:a._buildArgsAtLeastConfirmed([e],n,"jsonParsed")}})),e.next=3,this._rpcBatchRequest(r);case 3:return i=e.sent,o=i.map((function(e){var t=ao(e,Wl);if("error"in t)throw new oc(t.error,"failed to get confirmed transactions");return t.result})),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress",value:(E=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={},e.next=3,this.getFirstAvailableBlock();case 3:o=e.sent;case 4:if("until"in i){e.next=24;break}if(!(--n<=0||n<o)){e.next=8;break}return e.abrupt("break",24);case 8:return e.prev=8,e.next=11,this.getConfirmedBlockSignatures(n,"finalized");case 11:(a=e.sent).signatures.length>0&&(i.until=a.signatures[a.signatures.length-1].toString()),e.next=22;break;case 15:if(e.prev=15,e.t0=e.catch(8),!(e.t0 instanceof Error&&e.t0.message.includes("skipped"))){e.next=21;break}return e.abrupt("continue",4);case 21:throw e.t0;case 22:e.next=4;break;case 24:return e.next=26,this.getSlot("finalized");case 26:s=e.sent;case 27:if("before"in i){e.next=47;break}if(!(++r>s)){e.next=31;break}return e.abrupt("break",47);case 31:return e.prev=31,e.next=34,this.getConfirmedBlockSignatures(r);case 34:(u=e.sent).signatures.length>0&&(i.before=u.signatures[u.signatures.length-1].toString()),e.next=45;break;case 38:if(e.prev=38,e.t1=e.catch(31),!(e.t1 instanceof Error&&e.t1.message.includes("skipped"))){e.next=44;break}return e.abrupt("continue",27);case 44:throw e.t1;case 45:e.next=27;break;case 47:return e.next=49,this.getConfirmedSignaturesForAddress2(t,i);case 49:return c=e.sent,e.abrupt("return",c.map((function(e){return e.signature})));case 51:case"end":return e.stop()}}),e,this,[[8,15],[31,38]])}))),function(e,t,n){return E.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress2",value:(A=B(z().mark((function e(t,n,r){var i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",i);case 3:if(o=e.sent,!("error"in(a=ao(o,el)))){e.next=7;break}throw new oc(a.error,"failed to get confirmed signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return A.apply(this,arguments)})},{key:"getSignaturesForAddress",value:(M=B(z().mark((function e(t,n,r){var i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getSignaturesForAddress",i);case 3:if(o=e.sent,!("error"in(a=ao(o,tl)))){e.next=7;break}throw new oc(a.error,"failed to get signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return M.apply(this,arguments)})},{key:"getAddressLookupTable",value:(b=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=new uc({key:t,state:uc.deserialize(o.data)})),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getNonceAndContext",value:(w=B(z().mark((function e(t,n){var r,i,o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=Yu.fromAccountData(o.data)),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getNonce",value:(v=B(z().mark((function e(t,n){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNonceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"requestAirdrop",value:(g=B(z().mark((function e(t,n){var r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("requestAirdrop",[t.toBase58(),n]);case 2:if(r=e.sent,!("error"in(i=ao(r,Gl)))){e.next=6;break}throw new oc(i.error,"airdrop to ".concat(t.toBase58()," failed"));case 6:return e.abrupt("return",i.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_blockhashWithExpiryBlockHeight",value:(y=B(z().mark((function e(t){var n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=10;break}case 1:if(!this._pollingBlockhash){e.next=6;break}return e.next=4,_u(100);case 4:e.next=1;break;case 6:if(n=Date.now()-this._blockhashInfo.lastFetch,r=n>=3e4,null===this._blockhashInfo.latestBlockhash||r){e.next=10;break}return e.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return e.next=12,this._pollNewBlockhash();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"_pollNewBlockhash",value:(m=B(z().mark((function e(){var t,n,r,i,o;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null,i=0;case 6:if(!(i<50)){e.next=18;break}return e.next=9,this.getLatestBlockhash("finalized");case 9:if(o=e.sent,r===o.blockhash){e.next=13;break}return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",o);case 13:return e.next=15,_u(200);case 15:i++,e.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 19:return e.prev=19,this._pollingBlockhash=!1,e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[1,,19,22]])}))),function(){return m.apply(this,arguments)})},{key:"getStakeMinimumDelegation",value:(f=B(z().mark((function e(t){var n,r,i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=fc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,"base64",i),e.next=4,this._rpcRequest("getStakeMinimumDelegation",o);case 4:if(a=e.sent,!("error"in(s=ao(a,vc(yo()))))){e.next=8;break}throw new oc(s.error,"failed to get stake minimum delegation");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"simulateTransaction",value:(p=B(z().mark((function e(t,n,r){var i,o,a,s,u,c,l,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T,I,k,L,x;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("message"in t)){e.next=17;break}if(i=t.serialize(),o=Ee.from(i).toString("base64"),!Array.isArray(n)&&void 0===r){e.next=6;break}throw new Error("Invalid arguments");case 6:return(a=n||{}).encoding="base64","commitment"in a||(a.commitment=this.commitment),s=[o,a],e.next=12,this._rpcRequest("simulateTransaction",s);case 12:if(u=e.sent,!("error"in(c=ao(u,Cc)))){e.next=16;break}throw new Error("failed to simulate transaction: "+c.error.message);case 16:return e.abrupt("return",c.result);case 17:if(t instanceof Au?(d=t,(l=new Au).feePayer=d.feePayer,l.instructions=t.instructions,l.nonceInfo=d.nonceInfo,l.signatures=d.signatures):(l=Au.populate(t))._message=l._json=void 0,void 0===n||Array.isArray(n)){e.next=20;break}throw new Error("Invalid arguments");case 20:if(h=n,!l.nonceInfo||!h){e.next=25;break}(p=l).sign.apply(p,ee(h)),e.next=45;break;case 25:f=this._disableBlockhashCaching;case 26:return e.next=28,this._blockhashWithExpiryBlockHeight(f);case 28:if(y=e.sent,l.lastValidBlockHeight=y.lastValidBlockHeight,l.recentBlockhash=y.blockhash,h){e.next=33;break}return e.abrupt("break",45);case 33:if((m=l).sign.apply(m,ee(h)),l.signature){e.next=36;break}throw new Error("!signature");case 36:if(g=l.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(g)||this._blockhashInfo.transactionSignatures.includes(g)){e.next=42;break}return this._blockhashInfo.simulatedSignatures.push(g),e.abrupt("break",45);case 42:f=!0;case 43:e.next=26;break;case 45:return v=l._compile(),w=v.serialize(),b=l._serialize(w),M=b.toString("base64"),A={encoding:"base64",commitment:this.commitment},r&&(E=(Array.isArray(r)?r:v.nonProgramIds()).map((function(e){return e.toBase58()})),A.accounts={encoding:"base64",addresses:E}),h&&(A.sigVerify=!0),N=[M,A],e.next=55,this._rpcRequest("simulateTransaction",N);case 55:if(T=e.sent,!("error"in(I=ao(T,Cc)))){e.next=60;break}throw"data"in I.error&&(k=I.error.data.logs)&&Array.isArray(k)&&(x=(L="\n ")+k.join(L),console.error(I.error.message,x)),new ic("failed to simulate transaction: "+I.error.message,k);case 60:return e.abrupt("return",I.result);case 61:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"sendTransaction",value:(h=B(z().mark((function e(t,n,r){var i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("version"in t)){e.next=7;break}if(!n||!Array.isArray(n)){e.next=3;break}throw new Error("Invalid arguments");case 3:return i=t.serialize(),e.next=6,this.sendRawTransaction(i,n);case 6:return e.abrupt("return",e.sent);case 7:if(void 0!==n&&Array.isArray(n)){e.next=9;break}throw new Error("Invalid arguments");case 9:if(o=n,!t.nonceInfo){e.next=14;break}t.sign.apply(t,ee(o)),e.next=32;break;case 14:a=this._disableBlockhashCaching;case 15:return e.next=17,this._blockhashWithExpiryBlockHeight(a);case 17:if(s=e.sent,t.lastValidBlockHeight=s.lastValidBlockHeight,t.recentBlockhash=s.blockhash,t.sign.apply(t,ee(o)),t.signature){e.next=23;break}throw new Error("!signature");case 23:if(u=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(u)){e.next=29;break}return this._blockhashInfo.transactionSignatures.push(u),e.abrupt("break",32);case 29:a=!0;case 30:e.next=15;break;case 32:return c=t.serialize(),e.next=35,this.sendRawTransaction(c,r);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:(d=B(z().mark((function e(t,n){var r,i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Hs(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendEncodedTransaction",value:(l=B(z().mark((function e(t,n){var r,i,o,a,s,u,c;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={encoding:"base64"},i=n&&n.skipPreflight,o=n&&n.preflightCommitment||this.commitment,n&&null!=n.maxRetries&&(r.maxRetries=n.maxRetries),n&&null!=n.minContextSlot&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),o&&(r.preflightCommitment=o),a=[t,r],e.next=10,this._rpcRequest("sendTransaction",a);case 10:if(s=e.sent,!("error"in(u=ao(s,ql)))){e.next=15;break}throw"data"in u.error&&(c=u.error.data.logs),new ic("failed to send transaction: "+u.error.message,c);case 15:return e.abrupt("return",u.result);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){B(z().mark((function t(){return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._rpcWebSocket.notify("ping");case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){var t=this;this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((function(e){var n=$(e,2),r=n[0],i=n[1];t._setSubscription(r,O(O({},i),{},{state:"pending"}))}))):this._updateSubscriptions()}},{key:"_setSubscription",value:function(e,t){var n,r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){var i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach((function(e){try{e(t.state)}catch(e){}}))}}},{key:"_onSubscriptionStateChange",value:function(e,t){var n,r=this,i=this._subscriptionHashByClientSubscriptionId[e];if(null==i)return function(){};var o=(n=this._subscriptionStateChangeCallbacksByHash)[i]||(n[i]=new Set);return o.add(t),function(){o.delete(t),0===o.size&&delete r._subscriptionStateChangeCallbacksByHash[i]}}},{key:"_updateSubscriptions",value:(c=B(z().mark((function e(){var t,n,r=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Object.keys(this._subscriptionsByHash).length){e.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){r._rpcWebSocketIdleTimeout=null;try{r._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)),e.abrupt("return");case 3:if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){e.next=7;break}return this._rpcWebSocket.connect(),e.abrupt("return");case 7:return t=this._rpcWebSocketGeneration,n=function(){return t===r._rpcWebSocketGeneration},e.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var e=B(z().mark((function e(t){var i;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=r._subscriptionsByHash[t])){e.next=3;break}return e.abrupt("return");case 3:e.t0=i.state,e.next="pending"===e.t0||"unsubscribed"===e.t0?6:"subscribed"===e.t0?15:19;break;case 6:if(0!==i.callbacks.size){e.next=12;break}return delete r._subscriptionsByHash[t],"unsubscribed"===i.state&&delete r._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],e.next=11,r._updateSubscriptions();case 11:return e.abrupt("return");case 12:return e.next=14,B(z().mark((function e(){var o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.args,a=i.method,e.prev=1,r._setSubscription(t,O(O({},i),{},{state:"subscribing"})),e.next=5,r._rpcWebSocket.call(a,o);case 5:return s=e.sent,r._setSubscription(t,O(O({},i),{},{serverSubscriptionId:s,state:"subscribed"})),r._subscriptionCallbacksByServerSubscriptionId[s]=i.callbacks,e.next=10,r._updateSubscriptions();case 10:e.next=20;break;case 12:if(e.prev=12,e.t0=e.catch(1),e.t0 instanceof Error&&console.error("".concat(a," error for argument"),o,e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,O(O({},i),{},{state:"pending"})),e.next=20,r._updateSubscriptions();case 20:case"end":return e.stop()}}),e,null,[[1,12]])})))();case 14:case 18:return e.abrupt("break",19);case 15:if(0!==i.callbacks.size){e.next=18;break}return e.next=18,B(z().mark((function e(){var o,a;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.serverSubscriptionId,a=i.unsubscribeMethod,!r._subscriptionsAutoDisposedByRpc.has(o)){e.next=5;break}r._subscriptionsAutoDisposedByRpc.delete(o),e.next=21;break;case 5:return r._setSubscription(t,O(O({},i),{},{state:"unsubscribing"})),r._setSubscription(t,O(O({},i),{},{state:"unsubscribing"})),e.prev=7,e.next=10,r._rpcWebSocket.call(a,[o]);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),e.t0 instanceof Error&&console.error("".concat(a," error:"),e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,O(O({},i),{},{state:"subscribed"})),e.next=20,r._updateSubscriptions();case 20:return e.abrupt("return");case 21:return r._setSubscription(t,O(O({},i),{},{state:"unsubscribed"})),e.next=24,r._updateSubscriptions();case 24:case"end":return e.stop()}}),e,null,[[7,12]])})))();case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_handleServerNotification",value:function(e,t){var n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((function(e){try{e.apply(void 0,ee(t))}catch(e){console.error(e)}}))}},{key:"_wsOnAccountNotification",value:function(e){var t=ao(e,nl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_makeSubscription",value:function(e,t){var n=this,r=this._nextClientSubscriptionId++,i=tc([e.method,t],!0),o=this._subscriptionsByHash[i];return void 0===o?this._subscriptionsByHash[i]=O(O({},e),{},{args:t,callbacks:new Set([e.callback]),state:"pending"}):o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=B(z().mark((function t(){var o;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete n._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete n._subscriptionHashByClientSubscriptionId[r],fu(void 0!==(o=n._subscriptionsByHash[i]),"Could not find a `Subscription` when tearing down client subscription #".concat(r)),o.callbacks.delete(e.callback),t.next=7,n._updateSubscriptions();case 7:case"end":return t.stop()}}),t)}))),this._updateSubscriptions(),r}},{key:"onAccountChange",value:function(e,t,n){var r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}},{key:"removeAccountChangeListener",value:(u=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_wsOnProgramAccountNotification",value:function(e){var t=ao(e,il),n=t.result,r=t.subscription;this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}},{key:"onProgramAccountChange",value:function(e,t,n,r){var i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}},{key:"removeProgramAccountChangeListener",value:(s=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"program account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"onLogs",value:function(e,t,n){var r=this._buildArgs(["object"===_(e)?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}},{key:"removeOnLogsListener",value:(a=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"logs");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_wsOnLogsNotification",value:function(e){var t=ao(e,Jl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_wsOnSlotNotification",value:function(e){var t=ao(e,al),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotChange",value:function(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:(o=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_wsOnSlotUpdatesNotification",value:function(e){var t=ao(e,ul),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotUpdate",value:function(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:(i=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot update");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_unsubscribeClientSubscription",value:(r=B(z().mark((function e(t,n){var r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t])){e.next=6;break}return e.next=4,r();case 4:e.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(t,"` for '").concat(n,"' events ")+"could not be found.");case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var o={};n&&(o.encoding=n),i&&(o.commitment=i),r&&(o=Object.assign(o,r)),e.push(o)}return e}},{key:"_buildArgsAtLeastConfirmed",value:function(e,t,n,r){var i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}},{key:"_wsOnSignatureNotification",value:function(e){var t=ao(e,cl),n=t.result,r=t.subscription;"receivedSignature"!==n.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===n.value?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}},{key:"onSignature",value:function(e,t,n){var r=this,i=this._buildArgs([e],n||this._commitment||"finalized"),o=this._makeSubscription({callback:function(e,n){if("status"===e.type){t(e.result,n);try{r.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return o}},{key:"onSignatureWithOptions",value:function(e,t,n){var r=this,i=O(O({},n),{},{commitment:n&&n.commitment||this._commitment||"finalized"}),o=i.commitment,a=Z(i,Bs),s=this._buildArgs([e],o,void 0,a),u=this._makeSubscription({callback:function(e,n){t(e,n);try{r.removeSignatureListener(u)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return u}},{key:"removeSignatureListener",value:(n=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"signature result");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_wsOnRootNotification",value:function(e){var t=ao(e,ll),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onRootChange",value:function(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:(t=B(z().mark((function e(t){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"root change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),$l=function(){function e(t){R(this,e),this._keypair=void 0,this._keypair=null!=t?t:Us()}return W(e,[{key:"publicKey",get:function(){return new Ks(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new e(Us())}},{key:"fromSecretKey",value:function(t,n){if(64!==t.byteLength)throw new Error("bad secret key size");var r=t.slice(32,64);if(!n||!n.skipValidation)for(var i=t.slice(0,32),o=Ws(i),a=0;a<32;a++)if(r[a]!==o[a])throw new Error("provided secretKey is invalid");return new e({publicKey:r,secretKey:t})}},{key:"fromSeed",value:function(t){var n=Ws(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}}]),e}(),ed=Object.freeze({CreateLookupTable:{index:0,layout:Qi([Ri("instruction"),Fu("recentSlot"),Pi("bumpSeed")])},FreezeLookupTable:{index:1,layout:Qi([Ri("instruction")])},ExtendLookupTable:{index:2,layout:Qi([Ri("instruction"),Fu(),Yi(uu(),_i(Ri(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Qi([Ri("instruction")])},CloseLookupTable:{index:4,layout:Qi([Ri("instruction")])}}),td=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(ed);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return t}},{key:"decodeCreateLookupTable",value:function(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);var t=Bu(ed.CreateLookupTable,e.data).recentSlot;return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}},{key:"decodeExtendLookupTable",value:function(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error("invalid instruction; found ".concat(e.keys.length," keys, expected at least 2"));var t=Bu(ed.ExtendLookupTable,e.data).addresses;return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map((function(e){return new Ks(e)}))}}},{key:"decodeCloseLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(nd.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),nd=function(){function e(){R(this,e)}return W(e,null,[{key:"createLookupTable",value:function(e){var t=$(Ks.findProgramAddressSync([e.authority.toBuffer(),Gi(BigInt(e.recentSlot),8)],this.programId),2),n=t[0],r=t[1],i=Pu(ed.CreateLookupTable,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Gu.programId,isSigner:!1,isWritable:!1}];return[new Mu({programId:this.programId,keys:o,data:i}),n]}},{key:"freezeLookupTable",value:function(e){var t=Pu(ed.FreezeLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Mu({programId:this.programId,keys:n,data:t})}},{key:"extendLookupTable",value:function(e){var t=Pu(ed.ExtendLookupTable,{addresses:e.addresses.map((function(e){return e.toBytes()}))}),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&n.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Gu.programId,isSigner:!1,isWritable:!1}),new Mu({programId:this.programId,keys:n,data:t})}},{key:"deactivateLookupTable",value:function(e){var t=Pu(ed.DeactivateLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Mu({programId:this.programId,keys:n,data:t})}},{key:"closeLookupTable",value:function(e){var t=Pu(ed.CloseLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Mu({programId:this.programId,keys:n,data:t})}}]),e}();nd.programId=new Ks("AddressLookupTab1e1111111111111111111111111");var rd=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Pi("instruction").decode(e.data),r=0,i=Object.entries(id);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return t}},{key:"decodeRequestUnits",value:function(e){this.checkProgramId(e.programId);var t=Bu(id.RequestUnits,e.data);return{units:t.units,additionalFee:t.additionalFee}}},{key:"decodeRequestHeapFrame",value:function(e){return this.checkProgramId(e.programId),{bytes:Bu(id.RequestHeapFrame,e.data).bytes}}},{key:"decodeSetComputeUnitLimit",value:function(e){return this.checkProgramId(e.programId),{units:Bu(id.SetComputeUnitLimit,e.data).units}}},{key:"decodeSetComputeUnitPrice",value:function(e){return this.checkProgramId(e.programId),{microLamports:Bu(id.SetComputeUnitPrice,e.data).microLamports}}},{key:"checkProgramId",value:function(e){if(!e.equals(od.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}]),e}(),id=Object.freeze({RequestUnits:{index:0,layout:Qi([Pi("instruction"),Ri("units"),Ri("additionalFee")])},RequestHeapFrame:{index:1,layout:Qi([Pi("instruction"),Ri("bytes")])},SetComputeUnitLimit:{index:2,layout:Qi([Pi("instruction"),Ri("units")])},SetComputeUnitPrice:{index:3,layout:Qi([Pi("instruction"),Fu("microLamports")])}}),od=function(){function e(){R(this,e)}return W(e,null,[{key:"requestUnits",value:function(e){var t=Pu(id.RequestUnits,e);return new Mu({keys:[],programId:this.programId,data:t})}},{key:"requestHeapFrame",value:function(e){var t=Pu(id.RequestHeapFrame,e);return new Mu({keys:[],programId:this.programId,data:t})}},{key:"setComputeUnitLimit",value:function(e){var t=Pu(id.SetComputeUnitLimit,e);return new Mu({keys:[],programId:this.programId,data:t})}},{key:"setComputeUnitPrice",value:function(e){var t=Pu(id.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new Mu({keys:[],programId:this.programId,data:t})}}]),e}();od.programId=new Ks("ComputeBudget111111111111111111111111111111");var ad=Qi([Pi("numSignatures"),Pi("padding"),Bi("signatureOffset"),Bi("signatureInstructionIndex"),Bi("publicKeyOffset"),Bi("publicKeyInstructionIndex"),Bi("messageDataOffset"),Bi("messageDataSize"),Bi("messageInstructionIndex")]),sd=function(){function e(){R(this,e)}return W(e,null,[{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.instructionIndex;fu(32===n.length,"Public Key must be ".concat(32," bytes but received ").concat(n.length," bytes")),fu(64===i.length,"Signature must be ".concat(64," bytes but received ").concat(i.length," bytes"));var a=ad.span,s=a+n.length,u=s+i.length,c=Ee.alloc(u+r.length),l=null==o?65535:o;return ad.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:l,publicKeyOffset:a,publicKeyInstructionIndex:l,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:l},c),c.fill(n,a),c.fill(i,s),c.fill(r,u),new Mu({keys:[],programId:e.programId,data:c})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;fu(64===t.length,"Private key must be ".concat(64," bytes but received ").concat(t.length," bytes"));try{var i=$l.fromSecretKey(t),o=i.publicKey.toBytes(),a=Fs(n,i.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:a,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();sd.programId=new Ks("Ed25519SigVerify111111111111111111111111111");Os.utils.isValidPrivateKey;var ud,cd=Os.getPublicKey,ld=Qi([Pi("numSignatures"),Bi("signatureOffset"),Pi("signatureInstructionIndex"),Bi("ethAddressOffset"),Pi("ethAddressInstructionIndex"),Bi("messageDataOffset"),Bi("messageDataSize"),Pi("messageInstructionIndex"),Fi(20,"ethAddress"),Fi(64,"signature"),Pi("recoveryId")]),dd=function(){function e(){R(this,e)}return W(e,null,[{key:"publicKeyToEthAddress",value:function(e){fu(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return Ee.from(fs(Hs(e))).slice(-20)}catch(e){throw new Error("Error constructing Ethereum address: ".concat(e))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.recoveryId,a=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,i=t.message,o=t.signature,a=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;fu(20===(n="string"==typeof r?r.startsWith("0x")?Ee.from(r.substr(2),"hex"):Ee.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,l=c+o.length+1,d=Ee.alloc(ld.span+i.length);return ld.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:u,signature:Hs(o),ethAddress:Hs(n),recoveryId:a},d),d.fill(Hs(i),ld.span),new Mu({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;fu(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var i=Hs(t),o=cd(i,!1).slice(1),a=function(e,t){var n=Os.sign(e,t);return[n.toCompactRawBytes(),n.recovery]}(Ee.from(fs(Hs(n))),i),s=$(a,2),u=s[0],c=s[1];return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();dd.programId=new Ks("KeccakSecp256k11111111111111111111111111111");var hd=new Ks("StakeConfig11111111111111111111111111111111"),pd=W((function e(t,n){R(this,e),this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=n})),fd=W((function e(t,n,r){R(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));ud=fd,fd.default=new ud(0,0,Ks.default);var md=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(yd);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a StakeInstruction");return t}},{key:"decodeInitialize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(yd.Initialize,e.data),n=t.authorized,r=t.lockup;return{stakePubkey:e.keys[0].pubkey,authorized:new pd(new Ks(n.staker),new Ks(n.withdrawer)),lockup:new fd(r.unixTimestamp,r.epoch,new Ks(r.custodian))}}},{key:"decodeDelegate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),Bu(yd.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}},{key:"decodeAuthorize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(yd.Authorize,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Ks(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(i.custodianPubkey=e.keys[3].pubkey),i}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Bu(yd.AuthorizeWithSeed,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i=t.authoritySeed,o=t.authorityOwner,a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new Ks(o),newAuthorizedPubkey:new Ks(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}},{key:"decodeSplit",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(yd.Split,e.data).lamports;return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}},{key:"decodeMerge",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Bu(yd.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Bu(yd.Withdraw,e.data).lamports,n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}},{key:"decodeDeactivate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Bu(yd.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(vd.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),yd=Object.freeze({Initialize:{index:0,layout:Qi([Ri("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"authorized";return Qi([uu("staker"),uu("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return Qi([Wi("unixTimestamp"),Wi("epoch"),uu("custodian")],e)}()])},Authorize:{index:1,layout:Qi([Ri("instruction"),uu("newAuthorized"),Ri("stakeAuthorizationType")])},Delegate:{index:2,layout:Qi([Ri("instruction")])},Split:{index:3,layout:Qi([Ri("instruction"),Wi("lamports")])},Withdraw:{index:4,layout:Qi([Ri("instruction"),Wi("lamports")])},Deactivate:{index:5,layout:Qi([Ri("instruction")])},Merge:{index:7,layout:Qi([Ri("instruction")])},AuthorizeWithSeed:{index:8,layout:Qi([Ri("instruction"),uu("newAuthorized"),Ri("stakeAuthorizationType"),lu("authoritySeed"),uu("authorityOwner")])}}),gd=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),vd=function(){function e(){R(this,e)}return W(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||fd.default,i=Pu(yd.Initialize,{authorized:{staker:Hs(n.staker.toBuffer()),withdrawer:Hs(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:Hs(r.custodian.toBuffer())}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:xu,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Mu(o)}},{key:"createAccountWithSeed",value:function(e){var t=new Au;t.add(Gu.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new Au;t.add(Gu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Pu(yd.Delegate);return(new Au).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:Du,isSigner:!1,isWritable:!1},{pubkey:hd,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,o=e.custodianPubkey,a=Pu(yd.Authorize,{newAuthorized:Hs(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Au).add({keys:s,programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,o=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,s=e.custodianPubkey,u=Pu(yd.AuthorizeWithSeed,{newAuthorized:Hs(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:Hs(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Tu,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new Au).add({keys:c,programId:this.programId,data:u})}},{key:"splitInstruction",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,o=Pu(yd.Split,{lamports:i});return new Mu({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"split",value:function(e){var t=new Au;return t.add(Gu.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}},{key:"splitWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.basePubkey,o=e.seed,a=e.lamports,s=new Au;return s.add(Gu.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,i=Pu(yd.Merge);return(new Au).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:Du,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,o=e.custodianPubkey,a=Pu(yd.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:Du,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Au).add({keys:s,programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Pu(yd.Deactivate);return(new Au).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}();vd.programId=new Ks("Stake11111111111111111111111111111111111111"),vd.space=200;var wd=W((function e(t,n,r,i){R(this,e),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i})),bd=function(){function e(){R(this,e)}return W(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Ri("instruction").decode(e.data),r=0,i=Object.entries(Md);r<i.length;r++){var o=$(i[r],2),a=o[0];if(o[1].index==n){t=a;break}}if(!t)throw new Error("Instruction type incorrect; not a VoteInstruction");return t}},{key:"decodeInitializeAccount",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);var t=Bu(Md.InitializeAccount,e.data).voteInit;return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new wd(new Ks(t.nodePubkey),new Ks(t.authorizedVoter),new Ks(t.authorizedWithdrawer),t.commission)}}},{key:"decodeAuthorize",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Md.Authorize,e.data),n=t.newAuthorized,r=t.voteAuthorizationType;return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Ks(n),voteAuthorizationType:{index:r}}}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Md.AuthorizeWithSeed,e.data).voteAuthorizeWithSeedArgs,n=t.currentAuthorityDerivedKeyOwnerPubkey,r=t.currentAuthorityDerivedKeySeed,i=t.newAuthorized,o=t.voteAuthorizationType;return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Ks(n),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new Ks(i),voteAuthorizationType:{index:o},votePubkey:e.keys[0].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Bu(Md.Withdraw,e.data).lamports;return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(Ed.programId))throw new Error("invalid instruction; programId is not VoteProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length<t)throw new Error("invalid instruction; found ".concat(e.length," keys, expected at least ").concat(t))}}]),e}(),Md=Object.freeze({InitializeAccount:{index:0,layout:Qi([Ri("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteInit";return Qi([uu("nodePubkey"),uu("authorizedVoter"),uu("authorizedWithdrawer"),Pi("commission")],e)}()])},Authorize:{index:1,layout:Qi([Ri("instruction"),uu("newAuthorized"),Ri("voteAuthorizationType")])},Withdraw:{index:3,layout:Qi([Ri("instruction"),Wi("lamports")])},AuthorizeWithSeed:{index:10,layout:Qi([Ri("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return Qi([Ri("voteAuthorizationType"),uu("currentAuthorityDerivedKeyOwnerPubkey"),lu("currentAuthorityDerivedKeySeed"),uu("newAuthorized")],e)}()])}}),Ad=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Ed=function(){function e(){R(this,e)}return W(e,null,[{key:"initializeAccount",value:function(e){var t=e.votePubkey,n=e.nodePubkey,r=e.voteInit,i=Pu(Md.InitializeAccount,{voteInit:{nodePubkey:Hs(r.nodePubkey.toBuffer()),authorizedVoter:Hs(r.authorizedVoter.toBuffer()),authorizedWithdrawer:Hs(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:xu,isSigner:!1,isWritable:!1},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Mu(o)}},{key:"createAccount",value:function(e){var t=new Au;return t.add(Gu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}},{key:"authorize",value:function(e){var t=e.votePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.voteAuthorizationType,o=Pu(Md.Authorize,{newAuthorized:Hs(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Au).add({keys:a,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.currentAuthorityDerivedKeyBasePubkey,n=e.currentAuthorityDerivedKeyOwnerPubkey,r=e.currentAuthorityDerivedKeySeed,i=e.newAuthorizedPubkey,o=e.voteAuthorizationType,a=e.votePubkey,s=Pu(Md.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Hs(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:Hs(i.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Tu,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new Au).add({keys:u,programId:this.programId,data:s})}},{key:"withdraw",value:function(e){var t=e.votePubkey,n=e.authorizedWithdrawerPubkey,r=e.lamports,i=e.toPubkey,o=Pu(Md.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Au).add({keys:a,programId:this.programId,data:o})}},{key:"safeWithdraw",value:function(t,n,r){if(t.lamports>n-r)throw new Error("Withdraw will leave vote account with insuffcient funds.");return e.withdraw(t)}}]),e}();Ed.programId=new Ks("Vote111111111111111111111111111111111111111"),Ed.space=3731;var Nd=new Ks("Va1idator1nfo111111111111111111111111111111"),Td=Mo({name:wo(),website:go(wo()),details:go(wo()),keybaseUsername:go(wo())}),Id=function(){function e(t,n){R(this,e),this.key=void 0,this.info=void 0,this.key=t,this.info=n}return W(e,null,[{key:"fromConfigData",value:function(t){var n=ee(t);if(2!==hu(n))return null;for(var r=[],i=0;i<2;i++){var o=new Ks(n.slice(0,Js)),a=1===(n=n.slice(Js)).slice(0,1)[0];n=n.slice(1),r.push({publicKey:o,isSigner:a})}if(r[0].publicKey.equals(Nd)&&r[1].isSigner){var s=lu().decode(Ee.from(n)),u=JSON.parse(s);return oo(u,Td),new e(r[1].publicKey,u)}return null}}]),e}(),kd=new Ks("Vote111111111111111111111111111111111111111"),Ld=Qi([uu("nodePubkey"),uu("authorizedWithdrawer"),Pi("commission"),Ui(),Yi(Qi([Ui("slot"),Ri("confirmationCount")]),_i(Ri(),-8),"votes"),Pi("rootSlotValid"),Ui("rootSlot"),Ui(),Yi(Qi([Ui("epoch"),uu("authorizedVoter")]),_i(Ri(),-8),"authorizedVoters"),Qi([Yi(Qi([uu("authorizedPubkey"),Ui("epochOfLastAuthorizedSwitch"),Ui("targetEpoch")]),32,"buf"),Ui("idx"),Pi("isEmpty")],"priorVoters"),Ui(),Yi(Qi([Ui("epoch"),Ui("credits"),Ui("prevCredits")]),_i(Ri(),-8),"epochCredits"),Qi([Ui("slot"),Ui("timestamp")],"lastTimestamp")]),xd=function(){function e(t){R(this,e),this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}return W(e,null,[{key:"fromAccountData",value:function(t){var n=Ld.decode(Hs(t),4),r=n.rootSlot;return n.rootSlotValid||(r=null),new e({nodePubkey:new Ks(n.nodePubkey),authorizedWithdrawer:new Ks(n.authorizedWithdrawer),commission:n.commission,votes:n.votes,rootSlot:r,authorizedVoters:n.authorizedVoters.map(Sd),priorVoters:Cd(n.priorVoters),epochCredits:n.epochCredits,lastTimestamp:n.lastTimestamp})}}]),e}();function Sd(e){var t=e.authorizedVoter;return{epoch:e.epoch,authorizedVoter:new Ks(t)}}function jd(e){var t=e.authorizedPubkey,n=e.epochOfLastAuthorizedSwitch,r=e.targetEpoch;return{authorizedPubkey:new Ks(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function Cd(e){var t=e.buf,n=e.idx;return e.isEmpty?[]:[].concat(ee(t.slice(n+1).map(jd)),ee(t.slice(0,n).map(jd)))}var Dd={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function Od(){return Od=B(z().mark((function e(t,n,r,i){var o,a,s,u,c,l,d;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,a=i):a=r,s=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment,minContextSlot:a.minContextSlot},e.next=4,t.sendRawTransaction(n,s);case 4:return u=e.sent,c=a&&a.commitment,l=o?t.confirmTransaction(o,c):t.confirmTransaction(u,c),e.next=9,l;case 9:if(!(d=e.sent.value).err){e.next=12;break}throw new Error("Raw transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}}),e)}))),Od.apply(this,arguments)}var zd=Object.freeze({__proto__:null,Account:$s,AddressLookupTableAccount:uc,AddressLookupTableInstruction:td,AddressLookupTableProgram:nd,Authorized:pd,BLOCKHASH_CACHE_TIMEOUT_MS:3e4,BPF_LOADER_DEPRECATED_PROGRAM_ID:eu,BPF_LOADER_PROGRAM_ID:Zu,BpfLoader:Ju,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:id,ComputeBudgetInstruction:rd,ComputeBudgetProgram:od,Connection:Kl,Ed25519Program:sd,Enum:qs,EpochSchedule:rc,FeeCalculatorLayout:Uu,Keypair:$l,LAMPORTS_PER_SOL:1e9,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:ed,Loader:qu,Lockup:fd,MAX_SEED_LENGTH:32,Message:yu,MessageAccountKeys:su,MessageV0:gu,NONCE_ACCOUNT_LENGTH:Qu,NonceAccount:Yu,PACKET_DATA_SIZE:tu,PUBLIC_KEY_LENGTH:Js,PublicKey:Ks,SIGNATURE_LENGTH_IN_BYTES:ru,SOLANA_SCHEMA:Zs,STAKE_CONFIG_ID:hd,STAKE_INSTRUCTION_LAYOUTS:yd,SYSTEM_INSTRUCTION_LAYOUTS:Hu,SYSVAR_CLOCK_PUBKEY:Tu,SYSVAR_EPOCH_SCHEDULE_PUBKEY:Iu,SYSVAR_INSTRUCTIONS_PUBKEY:ku,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Lu,SYSVAR_RENT_PUBKEY:xu,SYSVAR_REWARDS_PUBKEY:Su,SYSVAR_SLOT_HASHES_PUBKEY:ju,SYSVAR_SLOT_HISTORY_PUBKEY:Cu,SYSVAR_STAKE_HISTORY_PUBKEY:Du,Secp256k1Program:dd,SendTransactionError:ic,SolanaJSONRPCError:oc,SolanaJSONRPCErrorCode:{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},StakeAuthorizationLayout:gd,StakeInstruction:md,StakeProgram:vd,Struct:Gs,SystemInstruction:Vu,SystemProgram:Gu,Transaction:Au,TransactionExpiredBlockheightExceededError:iu,TransactionExpiredNonceInvalidError:au,TransactionExpiredTimeoutError:ou,TransactionInstruction:Mu,TransactionMessage:Eu,TransactionStatus:wu,VALIDATOR_INFO_KEY:Nd,VERSION_PREFIX_MASK:nu,VOTE_PROGRAM_ID:kd,ValidatorInfo:Id,VersionedMessage:vu,VersionedTransaction:Nu,VoteAccount:xd,VoteAuthorizationLayout:Ad,VoteInit:wd,VoteInstruction:bd,VoteProgram:Ed,clusterApiUrl:function(e,t){var n=!1===t?"http":"https";if(!e)return Dd[n].devnet;var r=Dd[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r},sendAndConfirmRawTransaction:function(e,t,n,r){return Od.apply(this,arguments)},sendAndConfirmTransaction:Ou}),_d=C(zd),Pd={};Object.defineProperty(Pd,"__esModule",{value:!0});var Bd={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND"},Rd=function(e){Y(n,q(Error));var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0],s=i[1],u=i[2];return(e=t.call(this,s)).code=a,e.data=u,e.name="SolanaMobileWalletAdapterError",e}return W(n)}(),Ud=function(e){Y(n,q(Error));var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0],s=i[1],u=i[2],c=i[3];return(e=t.call(this,u)).code=s,e.data=c,e.jsonRpcMessageId=a,e.name="SolanaMobileWalletAdapterProtocolError",e}return W(n)}();function Wd(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Qd(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,crypto.subtle.exportKey("raw",e);case 2:return r=n.sent,n.next=5,crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},t,r);case 5:return i=n.sent,(o=new Uint8Array(r.byteLength+i.byteLength)).set(new Uint8Array(r),0),o.set(new Uint8Array(i),r.byteLength),n.abrupt("return",o);case 10:case"end":return n.stop()}}),n)})))}var Yd=4;function Fd(e){if(e>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");var t=new ArrayBuffer(Yd);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}function Vd(){return Wd(this,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}function Hd(){return Wd(this,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}var Gd,qd=12;function Zd(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a,s;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=JSON.stringify(e),i=Fd(e.id),o=new Uint8Array(qd),crypto.getRandomValues(o),n.next=6,crypto.subtle.encrypt(Xd(i,o),t,(new TextEncoder).encode(r));case 6:return a=n.sent,(s=new Uint8Array(i.byteLength+o.byteLength+a.byteLength)).set(new Uint8Array(i),0),s.set(new Uint8Array(o),i.byteLength),s.set(new Uint8Array(a),i.byteLength+o.byteLength),n.abrupt("return",s);case 12:case"end":return n.stop()}}),n)})))}function Jd(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a,s,u;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.slice(0,Yd),i=e.slice(Yd,Yd+qd),o=e.slice(Yd+qd),n.next=5,crypto.subtle.decrypt(Xd(r,i),t,o);case 5:if(a=n.sent,s=Kd().decode(a),u=JSON.parse(s),!Object.hasOwnProperty.call(u,"error")){n.next=10;break}throw new Ud(u.id,u.error.code,u.error.message);case 10:return n.abrupt("return",u);case 11:case"end":return n.stop()}}),n)})))}function Xd(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}function Kd(){return void 0===Gd&&(Gd=new TextDecoder("utf-8")),Gd}function $d(e,t,n){return Wd(this,void 0,void 0,z().mark((function r(){var i,o,a,s,u,c,l;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e,{name:"ECDH",namedCurve:"P-256"},!1,[])]);case 2:return i=r.sent,o=$(i,2),a=o[0],s=o[1],r.next=8,crypto.subtle.deriveBits({name:"ECDH",public:s},n,256);case 8:return u=r.sent,r.next=11,crypto.subtle.importKey("raw",u,"HKDF",!1,["deriveKey"]);case 11:return c=r.sent,r.next=14,crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(a),info:new Uint8Array},c,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"]);case 14:return l=r.sent,r.abrupt("return",l);case 16:case"end":return r.stop()}}),r)})))}function eh(e){if(e<49152||e>65535)throw new Rd(Bd.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,"Association port number must be between 49152 and 65535. ".concat(e," given."),{port:e});return e}function th(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i<r;i++)t+=String.fromCharCode(n[i]);return window.btoa(t)}var nh="solana-wallet";function rh(e){return e.replace(/(^\/+|\/+$)/g,"").split("/")}function ih(e,t){var n=null;if(t){try{n=new URL(t)}catch(e){}if("https:"!==(null==n?void 0:n.protocol))throw new Rd(Bd.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||(n=new URL("".concat(nh,":/")));var r=e.startsWith("/")?e:[].concat(ee(rh(n.pathname)),ee(rh(e))).join("/");return new URL(r,n)}function oh(e,t,n){return Wd(this,void 0,void 0,z().mark((function r(){var i,o,a,s;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=eh(t),r.next=3,crypto.subtle.exportKey("raw",e);case 3:return o=r.sent,a=th(o),(s=ih("v1/associate/local",n)).searchParams.set("association",a.replace(/[/+=]/g,(function(e){return{"/":"_","+":"-","=":"."}[e]}))),s.searchParams.set("port","".concat(i)),r.abrupt("return",s);case 9:case"end":return r.stop()}}),r)})))}var ah={Firefox:0,Other:1};var sh=null;function uh(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=eh(49152+Math.floor(16384*Math.random())),n.next=3,oh(e,r,t);case 3:if("https:"!==(i=n.sent).protocol){n.next=8;break}window.location.assign(i),n.next=26;break;case 8:n.prev=8,o=-1!==navigator.userAgent.indexOf("Firefox/")?ah.Firefox:ah.Other,n.t0=o,n.next=n.t0===ah.Firefox?13:n.t0===ah.Other?15:20;break;case 13:return s=i,null==sh&&((sh=document.createElement("iframe")).style.display="none",document.body.appendChild(sh)),sh.contentWindow.location.href=s.toString(),n.abrupt("break",21);case 15:return a=new Promise((function(e,t){function n(){clearTimeout(i),window.removeEventListener("blur",r)}function r(){n(),e()}window.addEventListener("blur",r);var i=setTimeout((function(){n(),t()}),2e3)})),window.location.assign(i),n.next=19,a;case 19:return n.abrupt("break",21);case 20:case 21:n.next=26;break;case 23:throw n.prev=23,n.t1=n.catch(8),new Rd(Bd.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.");case 26:return n.abrupt("return",r);case 27:case"end":return n.stop()}var s}),n,null,[[8,23]])})))}var ch=[150,150,200,500,500,750,750,1e3],lh=3e4;function dh(){if("undefined"==typeof window||!0!==window.isSecureContext)throw new Rd(Bd.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function hh(e){var t;try{t=new URL(e)}catch(e){throw new Rd(Bd.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if("https:"!==t.protocol)throw new Rd(Bd.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}Pd.SolanaMobileWalletAdapterError=Rd,Pd.SolanaMobileWalletAdapterErrorCode=Bd,Pd.SolanaMobileWalletAdapterProtocolError=Ud,Pd.SolanaMobileWalletAdapterProtocolErrorCode={ERROR_AUTHORIZATION_FAILED:-1,ERROR_INVALID_PAYLOADS:-2,ERROR_NOT_SIGNED:-3,ERROR_NOT_SUBMITTED:-4,ERROR_TOO_MANY_PAYLOADS:-5,ERROR_ATTEST_ORIGIN_ANDROID:-100},Pd.transact=function(e,t){return Wd(this,void 0,void 0,z().mark((function n(){var r,i,o,a,s,u,c,l,d=this;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return dh(),n.next=3,Vd();case 3:return r=n.sent,n.next=6,uh(r.publicKey,null==t?void 0:t.baseUri);case 6:return i=n.sent,o="ws://localhost:".concat(i,"/solana-wallet"),s=function(){var e=ee(ch);return function(){return e.length>1?e.shift():e[0]}}(),u=1,c=0,l={__type:"disconnected"},n.abrupt("return",new Promise((function(t,n){var h,p,f,m={},y=function e(){return Wd(d,void 0,void 0,z().mark((function t(){var n,r;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("connecting"===l.__type){t.next=3;break}return console.warn("Expected adapter state to be `connecting` at the moment the websocket opens. "+"Got `".concat(l.__type,"`.")),t.abrupt("return");case 3:return n=l.associationKeypair,h.removeEventListener("open",e),t.next=7,Hd();case 7:return r=t.sent,t.t0=h,t.next=11,Qd(r.publicKey,n.privateKey);case 11:t.t1=t.sent,t.t0.send.call(t.t0,t.t1),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:r.privateKey};case 14:case"end":return t.stop()}}),t)})))},g=function(e){e.wasClean?l={__type:"disconnected"}:n(new Rd(Bd.ERROR_SESSION_CLOSED,"The wallet session dropped unexpectedly (".concat(e.code,": ").concat(e.reason,")."),{closeEvent:e})),p()},v=function(e){return Wd(d,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p(),!(Date.now()-a>=lh)){e.next=5;break}n(new Rd(Bd.ERROR_SESSION_TIMEOUT,"Failed to connect to the wallet websocket on port ".concat(i,"."))),e.next=8;break;case 5:return e.next=7,new Promise((function(e){var t=s();f=window.setTimeout(e,t)}));case 7:b();case 8:case"end":return e.stop()}}),e)})))},w=function(r){return Wd(d,void 0,void 0,z().mark((function i(){var o,a,s,d,f,y,g,v;return z().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.data.arrayBuffer();case 2:o=i.sent,i.t0=l.__type,i.next="connected"===i.t0?6:"hello_req_sent"===i.t0?30:51;break;case 6:if(i.prev=6,a=o.slice(0,Yd),(s=new DataView(a).getUint32(0,!1))===c+1){i.next=11;break}throw new Error("Encrypted message has invalid sequence number");case 11:return c=s,i.next=14,Jd(o,l.sharedSecret);case 14:d=i.sent,f=m[d.id],delete m[d.id],f.resolve(d.result),i.next=29;break;case 20:if(i.prev=20,i.t1=i.catch(6),!(i.t1 instanceof Ud)){i.next=28;break}y=m[i.t1.jsonRpcMessageId],delete m[i.t1.jsonRpcMessageId],y.reject(i.t1),i.next=29;break;case 28:throw i.t1;case 29:return i.abrupt("break",51);case 30:return i.next=32,$d(o,l.associationPublicKey,l.ecdhPrivateKey);case 32:return g=i.sent,l={__type:"connected",sharedSecret:g},v=new Proxy({},{get:function(e,t){if(null==e[t]){var n=t.toString().replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())})).toLowerCase();e[t]=function(e){return Wd(this,void 0,void 0,z().mark((function r(){var i;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=u++,r.t0=h,r.next=4,Zd({id:i,jsonrpc:"2.0",method:n,params:null!=e?e:{}},g);case 4:return r.t1=r.sent,r.t0.send.call(r.t0,r.t1),r.abrupt("return",new Promise((function(e,n){m[i]={resolve:function(r){switch(t){case"authorize":case"reauthorize":var i=r.wallet_uri_base;if(null!=i)try{hh(i)}catch(e){return void n(e)}}e(r)},reject:n}})));case 7:case"end":return r.stop()}}),r)})))}}return e[t]},defineProperty:function(){return!1},deleteProperty:function(){return!1}}),i.prev=35,i.t2=t,i.next=39,e(v);case 39:i.t3=i.sent,(0,i.t2)(i.t3),i.next=46;break;case 43:i.prev=43,i.t4=i.catch(35),n(i.t4);case 46:return i.prev=46,p(),h.close(),i.finish(46);case 50:return i.abrupt("break",51);case 51:case"end":return i.stop()}}),i,null,[[6,20],[35,43,46,50]])})))},b=function(){p&&p(),l={__type:"connecting",associationKeypair:r},void 0===a&&(a=Date.now()),(h=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",y),h.addEventListener("close",g),h.addEventListener("error",v),h.addEventListener("message",w),p=function(){window.clearTimeout(f),h.removeEventListener("open",y),h.removeEventListener("close",g),h.removeEventListener("error",v),h.removeEventListener("message",w)}};b()})));case 13:case"end":return n.stop()}}),n)})))};var ph=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var i=e.charAt(r),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=r}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var n=0,r=0,i=0;e[n]===s;)r++,n++;for(var o=(e.length-n)*u+1>>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d<i)&&-1!==h;h--,d++)l+=a*c[h]>>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var f=new Uint8Array(r+(o-p)),m=r;p!==o;)f[m++]=c[p++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h<r)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var m=s.repeat(n);f<u;++f)m+=e.charAt(l[f]);return m},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+a+" character")}}},fh=ph("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Object.defineProperty(se,"__esModule",{value:!0});var mh=_d,yh=Pd;function gh(e){return e&&"object"===_(e)&&"default"in e?e:{default:e}}var vh=gh(fh);function wh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function bh(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Mh(e){var t;return window.btoa((t=String.fromCharCode).call.apply(t,[null].concat(ee(e))))}function Ah(e){return new Uint8Array(window.atob(e).split("").map((function(e){return e.charCodeAt(0)})))}function Eh(e){return Mh("version"in e?e.serialize():e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}function Nh(e){var t=e[0]*mh.SIGNATURE_LENGTH_IN_BYTES+1;return"legacy"===mh.VersionedMessage.deserializeMessageVersion(e.slice(t,e.length))?mh.Transaction.from(e):mh.VersionedTransaction.deserialize(e)}se.transact=function(e,t){return bh(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=function(t){var n=new Proxy({},{get:function(e,n){if(null==e[n])switch(n){case"signAndSendTransactions":e[n]=function(e){var n=e.minContextSlot,r=e.transactions,i=wh(e,["minContextSlot","transactions"]);return bh(this,void 0,void 0,z().mark((function e(){var o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.map(Eh),e.next=3,t.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},i),null!=n?{options:{min_context_slot:n}}:null),{payloads:o}));case 3:return a=e.sent,s=a.signatures,u=s.map(Ah).map(vh.default.encode),e.abrupt("return",u);case 7:case"end":return e.stop()}}),e)})))};break;case"signMessages":e[n]=function(e){var n=e.payloads,r=wh(e,["payloads"]);return bh(this,void 0,void 0,z().mark((function e(){var i,o,a,s;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.map(Mh),e.next=3,t.signMessages(Object.assign(Object.assign({},r),{payloads:i}));case 3:return o=e.sent,a=o.signed_payloads,s=a.map(Ah),e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})))};break;case"signTransactions":e[n]=function(e){var n=e.transactions,r=wh(e,["transactions"]);return bh(this,void 0,void 0,z().mark((function e(){var i,o,a,s,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.map(Eh),e.next=3,t.signTransactions(Object.assign(Object.assign({},r),{payloads:i}));case 3:return o=e.sent,a=o.signed_payloads,s=a.map(Ah),u=s.map(Nh),e.abrupt("return",u);case 8:case"end":return e.stop()}}),e)})))};break;default:e[n]=t[n]}return e[n]},defineProperty:function(){return!1},deleteProperty:function(){return!1}});return e(n)},n.next=3,yh.transact(r,t);case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),n)})))};var Th={},Ih=function(){function e(t,n){if(R(this,e),!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=n}return W(e,[{key:"makeDestinationObject",value:function(){return{}}},{key:"decode",value:function(e,t){throw new Error("Layout is abstract")}},{key:"encode",value:function(e,t,n){throw new Error("Layout is abstract")}},{key:"getSpan",value:function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function kh(e,t){return t.property?e+"["+t.property+"]":e}Th.Layout=Ih,Th.nameWithProperty=kh,Th.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ih))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Lh=function(e){Y(n,Ih);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return W(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(),xh=function(e){Y(n,Lh);var t=X(n);function n(e,r){var i;if(R(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return W(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(),Sh=function(e){Y(n,Lh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ih))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(o=t.call(this,e.span,i||e.property)).layout=e,o.offset=r,o}return W(n,[{key:"isCount",value:function(){return this.layout instanceof jh||this.layout instanceof Ch}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(),jh=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(),Ch=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(),Dh=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(),Oh=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(),zh=Math.pow(2,32);function _h(e){var t=Math.floor(e/zh);return{hi32:t,lo32:e-t*zh}}function Ph(e,t){return e*zh+t}var Bh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Ph(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(),Rh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Ph(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Uh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Ph(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(),Wh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Ph(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=_h(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Qh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(),Yh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(),Fh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(),Vh=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return W(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(),Hh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ih))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Lh&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Lh)&&0<e.span&&(a=r*e.span),(o=t.call(this,a,i)).elementLayout=e,o.count=r,o}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0,r=this.count;if(r instanceof Lh&&(r=r.decode(e,t)),0<this.elementLayout.span)n=r*this.elementLayout.span;else for(var i=0;i<r;)n+=this.elementLayout.getSpan(e,t+n),++i;return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=[],r=0,i=this.count;for(i instanceof Lh&&(i=i.decode(e,t));r<i;)n.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),r+=1;return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.elementLayout,i=e.reduce((function(e,i){return e+r.encode(i,t,n+e)}),0);return this.count instanceof Lh&&this.count.encode(e.length,t,n),i}}]),n}(),Gh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;if(R(this,n),!Array.isArray(e)||!e.reduce((function(e,t){return e&&t instanceof Ih}),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof r&&void 0===i&&(i=r,r=void 0);var a,s=ae(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(0>u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),i=ae(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,i=n,o=0,a=0,s=ae(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.span;if(a=0<c?c:0,void 0!==u.property){var l=e[u.property];void 0!==l&&(a=u.encode(l,t,n),0>c&&(c=u.getSpan(t,n)))}o=n,n+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=ae(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0<e.length&&(n[i.property]=e.shift())}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"layoutFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=ae(this.fields);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.property===e)return r}}catch(e){n.e(e)}finally{n.f()}}},{key:"offsetOf",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=0,r=ae(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.property===e)return n;0>i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(),qh=function(){function e(t){R(this,e),this.property=t}return W(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),Zh=function(e){Y(n,qh);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Lh&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return W(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(),Jh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;R(this,n);var a=e instanceof jh||e instanceof Ch;if(a)e=new Zh(new Sh(e));else if(e instanceof Lh&&e.isCount())e=new Zh(e);else if(!(e instanceof qh))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof Ih))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&a&&(s+=e.layout.span),(o=t.call(this,s,i)).discriminator=e,o.usesPrefixDiscriminator=a,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(J(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){var a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new Xh(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return Ee.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(),Xh=function(e){Y(n,Ih);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof Jh))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Ih))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return W(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}();function Kh(e){return 0>e&&(e+=4294967296),e}var $h=function(e){Y(n,Ih);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof jh||e instanceof Ch))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=void 0),4<e.span)throw new RangeError("word cannot exceed 32 bits");(o=t.call(this,e.span,i)).word=e,o.msb=!!r,o.fields=[];var a=0;return o._packedSetValue=function(e){return a=Kh(e),this},o._packedGetValue=function(){return a},o}return W(n,[{key:"decode",value:function(e,t){var n=this.makeDestinationObject();void 0===t&&(t=0);var r=this.word.decode(e,t);this._packedSetValue(r);var i,o=ae(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;void 0!==a.property&&(n[a.property]=a.decode(r))}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.word.decode(t,n);this._packedSetValue(r);var i,o=ae(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(void 0!==a.property){var s=e[a.property];void 0!==s&&a.encode(s)}}}catch(e){o.e(e)}finally{o.f()}return this.word.encode(this._packedGetValue(),t,n)}},{key:"addField",value:function(e,t){var n=new ep(this,e,t);return this.fields.push(n),n}},{key:"addBoolean",value:function(e){var t=new tp(this,e);return this.fields.push(t),t}},{key:"fieldFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=ae(this.fields);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.property===e)return r}}catch(e){n.e(e)}finally{n.f()}}}]),n}(),ep=function(){function e(t,n,r){if(R(this,e),!(t instanceof $h))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<<n)-1,32===n&&(this.valueMask=4294967295),this.start=o,this.container.msb&&(this.start=i-o-n),this.wordMask=Kh(this.valueMask<<this.start),this.property=r}return W(e,[{key:"decode",value:function(){return Kh(this.container._packedGetValue()&this.wordMask)>>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==Kh(e&this.valueMask))throw new TypeError(kh("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=Kh(e<<this.start);this.container._packedSetValue(Kh(t&~this.wordMask)|n)}}]),e}(),tp=function(e){Y(n,ep);var t=X(n);function n(e,r){return R(this,n),t.call(this,e,1,r)}return W(n,[{key:"decode",value:function(e,t){return!!ep.prototype.decode.call(this,e,t)}},{key:"encode",value:function(e){return"boolean"==typeof e&&(e=+e),ep.prototype.encode.call(this,e)}}]),n}(),np=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Lh&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");var o=-1;return e instanceof Lh||(o=e),(i=t.call(this,o,r)).length=e,i}return W(n,[{key:"getSpan",value:function(e,t){var n=this.span;return 0>n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Lh&&(r=e.length),!Ee.isBuffer(e)||r!==e.length)throw new TypeError(kh("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Lh&&this.length.encode(r,t,n),r}}]),n}(),rp=function(e){Y(n,Ih);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return W(n,[{key:"getSpan",value:function(e,t){if(!Ee.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;n<e.length&&0!==e[n];)n+=1;return 1+n-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);return e.slice(t,t+r-1).toString("utf-8")}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0),"string"!=typeof e&&(e=e.toString());var r=new Ee(e,"utf8"),i=r.length;if(n+i>t.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+i]=0,i+1}}]),n}(),ip=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return W(n,[{key:"getSpan",value:function(e,t){if(!Ee.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return e.slice(t,t+r).toString("utf-8")}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0),"string"!=typeof e&&(e=e.toString());var r=new Ee(e,"utf8"),i=r.length;if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");if(n+i>t.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),i}}]),n}(),op=function(e){Y(n,Ih);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return W(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}();Th.ExternalLayout=Lh,Th.GreedyCount=xh,Th.OffsetLayout=Sh,Th.UInt=jh,Th.UIntBE=Ch,Th.Int=Dh,Th.IntBE=Oh,Th.Float=Qh,Th.FloatBE=Yh,Th.Double=Fh,Th.DoubleBE=Vh,Th.Sequence=Hh,Th.Structure=Gh,Th.UnionDiscriminator=qh,Th.UnionLayoutDiscriminator=Zh,Th.Union=Jh,Th.VariantLayout=Xh,Th.BitStructure=$h,Th.BitField=ep,Th.Boolean=tp,Th.Blob=np,Th.CString=rp,Th.UTF8=ip,Th.Constant=op,Th.greedy=function(e,t){return new xh(e,t)},Th.offset=function(e,t,n){return new Sh(e,t,n)},Th.u8=function(e){return new jh(1,e)},Th.u16=function(e){return new jh(2,e)},Th.u24=function(e){return new jh(3,e)},Th.u32=function(e){return new jh(4,e)},Th.u40=function(e){return new jh(5,e)},Th.u48=function(e){return new jh(6,e)},Th.nu64=function(e){return new Bh(e)},Th.u16be=function(e){return new Ch(2,e)},Th.u24be=function(e){return new Ch(3,e)},Th.u32be=function(e){return new Ch(4,e)},Th.u40be=function(e){return new Ch(5,e)},Th.u48be=function(e){return new Ch(6,e)},Th.nu64be=function(e){return new Rh(e)},Th.s8=function(e){return new Dh(1,e)},Th.s16=function(e){return new Dh(2,e)},Th.s24=function(e){return new Dh(3,e)},Th.s32=function(e){return new Dh(4,e)},Th.s40=function(e){return new Dh(5,e)},Th.s48=function(e){return new Dh(6,e)},Th.ns64=function(e){return new Uh(e)},Th.s16be=function(e){return new Oh(2,e)},Th.s24be=function(e){return new Oh(3,e)},Th.s32be=function(e){return new Oh(4,e)},Th.s40be=function(e){return new Oh(5,e)},Th.s48be=function(e){return new Oh(6,e)},Th.ns64be=function(e){return new Wh(e)},Th.f32=function(e){return new Qh(e)},Th.f32be=function(e){return new Yh(e)},Th.f64=function(e){return new Fh(e)},Th.f64be=function(e){return new Vh(e)},Th.struct=function(e,t,n){return new Gh(e,t,n)},Th.bits=function(e,t,n){return new $h(e,t,n)};var ap=Th.seq=function(e,t,n){return new Hh(e,t,n)};Th.union=function(e,t,n){return new Jh(e,t,n)},Th.unionLayoutDiscriminator=function(e,t){return new Zh(e,t)},Th.blob=function(e,t){return new np(e,t)},Th.cstr=function(e){return new rp(e)},Th.utf8=function(e,t){return new ip(e,t)},Th.const=function(e,t){return new op(e,t)};var sp={},up={exports:{}};!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===_(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:tr.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===_(e)&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===_(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(e,l,l+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){c(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?m+r:d[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===o?(n<e.length&&(e[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,p=0|a[1],f=8191&p,m=p>>>13,y=0|a[2],g=8191&y,v=y>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],E=8191&A,N=A>>>13,T=0|a[5],I=8191&T,k=T>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(m,W)|0,o=Math.imul(m,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(m,F)|0,o=o+Math.imul(m,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,W),i=(i=Math.imul(b,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var we=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(N,W)|0,o=Math.imul(N,Q),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ne=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(B,W),i=(i=Math.imul(B,Q))+Math.imul(R,W)|0,o=Math.imul(R,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Te=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Le=(c+(r=r+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(N,fe)|0))<<13)|0;c=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(R,ue)|0,o=Math.imul(R,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,de),i=(i=Math.imul(B,he))+Math.imul(R,de)|0,o=Math.imul(R,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(B,fe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(R,fe)|0))<<13)|0;return c=((o=Math.imul(R,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=we,u[4]=be,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Ne,u[9]=Te,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return y(e,t,n)}Math.imul||(m=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?f(this,e,t):n<1024?y(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,m=1;0==(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new N(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){N.call(this,e),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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},r(b,w),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(M,w),r(A,w),r(E,w),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},N.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},N.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},N.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},N.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},N.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},N.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},N.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},N.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},N.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},N.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},N.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},N.prototype.isqr=function(e){return this.imul(e,e.clone())},N.prototype.sqr=function(e){return this.mul(e,e)},N.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<f);var g=this.pow(d,new i(1).iushln(f-y-1));h=h.redMul(g),d=g.redSqr(),p=p.redMul(d),f=y}return h},N.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},N.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},N.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},N.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},r(T,N),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(up,S),function(e){var t=S&&S.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.map=e.array=e.rustEnum=e.str=e.vecU8=e.tagged=e.vec=e.bool=e.option=e.publicKey=e.i128=e.u128=e.i64=e.u64=e.struct=e.f64=e.f32=e.i32=e.u32=e.i16=e.u16=e.i8=e.u8=void 0;var n=Th,r=_d,i=t(up.exports),o=Th;Object.defineProperty(e,"u8",{enumerable:!0,get:function(){return o.u8}}),Object.defineProperty(e,"i8",{enumerable:!0,get:function(){return o.s8}}),Object.defineProperty(e,"u16",{enumerable:!0,get:function(){return o.u16}}),Object.defineProperty(e,"i16",{enumerable:!0,get:function(){return o.s16}}),Object.defineProperty(e,"u32",{enumerable:!0,get:function(){return o.u32}}),Object.defineProperty(e,"i32",{enumerable:!0,get:function(){return o.s32}}),Object.defineProperty(e,"f32",{enumerable:!0,get:function(){return o.f32}}),Object.defineProperty(e,"f64",{enumerable:!0,get:function(){return o.f64}}),Object.defineProperty(e,"struct",{enumerable:!0,get:function(){return o.struct}});var a=function(e){Y(r,e);var t=X(r);function r(e,i,o){var a;return R(this,r),(a=t.call(this,e,o)).blob=n.blob(e),a.signed=i,a}return W(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new i.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Ee,"le",this.span),t,n)}}]),r}(n.Layout);function s(e){return new a(8,!1,e)}e.u64=s,e.i64=function(e){return new a(8,!0,e)},e.u128=function(e){return new a(16,!1,e)},e.i128=function(e){return new a(16,!0,e)};var u=function(e){Y(n,e);var t=X(n);function n(e,r,i,o){var a;return R(this,n),(a=t.call(this,e.span,o)).layout=e,a.decoder=r,a.encoder=i,a}return W(n,[{key:"decode",value:function(e,t){return this.decoder(this.layout.decode(e,t))}},{key:"encode",value:function(e,t,n){return this.layout.encode(this.encoder(e),t,n)}},{key:"getSpan",value:function(e,t){return this.layout.getSpan(e,t)}}]),n}(n.Layout);e.publicKey=function(e){return new u(n.blob(32),(function(e){return new r.PublicKey(e)}),(function(e){return e.toBuffer()}),e)};var c=function(e){Y(r,e);var t=X(r);function r(e,i){var o;return R(this,r),(o=t.call(this,-1,i)).layout=e,o.discriminator=n.u8(),o}return W(r,[{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}},{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}]),r}(n.Layout);function l(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function d(e){return e?1:0}function h(e){var t=n.u32("length"),r=n.struct([t,n.blob(n.offset(t,-t.span),"data")]);return new u(r,(function(e){return e.data}),(function(e){return{data:e}}),e)}e.option=function(e,t){return new c(e,t)},e.bool=function(e){return new u(n.u8(),l,d,e)},e.vec=function(e,t){var r=n.u32("length"),i=n.struct([r,n.seq(e,n.offset(r,-r.span),"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),t)},e.tagged=function(e,t,r){var i=n.struct([s("tag"),t.replicate("data")]);return new u(i,(function(t){var n=t.tag,r=t.data;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(function(t){return{tag:e,data:t}}),r)},e.vecU8=h,e.str=function(e){return new u(h(),(function(e){return e.toString("utf-8")}),(function(e){return Ee.from(e,"utf-8")}),e)},e.rustEnum=function(e,t,r){var i=n.union(null!=r?r:n.u8(),t);return e.forEach((function(e,t){return i.addVariant(t,e,e.property)})),i},e.array=function(e,t,r){var i=n.struct([n.seq(e,t,"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),r)};var p=function(e){Y(n,e);var t=X(n);function n(e,r,i){var o;return R(this,n),(o=t.call(this,e.span+r.span,i)).keyLayout=e,o.valueLayout=r,o}return W(n,[{key:"decode",value:function(e,t){return t=t||0,[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}},{key:"encode",value:function(e,t,n){n=n||0;var r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}},{key:"getSpan",value:function(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}]),n}(n.Layout);e.map=function(e,t,r){var i=n.u32("length"),o=n.struct([i,n.seq(new p(e,t),n.offset(i,-i.span),"values")]);return new u(o,(function(e){var t=e.values;return new Map(t)}),(function(e){return{values:Array.from(e.entries())}}),r)}}(sp),se.Web3MobileWallet;var cp=se.transact,lp=tr.Buffer,dp=fr.exports,hp=sp.struct([sp.publicKey("mint"),sp.publicKey("owner"),sp.u64("amount"),sp.u32("delegateOption"),sp.publicKey("delegate"),sp.u8("state"),sp.u32("isNativeOption"),sp.u64("isNative"),sp.u64("delegatedAmount"),sp.u32("closeAuthorityOption"),sp.publicKey("closeAuthority")]);sp.array;var pp=sp.bool,fp=sp.i128;sp.i16;var mp=sp.i32,yp=sp.i64;sp.i8,sp.map;var gp=sp.option,vp=sp.publicKey,wp=sp.rustEnum,bp=sp.str,Mp=sp.struct;sp.tagged;var Ap=sp.u128,Ep=sp.u16,Np=sp.u32,Tp=sp.u64,Ip=sp.u8,kp=sp.vec;sp.vecU8;const Lp="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yOTkuMyAyMzcuNSA1MDAgMTIybDIwMC43IDExNS41LTczLjUgNDIuNkw1MDAgMjA4LjJsLTEyNy4xIDcxLjktNzMuNi00Mi42em00MDEuNCAxNDYtNzMuNS00Mi42LTEyNy4xIDczTDM3MyAzNDAuNGwtNzMuNSA0My4xdjg1LjdsMTI3LjEgNzN2MTQ1LjRsNzMuNSA0My4xIDczLjUtNDMuMVY1NDIuMWwxMjcuMS03M3YtODUuNnptMCAyMzIuMXYtODUuN2wtNzMuNSA0Mi42djg1LjdjLS4xLS42IDczLjUtNDIuNiA3My41LTQyLjZ6bTUxLjkgMjkuMy0xMjcuMSA3M3Y4NS43TDgyNi4xIDY4OFY0NTYuNGwtNzMuNSA0My4xdjE0NS40em0tNzMuNS0zMzQuNCA3My41IDQzLjF2ODUuN2w3My41LTQzLjF2LTg1LjdsLTczLjUtNDMuMS03My41IDQzLjF6TTQyNi41IDc0OS40djg1LjdsNzMuNSA0My4xIDczLjUtNDMuMXYtODUuN2wtNzMuNSA0Mi03My41LTQyek0yOTkuMyA2MTUuNmw3My41IDQzLjF2LTg2LjJMMjk5LjMgNTMwdjg1LjZ6bTEyNy4yLTMwNS4xIDczLjUgNDMuMSA3My41LTQzLjEtNzMuNS00Mi42YzAtLjUtNzMuNSA0Mi42LTczLjUgNDIuNnptLTE3OS4xIDQzLjEgNzMuNS00My4xLTczLjUtNDMuMS03My41IDQzLjF2ODUuN2w3My41IDQzLjF2LTg1Ljd6bTAgMTQ1LjQtNzMuNS00Mi42VjY4OGwyMDAuNyAxMTUuNXYtODUuN2wtMTI3LjEtNzNjLS4xLjEtLjEtMTQ1LjgtLjEtMTQ1Ljh6IiBmaWxsPSIjZjBiOTBiIi8+PC9zdmc+",xp="https://app.uniswap.org/static/media/bnb-logo.797868eb94521320b78e3967134febbe.svg";var Sp={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",platform:"evm",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:Lp,logoBackgroundColor:"#000000",logoWhiteBackground:Lp,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:xp},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://bscscan.com/tx/${e.id||e}`:t?`https://bscscan.com/token/${t}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:xp,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const jp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADxdJREFUeJztXVtzFMcVplwuP8VVeYmf7HJ+RKqSl/AQP6X8H+yqXUEIjhMnQY5jO9oVCIzA5mowdzAYG4xAGAyWLC5G3IyDL8gOASUYKrarYGZWC7qi23b6692VV6uZ7e6ZnT3di07VV6JUaLfnnG+6z+lz+vScOXUoL6SzP52/2PtlQ9p7piHlLU2k3P2JJqcjkXLO8589/OdN/tPjvx8VEP8Wv+sp/J8O/A3+Fp+Bz8JnUj/XrPjIwjT7ybxm57fJlLsy2eR2cwPe4QZksYB/Nr4D34XvxHdTP/8DJ+k0e4S/lb9Jpr2WZJNzgRtjPDaDS4DvFmPgY8GYMDZq/dStNKQzv0qmnA1c6RkqgysQIoMxYqzU+qoLWZDO/jyZdl7lir1ObdwQZLiOseMZqPVonSTS7i+4AtsTTW6O2pDR4ebEs/Bnotar8dKw2Pk1n0I76Y0W16zgdOIZqfVsnCSbvaeEB2+AkWpCBEQS/Jmp9U4u3Fl6nIdWB6gNQgb+7NABtR1qLjxcejiZdhfxKXGA3AjUswHXAXQBnVDbpSbCPeO5fAr8hlrxpgE6gW6o7ROb5N96Z3l9ePZxgUcMXEd1NxssbMk8kWxyztEr2A5AV3XjGySb3acTSLYYoFjL4EF31PYLLXwaeyiZcltnp/woEJtIrdAltT21BEkR7tnuo1dgfQC6tCbRlGh1H02k3C5qpalg/bt3WdOGDPk4lACdct1S27eiLEgPPMbDmcvkylLAgiUOc/sm2LHuITavmX48KoBun1828DNqO/tKsiX7JF+zeqmVpIqPzg2xyckc++Sfw2ImoB6POtxe6Jra3tMEb75Nxv/Hmxk2MZGbIsCpz4bZn1d45OPSIQF0Tm13IViXbJn2i+i9NcYgRQIA+zsGyMelA6Fzap8AnqktDl8RO9r7WVFKCQAs3dJHPj4tcN2TRQcizrcs1Hv+NZf1D04GEqDj/JBwDqnHqYNCiFj7fYL8Jg+9AnTQfXmYlUo5AYAtbffIx6lNAm6L2hpfbO/atcO3dGsfy+VyUgIAL66yySEE3FzNto2R2ElYtrffkHbYd7fHWbkEEeDQyUHk6cnHrQkPtonV+CKla2FWDx6+nwQRAFi5K0s+bl3ANrGmkvP5fPoH1cFfX/fYyP2cNgG6Lg6z55a55OPXJgG3UVzGn2vbug98fvW+r/FlBADePtJPPn59iKKS6lYW5ad++8q4Vu+5G2h8FQIAr663JFlUAtiqqksBZ1Uj9UPp4neLHeb0TUQmwNEzg2xemv559OE2VsX4KE2ysXoXhpOJCgGAdXttShblAZtVpayMe5Zt1A+ji5fXZdj4uL/jF4YApy4NsxdaLXQIue2iGb/Ze4r6IcLg6rejUuPrEAB47yO7kkVTJIhyAsnG41rYylUVHQIAizdZlixqyh9DC2V8HGKkHrwuELffHZiUWz4kAVBEAueS+jl1EepAqo2ndLFW64guAYBNB2xMFjmdWsbHWXbqQesC0zMMGjcBgEVv2JYs4tDpT5BvzmDAoBWBxM2tH8a0jB+FAAe77EsWwaZKxkdLE9u2fPce65dbu4oEAFp32JYscnNK7WrQ14Z+sOpAMefwiLrjVy0CdF0cYguX2rU3ANtKCWBTdS9wqWcklPGjEgDYcdiuZBEaV1U0PtqbUQ9SB6/vyoY2fjUIALy81q5kUcUWduhxRz1AVcxvdthtb2aVT60JcOT0oKg4otaHKmBjX+OLA50GN2Esx+FT8mRPLQgAIO1MrQ91ArgZ31JytDqlHpwqXlrjsbExvZg/TgKcvDTM/rjcHocQtp45/ae9FuqBqeLr/6gle2pFAAChKLVeVAFbzyRAk3OBemAq2LhfPdlTSwIA6Y12JItg62nGR9tzyq7bqljY4rK+e5WrfCgJcPzskHBOqfUkJQC39bRW9+h9Tz0oFXx8Yahqxo+DAMCGfXY4hLB5SfjnrqQekAypjRntZA8FAU5/NixK0an1JQNsXrL+m1/4ceM7/WRPJcExsas3Rtn7nQNVJ8GBj82vHppWKBLrNStVAOrzqyWjPHzEWQGEbjBW81t9bPn2LNt9tF/UE1SLBMu2Ge4QcpsL4+MyJPLBVADi68HhcMmeUrnbP8kufDUyw8ggQBHoD7Dt4D3WyX2NqASAv/L7Fnr9VYK4CAs3YlEPpBLOfxk+2QP5wRlnZy7ztTnAUKUEKGLJpj72JnfmUFoehQTbDpldPQTb8/Xfe5Z6IEHA1BxWem+N8rdd/ib7EaAUq/dkxZoelgTYtaTWYxBwJR7y/8uoB+IHnMbB26sjY+M59uU1vr5/qj6FywhQxIodWfbOh/2ioZQOAZCzMLV6CLafU7hUkXww5Wjr8j/S7Sdo+3LxyojSGx+WAFN+wtY+tp1P7V0afsIbbxtaPcRtb2T1b+Mqj90flcf8t91x1v158PoeBwGKWLy5j23kfsIxBT/h5KfDoj8RtV7LIaqFTcwBfHUt+Eg35L//G2WnqxSyhSVAKdZwP+FgV2U/Yc9R85JFIieQwH25BgymCHTt9JPxiRy7ch3xe/QQrdoEKGLlzqzICgb5CQb2Je6ZU7g0mXogAmjR5mWnJ3uwB3Dp65nxu4kEKGIZ9xN2tN9jJy5OJ6txfYm57TEDGNPwCdm0otzJTLCzX+T31uMwfJwEmNpP2NLHNu2/y453/0gEw/oSe3MK16dTD2Sqf+/N78diN3qtCDDlMG7qY2v33mWHTg6Y1ZeY294YAhw7Ozi1P19L1IIA0/yEXdxpfMeQWUAQwJAlAClUtHOrdwL8fW3GpBPGnlFOIIDp8lh3dT19EwiAJe4PprWdKziBRoWBALaB1/JpEhsothMAdYJY8w3dDhZh4HkDBuIL7J7t+qDfWgKg57BRYV85uO0xA3SQD0SCl9ZkRP9eWwjwyrqM8bUABXQYkwySpU0xhb62Lcs6z5u7E4idPpUDIn8ypeOYSAYZkg5esTPLPr0yIu2+gd1CnA3QTcvGSYA0B6IY2TpfXNLQxo5a30BDyluKI2HPUA+kCHj/qNlDDl0WKsGxevd49LAxqvGxPM2XjBV+AJpNYp/DpJ1AURBiUkkYvP9i9S9yAnjTZX+DaffoJ+H9g7CGR1j3nEKDCIS12OLGd6HGwaRoQJSEmVYU+rfVHhu+/2MR6LWbo+JMQGUmO6Lo4kSIsDFMWKfSNRRLWWnJOdrPm3aAVBSFmlgWXt7sEQc4kB+QKRBv5Pb2e7ERAIUqssbROL629eDMMSzZbFiZeLEs3NSDISjhLpeh4Umx7ssaMiD+bpMUaOgQAE6b7DYxjAkdS7ouzoxScFUdtT7LMe1giIlHw/AmORn/g6AoFlWps0OdP7p7hiUA/AuVUi74A+gU4vf5KC2XOYkkBCg9Gmbq4VBMm0gRBwkqgGX7B1A+PO+ggpKgsO4vK+VhHXwBVAAFkQuhqqk3kE07HGry8XDU5FcStIWHl40Zo9LnwH9AXZ6MAHBCZUe8EaLiFLBsL2LVbjOrgWccDze5QQTeQpX27zj6tV3hJM4r6zPsg5Lpemr7lv9eRiIA5V4dCruR+wxuLz+jQYTpLWIwHQ8MqZ0P/Pb7MdYiuQMYpMLOI87vIcRU2ZrFUnPwhNp+A7arTb5xzLdFjOlNorCTpio4+o0zhSBOpc+EZy+LKJDD33lYLyNpYPXvNPg2ibKhTRzqA3QE9wUiHAzTtgXx/po9+jUJpreTD2wTlw8HzW4UCY/e7wpYmSCc1NmDRxQQpioJOQzTbxgLbBSZXwbMbxWLmDtsj8B/3RiteA8gMnr7QtYlItEjW3JMQMVWsflZwL1OPUgZEM6FFWwrI2dQWp+H4o3NB/S2kMuBo+zUepFB2ixaEMCSdvFf/Lvy+UGZIKpAW5hiNBDF+Cae+/MlgEq7eFsujMAWbdSegdXoEoZNKFmewAwoXhhRWAasuDIGTRuitI57kNrFK18ZA7Hp0qgPz4RvHhmVACZV90ihc2lUfhYwr3GEHxrS4XsIRiEAchQmVfdUgva1cRCbLo58sayKKG4CIOdvWnVPxZckzMWRYhYwsFAkCDpXxkYlgHHVPRUQ+upYQQDLLo/W7SkYhgAoOaN+Ti0CRLk8GpJIOQeoH0IVSOfeCagiqgYBUH1sYnVPILjtIhkf0pDOPM6diAHyh1EEpufxClVEYQmA4o9Gi66Mhc1gu8gEgCTT7iLqB9KBrIooDAGM7fUXRABus6oYH5JOs4e5M/EN9UNpsF+0gq8WAd4zuLrH9/m5rWCzqhEAkkw7c23YIi4CmTl0EI1KAFHdY9UVsW4Otqqq8UtIsJz+AdWBJhNRCYD0M/Vz6AA2isX4kPxS4JyjfkgdVKoikhHgrfctC/m4bao+9ZfLwpbMEwlDGkupoFIVUSUCtJ80v7qnDB5sE6vxi5Jsdp+2yR9AFdCoTxVREAEwaxjTy08JfN3nNqmJ8adIkHJb6R9cHbt9qoiCCIBOJNTj1QFsUVPjQ/ha8xCPNfdRP7wOcFmUjAC7j9hR3TNlfG4D2KLmBCiQ4JFEyu2iVoIqyquIyglgT3VPAVz3gSXetZJEq/tossm9TK4MRbSWVBGVEwDtXqjHpwqhc657UuMXZUF64DHuiPRSK0UVOLJdTgCcPKIelzrcXuic2u7TJNmSfdIWEhSriIoEsKm6BzqGrqnt7StgpS3LAc7to+MIqntMvM/HD9CtcW9+uWBdssUxxDk+dPGiHocSoFNT1nyZiIOmloWIJqMQ6tF6+7oi9gnEZpE9O4bmwc1Bh2RxfjUkv21sT+7AIHg1396NS5CksC2LSAnoqmaJnVqJSCWLeoLZJSEYophjeewpXUpBtYpN5WW1AnQSWyWPaQKGc7Y32lRtHJvhhQ7cxrp+64NElJw3OW3URqB76522qpVu2yw4vWLTMbTohne7I5/YqUfBIUZbTiWHMjx/ttAHNR8kwVn2fJOKeogYxGZOu/b5/FnJt6vJ9yyyI8tYZvhejF25LcusVBa0N0OPO5ObWWJsGKO0FdushBckRdDqFP1u0fSYsss5vluMgY8FY7IuYVMPgrbn6H2PCxBEJBHn9Tf8s4UHz78L3zmj5fqsmCG4DAk3YiWbvGfFvYgpdz888EJL/J7Chdkerk8XEP8Wv+vJzyo8EsHf8L/FZ+Czpi5YqjP5P2ey0rAsl+yGAAAAAElFTkSuQmCC",Cp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";var Dp={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",platform:"evm",label:"Ethereum",fullName:"Ethereum Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbC1vcGFjaXR5Oi42MDJ9LnN0MCwuc3Qxe2ZpbGw6I2ZmZn08L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MTEuNCA3My4zdjMxNS41TDc3OCA1MDggNTExLjQgNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTExLjQgNzMuMyAyNDQuNyA1MDhsMjY2LjYtMTE5LjJWNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTExLjQgNzEyLjN2MjE0LjVsMjY2LjgtMzY5LjEtMjY2LjggMTU0LjZ6Ii8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTUxMS40IDkyNi43VjcxMi4zTDI0NC43IDU1Ny42bDI2Ni43IDM2OS4xeiIvPjxwYXRoIGQ9Ik01MTEuNCA2NjIuNyA3NzggNTA4IDUxMS40IDM4OC44djI3My45eiIgZmlsbD0iI2ZmZiIgZmlsbC1vcGFjaXR5PSIuMiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Im0yNDQuNyA1MDggMjY2LjYgMTU0LjdWMzg4LjhMMjQ0LjcgNTA4eiIvPjwvc3ZnPgo=",logoBackgroundColor:"#5683ec",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGltYWdlLXJlbmRlcmluZz0ib3B0aW1pemVRdWFsaXR5IiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgdGV4dC1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGU+LnN0MXtmaWxsOiM4YzhjOGN9PC9zdHlsZT48cGF0aCBkPSJtNDk5LjggNzcuNS01LjUgMTl2NTU5LjFsNS41IDUuNSAyNTkuNy0xNTMuNUw0OTkuOCA3Ny41eiIgZmlsbD0iIzM0MzQzNCIvPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Im00OTkuOCA3Ny41LTI1OS4zIDQzMEw0OTkuOCA2NjFWNzcuNXoiLz48cGF0aCBkPSJtNDk5LjggNzEwLjMtMi45IDR2MTk5LjFsMi45IDkuMSAyNTkuNy0zNjUuOC0yNTkuNyAxNTMuNnoiIGZpbGw9IiMzYzNjM2IiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNDk5LjggOTIyLjVWNzEwLjNMMjQwLjUgNTU2LjdsMjU5LjMgMzY1Ljh6Ii8+PHBhdGggZD0ibTQ5OS44IDY2MSAyNTkuNy0xNTMuNS0yNTkuNy0xMTcuOFY2NjF6IiBmaWxsPSIjMTQxNDE0Ii8+PHBhdGggZD0iTTI0MC41IDUwNy41IDQ5OS44IDY2MVYzODkuN0wyNDAuNSA1MDcuNXoiIGZpbGw9IiMzOTM5MzkiLz48L3N2Zz4K",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:jp},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",logo:Cp,logoBackgroundColor:"#FFFFFF"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://etherscan.io/tx/${e.id||e}`:t?`https://etherscan.io/token/${t}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:jp,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Cp,type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Op="https://assets.spooky.fi/tokens/FTM.png",zp="https://assets.spooky.fi/tokens/wFTM.png";var _p={name:"fantom",id:"0xfa",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00NjcgMTM1LjVjMTgtOS4zIDQ1LjEtOS4zIDYzIDBsMTgzLjQgOTdjMTAuNyA2LjEgMTYuNiAxNCAxOCAyMy4zdjQ4Ni42YzAgOS4zLTYuMSAxOS4yLTE4IDI1LjJsLTE4My4yIDk3Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTgzLjMtOTdjLTExLjktNi4xLTE3LjItMTUuOS0xOC0yNS4yVjI1NS43Yy43LTguNyA2LjctMTcuMiAxNy4yLTIzLjNMNDY3IDEzNS41em0yMzUuOCAzODkuNy0xNzIuNiA5MC45Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTcxLjktOTAuM3YyMTQuNGwxNzEuOSA5MC4zYzEwIDUuMyAyMC42IDEwLjcgMzEuMiAxMS4zaC43YzEwIDAgMjAtNS4zIDMwLjUtMTBsMTc0LTkyLjMtLjgtMjE0LjN6TTIzNy4zIDczMS4xYzAgMTguNiAyIDMxLjIgNi43IDM5LjggMy4zIDcuMyA4LjcgMTIuNiAxOC42IDE5LjJsLjcuN2MyIDEuNCA0LjcgMi42IDcuMyA0LjdsMy4zIDIgMTAuNyA2LjEtMTQuNiAyNC42LTExLjMtNy4zLTItMS40Yy0zLjMtMi02LjEtNC04LjctNS4zLTI3LjktMTguNi0zNy44LTM5LjItMzcuOC04MS42di0xLjRoMjcuMXpNNDg1IDM5Ni40Yy0xLjQuNy0yLjYuNy00IDEuNGwtMTgzLjIgOTYuOWgtLjcuN2wxODMuMyA5N2MxLjQuNyAyLjYgMS40IDQgMS40bC0uMS0xOTYuN3ptMjkuMyAwdjE5Ny44YzEuNC0uNyAyLjYtLjcgNC0xLjRsMTgzLjMtOTdoLjctLjdsLTE4My4zLTk4LjJjLTEuNC0uNS0yLjgtMS4yLTQtMS4yem0xODguNS0xMDctMTY0LjcgODYuMyAxNjQuNyA4Ni40VjI4OS40em0tNDA3LjcgMHYxNzMuM2wxNjQuNy04Ni4zLTE2NC43LTg3em0yMjIuNS0xMjhjLTkuMy01LjMtMjYuNS01LjMtMzYuNiAwbC0xODMuMiA5N2gtLjcuN2wxODMuMyA5N2M5LjMgNS4zIDI2LjUgNS4zIDM2LjYgMGwxODMuMy05N2guNy0uN2wtMTgzLjQtOTd6bTIxMi41IDkuMyAxMS4zIDcuMyAyIDEuNGMzLjMgMiA2LjEgNCA4LjcgNS4zIDI3LjkgMTguNiAzNy44IDM5LjIgMzcuOCA4MS42djEuNGgtMjguN2MwLTE4LjYtMi0zMS4yLTYuNy0zOS44LTMuMy03LjMtOC43LTEyLjYtMTguNi0xOS4ybC0uNy0uN2MtMi0xLjQtNC43LTIuNi03LjMtNC43bC0zLjMtMi0xMC43LTYuMSAxNi4yLTI0LjV6IiBmaWxsPSIjZmZmIi8+PC9zdmc+",logoBackgroundColor:"#226efb",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxjaXJjbGUgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNDI1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzE5NjlmZiIvPjxwYXRoIGQ9Ik00NzQuMSAyMTAuM2MxNC4zLTcuNCAzNS45LTcuNCA1MC4yIDBsMTQ1LjkgNzcuMmM4LjUgNC44IDEzLjIgMTEuMSAxNC4zIDE4LjV2Mzg3LjVjMCA3LjQtNC44IDE1LjMtMTQuMyAyMC4xbC0xNDUuOSA3Ny4yYy0xNC4zIDcuNC0zNS45IDcuNC01MC4yIDBsLTE0NS45LTc3LjJjLTkuNS00LjgtMTMuNy0xMi43LTE0LjMtMjAuMVYzMDZjLjUtNi45IDUuMy0xMy43IDEzLjctMTguNS4xIDAgMTQ2LjUtNzcuMiAxNDYuNS03Ny4yem0xODcuNyAzMTAuM0w1MjQuMyA1OTNjLTE0LjMgNy40LTM1LjkgNy40LTUwLjIgMGwtMTM2LjktNzEuOXYxNzAuN2wxMzYuOSA3MS45YzcuOSA0LjIgMTYuNCA4LjUgMjQuOCA5aC41YzcuOSAwIDE1LjktNC4yIDI0LjMtNy45bDEzOC41LTczLjVWNTIwLjZoLS40ek0yOTEuMiA2ODQuNWMwIDE0LjggMS42IDI0LjggNS4zIDMxLjcgMi42IDUuOCA2LjkgMTAgMTQuOCAxNS4zbC41LjVjMS42IDEuMSAzLjcgMi4xIDUuOCAzLjdsMi42IDEuNiA4LjUgNC44LTExLjYgMTkuNi05LTUuOC0xLjYtMS4xYy0yLjYtMS42LTQuOC0zLjItNi45LTQuMi0yMi4yLTE0LjgtMzAuMS0zMS4yLTMwLjEtNjV2LTEuMWgyMS43em0xOTcuMi0yNjYuNGMtMS4xLjUtMi4xLjUtMy4yIDEuMWwtMTQ1LjkgNzcuMmgtLjUuNWwxNDUuOSA3Ny4yYzEuMS41IDIuMSAxLjEgMy4yIDEuMVY0MTguMXptMjMuMiAwdjE1Ny41YzEuMS0uNSAyLjEtLjUgMy4yLTEuMWwxNDUuOS03Ny4yaC41LS41bC0xNDUuOS03OC4yYy0xLjEtLjUtMi4xLTEtMy4yLTF6TTY2MS44IDMzM2wtMTMxLjEgNjguNyAxMzEuMSA2OC43VjMzM3ptLTMyNC42IDB2MTM4bDEzMS4xLTY4LjdjMC0uMS0xMzEuMS02OS4zLTEzMS4xLTY5LjN6bTE3Ny4xLTEwMi4xYy03LjQtNC4yLTIxLjEtNC4yLTI5LjEgMGwtMTQ1LjkgNzcuMmgtLjUuNWwxNDUuOSA3Ny4yYzcuNCA0LjIgMjEuMSA0LjIgMjkuMSAwbDE0NS45LTc3LjJoLjUtLjVsLTE0NS45LTc3LjJ6bTE2OS4xIDcuNCA5IDUuOCAxLjYgMS4xYzIuNiAxLjYgNC44IDMuMiA2LjkgNC4yIDIyLjIgMTQuOCAzMC4xIDMxLjIgMzAuMSA2NXYxLjFoLTIyLjdjMC0xNC44LTEuNi0yNC44LTUuMy0zMS43LTIuNi01LjgtNi45LTEwLTE0LjgtMTUuM2wtLjUtLjVjLTEuNi0xLjEtMy43LTIuMS01LjgtMy43bC0yLjYtMS42LTguNS00LjggMTIuNi0xOS42eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Op},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",logo:zp},stables:{usd:["0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf","0x1B6382DBDEa11d97f24495C9A90b7c88469134a4"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://ftmscan.com/tx/${e.id||e}`:t?`https://ftmscan.com/token/${t}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:Op,type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:zp,type:"20"},{address:"0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",symbol:"lzUSDC",name:"LayerZero USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x1B6382DBDEa11d97f24495C9A90b7c88469134a4",symbol:"axlUSDC",name:"Axelar Wrapped USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Pp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/info/logo.png",Bp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png";var Rp={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon (POS)",fullName:"Polygon (POS) Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMzEuNSA0NTkuM2MtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnYxOTQuNGMwIDE5LjIgOS42IDM2IDI0IDQzLjJsMTY1LjYgOTZjMTQuNCA5LjYgMzMuNiA5LjYgNDggMGwxNjUuNi05NmMxNC40LTkuNiAyNC0yNCAyNC00My4ydi02OS42bC03Ni44LTQzLjJ2NjQuOGMwIDE5LjItOS42IDM2LTI0IDQzLjJsLTg2LjQgNTIuOGMtMTQuNCA5LjYtMzMuNiA5LjYtNDggMGwtODYuNC01MC40Yy0xNC40LTkuNi0yNC0yNC0yNC00My4yVjU1MC41YzAtMTkuMiA5LjYtMzYgMjQtNDMuMmw4OC44LTUwLjRjMTQuNC05LjYgMzMuNi05LjYgNDggMGwxMTIuOCA2NC44IDc2LjggNDUuNiAxMTIuOCA2NC44YzE0LjQgOS42IDMzLjYgOS42IDQ4IDBsMTY4LTk2YzE0LjQtOS42IDI0LTI0IDI0LTQzLjJ2LTE5MmMwLTE0LjQtOS42LTMxLjItMjQtNDAuOGwtMTY4LTk2Yy0xNC40LTkuNi0zMy42LTkuNi00OCAwbC0xNjUuNiA5NmMtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnY2OS42bDc2LjggNDUuNnYtNjkuNmMwLTE5LjIgOS42LTM2IDI0LTQzLjJsODguOC01Mi44YzE0LjQtOS42IDMzLjYtOS42IDQ4IDBsODguOCA1MC40YzE0LjQgOS42IDI0IDI0IDI0IDQzLjJ2MTAwLjhjMCAxOS4yLTEyIDM2LTI0IDQzLjJsLTg4LjggNTIuOGMtMTQuNCA5LjYtMzMuNiA5LjYtNDggMGwtMTEyLjgtNjkuNi03OS4yLTQzLjItMTE3LjYtNjkuNmMtMTQuNC05LjYtMzMuNi05LjYtNDggMCAwIDIuNC0xNjAuOCA5OC40LTE2My4yIDk4LjR6IiBmaWxsPSIjZmZmIi8+PC9zdmc+",logoBackgroundColor:"#824ee2",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMDkuNyA0NTljLTE2LjQgOS40LTI1LjggMjUuOC0yNS44IDQ2Ljl2MjA2LjNjMCAyMS4xIDkuNCAzNy41IDI1LjggNDYuOWwxNzUuOCAxMDMuMWMxNi40IDkuNCAzNS4yIDkuNCA1MS42IDBsMTc1LjgtMTAzLjFjMTYuNC05LjQgMjUuOC0yNS44IDI1LjgtNDYuOXYtNzIuN2wtODItNDYuOXY2OGMwIDIxLjEtOS40IDM3LjUtMjUuOCA0Ni45TDMzNyA3NjEuNGMtMTYuNCA5LjQtMzUuMiA5LjQtNTEuNiAwTDE5NCA3MDcuNWMtMTYuNC05LjQtMjUuOC0yNS44LTI1LjgtNDYuOVY1NTIuOGMwLTIxLjEgOS40LTM3LjUgMjUuOC00Ni45bDkzLjgtNTMuOWMxNC4xLTkuNCAzNS4yLTkuNCA1MS42IDBsMTE5LjUgNjggODIgNDkuMiAxMTkuNSA2OGMxNi40IDkuNCAzNS4yIDkuNCA1MS42IDBMODkwLjIgNTM0YzE2LjQtOS40IDI1LjgtMjUuOCAyNS44LTQ2LjlWMjgzLjJjMC0xNi40LTkuNC0zMi44LTI1LjgtNDIuMkw3MTIuMSAxMzcuOWMtMTYuNC05LjQtMzUuMi05LjQtNTEuNiAwTDQ4NC43IDI0MWMtMTYuNCA5LjQtMjUuOCAyNS44LTI1LjggNDYuOXY3NWw4MiA0OS4ydi03Mi43YzAtMjEuMSA5LjQtMzcuNSAyNS44LTQ2LjlsOTMuOC01Ni4zYzE2LjQtOS40IDM1LjItOS40IDUxLjYgMGw5My44IDUzLjljMTQuMSA5LjQgMjUuOCAyNS44IDI1LjggNDYuOXYxMDhjMCAyMS4xLTExLjcgMzcuNS0yNS44IDQ2LjlsLTkzLjggNTYuM2MtMTQuMSA5LjQtMzUuMiA5LjQtNTEuNiAwTDU0MSA0NzUuNGwtODItNDYuOS0xMjQuMi03Mi43Yy0xNC4xLTkuNC0zNS4yLTkuNC01MS42IDAtLjEuMS0xNzEuMiAxMDMuMi0xNzMuNSAxMDMuMnoiIGZpbGw9IiM4MjQ3ZTUiLz48L3N2Zz4=",currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Pp},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",logo:Bp},stables:{usd:["0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://polygonscan.com/tx/${e.id||e}`:t?`https://polygonscan.com/token/${t}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://polygon.meowrpc.com","https://polygon-bor.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:Pp,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:Bp,type:"20"},{address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xf6261529C6C2fBEB313aB25cDEcD243613b40EB5",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Up="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDp1cmwoI1NWR0lEXzAwMDAwMDE5Njc2ODQzODE5NzI3MzAwODIwMDAwMDA1OTQ3NjMyODMzODYxMjM4OTE3Xyl9LnN0MntmaWxsOnVybCgjU1ZHSURfMDAwMDAwNjQzMjA1MjE4MTcxODM4NzM1NjAwMDAwMDMxNzkyNDIxNTkzMzkwODM5NjdfKX08L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iODE1Ljg1NiIgeTE9IjcwLjgyNCIgeDI9IjM4OC4zMzYiIHkyPSItNzQ4LjA1MiIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDE5MS40MzUpIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMGZmYTMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNkYzFmZmYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGQ9Ik0yMzcuOSA2NTcuOWM0LjktNC45IDEyLjItNy4zIDE3LjEtNy4zaDYxOS43YzEyLjIgMCAxNy4xIDE0LjcgOS44IDIyTDc2Mi4xIDc5NS4xYy00LjkgNC45LTEyLjIgNy4zLTE3LjEgNy4zSDEyNS4zYy0xMi4yIDAtMTcuMS0xNC43LTkuOC0yNC41bDEyMi40LTEyMHoiIGZpbGw9InVybCgjU1ZHSURfMV8pIi8+PGxpbmVhckdyYWRpZW50IGlkPSJTVkdJRF8wMDAwMDE1MDgxNTQ0MzI2NzI2OTc2MDQ0MDAwMDAxMzQ2MDgyNDM3MDQwMzE3MjU0M18iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iNjI4LjQ4MSIgeTE9IjE2NC4xMzQiIHgyPSIyMDAuOTYyIiB5Mj0iLTY1NC43NCIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDE5MS40MzUpIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMGZmYTMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNkYzFmZmYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGQ9Ik0yMzcuOSAyMDQuOGM0LjktNC45IDEyLjItNy4zIDE3LjEtNy4zaDYxOS43YzEyLjIgMCAxNy4xIDE0LjcgOS44IDIyTDc2Mi4xIDM0MmMtNC45IDQuOS0xMi4yIDcuMy0xNy4xIDcuM0gxMjUuM2MtMTIuMiAwLTE3LjEtMTQuNy05LjgtMjJsMTIyLjQtMTIyLjV6IiBmaWxsPSJ1cmwoI1NWR0lEXzAwMDAwMTUwODE1NDQzMjY3MjY5NzYwNDQwMDAwMDEzNDYwODI0MzcwNDAzMTcyNTQzXykiLz48bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzAwMDAwMDA3NDA5ODc3MzYzMTA0OTgxNjMwMDAwMDE1MTMzNzA1NTcwNjgwMDk3NzA5XyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSI3MjAuOTIzIiB5MT0iMTE1Ljg3IiB4Mj0iMjkzLjQwNiIgeTI9Ii03MDMuMDAzIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDAgMTkxLjQzNSkiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzAwZmZhMyIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2RjMWZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PHBhdGggZD0iTTc2Mi4xIDQzMC4xYy00LjktNC45LTEyLjItNy4zLTE3LjEtNy4zSDEyNS4zYy0xMi4yIDAtMTcuMSAxNC43LTkuOCAyMkwyMzggNTY3LjNjNC45IDQuOSAxMi4yIDcuMyAxNy4xIDcuM2g2MTkuN2MxMi4yIDAgMTcuMS0xNC43IDkuOC0yMkw3NjIuMSA0MzAuMXoiIGZpbGw9InVybCgjU1ZHSURfMDAwMDAwMDc0MDk4NzczNjMxMDQ5ODE2MzAwMDAwMTUxMzM3MDU1NzA2ODAwOTc3MDlfKSIvPjwvc3ZnPgo=",Wp="https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png";var Qp={name:"solana",networkId:"solana",namespace:"solana",label:"Solana",fullName:"Solana Mainnet Beta",logo:Up,logoBackgroundColor:"#000000",logoWhiteBackground:Up,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111",logo:Wp},wrapped:{address:"So11111111111111111111111111111111111111112",logo:Wp},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://solscan.io/tx/${e.id||e}`:t?`https://solscan.io/token/${t}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://swr.xnftdata.com/rpc-proxy"],sockets:["wss://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","wss://mainnet-beta.solflare.network"],tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:Wp,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"},{address:"DePay1miDBPWXs6PVQrdC5Vch2jemgEPaiyXLNLLa2NF",symbol:"DEPAY",name:"DePay",decimals:9,logo:"https://depay.com/favicon.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const Yp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDojMjEzMTQ3fTwvc3R5bGU+PHBhdGggZD0iTTkyIDkyaDgxNnY4MTZIOTJWOTJ6IiBmaWxsPSJub25lIi8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTE2NS44IDM0MC4xVjY2MGMwIDIwLjYgMTAuOCAzOS4yIDI4LjcgNDkuNmwyNzcuMSAxNTkuOWMxNy42IDEwLjEgMzkuNSAxMC4xIDU3LjEgMGwyNzcuMS0xNTkuOWMxNy42LTEwLjEgMjguNy0yOSAyOC43LTQ5LjZWMzQwLjFjMC0yMC42LTEwLjgtMzkuMi0yOC43LTQ5LjZsLTI3Ny4xLTE2MGMtMTcuNi0xMC4xLTM5LjUtMTAuMS01Ny4xIDBsLTI3Ny4xIDE2MGMtMTcuNiAxMC4xLTI4LjQgMjktMjguNCA0OS42aC0uM3oiLz48cGF0aCBkPSJtNTYwLjQgNTYyLTM5LjUgMTA4LjRjLTEgMi45LTEgNi4yIDAgOS41bDY3LjkgMTg2LjQgNzguNi00NS40LTk0LjMtMjU4LjhjLTIuMy02LTEwLjQtNi0xMi43LS4xem03OS4zLTE4Mi4xYy0yLjMtNS45LTEwLjQtNS45LTEyLjcgMGwtMzkuNSAxMDguNGMtMSAyLjktMSA2LjIgMCA5LjVMNjk4LjggODAzbDc4LjYtNDUuNC0xMzcuNy0zNzcuNHYtLjN6IiBmaWxsPSIjMTJhYWZmIi8+PHBhdGggZD0iTTUwMCAxNDIuNmMyIDAgMy45LjYgNS41IDEuNmwyOTkuNiAxNzNjMy42IDIgNS41IDUuOSA1LjUgOS44djM0NmMwIDMuOS0yLjMgNy44LTUuNSA5LjhsLTI5OS42IDE3M2MtMS42IDEtMy42IDEuNi01LjUgMS42cy0zLjktLjYtNS41LTEuNmwtMjk5LjYtMTczYy0zLjYtMi01LjUtNS45LTUuNS05LjhWMzI2LjdjMC0zLjkgMi4zLTcuOCA1LjUtOS44bDI5OS42LTE3M2MxLjYtMSAzLjYtMS42IDUuNS0xLjZ2LjN6bTAtNTAuNmMtMTAuOCAwLTIxLjIgMi42LTMxIDguMmwtMjk5LjYgMTczYy0xOS4yIDExLjEtMzEgMzEuMy0zMSA1My41djM0NmMwIDIyLjIgMTEuOCA0Mi40IDMxIDUzLjVsMjk5LjYgMTczYzkuNSA1LjUgMjAuMiA4LjIgMzEgOC4yczIxLjItMi42IDMxLTguMmwyOTkuNi0xNzNjMTkuMi0xMS4xIDMxLTMxLjMgMzEtNTMuNXYtMzQ2YzAtMjIuMi0xMS44LTQyLjQtMzEtNTMuNWwtMjk5LjktMTczYy05LjUtNS41LTIwLjItOC4yLTMxLTguMmguM3oiIGZpbGw9IiM5ZGNjZWQiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJtMzAxLjUgODAzLjIgMjcuOC03NS43IDU1LjUgNDYtNTEuOSA0Ny43LTMxLjQtMTh6Ii8+PHBhdGggZD0iTTQ3NC41IDMwMi4yaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOEwyMjIuOSA3NTcuNWw3OC42IDQ1LjRMNDgxLjEgMzExYzEuNi00LjYtMS42LTkuMS02LjItOS4xbC0uNC4zem0xMzMuMiAwaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOGwtMTg2IDUwOS44IDc4LjYgNDUuNEw2MTMuOSAzMTFjMS42LTQuNi0xLjYtOS4xLTYuMi05LjF2LjN6IiBmaWxsPSIjZmZmIi8+PC9zdmc+Cg==";var Fp={name:"arbitrum",id:"0xa4b1",networkId:"42161",namespace:"eip155",platform:"evm",label:"Arbitrum",fullName:"Arbitrum One",logo:Yp,logoBackgroundColor:"#2b354d",logoWhiteBackground:Yp,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp.currency.logo},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",logo:Dp.wrapped.logo},stables:{usd:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"]},explorer:"https://arbiscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://arbiscan.io/tx/${e.id||e}`:t?`https://arbiscan.io/token/${t}`:n?`https://arbiscan.io/address/${n}`:void 0,endpoints:["https://arbitrum.blockpi.network/v1/rpc/public","https://arbitrum-one.publicnode.com","https://endpoints.omniatech.io/v1/arbitrum/one/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Dp.currency.logo,type:"NATIVE"},{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Dp.wrapped.logo,type:"20"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8/logo.png",type:"20"},{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1/logo.png",type:"20"},{address:"0x912CE59144191C1204E64559FE8253a0e49E6548",symbol:"ARB",name:"Arbitrum",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Vp="https://traderjoexyz.com/static/media/avalanche.7c81486190237e87e238c029fd746008.svg",Hp="https://raw.githubusercontent.com/traderjoe-xyz/joe-tokenlists/main/logos/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png";var Gp={name:"avalanche",id:"0xa86a",networkId:"43114",namespace:"eip155",platform:"evm",label:"Avalanche",fullName:"Avalanche C-Chain",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0zNTkuMSA3NTEuMWgtOTUuM2MtMjAgMC0yOS45IDAtMzYtMy44LTYuNi00LjMtMTAuNC0xMS4zLTEwLjktMTguOS0uMy03LjEgNC42LTE1LjggMTQuNC0zM2wyMzUtNDE0LjNjMTAuMS0xNy42IDE1LjEtMjYuNCAyMS40LTI5LjYgNi45LTMuNSAxNS4xLTMuNSAyMS45IDAgNi40IDMuMyAxMS40IDEyIDIxLjQgMjkuNmw0OC40IDg0LjMuMi41YzEwLjggMTguOSAxNi4zIDI4LjUgMTguNiAzOC41IDIuNiAxMC45IDIuNiAyMi42IDAgMzMuNS0yLjQgMTAuMS03LjggMTkuOC0xOC44IDM4LjlMNDU2LjIgNjk0LjlsLS4zLjVjLTEwLjggMTktMTYuMyAyOC43LTI0LjEgMzYtOC4zIDgtMTguMyAxMy43LTI5LjMgMTYuOS05LjkgMi44LTIxLjEgMi44LTQzLjQgMi44em0yNDAuMyAwaDEzNi40YzIwLjIgMCAzMC4yIDAgMzYuMy00IDYuNi00LjMgMTAuNi0xMS4zIDEwLjktMTkuMS4zLTYuOS00LjUtMTUuMi0xMy45LTMxLjZsLTEtMS43TDY5OS44IDU3OGwtLjgtMS4yYy05LjYtMTYuMy0xNC40LTI0LjUtMjAuNy0yNy42LTYuOS0zLjYtMTUtMy42LTIxLjcgMC02LjIgMy4zLTExLjMgMTEuOC0yMS4zIDI5bC02OC4xIDExNi45LS4yLjNjLTEwLjEgMTcuMi0xNSAyNS44LTE0LjUgMzIuOC41IDcuNyA0LjUgMTQuOSAxMC45IDE5IDUuNyAzLjkgMTUuOCAzLjkgMzYgMy45eiIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#E84142",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yMzUuNiAyNTkuNWg1MjguOXY0ODFIMjM1LjZ2LTQ4MXoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNOTI4IDUwMGMwIDIzNi40LTE5MS42IDQyOC00MjggNDI4UzcyIDczNi40IDcyIDUwMCAyNjMuNiA3MiA1MDAgNzJzNDI4IDE5MS42IDQyOCA0Mjh6TTM3OC43IDY3MC4zaC04My4xYy0xNy41IDAtMjYuMSAwLTMxLjMtMy40LTUuNy0zLjctOS4xLTkuOC05LjYtMTYuNS0uMy02LjIgNC0xMy44IDEyLjYtMjguOUw0NzIuNSAyNjBjOC43LTE1LjQgMTMuMS0yMyAxOC43LTI1LjkgNi0zIDEzLjEtMyAxOS4xIDAgNS42IDIuOCAxMCAxMC41IDE4LjcgMjUuOWw0Mi4yIDczLjYuMi40YzkuNCAxNi41IDE0LjIgMjQuOCAxNi4zIDMzLjYgMi4zIDkuNiAyLjMgMTkuNiAwIDI5LjItMi4xIDguOC02LjggMTcuMi0xNi40IDM0TDQ2My42IDYyMS4ybC0uMy41Yy05LjUgMTYuNi0xNC4zIDI1LTIxIDMxLjQtNy4zIDYuOS0xNiAxMi0yNS41IDE0LjgtOC43IDIuNC0xOC41IDIuNC0zOC4xIDIuNHptMjA5LjggMGgxMTljMTcuNiAwIDI2LjQgMCAzMS43LTMuNSA1LjctMy43IDkuMi05LjkgOS42LTE2LjYuMy02LTMuOS0xMy4zLTEyLjItMjcuNWwtLjktMS41LTU5LjYtMTAyLS43LTEuMWMtOC40LTE0LjItMTIuNi0yMS4zLTE4LTI0LjEtNi0zLTEzLjEtMy0xOSAwLTUuNSAyLjgtOS45IDEwLjMtMTguNiAyNS4zbC01OS40IDEwMi0uMi40Yy04LjcgMTUtMTMgMjIuNS0xMi43IDI4LjcuNCA2LjcgMy45IDEyLjkgOS42IDE2LjYgNSAzLjMgMTMuOCAzLjMgMzEuNCAzLjN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2U4NDE0MiIvPjwvc3ZnPg==",currency:{name:"Avalanche",symbol:"AVAX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Vp},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",logo:Hp},stables:{usd:["0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"]},explorer:"https://snowtrace.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://snowtrace.io/tx/${e.id||e}`:t?`https://snowtrace.io/token/${t}`:n?`https://snowtrace.io/address/${n}`:void 0,endpoints:["https://avalanche.public-rpc.com","https://avalanche.blockpi.network/v1/rpc/public","https://avax.meowrpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"AVAX",name:"Avalanche",decimals:18,logo:Vp,type:"NATIVE"},{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",name:"Wrapped AVAX",decimals:18,logo:Hp,type:"20"},{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7/logo.png",type:"20"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E/logo.png",type:"20"},{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70/logo.png",type:"20"},{address:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const qp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAMAAAAKTh9YAAAAYFBMVEVHcEz////////////////////////////////////j++ma6qVj5nsl5lAK4zpA6mXO79aD8Zyr87uCvq0J2TkItEkOhl4EeVsKzSwLrxMNtQpjsZG42dEeuxyF2oU6wzjPwJjeAAAACnRSTlMAEUB9r9j/YO+Kf6/iMwAABD1JREFUeAHU1EESQjEMAlBIAq33v7ArV7+OLss7AZOB4IDVI/kW0nQRf+Ca7QvNwg/s7VtpGJP8oPFNybdT4aidoPHEcYZn6ymnEEOjH8KPk0zeTI+DLacpfMhpxKTGnFtDB9o8/Jisw8uxh1/OtGIrYw9Ah9pEOVWhnaoxTvWCnErR2Z3rzX59JMYOAkEYXr1gRJfIzP1PalbOpZm2aEf+tcKnCCz7bS37si/7si/7si/7si/7srvRHAE5kJHdbV4wkn076Q9RMMLu04fYnceT/An9JnhMkr19Ezwvvvee73ieOL1dfdN15yQlwas2S7vbgTn4iLfaDO0emIPPeLtgZt+AOfhcQHJGdieYg88VLG9k98AUfG7gBRu7YAo+9wpeNLEnYAY+915wkIndQ4Xn9IajgoV9hwbP6b3iqGRhF5zH537VHi3swGl87tft3tB+Ap/7Z9lFhef0z3hndmjwnP4Z32qEAs/po4//Rwao8JzeC3hiMyeACs/ppnMCUlThOf3wxjurObAKz+kHNz5arT0CNHhO5zde7NZ8UYXn9N4K2Utnt8NzOsFL+Kuz2+EJneA5nduN8bmTWsXzKqNzuyX+FZ3rL43Sud0Un/txtV7KqNY+6Hq7Kb71Gxt0W7seX5od/Z6a+8BuGASCMMwraRK4103A9z9leq+Q3zCYC+h7oy7tbr6d4zGd2zme04Ed4AEd2AEe0Kmd4wGd2jke0Kmd4wGd2jke0Kmd4wGd2jke0Kmd4wGd2Tl+B+jQzvH7j/ThnNub4Xd7Rud2gLc9pyM7wO9sz+nEDvA7e8G/0vX2IeTan/DXPdWL+cwD/hl/c3r2lT2u7XbWk31aYt9vesp9yD5Xn1ZPx7svtNtMYwfX9/hqjwAvuq8awIufZwzgxc+RZgAvfn43gBe/N5lxPLAD+sTs2HgnS53jnS51jHfC1CneKVOHeCdNneGdNnWEd+LUCd6pUwd4p04d4J06dYB3tekAL64nSAAvr+PgeGYHdI6ndkDneGoHdI4HdkAvxw/V7IsiegU8sIdSejk+VbIvyumveBY8twdQh51A8PL691x8PBf3HRD8oO33QPhR2mfD8EnZ3wTxXthXRvFe18+H8anbPsqkOVfnnJ6DF/RmPdE5vs69aQiYnoH3rXuzXukcP6jmE3C8734uxAgfgSvM4+D4RcV37SmgZ+BT6/kz0yd6KT5+kcex9bel+fDPupXP+MOs8byl6esGYfRxbDPnanG0OVf+8ODeH9Ks5f+mE50vJlp37d23EQQhFATRr6Yg/4RPuSe9o6tmIni7gN2222677bbbbrvttttuu5sw/7EP1j7kfhO6m5Wbak90Jw7d54NeGsV9jb0y1B+f+P5qpHB08XvD8M4zrq9N7pqje/L8jj/twXa8XOl4uSoe4/363RnvlyOo/LE1R8JnZfywrB7pGLY0Xa/gV5AhY9e5oJHCAAAAAElFTkSuQmCC",Zp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAYAAAA9kO9qAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0PSURBVHgB7d1LbFzVHcfx37l3/CDGxgkhxEnU2K1EgxoUN0kVUglhIhbdVAo7dpCiSl2BqbqphIRpuy5u95SwY1XSWlXVIhFXtGqjJsXQSJRCsXklaQiJ8zCxPTP3cv53cuOxZ8bjmbmP8z/n/5GMHcfjmPHXZ86ce++xQpJGxwdRwChCtQ9Q+nU4qt87CIVhCLGeEHP6v/NQag5h8DY8TKOEGcxMziMhCp2iwD0c1V/kE/QnUNxCJGdavxzHmRdfQYfajz2K3HsGKhyHBC7SN6dznUY5eEGP9nNoQ+uxS+Qib6GawL9++QJa1FrsB8fH9D/0sn5rGELka04PuMdwenJ6ozfwN/qB2D/+vP7ZOA4ZzYUZdIfqSQx9Fzj/979s5AbNR3aatvieHs3DoxDCSOqEnssfa7Zys37s0VKiOqmXhUYhhMlCvUwZhI+sF3zj2CV0wU2T4L2GN6Spi4QuOFG612jKXV/9J6j0ZFThRxCCnz2NnrTWTmMqy4snIQRnSk9n1ixL1k5jKuvoQvBGHdPzziqrY4/W0uWAkbDCMDw1Xv2OlWnM6PgwfDULIewxj3I4Eq/OrIzsvpqAEHYZrB7dq6cxD0MI2yg8E8/dK7HvH38SMlcXdqpcb4E49sqFF0LY6VbfqnKil7oCIewVPVH1omtGhbBbdG20hwBjEMJ2AcWuvH0QwnYK+zyE4TCEsF2oaGSXy+yEA3TntPQ4DCHsN+xBCEdI7MIZErtwhsQunCGxC2dI7MIZErtwhsQunCGxC2dI7MIZErtwhsQunCGxC2dI7MIZErtwRgEWU30loK9c+cOCj3DB6v/dtqltS7ffDi/2wFZWffcpbv/IJXh7r8Hfe70SexWKPZjdhPKpzdGLzd/Y9dD9Uzh0BR69VIUeo/somO1D6c0tCN6y50I2hQPPhmCORqauxz9D4cjnLd2u9MY9KL6605noC9+/EN1PaweB9dB9Q/cR3VfcsY+9nW/gWsWpIRRf+hpspUa+RM/T/4OnX7eLol987n7WAwPb2Cnurqdn9cPxZSTBhm9mPfRo1/XUxx0NBtWWX9qN0tR2cMRyNYa+cT2/eDex0KPPqadCvfpzqjpzWK4Kj51D99MfJhY66X7qo+jRlCOWsdNI1clDciM2Be8/9AW6n/gEaaDg6UkuN+xip1Gl1SeirbAheH/0Krp/OIc09fz0v4k+YmSBVewUYBYPoZyD976xgMLjn0INpBui0scv6BGWE1ax06qLl1GAHIOn0D09qvt7biAL9Airdic/nUwLq9iznidyCj4KXb/438l2q/2uR9ObUiaNTex+g6N9aeMQfBx69PaORWTJPyKxJ45iz4vJwVeHrrYupz5XX4vm7mpkARywiT3v0EwMvjr0SH8RefBHeMzb2cTuGXCHmhR8Tej0Pj2y54HLk3g+I7sha7omBF8v9EhPgDxI7BbLM/iGoedpyQcHbGIPDDtBK4/gm4a+lM+3M7zK47IINrGbeDZilsFvZEQPr3UhD3ShBwd8Yp/dBBNlEfxGpy7huV7kIfjkDnDAJvbSqc0wVZrBtzJHD68X9Oie7ZSCHnHz+iFrFZ85+9kBoy+YTiP4dp6MBu/diSwV/3gvuGC1GlOaMvuOTTL4dlddyu/chTDDJ6rlv20BF8xiHzJuVWatJILvaHlRhx68M4AsFF/dxeoyRlaxhws+ln/9dZiuk+CTWEePRveU5+7xrgOcsDuoRHN3DndyO8EndsBIj+6l3w2lNp2h5050cTo3LI+g0sOnbcEnfWSUVmZKJ5IPPg6d4y4MPnYcngBDNMIT2vnLZHQKLO2+RTuQocFqUmqnANz0EX5wZ3QSnUrgvJnwcjcWJ/YYe8yjGbaxExuCT/1cl2VPx9kXxa46OCuy/O8BLP38Pr2mzuMAUj2sYyecg8/spC4dPB3SD/7T33L0wWe9KP15G5Z/sxuY7wZnVuz1SLoe/zS6INt08c5jqr+U29mL9G+rHYt6erMQnRZMf7799ekfDFzqRqBfwvf6EdzwUT6tf0Cv898D15rYCZvg9dy3+Id7jQ8oLCprQidWnc/OZpVmyzK6jp4H+s3dZMi20Il1F2+wCV6HbmrwNoZOrLxSSYJvn62hE2svy5PgW2dz6MTqa1Al+I2zPXRi/QXXEnxzLoROnNhdQIJvzJXQiTNbaUjwtVwKnTi1b4wEv8K10IlzmyRJ8G6GTpzcEczl4F0NnTi7/R234NWmzi/idjl04vRej6yCf/R9qJ4OfmnvTc/p0InzG5tyCR67+tB94FRbwUvoFbKLL3gF3/PAmy0Ffzv0mzx22k2TxH4Lh+DDzVug+pY2HLyEvprEXsX44H0fwcBdUL1fNg1eQq8lsa9BwZemtsNYd1QueG4WvIReS2KvI9rWzdRNVLtXLnpuFHxAu+pK6DUk9jpom73gbD9MFPau3sqiXvDhZzy2kM6axN4ABc9FTfBlBVFLYm9Abcvn1yw2VS7Xffft4PuuAr35/NY800nsddDejP7eazBSg9hJHLw/fBGilsReh8l7z6jFm+v/faGI3u+9Dm/7FxCrSexr0EZLhSOfw1Tqxo3mH6OD3/SD30vwa0jsVTjsKKYWmscefVzvsgS/hsR+C4vQr1xed85e8/ES/CoSO/jsEen9/wJaJcGvcD52LqGrS/p5xHJ7y6ESfIXTsXMJnSL3znX2dUrwDsfOKXT/ww+QBNeDdzJ2dqEvJ3c01+XgnYvd5dBjrgbvVOwS+goXg3cmdgm9lmvBOxG7hN6YS8FbH7uE3pwrwVsdu4S+cS4Eb23sEnrrbA/eytgl9PbZHLx1sUvonbM1eKtiZ/Mbrq8pY0OP2Ri8NbGzCf1iDxZ/sg9Lf3oAprMteCtiZxX6c/dHr5dPHsTSyQMwnU3Bs4+dY+gxCT5brGPnHHpMgs8O29htCD0mwWeDZew2hR7jFrwavA5u2MVeOHTZutBjvIKf0q87/6VmWeIX+1Mfw3TthB7jErynR/auw2fBCavYaacub5vZo0knoce4BN99+B1Wozuv2A2fviQReoxD8DSd4TS6s4nd23vN6FE9ydBjHILv+vZ74IJN7IVDV2CqNEKPmR48zd25rMywiV2NtP/bndOUZugx04P3R86BAz6xGziFySL0mMnBezKyJ8u0+XqWocdMDd7r57EiI7v4tiGP0GNcliVNxCZ2U34vaZ6hx0wLPrie333RCj6xX+xG3kwIPWZS8MH8ZnDAJvbg7ADyZFLoMVOCD84PggM2sZdO5Td6mBh6LO/gg/l+BBfuBgd8pjGzfbnM200OPZZn8OXZIXDB6Amqj9LUvcgSh9BjeQW/pP9dLlgtPZamhjIb3TmFHss6+OJb9yHU0xguWMVOo3vx1R1IG8fQYxT84m/HkDaaq3Ma1Qm7g0o0upfeuAdp4Rx6rDjzzdSDX5p6mNWoTlgeQS2+tBvB7CYkzYbQY2kGv/j6gyi9vxPc+NhxeALcFD2U/7oVatdNeLsWkQT64Vn62R4rQo8FF7YivNIPf+Q8VGHjvxm7kXCxR4/oD6F46lvgSOHAsyEYS2KngdLUdv1cYKcxpyQkjc5KvOPYFLzN7Z+dGJy/Gzdfe4TNmno97GMndPovRV84cqml25X1UVmKPO+js1mhq4q6x860FD09EV1+cz+K/9wD7qyIPUbR0+V7/qEr8Pdeh+orrfp7GrlpulLWR2PLb2y1diRvxh8+F4VPmx35Q6s3PApLXQg+H0B5Ti8EvDuiX6e/+pUVq2Kv5/ZFH3rZ0tW4m4l2COitbJ/NbYWlFdZ/9216wpkWeuKJRfvvJ7l4QzhDYhfOkNiFMyR24QyJXThDYhfOkNiFMyR24QyJXThDYhfOkNiFMyR24QyJXThDYhfOkNiFMyj2OQhhvzkPIeYhhO105zr28G0IYTsVfuRBYQZC2C7EjKdn7RK7sJ+HaQ+lKHaZtwu7lWhkn5mk0GV0Fzabps4r6+xh+AqEsNdx+k8l9gAnIFMZYaNQH0c682I0mFdip6lMGP4KQthGhdPxmyunCwSYhIzuwjZlvBC/uRK7jO7CNkqHPjM5F/9x9YlgNLqHcq6MsAB1fPrFiep3rY6dRncvPAYhuKvTsV/zQef+MYedDyr9GDAGITii6cvpyeO1727kwI9f048FRyEEK+EJnJl8rN7fNL54oxwco5NnIAQX1GsZDafhat0bj44PwlMn9UeNQgiTUehB+Mit01/qWv+yPLohfQKoExDCWHrq0iR0sv7IXu3g+ARC9TyEMEn0ZHT1EmPjD23FwfExBOplfathCJEnWken5cXTk9MbvUlrscdklBd5oWumPX2kv6QPgDaZtqzVXuxkdHwYvtLR42EZ6UXqOog81n7s1faPP6k/0xNyIEokigJX4Yx+/Up0GnqbkceSiT1GS5UFvUwZYEx/5n36ixzW/8SgjPyiqeicrHC+sgGAmtGRvx1dMtph4NW+AiZycfiu2QTRAAAAAElFTkSuQmCC";var Jp={name:"gnosis",id:"0x64",networkId:"100",namespace:"eip155",label:"Gnosis",fullName:"Gnosis Chain",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojZmZmfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMzMS45IDU1Ni41YzIzLjUgMCA0Ni40LTcuOCA2NS0yMi4yTDI0OCAzODUuNGMtMzUuOSA0Ni40LTI3LjQgMTEyLjkgMTguOSAxNDguOCAxOC42IDE0IDQxLjUgMjEuOSA2NSAyMS45di40em00NDIuMy0xMDYuMWMwLTIzLjUtNy44LTQ2LjQtMjIuMi02NUw2MDMuMiA1MzQuMmM0Ni40IDM1LjkgMTEyLjkgMjcuNCAxNDguOC0xOC45IDE0LjMtMTguNiAyMi4yLTQxLjQgMjIuMi02NC45eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Im04NDkuMiAyODguNS02NS45IDY1LjljNTIuOSA2My42IDQ0LjcgMTU4LTE4LjkgMjExLjItNTUuNiA0Ni43LTEzNi42IDQ2LjctMTkyLjIgMEw1MDAgNjM3LjdsLTcyLjEtNzIuMWMtNjMuNiA1Mi45LTE1OCA0NC43LTIxMS4yLTE4LjktNDYuNy01NS42LTQ2LjctMTM2LjYgMC0xOTIuMmwtMzMuNi0zMy42LTMyLTMyLjNDMTEyLjMgMzUyLjIgOTIgNDI1LjMgOTIgNTAwYzAgMjI1LjIgMTgyLjggNDA4IDQwOCA0MDhzNDA4LTE4Mi44IDQwOC00MDhjLjMtNzQuNC0yMC42LTE0Ny44LTU4LjgtMjExLjV6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTc5NS4xIDIxOC4zYy0xNTUuNC0xNjIuOC00MTMuNi0xNjktNTc2LjQtMTMuNy00LjkgNC42LTkuNSA5LjEtMTMuNyAxMy43LTEwLjEgMTAuOC0xOS42IDIxLjktMjguNyAzMy4zTDUwMCA1NzUuNGwzMjMuOC0zMjMuOGMtOC44LTExLjctMTguNi0yMi44LTI4LjctMzMuM3pNNTAwIDE0NS4yYzk1LjMgMCAxODQuMSAzNi45IDI1MSAxMDMuOEw1MDAgNTAwIDI0OSAyNDljNjYuNi02Ny4yIDE1NS43LTEwMy44IDI1MS0xMDMuOHoiLz48L3N2Zz4K",logoBackgroundColor:"#406958",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojM2U2OTU3fTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMyNC4yIDU1OS4xYzI0LjYgMCA0OC41LTguMiA2Ny45LTIzLjJMMjM2LjUgMzgwLjJjLTM3LjUgNDguNS0yOC43IDExOC4xIDE5LjggMTU1LjYgMTkuNSAxNC43IDQzLjMgMjIuOSA2Ny45IDIyLjl2LjR6TTc4Ni43IDQ0OC4xYzAtMjQuNi04LjItNDguNS0yMy4yLTY3LjlMNjA3LjkgNTM1LjhjNDguNSAzNy41IDExOC4xIDI4LjcgMTU1LjYtMTkuOCAxNS0xOS40IDIzLjItNDMuMyAyMy4yLTY3Ljl6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0ibTg2NS4yIDI3OC44LTY4LjkgNjguOWM1NS4zIDY2LjYgNDYuOCAxNjUuMi0xOS44IDIyMC44LTU4LjQgNDguOC0xNDIuNyA0OC44LTIwMSAwTDUwMCA2NDRsLTc1LjQtNzUuNGMtNjYuNiA1NS4zLTE2NS4yIDQ2LjgtMjIwLjgtMTkuOC00OC44LTU4LjQtNDguOC0xNDIuNyAwLTIwMWwtMzUuMi0zNS4yLTMzLjQtMzMuOGMtNDAuNiA2Ni42LTYxLjggMTQzLTYxLjggMjIxLjIgMCAyMzUuNSAxOTEuMSA0MjYuNiA0MjYuNiA0MjYuNlM5MjYuNiA3MzUuNSA5MjYuNiA1MDBjLjQtNzcuOC0yMS41LTE1NC42LTYxLjQtMjIxLjJ6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTgwOC42IDIwNS41QzY0Ni4xIDM1LjEgMzc2LjEgMjguNyAyMDUuOCAxOTEuMWMtNS4xIDQuOC05LjkgOS42LTE0LjMgMTQuMy0xMC42IDExLjMtMjAuNSAyMi45LTMwIDM0LjhMNTAwIDU3OC44bDMzOC42LTMzOC42Yy05LjItMTIuMi0xOS41LTIzLjgtMzAtMzQuN3pNNTAwIDEyOWM5OS43IDAgMTkyLjUgMzguNiAyNjIuNSAxMDguNUw1MDAgNTAwIDIzNy41IDIzNy41QzMwNy4yIDE2Ny4yIDQwMC4zIDEyOSA1MDAgMTI5eiIvPjwvc3ZnPgo=",currency:{name:"xDAI",symbol:"xDAI",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:qp},wrapped:{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",logo:Zp},stables:{usd:["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83"]},explorer:"https://gnosisscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://gnosisscan.io/tx/${e.id||e}`:t?`https://gnosisscan.io/token/${t}`:n?`https://gnosisscan.io/address/${n}`:void 0,endpoints:["https://rpc.gnosis.gateway.fm","https://rpc.gnosischain.com","https://gnosis.blockpi.network/v1/rpc/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"xDAI",name:"xDAI",decimals:18,logo:qp,type:"NATIVE"},{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",symbol:"WXDAI",name:"Wrapped XDAI",decimals:18,logo:Zp,type:"20"},{address:"0x4ECaBa5870353805a9F068101A40E0f32ed605C6",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",symbol:"GNO",name:"Gnosis",decimals:18,logo:"https://cdn.sushi.com/image/upload/f_auto,c_limit,w_16,q_auto/tokens/100/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb.jpg",type:"20"},{address:"0xD057604A14982FE8D88c5fC25Aac3267eA142a08",symbol:"HOPR",name:"HOPR",decimals:18,logo:"https://hoprnet.org/assets/icons/hopr_icon.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var Xp={name:"optimism",id:"0xa",networkId:"10",namespace:"eip155",label:"Optimism",fullName:"Optimism",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00ODcuMSAzOTUuN2MtNS4yLTE1LjgtMTMuMi0zMS43LTI2LjQtNDIuMi0xMy4yLTEwLjUtMjYuNC0yMS4yLTQ0LjktMjYuNC0xOC41LTUuMi0zNy04LTU4LjEtOC00Ny41IDAtODcuMSAxMC41LTExNi4xIDM0LjQtMjkgMjMuOC00Ny41IDU4LjEtNjAuNyAxMDIuOS0yLjYgMTUuOC04IDI5LTEwLjUgNDQuOS0yLjYgMTMuMi01LjIgMjktOCA0Mi4yLTIuNiAyMy44LTIuNiA0Mi4yIDIuNiA2MC43IDUuMiAxNS44IDEzLjIgMzEuNyAyNi40IDQyLjIgMTMuMiAxMC41IDI2LjQgMjEuMiA0NC45IDI2LjQgMTguNCA1LjIgMzcgOCA1OC4xIDggNDcuNSAwIDg3LjEtMTAuNSAxMTYuMS0zNC40czQ3LjUtNTguMSA2MC43LTEwMi45YzIuNi0xMy4yIDUuMi0yOSAxMC41LTQyLjIgMi42LTEzLjIgNS4yLTI5IDgtNDQuOSAyLjgtMjMuOCAyLjgtNDQuOC0yLjYtNjAuN3ptLTkyLjQgNjAuOGMtMi42IDEzLjItNS4yIDI2LjQtOCAzOS41LTIuNiAxMy4yLTUuMiAyNi40LTEwLjUgNDIuMi01LjIgMjMuOC0xNS44IDM5LjUtMjkgNTAuMi0xMy4yIDEwLjUtMjkgMTUuOC00Ny41IDE1LjgtMTguNCAwLTMxLjctNS4yLTM5LjUtMTUuOC04LTEwLjUtMTAuNS0yOS01LjItNTAuMiAyLjYtMTUuOCA1LjItMjkgOC00Mi4yIDIuNi0xMy4yIDUuMi0yNi40IDEwLjUtMzkuNSA1LjItMjMuOCAxNS44LTM5LjUgMjktNTAuMiAxMy4yLTEwLjUgMjktMTUuOCA0Ny41LTE1LjggMTguNCAwIDMxLjcgNS4yIDM5LjUgMTUuOCA3LjkgMTAuNiAxMC41IDI2LjMgNS4yIDUwLjJ6bTQ0MC45LTY4LjZjLTUuMi0xNS44LTEzLjItMjYuNC0yMy44LTM3cy0yMy44LTE1LjgtNDIuMi0yMS4yYy0xNS44LTUuMi0zNC40LTgtNTUuNC04SDU3OS43Yy0yLjYgMC01LjIgMC0xMC41IDIuNi0yLjYgMi42LTUuMiA1LjItNS4yIDhsLTY4LjYgMzI3LjRjMCAyLjYgMCA4IDIuNiA4IDIuNiAyLjYgNS4yIDIuNiA4IDIuNmg2OC42YzIuNiAwIDggMCAxMC41LTIuNnM1LjItNS4yIDUuMi04bDIzLjgtMTEwLjloNjguNmM0Mi4yIDAgNzYuNi04IDEwMi45LTI2LjQgMjYuNC0xOC40IDQyLjItNDcuNSA1MC4yLTg0LjYgNS4xLTE4LjQgNS4xLTM2LjctLjItNDkuOXpNNzQzLjEgNDM4Yy0yLjYgMTUuOC0xMC41IDI2LjQtMjEuMiAzNC40cy0yMy44IDEwLjUtMzcgMTAuNWgtNTguMWwxOC40LTg5LjdoNjAuN2MxMy4yIDAgMjEuMiAyLjYgMjYuNCA1LjIgNS4yIDUuMiAxMC41IDEwLjUgMTAuNSAxNS44IDMgNS4yIDMgMTMuMi4zIDIzLjh6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",logoBackgroundColor:"#FF0420",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxjaXJjbGUgY3g9IjUwMCIgY3k9IjUwMCIgcj0iMzk2LjYiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNTAwIDg5Ni42YzIxOS4xIDAgMzk2LjYtMTc3LjYgMzk2LjYtMzk2LjZTNzE5LjEgMTAzLjQgNTAwIDEwMy40IDEwMy40IDI4MC45IDEwMy40IDUwMCAyODAuOSA4OTYuNiA1MDAgODk2LjZ6TTM1MC43IDYwOWMxMC45IDMuNCAyMi42IDUuMSAzNS4zIDUuMSAyOS4xIDAgNTIuNC02LjcgNjkuNi0yMC4yIDE3LjMtMTMuNyAyOS4zLTM0LjMgMzYuMi02MS44IDItOC42IDMuOS0xNy4zIDUuNy0yNS45IDItOC42IDMuNy0xNy40IDUuMS0yNi4yIDIuNC0xMy43IDItMjUuNi0xLjItMzUuOS0zLTEwLjItOC4zLTE4LjktMTYtMjUuOS03LjQtNy0xNi42LTEyLjMtMjcuNC0xNS43LTEwLjctMy42LTIyLjMtNS40LTM1LTUuNC0yOS4zIDAtNTIuNyA3LTY5LjkgMjEuMXMtMjkuMiAzNC43LTM1LjkgNjEuOGMtMiA4LjgtNCAxNy42LTYgMjYuMi0xLjggOC42LTMuNSAxNy4zLTUuMSAyNS45LTIuMiAxMy43LTEuOCAyNS42IDEuMiAzNS45IDMuMiAxMC4yIDguNSAxOC44IDE2IDI1LjYgNy40IDYuOCAxNi42IDExLjkgMjcuNCAxNS40em02Ny44LTQ4Yy04LjIgNi40LTE3LjggOS42LTI4LjYgOS42LTExLjEgMC0xOS0zLjItMjMuOC05LjYtNC44LTYuNC02LTE2LjctMy42LTMwLjcgMS42LTguOCAzLjItMTcuMiA0LjgtMjUgMS44LTcuOCAzLjgtMTYgNi0yNC40IDMuNC0xNC4xIDkuMS0yNC4zIDE3LjItMzAuNyA4LjItNi40IDE3LjgtOS42IDI4LjYtOS42czE4LjggMy4yIDIzLjggOS42IDYuMiAxNi43IDMuNiAzMC43Yy0xLjQgOC40LTMgMTYuNi00LjggMjQuNC0xLjYgNy44LTMuNSAxNi4yLTUuNyAyNS0zLjQgMTQtOS4yIDI0LjMtMTcuNSAzMC43em05MS43IDQ4YzEuMiAxLjQgMi44IDIuMSA0LjggMi4xaDQxYzIuMiAwIDQuMS0uNyA1LjctMi4xIDEuOC0xLjQgMi45LTMuMiAzLjMtNS40bDEzLjktNjZoNDAuN2MyNS45IDAgNDYuNS01LjUgNjEuOC0xNi42IDE1LjUtMTEuMSAyNS43LTI4LjEgMzAuNy01MS4yIDIuNC0xMS43IDIuMy0yMS44LS4zLTMwLjQtMi42LTguOC03LjItMTYuMi0xMy45LTIyLTYuNi01LjgtMTUtMTAuMS0yNS0xMy05LjgtMi44LTIwLjktNC4yLTMzLjItNC4yaC04MC4yYy0yIDAtMy45LjctNS43IDIuMS0xLjggMS40LTIuOSAzLjItMy4zIDUuNEw1MDkgNjAzLjVjLS40IDIuMiAwIDQgMS4yIDUuNXptMTExLjItMTEzLjFoLTM0LjdsMTEuOC01NGgzNi4yYzcuMiAwIDEyLjYgMS4yIDE2IDMuNiAzLjYgMi40IDUuNyA1LjYgNi4zIDkuNi42IDQgLjQgOC42LS42IDEzLjktMiA5LTYuMyAxNS44LTEzIDIwLjItNi40IDQuNS0xMy44IDYuNy0yMiA2Ljd6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmMDQyMCIvPjwvc3ZnPg==",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Dp.wrapped.logo},stables:{usd:["0x94b008aA00579c1307B0EF2c499aD98a8ce58e58","0x7F5c764cBc14f9669B88837ca1490cCa17c31607"]},explorer:"https://optimistic.etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://optimistic.etherscan.io/tx/${e.id||e}`:t?`https://optimistic.etherscan.io/token/${t}`:n?`https://optimistic.etherscan.io/address/${n}`:void 0,endpoints:["https://optimism.blockpi.network/v1/rpc/public","https://optimism.meowrpc.com","https://optimism.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Dp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Dp.wrapped.logo,type:"20"},{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png",type:"20"},{address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x4200000000000000000000000000000000000042",symbol:"OP",name:"Optimism",decimals:18,logo:"https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var Kp={name:"base",id:"0x2105",networkId:"8453",namespace:"eip155",label:"Base",fullName:"Base",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguNiA4NDJDNjg4IDg0MiA4NDIgNjg4LjkgODQyIDQ5OS41UzY4OCAxNTcgNDk4LjYgMTU3QzMxOSAxNTcgMTcxLjIgMjk1LjEgMTU3IDQ3MC4zaDQ1My4xdjU3LjVIMTU3QzE3MiA3MDMuOSAzMTkgODQyIDQ5OC42IDg0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#0052FF",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguOSA4NDVDNjkwLjEgODQ1IDg0NSA2OTAuMyA4NDUgNDk5LjVTNjkwLjEgMTU0IDQ5OC45IDE1NEMzMTcuNiAxNTQgMTY4LjggMjkzLjMgMTU0IDQ3MC41aDQ1Ny40djU4LjFIMTU0QzE2OC44IDcwNS44IDMxNy42IDg0NSA0OTguOSA4NDV6IiBmaWxsPSIjMDA1MmZmIi8+PC9zdmc+",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Dp.wrapped.logo},stables:{usd:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"]},explorer:"https://basescan.org",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://basescan.org/tx/${e.id||e}`:t?`https://basescan.org/token/${t}`:n?`https://basescan.org/address/${n}`:void 0,endpoints:["https://base.blockpi.network/v1/rpc/public","https://base.meowrpc.com","https://mainnet.base.org"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Dp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Dp.wrapped.logo,type:"20"},{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",symbol:"USDbC",name:"USD Base Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const $p=[Dp,Sp,Rp,Qp,_p,Fp,Gp,Jp,Xp,Kp];var ef={ethereum:Dp,bsc:Sp,polygon:Rp,solana:Qp,fantom:_p,arbitrum:Fp,avalanche:Gp,gnosis:Jp,optimism:Xp,base:Kp,all:$p,findById:function(e){let t=e;t.match("0x0")&&(t=t.replace(/0x0+/,"0x"));let n=$p.find((e=>e.id&&e.id.toLowerCase()==t.toLowerCase()));return n},findByNetworkId:function(e){e=e.toString();let t=$p.find((t=>t.networkId==e));return t},findByName:function(e){return $p.find((t=>t.name==e))}},tf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function rf(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var of=function(e){var t=pf(e),n=t[0],r=t[1];return 3*(n+r)/4-r},af=function(e){var t,n,r=pf(e),i=r[0],o=r[1],a=new lf(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n<u;n+=4)t=cf[e.charCodeAt(n)]<<18|cf[e.charCodeAt(n+1)]<<12|cf[e.charCodeAt(n+2)]<<6|cf[e.charCodeAt(n+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=cf[e.charCodeAt(n)]<<2|cf[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=cf[e.charCodeAt(n)]<<10|cf[e.charCodeAt(n+1)]<<4|cf[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},sf=function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(ff(e,a,a+o>s?s:a+o));1===r?(t=e[n-1],i.push(uf[t>>2]+uf[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(uf[t>>10]+uf[t>>4&63]+uf[t<<2&63]+"="));return i.join("")},uf=[],cf=[],lf="undefined"!=typeof Uint8Array?Uint8Array:Array,df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hf=0;hf<64;++hf)uf[hf]=df[hf],cf[df.charCodeAt(hf)]=hf;function pf(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function ff(e,t,n){for(var r,i,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(uf[(i=r)>>18&63]+uf[i>>12&63]+uf[i>>6&63]+uf[63&i]);return o.join("")}cf["-".charCodeAt(0)]=62,cf["_".charCodeAt(0)]=63;var mf={byteLength:of,toByteArray:af,fromByteArray:sf},yf=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},gf=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*m},vf=rf((function(e,t){const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50;const r=2147483647;function i(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|h(e,t);let r=i(n);const a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(H(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);const a=function(e){if(o.isBuffer(e)){const t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||G(e.length)?i(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return s(e),i(e<0?0:0|d(e))}function c(e){const t=e.length<0?0:0|d(e.length),n=i(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function l(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,o.prototype),r}function d(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(i)return r?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){let o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function g(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(G(r))return a;e[n+a]=r}return a}function v(e,t,n,r){return V(Y(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return V(F(t),e,n,r)}function M(e,t,n,r){return V(function(e,t){let n,r,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?mf.fromByteArray(e):mf.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}(r)}t.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,n){return a(e,t,n)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)}(e,t,n)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=o.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(H(t,Uint8Array))i+t.length>r.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)f(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const u=Math.min(a,s),c=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<u;++e)if(c[e]!==l[e]){a=c[e],s=l[e];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return w(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function I(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=q[e[r]];return i}function L(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function x(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i){R(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function C(e,t,n,r,i){R(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,r,i){return t=+t,n>>>=0,i||D(e,0,n,4),gf(e,t,n,r,23,4),n+4}function z(e,t,n,r,i){return t=+t,n>>>=0,i||D(e,0,n,8),gf(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),yf(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),yf(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),yf(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),yf(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){S(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){S(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Z((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Z((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);S(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);S(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Z((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Z((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const a=o.isBuffer(e)?e:o.from(e,r),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};const _={};function P(e,t,n){_[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function B(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function R(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new _.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){U(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,i,o)}function U(e,t){if("number"!=typeof e)throw new _.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw U(e,n),new _.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new _.ERR_BUFFER_OUT_OF_BOUNDS;throw new _.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=B(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(e){return mf.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}const q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}})),wf=rf((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:vf.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(e,l,l+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){c(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[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(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?m+r:d[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===o?(n<e.length&&(e[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,p=0|a[1],f=8191&p,m=p>>>13,y=0|a[2],g=8191&y,v=y>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],E=8191&A,N=A>>>13,T=0|a[5],I=8191&T,k=T>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(m,W)|0,o=Math.imul(m,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(m,F)|0,o=o+Math.imul(m,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,W),i=(i=Math.imul(b,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var we=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(N,W)|0,o=Math.imul(N,Q),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ne=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(B,W),i=(i=Math.imul(B,Q))+Math.imul(R,W)|0,o=Math.imul(R,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Te=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Le=(c+(r=r+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(N,fe)|0))<<13)|0;c=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(R,ue)|0,o=Math.imul(R,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,de),i=(i=Math.imul(B,he))+Math.imul(R,de)|0,o=Math.imul(R,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(B,fe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(R,fe)|0))<<13)|0;return c=((o=Math.imul(R,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=we,u[4]=be,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Ne,u[9]=Te,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return y(e,t,n)}Math.imul||(m=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?f(this,e,t):n<1024?y(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,m=1;0==(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new N(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){N.call(this,e),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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},r(b,w),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(M,w),r(A,w),r(E,w),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},N.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},N.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},N.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},N.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},N.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},N.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},N.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},N.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},N.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},N.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},N.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},N.prototype.isqr=function(e){return this.imul(e,e.clone())},N.prototype.sqr=function(e){return this.mul(e,e)},N.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<f);var g=this.pow(d,new i(1).iushln(f-y-1));h=h.redMul(g),d=g.redSqr(),p=p.redMul(d),f=y}return h},N.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},N.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},N.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},N.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},r(T,N),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,tf)}));
11
11
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */let bf=!1,Mf=!1;const Af={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ef=Af.default,Nf=null;const Tf=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var If,kf;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(If||(If={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(kf||(kf={}));const Lf="0123456789abcdef";class xf{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==Af[n]&&this.throwArgumentError("invalid log level name","logLevel",e),Ef>Af[n]||console.log.apply(console,t)}debug(...e){this._log(xf.levels.DEBUG,e)}info(...e){this._log(xf.levels.INFO,e)}warn(...e){this._log(xf.levels.WARNING,e)}makeError(e,t,n){if(Mf)return this.makeError("censored error",t,{});t||(t=xf.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Lf[t[e]>>4],n+=Lf[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const i=e;let o="";switch(t){case kf.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case kf.CALL_EXCEPTION:case kf.INSUFFICIENT_FUNDS:case kf.MISSING_NEW:case kf.NONCE_EXPIRED:case kf.REPLACEMENT_UNDERPRICED:case kf.TRANSACTION_REPLACED:case kf.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,xf.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){Tf&&this.throwError("platform missing String.prototype.normalize",xf.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Tf})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,xf.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,xf.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,xf.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,xf.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",xf.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",xf.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",xf.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Nf||(Nf=new xf("logger/5.7.0")),Nf}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",xf.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),bf){if(!e)return;this.globalLogger().throwError("error censorship permanent",xf.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Mf=!!e,bf=!!t}static setLogLevel(e){const t=Af[e.toLowerCase()];null!=t?Ef=t:xf.globalLogger().warn("invalid log level - "+e)}static from(e){return new xf(e)}}xf.errors=kf,xf.levels=If;const Sf=new xf("bytes/5.7.0");function jf(e){return!!e.toHexString}function Cf(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Cf(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Df(e){return Uf(e)&&!(e.length%2)||zf(e)}function Of(e){return"number"==typeof e&&e==e&&e%1==0}function zf(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Of(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!Of(n)||n<0||n>=256)return!1}return!0}function _f(e,t){if(t||(t={}),"number"==typeof e){Sf.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),Cf(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),jf(e)&&(e=e.toHexString()),Uf(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":Sf.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return Cf(new Uint8Array(r))}return zf(e)?Cf(new Uint8Array(e)):Sf.throwArgumentError("invalid arrayify value","value",e)}function Pf(e){const t=e.map((e=>_f(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),Cf(r)}function Bf(e){let t=_f(e);if(0===t.length)return t;let n=0;for(;n<t.length&&0===t[n];)n++;return n&&(t=t.slice(n)),t}function Rf(e,t){(e=_f(e)).length>t&&Sf.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),Cf(n)}function Uf(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Wf="0123456789abcdef";function Qf(e,t){if(t||(t={}),"number"==typeof e){Sf.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Wf[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),jf(e))return e.toHexString();if(Uf(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":Sf.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(zf(e)){let t="0x";for(let n=0;n<e.length;n++){let r=e[n];t+=Wf[(240&r)>>4]+Wf[15&r]}return t}return Sf.throwArgumentError("invalid hexlify value","value",e)}function Yf(e){if("string"!=typeof e)e=Qf(e);else if(!Uf(e)||e.length%2)return null;return(e.length-2)/2}function Ff(e,t,n){return"string"!=typeof e?e=Qf(e):(!Uf(e)||e.length%2)&&Sf.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function Vf(e){let t="0x";return e.forEach((e=>{t+=Qf(e).substring(2)})),t}function Hf(e){const t=function(e){"string"!=typeof e&&(e=Qf(e));Uf(e)||Sf.throwArgumentError("invalid hex string","value",e);e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}(Qf(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Gf(e,t){for("string"!=typeof e?e=Qf(e):Uf(e)||Sf.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Sf.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function qf(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Df(e)){let n=_f(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=Qf(n.slice(0,32)),t.s=Qf(n.slice(32,64))):65===n.length?(t.r=Qf(n.slice(0,32)),t.s=Qf(n.slice(32,64)),t.v=n[64]):Sf.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:Sf.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=Qf(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=Rf(_f(t._vs),32);t._vs=Qf(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&Sf.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=Qf(n);null==t.s?t.s=i:t.s!==i&&Sf.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?Sf.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&Sf.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Uf(t.r)?t.r=Gf(t.r,32):Sf.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Uf(t.s)?t.s=Gf(t.s,32):Sf.throwArgumentError("signature missing or invalid s","signature",e);const n=_f(t.s);n[0]>=128&&Sf.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=Qf(n);t._vs&&(Uf(t._vs)||Sf.throwArgumentError("signature invalid _vs","signature",e),t._vs=Gf(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&Sf.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const Zf="bignumber/5.7.0";var Jf=wf.BN;const Xf=new xf(Zf),Kf={},$f=9007199254740991;let em=!1;class tm{constructor(e,t){e!==Kf&&Xf.throwError("cannot call constructor directly; use BigNumber.from",xf.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return rm(im(this).fromTwos(e))}toTwos(e){return rm(im(this).toTwos(e))}abs(){return"-"===this._hex[0]?tm.from(this._hex.substring(1)):this}add(e){return rm(im(this).add(im(e)))}sub(e){return rm(im(this).sub(im(e)))}div(e){return tm.from(e).isZero()&&om("division-by-zero","div"),rm(im(this).div(im(e)))}mul(e){return rm(im(this).mul(im(e)))}mod(e){const t=im(e);return t.isNeg()&&om("division-by-zero","mod"),rm(im(this).umod(t))}pow(e){const t=im(e);return t.isNeg()&&om("negative-power","pow"),rm(im(this).pow(t))}and(e){const t=im(e);return(this.isNegative()||t.isNeg())&&om("unbound-bitwise-result","and"),rm(im(this).and(t))}or(e){const t=im(e);return(this.isNegative()||t.isNeg())&&om("unbound-bitwise-result","or"),rm(im(this).or(t))}xor(e){const t=im(e);return(this.isNegative()||t.isNeg())&&om("unbound-bitwise-result","xor"),rm(im(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&om("negative-width","mask"),rm(im(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&om("negative-width","shl"),rm(im(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&om("negative-width","shr"),rm(im(this).shrn(e))}eq(e){return im(this).eq(im(e))}lt(e){return im(this).lt(im(e))}lte(e){return im(this).lte(im(e))}gt(e){return im(this).gt(im(e))}gte(e){return im(this).gte(im(e))}isNegative(){return"-"===this._hex[0]}isZero(){return im(this).isZero()}toNumber(){try{return im(this).toNumber()}catch(e){om("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Xf.throwError("this platform does not support BigInt",xf.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?em||(em=!0,Xf.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Xf.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",xf.errors.UNEXPECTED_ARGUMENT,{}):Xf.throwError("BigNumber.toString does not accept parameters",xf.errors.UNEXPECTED_ARGUMENT,{})),im(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof tm)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new tm(Kf,nm(e)):e.match(/^-?[0-9]+$/)?new tm(Kf,nm(new Jf(e))):Xf.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&om("underflow","BigNumber.from",e),(e>=$f||e<=-$f)&&om("overflow","BigNumber.from",e),tm.from(String(e));const t=e;if("bigint"==typeof t)return tm.from(t.toString());if(zf(t))return tm.from(Qf(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return tm.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Uf(e)||"-"===e[0]&&Uf(e.substring(1))))return tm.from(e)}return Xf.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function nm(e){if("string"!=typeof e)return nm(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Xf.throwArgumentError("invalid hex","value",e),"0x00"===(e=nm(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function rm(e){return tm.from(nm(e))}function im(e){const t=tm.from(e).toHexString();return"-"===t[0]?new Jf("-"+t.substring(3),16):new Jf(t.substring(2),16)}function om(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),Xf.throwError(e,xf.errors.NUMERIC_FAULT,r)}const am=new xf(Zf),sm={},um=tm.from(0),cm=tm.from(-1);function lm(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),am.throwError(e,xf.errors.NUMERIC_FAULT,i)}let dm="0";for(;dm.length<256;)dm+=dm;function hm(e){if("number"!=typeof e)try{e=tm.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+dm.substring(0,e):am.throwArgumentError("invalid decimal size","decimals",e)}function pm(e,t){null==t&&(t=0);const n=hm(t),r=(e=tm.from(e)).lt(um);r&&(e=e.mul(cm));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(n).toString();return e=1===n.length?o:o+"."+i,r&&(e="-"+e),e}function fm(e,t){null==t&&(t=0);const n=hm(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||am.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&am.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&am.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&lm("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<n.length-1;)a+="0";const s=tm.from(o),u=tm.from(a);let c=s.mul(n).add(u);return r&&(c=c.mul(cm)),c}class mm{constructor(e,t,n,r){e!==sm&&am.throwError("cannot use FixedFormat constructor; use FixedFormat.from",xf.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=hm(r),Object.freeze(this)}static from(e){if(e instanceof mm)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||am.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&am.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&am.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&am.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new mm(sm,t,n,r)}}class ym{constructor(e,t,n,r){e!==sm&&am.throwError("cannot use FixedNumber constructor; use FixedNumber.from",xf.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&am.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=fm(this._value,this.format.decimals),n=fm(e._value,e.format.decimals);return ym.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=fm(this._value,this.format.decimals),n=fm(e._value,e.format.decimals);return ym.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=fm(this._value,this.format.decimals),n=fm(e._value,e.format.decimals);return ym.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=fm(this._value,this.format.decimals),n=fm(e._value,e.format.decimals);return ym.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ym.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(gm.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ym.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(gm.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&am.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=ym.from("1"+dm.substring(0,e),this.format),r=vm.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&am.throwArgumentError("invalid byte width","width",e);return Gf(tm.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ym.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(tm.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Uf(e)||"bigint"==typeof e||zf(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),ym.fromString(pm(e,t),mm.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=mm.from(t),r=fm(e,n.decimals);!n.signed&&r.lt(um)&&lm("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=Gf(i,n.width/8));const o=pm(r,n.decimals);return new ym(sm,i,o,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=mm.from(t);if(_f(e).length>n.width/8)throw new Error("overflow");let r=tm.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=pm(r,n.decimals);return new ym(sm,i,o,n)}static from(e,t){if("string"==typeof e)return ym.fromString(e,t);if(zf(e))return ym.fromBytes(e,t);try{return ym.fromValue(e,0,t)}catch(e){if(e.code!==xf.errors.INVALID_ARGUMENT)throw e}return am.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const gm=ym.from(1),vm=ym.from("0.5");var wm=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const bm=new xf("properties/5.7.0");function Mm(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Am(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Em(e){return wm(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function Nm(e){const t={};for(const n in e)t[n]=e[n];return t}const Tm={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Im(e){if(null==e||Tm[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!Im(r))return!1}return!0}return bm.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function km(e){if(Im(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Lm(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Mm(t,n,Lm(r))}return t}return bm.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Lm(e){return km(e)}class xm{constructor(e){for(const t in e)this[t]=Lm(e[t])}}const Sm="abi/5.7.0",jm=new xf(Sm),Cm={};let Dm={calldata:!0,memory:!0,storage:!0},Om={calldata:!0,memory:!0};function zm(e,t){if("bytes"===e||"string"===e){if(Dm[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Om[t])return!0;return(Dm[t]||"payable"===t)&&jm.throwArgumentError("invalid modifier","name",t),!1}function _m(e,t){for(let n in t)Mm(e,n,t[n])}const Pm=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Bm=new RegExp(/^(.*)\[([0-9]*)\]$/);class Rm{constructor(e,t){e!==Cm&&jm.throwError("use fromString",xf.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),_m(this,t);let n=this.type.match(Bm);_m(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Rm.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Pm.sighash),Pm[e]||jm.throwArgumentError("invalid format type","format",e),e===Pm.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Pm.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Pm.full?", ":",")+")"):t+=this.type,e!==Pm.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Pm.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Rm.fromString(e,t):Rm.fromObject(e)}static fromObject(e){return Rm.isParamType(e)?e:new Rm(Cm,{name:e.name||null,type:Jm(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Rm.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function r(t){jm.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let n=0;n<e.length;n++){let o=e[n];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||r(n),a.state.allowType=!1,a.type=Jm(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||r(n),a.indexed=!0,a.name=""),zm(a.type,a.name)&&(a.name=""),a.type=Jm(a.type);let e=a;a=a.parent,a||r(n),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||r(n),a.indexed=!0,a.name=""),zm(a.type,a.name)&&(a.name=""),a.type=Jm(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Jm(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||r(n),a.indexed&&r(n),a.indexed=!0,a.name=""):zm(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||r(n),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||r(n),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:r(n)}}return a.parent&&jm.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||r(n.length-7),a.indexed&&r(n.length-7),a.indexed=!0,a.name=""):zm(a.type,a.name)&&(a.name=""),o.type=Jm(o.type),o}(e,!!t),Rm.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}}function Um(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===r?(t.push(n),n=""):(n+=o,"("===o?r++:")"===o&&(r--,-1===r&&jm.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>Rm.fromString(e,t)))}class Wm{constructor(e,t){e!==Cm&&jm.throwError("use a static from method",xf.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),_m(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Wm.isFragment(e)?e:"string"==typeof e?Wm.fromString(e):Wm.fromObject(e)}static fromObject(e){if(Wm.isFragment(e))return e;switch(e.type){case"function":return Gm.fromObject(e);case"event":return Qm.fromObject(e);case"constructor":return Hm.fromObject(e);case"error":return Zm.fromObject(e);case"fallback":case"receive":return null}return jm.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Qm.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Gm.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Hm.fromString(e.trim()):"error"===e.split(" ")[0]?Zm.fromString(e.substring(5).trim()):jm.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Qm extends Wm{format(e){if(e||(e=Pm.sighash),Pm[e]||jm.throwArgumentError("invalid format type","format",e),e===Pm.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Pm.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Pm.full?", ":",")+") ",e!==Pm.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Qm.fromString(e):Qm.fromObject(e)}static fromObject(e){if(Qm.isEventFragment(e))return e;"event"!==e.type&&jm.throwArgumentError("invalid event object","value",e);const t={name:Km(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Rm.fromObject):[],type:"event"};return new Qm(Cm,t)}static fromString(e){let t=e.match($m);t||jm.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:jm.warn("unknown modifier: "+e)}})),Qm.fromObject({name:t[1].trim(),anonymous:n,inputs:Um(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ym(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&jm.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||jm.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=tm.from(n[1]),n[0]):e}function Fm(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Vm(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&jm.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&jm.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||jm.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&jm.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&jm.throwArgumentError("unable to determine stateMutability","value",e),t}class Hm extends Wm{format(e){if(e||(e=Pm.sighash),Pm[e]||jm.throwArgumentError("invalid format type","format",e),e===Pm.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Pm.sighash&&jm.throwError("cannot format a constructor for sighash",xf.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Pm.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Hm.fromString(e):Hm.fromObject(e)}static fromObject(e){if(Hm.isConstructorFragment(e))return e;"constructor"!==e.type&&jm.throwArgumentError("invalid constructor object","value",e);let t=Vm(e);t.constant&&jm.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Rm.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?tm.from(e.gas):null};return new Hm(Cm,n)}static fromString(e){let t={type:"constructor"},n=(e=Ym(e,t)).match($m);return n&&"constructor"===n[1].trim()||jm.throwArgumentError("invalid constructor string","value",e),t.inputs=Um(n[2].trim(),!1),Fm(n[3].trim(),t),Hm.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Gm extends Hm{format(e){if(e||(e=Pm.sighash),Pm[e]||jm.throwArgumentError("invalid format type","format",e),e===Pm.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Pm.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Pm.full?", ":",")+") ",e!==Pm.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Gm.fromString(e):Gm.fromObject(e)}static fromObject(e){if(Gm.isFunctionFragment(e))return e;"function"!==e.type&&jm.throwArgumentError("invalid function object","value",e);let t=Vm(e);const n={type:e.type,name:Km(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Rm.fromObject):[],outputs:e.outputs?e.outputs.map(Rm.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?tm.from(e.gas):null};return new Gm(Cm,n)}static fromString(e){let t={type:"function"},n=(e=Ym(e,t)).split(" returns ");n.length>2&&jm.throwArgumentError("invalid function string","value",e);let r=n[0].match($m);if(r||jm.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&Km(t.name),t.inputs=Um(r[2],!1),Fm(r[3].trim(),t),n.length>1){let r=n[1].match($m);""==r[1].trim()&&""==r[3].trim()||jm.throwArgumentError("unexpected tokens","value",e),t.outputs=Um(r[2],!1)}else t.outputs=[];return Gm.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function qm(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||jm.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Zm extends Wm{format(e){if(e||(e=Pm.sighash),Pm[e]||jm.throwArgumentError("invalid format type","format",e),e===Pm.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Pm.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Pm.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Zm.fromString(e):Zm.fromObject(e)}static fromObject(e){if(Zm.isErrorFragment(e))return e;"error"!==e.type&&jm.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Km(e.name),inputs:e.inputs?e.inputs.map(Rm.fromObject):[]};return qm(new Zm(Cm,t))}static fromString(e){let t={type:"error"},n=e.match($m);return n||jm.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Km(t.name),t.inputs=Um(n[2],!1),qm(Zm.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Jm(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Xm=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Km(e){return e&&e.match(Xm)||jm.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const $m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const ey=new xf(Sm);class ty{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){ey.throwArgumentError(e,this.localName,t)}}class ny{constructor(e){Mm(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Vf(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Pf(e._data))}writeBytes(e){let t=_f(e);const n=t.length%this.wordSize;return n&&(t=Pf([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=_f(tm.from(e));return t.length>this.wordSize&&ey.throwError("value out-of-bounds",xf.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Pf([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class ry{constructor(e,t,n,r){Mm(this,"_data",_f(e)),Mm(this,"wordSize",t||32),Mm(this,"_coerceFunc",n),Mm(this,"allowLoose",r),this._offset=0}get data(){return Qf(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):ry.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:ey.throwError("data out-of-bounds",xf.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new ry(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return tm.from(this.readBytes(this.wordSize))}}var iy=rf((function(e){!function(){var t="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof L&&L.versions&&L.versions.node?r=tf:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&e.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],c=[0,8,16,24],l=[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],d=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],f={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,n){return function(r){return new j(e,t,e).update(r)[n]()}},y=function(e,t,n){return function(r,i){return new j(e,t,i).update(r)[n]()}},g=function(e,t,n){return function(t,r,i,o){return A["cshake"+e].update(t,r,i,o)[n]()}},v=function(e,t,n){return function(t,r,i,o){return A["kmac"+e].update(t,r,i,o)[n]()}},w=function(e,t,n,r){for(var i=0;i<p.length;++i){var o=p[i];e[o]=t(n,r,o)}return e},b=function(e,t){var n=m(e,t,"hex");return n.create=function(){return new j(e,t,e)},n.update=function(e){return n.create().update(e)},w(n,m,e,t)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(e,t){var n=y(e,t,"hex");return n.create=function(n){return new j(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},w(n,y,e,t)}},{name:"cshake",padding:u,bits:h,createMethod:function(e,t){var n=f[e],r=g(e,0,"hex");return r.create=function(r,i,o){return i||o?new j(e,t,r).bytepad([i,o],n):A["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},w(r,g,e,t)}},{name:"kmac",padding:u,bits:h,createMethod:function(e,t){var n=f[e],r=v(e,0,"hex");return r.create=function(r,i,o){return new C(e,t,i).bytepad(["KMAC",o],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},w(r,v,e,t)}}],A={},E=[],N=0;N<M.length;++N)for(var T=M[N],I=T.bits,k=0;k<I.length;++k){var x=T.name+"_"+I[k];if(E.push(x),A[x]=T.createMethod(I[k],T.padding),"sha3"!==T.name){var S=T.name+I[k];E.push(S),A[S]=A[x]}}function j(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function C(e,t,n){j.call(this,e,t,n)}j.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,l=e.length,d=this.blockCount,h=0,p=this.s;h<l;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<d+1;++i)s[i]=0;if(n)for(i=this.start;h<l&&i<u;++h)s[i>>2]|=e[h]<<c[3&i++];else for(i=this.start;h<l&&i<u;++h)(o=e.charCodeAt(h))<128?s[i>>2]|=o<<c[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++h)),s[i>>2]|=(240|o>>18)<<c[3&i++],s[i>>2]|=(128|o>>12&63)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=s[d],i=0;i<d;++i)p[i]^=s[i];D(p),this.reset=!0}else this.start=i}return this},j.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},j.prototype.encodeString=function(e){var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var i=0,o=e.length;if(n)i=o;else for(var s=0;s<e.length;++s){var u=e.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},j.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,o=[];return o.length=i,this.update(o),this},j.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];D(r)}},j.prototype.toString=j.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,u="";a<r;){for(o=0;o<t&&a<r;++o,++a)e=n[o],u+=s[e>>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t==0&&(D(n),o=0)}return i&&(e=n[o],u+=s[e>>4&15]+s[15&e],i>1&&(u+=s[e>>12&15]+s[e>>8&15]),i>2&&(u+=s[e>>20&15]+s[e>>16&15])),u},j.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<r;){for(o=0;o<t&&a<r;++o,++a)u[a]=n[o];a%t==0&&D(n)}return i&&(u[o]=n[o],e=e.slice(0,s)),e},j.prototype.buffer=j.prototype.arrayBuffer,j.prototype.digest=j.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<n&&s<i;++a,++s)e=s<<2,t=r[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&D(r)}return o&&(e=s<<2,t=r[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},C.prototype=new j,C.prototype.finalize=function(){return this.encode(this.outputBits,!0),j.prototype.finalize.call(this)};var D=function(e){var t,n,r,i,o,a,s,u,c,d,h,p,f,m,y,g,v,w,b,M,A,E,N,T,I,k,L,x,S,j,C,D,O,z,_,P,B,R,U,W,Q,Y,F,V,H,G,q,Z,J,X,K,$,ee,te,ne,re,ie,oe,ae,se,ue,ce,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|c>>>31),n=o^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(d<<1|h>>>31),n=s^(h<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(p<<1|f>>>31),n=c^(f<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|o>>>31),n=h^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],y=e[1],G=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,F=e[41]<<18|e[40]>>>14,z=e[2]<<1|e[3]>>>31,_=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,P=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,w=e[25]<<11|e[24]>>>21,b=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,K=e[35]<<15|e[34]>>>17,D=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,M=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,H=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,L=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,W=e[38]<<8|e[39]>>>24,Q=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,N=e[49]<<14|e[48]>>>18,e[0]=m^~g&w,e[1]=y^~v&b,e[10]=T^~k&x,e[11]=I^~L&S,e[20]=z^~P&R,e[21]=_^~B&U,e[30]=V^~G&Z,e[31]=H^~q&J,e[40]=te^~re&oe,e[41]=ne^~ie&ae,e[2]=g^~w&M,e[3]=v^~b&A,e[12]=k^~x&j,e[13]=L^~S&C,e[22]=P^~R&W,e[23]=B^~U&Q,e[32]=G^~Z&X,e[33]=q^~J&K,e[42]=re^~oe&se,e[43]=ie^~ae&ue,e[4]=w^~M&E,e[5]=b^~A&N,e[14]=x^~j&D,e[15]=S^~C&O,e[24]=R^~W&Y,e[25]=U^~Q&F,e[34]=Z^~X&$,e[35]=J^~K&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=M^~E&m,e[7]=A^~N&y,e[16]=j^~D&T,e[17]=C^~O&I,e[26]=W^~Y&z,e[27]=Q^~F&_,e[36]=X^~$&V,e[37]=K^~ee&H,e[46]=se^~ce&te,e[47]=ue^~le&ne,e[8]=E^~m&g,e[9]=N^~y&v,e[18]=D^~T&k,e[19]=O^~I&L,e[28]=Y^~z&P,e[29]=F^~_&B,e[38]=$^~V&G,e[39]=ee^~H&q,e[48]=ce^~te&re,e[49]=le^~ne&ie,e[0]^=l[r],e[1]^=l[r+1]};if(o)e.exports=A;else for(N=0;N<E.length;++N)r[E[N]]=A[E[N]]}()})),oy=iy;function ay(e){return"0x"+oy.keccak_256(_f(e))}const sy=new xf("rlp/5.7.0");function uy(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function cy(e,t,n){let r=0;for(let i=0;i<n;i++)r=256*r+e[t+i];return r}function ly(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(ly(e))})),t.length<=55)return t.unshift(192+t.length),t;const n=uy(t.length);return n.unshift(247+n.length),n.concat(t)}Df(e)||sy.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(_f(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=uy(t.length);return n.unshift(183+n.length),n.concat(t)}function dy(e){return Qf(ly(e))}function hy(e,t,n,r){const i=[];for(;n<t+1+r;){const o=py(e,n);i.push(o.result),(n+=o.consumed)>t+1+r&&sy.throwError("child data too short",xf.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function py(e,t){if(0===e.length&&sy.throwError("data too short",xf.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&sy.throwError("data short segment too short",xf.errors.BUFFER_OVERRUN,{});const r=cy(e,t+1,n);return t+1+n+r>e.length&&sy.throwError("data long segment too short",xf.errors.BUFFER_OVERRUN,{}),hy(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&sy.throwError("data array too short",xf.errors.BUFFER_OVERRUN,{}),hy(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&sy.throwError("data array too short",xf.errors.BUFFER_OVERRUN,{});const r=cy(e,t+1,n);t+1+n+r>e.length&&sy.throwError("data array too short",xf.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:Qf(e.slice(t+1+n,t+1+n+r))}}if(e[t]>=128){const n=e[t]-128;t+1+n>e.length&&sy.throwError("data too short",xf.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:Qf(e.slice(t+1,t+1+n))}}return{consumed:1,result:Qf(e[t])}}function fy(e){const t=_f(e),n=py(t,0);return n.consumed!==t.length&&sy.throwArgumentError("invalid rlp data","data",e),n.result}const my=new xf("address/5.7.0");function yy(e){Uf(e,20)||my.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const r=_f(ay(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&r[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const gy={};for(let e=0;e<10;e++)gy[String(e)]=String(e);for(let e=0;e<26;e++)gy[String.fromCharCode(65+e)]=String(10+e);const vy=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function wy(e){let t=null;if("string"!=typeof e&&my.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=yy(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&my.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>gy[e])).join("");for(;t.length>=vy;){let e=t.substring(0,vy);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e)&&my.throwArgumentError("bad icap checksum","address",e),n=e.substring(4),t=new Jf(n,36).toString(16);t.length<40;)t="0"+t;t=yy("0x"+t)}else my.throwArgumentError("invalid address","address",e);var n;return t}function by(e){let t=null;try{t=wy(e.from)}catch(t){my.throwArgumentError("missing from address","transaction",e)}return wy(Ff(ay(dy([t,Bf(_f(tm.from(e.nonce).toHexString()))])),12))}class My extends ty{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=wy(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return wy(Gf(e.readValue().toHexString(),20))}}class Ay extends ty{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Ey=new xf(Sm);function Ny(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||Ey.throwError("cannot encode object for signature with missing names",xf.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&Ey.throwError("cannot encode object for signature with duplicate names",xf.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else Ey.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&Ey.throwArgumentError("types/value length mismatch","tuple",n);let i=new ny(e.wordSize),o=new ny(e.wordSize),a=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=o.length;e.encode(o,n);let r=i.writeUpdatableValue();a.push((e=>{r(e+t)}))}else e.encode(i,n)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function Ty(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),o=r.subReader(n.toNumber());try{i=t.decode(o)}catch(e){if(e.code===xf.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===xf.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let e=0;e<n.length;e++){const t=n[e];t instanceof Error&&Object.defineProperty(n,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(n)}class Iy extends ty{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let n=this.length;-1===n&&(n=t.length,e.writeValue(t.length)),Ey.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let e=0;e<t.length;e++)r.push(this.coder);return Ny(e,r,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&Ey.throwError("insufficient data length",xf.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e<t;e++)n.push(new Ay(this.coder));return e.coerce(this.name,Ty(e,n))}}class ky extends ty{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Ly extends ty{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=_f(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class xy extends Ly{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Qf(super.decode(e)))}}class Sy extends ty{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=_f(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,Qf(e.readBytes(this.size)))}}class jy extends ty{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const Cy=tm.from(-1),Dy=tm.from(0),Oy=tm.from(1),zy=tm.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class _y extends ty{constructor(e,t,n){const r=(t?"int":"uint")+8*e;super(r,r,n,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let n=tm.from(t),r=zy.mask(8*e.wordSize);if(this.signed){let e=r.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(Oy).mul(Cy)))&&this._throwError("value out-of-bounds",t)}else(n.lt(Dy)||n.gt(r.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const Py=new xf("strings/5.7.0");var By,Ry;function Uy(e,t,n,r,i){if(e===Ry.BAD_PREFIX||e===Ry.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===Ry.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(By||(By={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Ry||(Ry={}));const Wy=Object.freeze({error:function(e,t,n,r,i){return Py.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:Uy,replace:function(e,t,n,r,i){return e===Ry.OVERLONG?(r.push(i),0):(r.push(65533),Uy(e,t,n))}});function Qy(e,t){null==t&&(t=Wy.error),e=_f(e);const n=[];let r=0;for(;r<e.length;){const i=e[r++];if(i>>7==0){n.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){r+=t(128==(192&i)?Ry.UNEXPECTED_CONTINUE:Ry.BAD_PREFIX,r-1,e,n);continue}o=3,a=65535}if(r-1+o>=e.length){r+=t(Ry.OVERRUN,r-1,e,n);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=e[r];if(128!=(192&i)){r+=t(Ry.MISSING_CONTINUE,r,e,n),s=null;break}s=s<<6|63&i,r++}null!==s&&(s>1114111?r+=t(Ry.OUT_OF_RANGE,r-1-o,e,n,s):s>=55296&&s<=57343?r+=t(Ry.UTF16_SURROGATE,r-1-o,e,n,s):s<=a?r+=t(Ry.OVERLONG,r-1-o,e,n,s):n.push(s))}return n}function Yy(e,t=By.current){t!=By.current&&(Py.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return _f(n)}function Fy(e,t){return Qy(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class Vy extends Ly{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Yy(t))}decode(e){return Fy(super.decode(e))}}class Hy extends ty{constructor(e,t){let n=!1;const r=[];e.forEach((e=>{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return Ny(e,this.coders,t)}decode(e){return e.coerce(this.name,Ty(e,this.coders))}}const Gy=new xf(Sm),qy=new RegExp(/^bytes([0-9]*)$/),Zy=new RegExp(/^(u?int)([0-9]*)$/);const Jy=new class{constructor(e){Mm(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new My(e.name);case"bool":return new ky(e.name);case"string":return new Vy(e.name);case"bytes":return new xy(e.name);case"array":return new Iy(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Hy((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new jy(e.name)}let t=e.type.match(Zy);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&Gy.throwArgumentError("invalid "+t[1]+" bit length","param",e),new _y(n/8,"int"===t[1],e.name)}if(t=e.type.match(qy),t){let n=parseInt(t[1]);return(0===n||n>32)&&Gy.throwArgumentError("invalid bytes length","param",e),new Sy(n,e.name)}return Gy.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new ry(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new ny(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Rm.from(e))));return new Hy(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Gy.throwError("types/values length mismatch",xf.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(Rm.from(e)))),r=new Hy(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const r=e.map((e=>this._getCoder(Rm.from(e))));return new Hy(r,"_").decode(this._getReader(_f(t),n))}};function Xy(e){return ay(Yy(e))}const Ky="hash/5.7.0";function $y(e){e=atob(e);const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return _f(t)}function eg(e){e=_f(e);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function tg(e,t){null==t&&(t=1);const n=[],r=n.forEach,i=function(e,t){r.call(e,(function(e){t>0&&Array.isArray(e)?i(e,t-1):n.push(e)}))};return i(e,t),n}function ng(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,o=[0,1];for(let e=1;e<r;e++)o.push(i+=n());let a=n(),s=t;t+=a;let u=0,c=0;function l(){return 0==u&&(c=c<<8|e[t++],u=8),c>>--u&1}const d=Math.pow(2,31),h=d>>>1,p=h>>1,f=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|l();let y=[],g=0,v=d;for(;;){let e=Math.floor(((m-g+1)*i-1)/v),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e<o[r]?n=r:t=r}if(0==t)break;y.push(t);let a=g+Math.floor(v*o[t]/i),s=g+Math.floor(v*o[t+1]/i)-1;for(;0==((a^s)&h);)m=m<<1&f|l(),a=a<<1&f,s=s<<1&f|1;for(;a&~s&p;)m=m&h|m<<1&f>>>1|l(),a=a<<1^h,s=(s^h)<<1|h|1;g=a,v=1+s-a}let w=r-4;return y.map((t=>{switch(t-w){case 3:return w+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return w+256+(e[s++]<<8|e[s++]);case 1:return w+e[s++];default:return t-1}}))}(e))}function rg(e){return 1&e?~e>>1:e>>1}function ig(e,t){let n=Array(e);for(let r=0,i=-1;r<e;r++)n[r]=i+=1+t();return n}function og(e,t){let n=Array(e);for(let r=0,i=0;r<e;r++)n[r]=i+=rg(t());return n}function ag(e,t){let n=ig(e(),e),r=e(),i=ig(r,e),o=function(e,t){let n=Array(e);for(let r=0;r<e;r++)n[r]=1+t();return n}(r,e);for(let e=0;e<r;e++)for(let t=0;t<o[e];t++)n.push(i[e]+t);return t?n.map((e=>t[e])):n}function sg(e,t,n){let r=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<t;i++)og(e,n).forEach(((e,t)=>r[t].push(e)));return r}function ug(e,t){let n=1+t(),r=t(),i=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(n)}return t}(t);return tg(sg(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*r;return[o+t*n,a.map((e=>e+i))]}))})))}function cg(e,t){return sg(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const lg=ng($y("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),dg=new Set(ag(lg)),hg=new Set(ag(lg)),pg=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(ug(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(cg(n,e))}return function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r[0]]=r[1]}return t}(tg(t))}(lg),fg=function(e){let t=ag(e).sort(((e,t)=>e-t));return function n(){let r=[];for(;;){let i=ag(e,t);if(0==i.length)break;r.push({set:new Set(i),node:n()})}r.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:r,valid:o,fe0f:a,save:1==i,check:2==i}}()}(lg),mg=45,yg=95;function gg(e){return function(e,t=By.current){return Qy(Yy(e,t))}(e)}function vg(e){return e.filter((e=>65039!=e))}function wg(e){for(let t of e.split(".")){let e=gg(t);try{for(let t=e.lastIndexOf(yg)-1;t>=0;t--)if(e[t]!==yg)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===mg&&e[3]===mg)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function bg(e){return wg(function(e,t){let n=gg(e).reverse(),r=[];for(;n.length;){let e=Mg(n);if(e){r.push(...t(e));continue}let i=n.pop();if(dg.has(i)){r.push(i);continue}if(hg.has(i))continue;let o=pg[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);r.push(...o)}return wg(function(e){return e.normalize("NFC")}(String.fromCodePoint(...r)))}(e,vg))}function Mg(e,t){var n;let r,i,o=fg,a=[],s=e.length;for(t&&(t.length=0);s;){let u=e[--s];if(o=null===(n=o.branches.find((e=>e.set.has(u))))||void 0===n?void 0:n.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(r=a.slice(),2==o.valid&&r.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}const Ag=new xf(Ky),Eg=new Uint8Array(32);function Ng(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Tg(e){const t=Yy(bg(e)),n=[];if(0===e.length)return n;let r=0;for(let e=0;e<t.length;e++){46===t[e]&&(n.push(Ng(t.slice(r,e))),r=e+1)}if(r>=t.length)throw new Error("invalid ENS name; empty component");return n.push(Ng(t.slice(r))),n}function Ig(e){"string"!=typeof e&&Ag.throwArgumentError("invalid ENS name; not a string","name",e);let t=Eg;const n=Tg(e);for(;n.length;)t=ay(Pf([t,ay(n.pop())]));return Qf(t)}Eg.fill(0);var kg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Lg=new xf(Ky),xg=new Uint8Array(32);xg.fill(0);const Sg=tm.from(-1),jg=tm.from(0),Cg=tm.from(1),Dg=tm.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Og=Gf(Cg.toHexString(),32),zg=Gf(jg.toHexString(),32),_g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Pg=["name","version","chainId","verifyingContract","salt"];function Bg(e){return function(t){return"string"!=typeof t&&Lg.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Rg={name:Bg("name"),version:Bg("version"),chainId:function(e){try{return tm.from(e).toString()}catch(e){}return Lg.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return wy(e).toLowerCase()}catch(e){}return Lg.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=_f(e);if(32!==t.length)throw new Error("bad length");return Qf(t)}catch(e){}return Lg.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Ug(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],r=parseInt(t[2]||"256");(r%8!=0||r>256||t[2]&&t[2]!==String(r))&&Lg.throwArgumentError("invalid numeric width","type",e);const i=Dg.mask(n?r-1:r),o=n?i.add(Cg).mul(Sg):jg;return function(t){const n=tm.from(t);return(n.lt(o)||n.gt(i))&&Lg.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Gf(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return(0===n||n>32||t[1]!==String(n))&&Lg.throwArgumentError("invalid bytes width","type",e),function(t){return _f(t).length!==n&&Lg.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=_f(e),n=t.length%32;return n?Vf([t,xg.slice(n)]):Qf(t)}(t)}}}switch(e){case"address":return function(e){return Gf(wy(e),32)};case"bool":return function(e){return e?Og:zg};case"bytes":return function(e){return ay(e)};case"string":return function(e){return Xy(e)}}return null}function Wg(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Qg{constructor(e){Mm(this,"types",Object.freeze(Lm(e))),Mm(this,"_encoderCache",{}),Mm(this,"_types",{});const t={},n={},r={};Object.keys(e).forEach((e=>{t[e]={},n[e]=[],r[e]={}}));for(const r in e){const i={};e[r].forEach((o=>{i[o.name]&&Lg.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&Lg.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);Ug(a)||(n[a]||Lg.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),n[a].push(r),t[r][a]=!0)}))}const i=Object.keys(n).filter((e=>0===n[e].length));0===i.length?Lg.throwArgumentError("missing primary type","types",e):i.length>1&&Lg.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),Mm(this,"primaryType",i[0]),function i(o,a){a[o]&&Lg.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{n[e]&&(i(e,a),Object.keys(a).forEach((t=>{r[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in r){const n=Object.keys(r[t]);n.sort(),this._types[t]=Wg(t,e[t])+n.map((t=>Wg(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Ug(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],n=this.getEncoder(e),r=parseInt(t[3]);return t=>{r>=0&&t.length!==r&&Lg.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(n);return this._types[e]&&(i=i.map(ay)),ay(Vf(i))}}const n=this.types[e];if(n){const t=Xy(this._types[e]);return e=>{const r=n.map((({name:t,type:n})=>{const r=this.getEncoder(n)(e[t]);return this._types[n]?ay(r):r}));return r.unshift(t),Vf(r)}}return Lg.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Lg.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ay(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Ug(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const e=r[1],i=parseInt(r[3]);return i>=0&&t.length!==i&&Lg.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,n)))}const i=this.types[e];return i?i.reduce(((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e)),{}):Lg.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Qg(e)}static getPrimaryType(e){return Qg.from(e).primaryType}static hashStruct(e,t,n){return Qg.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){const r=_g[n];r||Lg.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort(((e,t)=>Pg.indexOf(e.name)-Pg.indexOf(t.name))),Qg.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Vf(["0x1901",Qg.hashDomain(e),Qg.from(t).hash(n)])}static hash(e,t,n){return ay(Qg.encode(e,t,n))}static resolveNames(e,t,n,r){return kg(this,void 0,void 0,(function*(){e=Nm(e);const i={};e.verifyingContract&&!Uf(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=Qg.from(t);o.visit(n,((e,t)=>("address"!==e||Uf(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield r(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=o.visit(n,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:n}}))}static getPayload(e,t,n){Qg.hashDomain(e);const r={},i=[];Pg.forEach((t=>{const n=e[t];null!=n&&(r[t]=Rg[t](n),i.push({name:t,type:_g[t]}))}));const o=Qg.from(t),a=Nm(t);return a.EIP712Domain?Lg.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(n),{types:a,domain:r,primaryType:o.primaryType,message:o.visit(n,((e,t)=>{if(e.match(/^bytes(\d*)/))return Qf(_f(t));if(e.match(/^u?int/))return tm.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Lg.throwArgumentError("invalid string","value",t),t}return Lg.throwArgumentError("unsupported type","type",e)}))}}}const Yg=new xf(Sm);class Fg extends xm{}class Vg extends xm{}class Hg extends xm{}class Gg extends xm{static isIndexed(e){return!(!e||!e._isIndexed)}}const qg={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Zg(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class Jg{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,Mm(this,"fragments",t.map((e=>Wm.from(e))).filter((e=>null!=e))),Mm(this,"_abiCoder",Am(new.target,"getAbiCoder")()),Mm(this,"functions",{}),Mm(this,"errors",{}),Mm(this,"events",{}),Mm(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Yg.warn("duplicate definition - constructor"):void Mm(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?Yg.warn("duplicate definition - "+n):t[n]=e})),this.deploy||Mm(this,"deploy",Hm.from({payable:!1,type:"constructor"})),Mm(this,"_isInterface",!0)}format(e){e||(e=Pm.full),e===Pm.sighash&&Yg.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Pm.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Jy}static getAddress(e){return wy(e)}static getSighash(e){return Ff(Xy(e.format()),0,4)}static getEventTopic(e){return Xy(e.format())}getFunction(e){if(Uf(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Yg.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?Yg.throwArgumentError("no matching function","name",t):n.length>1&&Yg.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[Gm.fromString(e).format()];return t||Yg.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Uf(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Yg.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?Yg.throwArgumentError("no matching event","name",t):n.length>1&&Yg.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[Qm.fromString(e).format()];return t||Yg.throwArgumentError("no matching event","signature",e),t}getError(e){if(Uf(e)){const t=Am(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}Yg.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?Yg.throwArgumentError("no matching error","name",t):n.length>1&&Yg.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[Gm.fromString(e).format()];return t||Yg.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return Am(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Am(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const n=_f(t);return Qf(n.slice(0,4))!==this.getSighash(e)&&Yg.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Qf(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Qf(Pf([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=_f(t);return Qf(n.slice(0,4))!==this.getSighash(e)&&Yg.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Qf(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Qf(Pf([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=_f(t),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(e){}break;case 4:{const e=Qf(n.slice(0,4)),t=qg[e];if(t)o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.signature,t.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return Yg.throwError("call revert exception"+i,xf.errors.CALL_EXCEPTION,{method:e.format(),data:Qf(t),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Qf(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Yg.throwError("too many arguments for "+e.format(),xf.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?Xy(t):"bytes"===e.type?ay(Qf(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=tm.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Gf(Qf(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Yg.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&Yg.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Yg.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)n.push(Xy(a));else if("bytes"===e.type)n.push(ay(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[a]))}else r.push(e),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);Uf(n[0],32)&&n[0].toLowerCase()===t||Yg.throwError("fragment/topic mismatch",xf.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(Rm.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(r.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,Pf(n)):null,s=this._abiCoder.decode(i,t,!0),u=[],c=0,l=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new Gg({_isIndexed:!0,hash:null});else if(o[t])u[t]=new Gg({_isIndexed:!0,hash:a[l++]});else try{u[t]=a[l++]}catch(e){u[t]=e}else try{u[t]=s[c++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){const n=u[t];n instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw Zg(`property ${JSON.stringify(e.name)}`,n)}}):u[e.name]=n}}));for(let e=0;e<u.length;e++){const t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:()=>{throw Zg(`index ${e}`,t)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Vg({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:tm.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Fg({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Qf(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new Hg({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var Xg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Kg=new xf("abstract-provider/5.7.0");class $g extends xm{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ev{constructor(){Kg.checkAbstract(new.target,ev),Mm(this,"_isProvider",!0)}getFeeData(){return Xg(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield Em({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let n=null,r=null,i=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,i=tm.from("1500000000"),r=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var tv=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const nv=new xf("abstract-signer/5.7.0"),rv=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],iv=[xf.errors.INSUFFICIENT_FUNDS,xf.errors.NONCE_EXPIRED,xf.errors.REPLACEMENT_UNDERPRICED];class ov{constructor(){nv.checkAbstract(new.target,ov),Mm(this,"_isSigner",!0)}getBalance(e){return tv(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return tv(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return tv(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield Em(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return tv(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield Em(this.checkTransaction(e));return yield this.provider.call(n,t)}))}sendTransaction(e){return tv(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),n=yield this.signTransaction(t);return yield this.provider.sendTransaction(n)}))}getChainId(){return tv(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return tv(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return tv(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return tv(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===rv.indexOf(t)&&nv.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=Nm(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&nv.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return tv(this,void 0,void 0,(function*(){const t=yield Em(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>tv(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&nv.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const n=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!n?0!==t.type&&1!==t.type||!n||nv.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):nv.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(n&&nv.throwError("network does not support EIP-1559",xf.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):nv.throwError("failed to get consistent fee data",xf.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(iv.indexOf(e.code)>=0)throw e;return nv.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xf.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&nv.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield Em(t)}))}_checkProvider(e){this.provider||nv.throwError("missing provider",xf.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class av extends ov{constructor(e,t){super(),Mm(this,"address",e),Mm(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{nv.throwError(e,xf.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new av(this.address,e)}}var sv=uv;function uv(e,t){if(!e)throw new Error(t||"Assertion failed")}uv.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var cv=[],lv=[],dv="undefined"!=typeof Uint8Array?Uint8Array:Array,hv=!1;function pv(){hv=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)cv[t]=e[t],lv[e.charCodeAt(t)]=t;lv["-".charCodeAt(0)]=62,lv["_".charCodeAt(0)]=63}function fv(e,t,n){for(var r,i,o=[],a=t;a<n;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(cv[(i=r)>>18&63]+cv[i>>12&63]+cv[i>>6&63]+cv[63&i]);return o.join("")}function mv(e){var t;hv||pv();for(var n=e.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;s<u;s+=a)o.push(fv(e,s,s+a>u?u:s+a));return 1===r?(t=e[n-1],i+=cv[t>>2],i+=cv[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=cv[t>>10],i+=cv[t>>4&63],i+=cv[t<<2&63],i+="="),o.push(i),o.join("")}function yv(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)}function gv(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*m}var vv={}.toString,wv=Array.isArray||function(e){return"[object Array]"==vv.call(e)};function bv(){return Av.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Mv(e,t){if(bv()<t)throw new RangeError("Invalid typed array length");return Av.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Av.prototype:(null===e&&(e=new Av(t)),e.length=t),e}function Av(e,t,n){if(!(Av.TYPED_ARRAY_SUPPORT||this instanceof Av))return new Av(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Tv(this,e)}return Ev(this,e,t,n)}function Ev(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Av.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Av.prototype:e=Iv(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Av.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|xv(t,n);e=Mv(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(Lv(t)){var n=0|kv(t.length);return 0===(e=Mv(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Mv(e,0):Iv(e,t);if("Buffer"===t.type&&wv(t.data))return Iv(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Nv(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Tv(e,t){if(Nv(t),e=Mv(e,t<0?0:0|kv(t)),!Av.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Iv(e,t){var n=t.length<0?0:0|kv(t.length);e=Mv(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function kv(e){if(e>=bv())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+bv().toString(16)+" bytes");return 0|e}function Lv(e){return!(null==e||!e._isBuffer)}function xv(e,t){if(Lv(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return nw(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return rw(e).length;default:if(r)return nw(e).length;t=(""+t).toLowerCase(),r=!0}}function Sv(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Vv(this,t,n);case"utf8":case"utf-8":return Wv(this,t,n);case"ascii":return Yv(this,t,n);case"latin1":case"binary":return Fv(this,t,n);case"base64":return Uv(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Hv(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function jv(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Cv(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Av.from(t,r)),Lv(t))return 0===t.length?-1:Dv(e,t,n,r,i);if("number"==typeof t)return t&=255,Av.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Dv(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Dv(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){d=!1;break}if(d)return o}return-1}function Ov(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function zv(e,t,n,r){return iw(nw(t,e.length-n),e,n,r)}function _v(e,t,n,r){return iw(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Pv(e,t,n,r){return _v(e,t,n,r)}function Bv(e,t,n,r){return iw(rw(t),e,n,r)}function Rv(e,t,n,r){return iw(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function Uv(e,t,n){return 0===t&&n===e.length?mv(e):mv(e.slice(t,n))}function Wv(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,c=e[i],l=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=Qv)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Qv));return n}(r)}Av.TYPED_ARRAY_SUPPORT=void 0===r.TYPED_ARRAY_SUPPORT||r.TYPED_ARRAY_SUPPORT,bv(),Av.poolSize=8192,Av._augment=function(e){return e.__proto__=Av.prototype,e},Av.from=function(e,t,n){return Ev(null,e,t,n)},Av.TYPED_ARRAY_SUPPORT&&(Av.prototype.__proto__=Uint8Array.prototype,Av.__proto__=Uint8Array),Av.alloc=function(e,t,n){return function(e,t,n,r){return Nv(t),t<=0?Mv(e,t):void 0!==n?"string"==typeof r?Mv(e,t).fill(n,r):Mv(e,t).fill(n):Mv(e,t)}(null,e,t,n)},Av.allocUnsafe=function(e){return Tv(null,e)},Av.allocUnsafeSlow=function(e){return Tv(null,e)},Av.isBuffer=function(e){return null!=e&&(!!e._isBuffer||ow(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ow(e.slice(0,0))}(e))},Av.compare=function(e,t){if(!Lv(e)||!Lv(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},Av.isEncoding=function(e){switch(String(e).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}},Av.concat=function(e,t){if(!wv(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Av.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Av.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!Lv(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Av.byteLength=xv,Av.prototype._isBuffer=!0,Av.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)jv(this,t,t+1);return this},Av.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)jv(this,t,t+3),jv(this,t+1,t+2);return this},Av.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)jv(this,t,t+7),jv(this,t+1,t+6),jv(this,t+2,t+5),jv(this,t+3,t+4);return this},Av.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Wv(this,0,e):Sv.apply(this,arguments)},Av.prototype.equals=function(e){if(!Lv(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Av.compare(this,e)},Av.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Av.prototype.compare=function(e,t,n,r,i){if(!Lv(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=e.slice(t,n),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},Av.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Av.prototype.indexOf=function(e,t,n){return Cv(this,e,t,n,!0)},Av.prototype.lastIndexOf=function(e,t,n){return Cv(this,e,t,n,!1)},Av.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Ov(this,e,t,n);case"utf8":case"utf-8":return zv(this,e,t,n);case"ascii":return _v(this,e,t,n);case"latin1":case"binary":return Pv(this,e,t,n);case"base64":return Bv(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rv(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Av.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Qv=4096;function Yv(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Fv(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Vv(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=tw(e[o]);return i}function Hv(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Gv(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function qv(e,t,n,r,i,o){if(!Lv(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(n+r>e.length)throw new RangeError("Index out of range")}function Zv(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Jv(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Xv(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Kv(e,t,n,r,i){return i||Xv(e,0,n,4),gv(e,t,n,r,23,4),n+4}function $v(e,t,n,r,i){return i||Xv(e,0,n,8),gv(e,t,n,r,52,8),n+8}Av.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Av.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Av.prototype;else{var i=t-e;n=new Av(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},Av.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Gv(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},Av.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Gv(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},Av.prototype.readUInt8=function(e,t){return t||Gv(e,1,this.length),this[e]},Av.prototype.readUInt16LE=function(e,t){return t||Gv(e,2,this.length),this[e]|this[e+1]<<8},Av.prototype.readUInt16BE=function(e,t){return t||Gv(e,2,this.length),this[e]<<8|this[e+1]},Av.prototype.readUInt32LE=function(e,t){return t||Gv(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Av.prototype.readUInt32BE=function(e,t){return t||Gv(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Av.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Gv(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Av.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Gv(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Av.prototype.readInt8=function(e,t){return t||Gv(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Av.prototype.readInt16LE=function(e,t){t||Gv(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Av.prototype.readInt16BE=function(e,t){t||Gv(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Av.prototype.readInt32LE=function(e,t){return t||Gv(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Av.prototype.readInt32BE=function(e,t){return t||Gv(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Av.prototype.readFloatLE=function(e,t){return t||Gv(e,4,this.length),yv(this,e,!0,23,4)},Av.prototype.readFloatBE=function(e,t){return t||Gv(e,4,this.length),yv(this,e,!1,23,4)},Av.prototype.readDoubleLE=function(e,t){return t||Gv(e,8,this.length),yv(this,e,!0,52,8)},Av.prototype.readDoubleBE=function(e,t){return t||Gv(e,8,this.length),yv(this,e,!1,52,8)},Av.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||qv(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},Av.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||qv(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Av.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,1,255,0),Av.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Av.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,2,65535,0),Av.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Zv(this,e,t,!0),t+2},Av.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,2,65535,0),Av.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Zv(this,e,t,!1),t+2},Av.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,4,4294967295,0),Av.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Jv(this,e,t,!0),t+4},Av.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,4,4294967295,0),Av.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Jv(this,e,t,!1),t+4},Av.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);qv(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},Av.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);qv(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},Av.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,1,127,-128),Av.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Av.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,2,32767,-32768),Av.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Zv(this,e,t,!0),t+2},Av.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,2,32767,-32768),Av.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Zv(this,e,t,!1),t+2},Av.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,4,2147483647,-2147483648),Av.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Jv(this,e,t,!0),t+4},Av.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||qv(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Av.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Jv(this,e,t,!1),t+4},Av.prototype.writeFloatLE=function(e,t,n){return Kv(this,e,t,!0,n)},Av.prototype.writeFloatBE=function(e,t,n){return Kv(this,e,t,!1,n)},Av.prototype.writeDoubleLE=function(e,t,n){return $v(this,e,t,!0,n)},Av.prototype.writeDoubleBE=function(e,t,n){return $v(this,e,t,!1,n)},Av.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!Av.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},Av.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Av.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=Lv(e)?e:nw(new Av(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var ew=/[^+\/0-9A-Za-z-_]/g;function tw(e){return e<16?"0"+e.toString(16):e.toString(16)}function nw(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function rw(e){return function(e){var t,n,r,i,o,a;hv||pv();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new dv(3*s/4-o),r=o>0?s-4:s;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=lv[e.charCodeAt(t)]<<18|lv[e.charCodeAt(t+1)]<<12|lv[e.charCodeAt(t+2)]<<6|lv[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=lv[e.charCodeAt(t)]<<2|lv[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=lv[e.charCodeAt(t)]<<10|lv[e.charCodeAt(t+1)]<<4|lv[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ew,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function iw(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ow(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var aw=function(e){return e instanceof Av},sw=rf((function(e,t){var n=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(" ")}r=1;for(var i=arguments,a=i.length,s=String(e).replace(n,(function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),u=i[r];r<a;u=i[++r])p(u)||!v(u)?s+=" "+u:s+=" "+o(u);return s},t.deprecate=function(e,n){if(y(tf.process))return function(){return t.deprecate(e,n).apply(this,arguments)};if(!0===L.noDeprecation)return e;var r=!1;return function(){if(!r){if(L.throwDeprecation)throw new Error(n);L.traceDeprecation?console.trace(n):console.error(n),r=!0}return e.apply(this,arguments)}};var r,i={};function o(e,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),u(r,e,r.depth)}function a(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e,t){return e}function u(e,n,r){if(e.customInspect&&n&&M(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return m(i)||(i=u(e,i,r)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(f(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(p(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),0===a.length){if(M(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(g(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return e.stylize(Date.prototype.toString.call(n),"date");if(b(n))return c(n)}var A,E="",N=!1,I=["{","}"];(d(n)&&(N=!0,I=["[","]"]),M(n))&&(E=" [Function"+(n.name?": "+n.name:"")+"]");return g(n)&&(E=" "+RegExp.prototype.toString.call(n)),w(n)&&(E=" "+Date.prototype.toUTCString.call(n)),b(n)&&(E=" "+c(n)),0!==a.length||N&&0!=n.length?r<0?g(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),A=N?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)T(t,String(a))?o.push(l(e,t,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(l(e,t,n,r,i,!0))})),o}(e,n,r,s,a):a.map((function(t){return l(e,n,r,s,t,N)})),e.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(A,E,I)):I[0]+E+I[1]}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=p(n)?u(e,c.value,null):u(e,c.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).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+": "+s}function d(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function p(e){return null===e}function f(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function g(e){return v(e)&&"[object RegExp]"===A(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===A(e)}function b(e){return v(e)&&("[object Error]"===A(e)||e instanceof Error)}function M(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(y(r)&&(r=L.env.NODE_DEBUG||""),e=e.toUpperCase(),!i[e])if(new RegExp("\\b"+e+"\\b","i").test(r)){var n=L.pid;i[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else i[e]=function(){};return i[e]},t.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=p,t.isNullOrUndefined=function(e){return null==e},t.isNumber=f,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=g,t.isObject=v,t.isDate=w,t.isError=b,t.isFunction=M,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=aw;var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),N[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t._extend=function(e,t){if(!t||!v(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}})),uw=rf((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),cw=rf((function(e){try{var t=sw;if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=uw}}));function lw(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}var dw=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):lw(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n};var hw=function(e){for(var t="",n=0;n<e.length;n++)t+=mw(e[n].toString(16));return t};function pw(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}var fw=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=pw(i)),n+=yw(i.toString(16))}return n};function mw(e){return 1===e.length?"0"+e:e}function yw(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var gw=function(e,t,n,r){var i=n-t;sv(i%4==0);for(var o=new Array(i/4),a=0,s=t;a<o.length;a++,s+=4){var u;u="big"===r?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o};var vw=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var o=e[r];"big"===t?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n};var ww=function(e,t){return e>>>t|e<<32-t};var bw=function(e,t){return e<<t|e>>>32-t};var Mw=function(e,t){return e+t>>>0};var Aw=function(e,t,n){return e+t+n>>>0};var Ew=function(e,t,n,r){return e+t+n+r>>>0};var Nw=function(e,t,n,r,i){return e+t+n+r+i>>>0};var Tw=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o<r?1:0)+n+i;e[t]=a>>>0,e[t+1]=o};var Iw=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0};var kw=function(e,t,n,r){return t+r>>>0};var Lw=function(e,t,n,r,i,o,a,s){var u=0,c=t;return u+=(c=c+r>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+n+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0};var xw=function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0};var Sw=function(e,t,n,r,i,o,a,s,u,c){var l=0,d=t;return l+=(d=d+r>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+s>>>0)<s?1:0,e+n+i+a+u+(l+=(d=d+c>>>0)<c?1:0)>>>0};var jw=function(e,t,n,r,i,o,a,s,u,c){return t+r+o+s+c>>>0};var Cw=function(e,t,n){return(t<<32-n|e>>>n)>>>0};var Dw=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var Ow=function(e,t,n){return e>>>n};var zw=function(e,t,n){return(e<<32-n|t>>>n)>>>0},_w={inherits:cw,toArray:dw,toHex:hw,htonl:pw,toHex32:fw,zero2:mw,zero8:yw,join32:gw,split32:vw,rotr32:ww,rotl32:bw,sum32:Mw,sum32_3:Aw,sum32_4:Ew,sum32_5:Nw,sum64:Tw,sum64_hi:Iw,sum64_lo:kw,sum64_4_hi:Lw,sum64_4_lo:xw,sum64_5_hi:Sw,sum64_5_lo:jw,rotr64_hi:Cw,rotr64_lo:Dw,shr64_hi:Ow,shr64_lo:zw};function Pw(){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}var Bw=Pw;Pw.prototype.update=function(e,t){if(e=_w.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=_w.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Pw.prototype.digest=function(e){return this.update(this._pad()),sv(null===this.pending),this._digest(e)},Pw.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r};var Rw={BlockHash:Bw},Uw=_w.rotr32;var Ww=function(e,t,n,r){return 0===e?Qw(t,n,r):1===e||3===e?Fw(t,n,r):2===e?Yw(t,n,r):void 0};function Qw(e,t,n){return e&t^~e&n}function Yw(e,t,n){return e&t^e&n^t&n}function Fw(e,t,n){return e^t^n}var Vw=function(e){return Uw(e,2)^Uw(e,13)^Uw(e,22)};var Hw=function(e){return Uw(e,6)^Uw(e,11)^Uw(e,25)};var Gw=function(e){return Uw(e,7)^Uw(e,18)^e>>>3};var qw=function(e){return Uw(e,17)^Uw(e,19)^e>>>10},Zw={ft_1:Ww,ch32:Qw,maj32:Yw,p32:Fw,s0_256:Vw,s1_256:Hw,g0_256:Gw,g1_256:qw},Jw=_w.rotl32,Xw=_w.sum32,Kw=_w.sum32_5,$w=Zw.ft_1,eb=Rw.BlockHash,tb=[1518500249,1859775393,2400959708,3395469782];function nb(){if(!(this instanceof nb))return new nb;eb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_w.inherits(nb,eb);var rb=nb;nb.blockSize=512,nb.outSize=160,nb.hmacStrength=80,nb.padLength=64,nb.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Jw(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(r=0;r<n.length;r++){var c=~~(r/20),l=Kw(Jw(i,5),$w(c,o,a,s),u,n[r],tb[c]);u=s,s=a,a=Jw(o,30),o=i,i=l}this.h[0]=Xw(this.h[0],i),this.h[1]=Xw(this.h[1],o),this.h[2]=Xw(this.h[2],a),this.h[3]=Xw(this.h[3],s),this.h[4]=Xw(this.h[4],u)},nb.prototype._digest=function(e){return"hex"===e?_w.toHex32(this.h,"big"):_w.split32(this.h,"big")};var ib=_w.sum32,ob=_w.sum32_4,ab=_w.sum32_5,sb=Zw.ch32,ub=Zw.maj32,cb=Zw.s0_256,lb=Zw.s1_256,db=Zw.g0_256,hb=Zw.g1_256,pb=Rw.BlockHash,fb=[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 mb(){if(!(this instanceof mb))return new mb;pb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=fb,this.W=new Array(64)}_w.inherits(mb,pb);var yb=mb;function gb(){if(!(this instanceof gb))return new gb;yb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}mb.blockSize=512,mb.outSize=256,mb.hmacStrength=192,mb.padLength=64,mb.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=ob(hb(n[r-2]),n[r-7],db(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],d=this.h[7];for(sv(this.k.length===n.length),r=0;r<n.length;r++){var h=ab(d,lb(u),sb(u,c,l),this.k[r],n[r]),p=ib(cb(i),ub(i,o,a));d=l,l=c,c=u,u=ib(s,h),s=a,a=o,o=i,i=ib(h,p)}this.h[0]=ib(this.h[0],i),this.h[1]=ib(this.h[1],o),this.h[2]=ib(this.h[2],a),this.h[3]=ib(this.h[3],s),this.h[4]=ib(this.h[4],u),this.h[5]=ib(this.h[5],c),this.h[6]=ib(this.h[6],l),this.h[7]=ib(this.h[7],d)},mb.prototype._digest=function(e){return"hex"===e?_w.toHex32(this.h,"big"):_w.split32(this.h,"big")},_w.inherits(gb,yb);var vb=gb;gb.blockSize=512,gb.outSize=224,gb.hmacStrength=192,gb.padLength=64,gb.prototype._digest=function(e){return"hex"===e?_w.toHex32(this.h.slice(0,7),"big"):_w.split32(this.h.slice(0,7),"big")};var wb=_w.rotr64_hi,bb=_w.rotr64_lo,Mb=_w.shr64_hi,Ab=_w.shr64_lo,Eb=_w.sum64,Nb=_w.sum64_hi,Tb=_w.sum64_lo,Ib=_w.sum64_4_hi,kb=_w.sum64_4_lo,Lb=_w.sum64_5_hi,xb=_w.sum64_5_lo,Sb=Rw.BlockHash,jb=[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 Cb(){if(!(this instanceof Cb))return new Cb;Sb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=jb,this.W=new Array(160)}_w.inherits(Cb,Sb);var Db=Cb;function Ob(e,t,n,r,i){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function zb(e,t,n,r,i,o){var a=t&r^~t&o;return a<0&&(a+=4294967296),a}function _b(e,t,n,r,i){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function Pb(e,t,n,r,i,o){var a=t&r^t&o^r&o;return a<0&&(a+=4294967296),a}function Bb(e,t){var n=wb(e,t,28)^wb(t,e,2)^wb(t,e,7);return n<0&&(n+=4294967296),n}function Rb(e,t){var n=bb(e,t,28)^bb(t,e,2)^bb(t,e,7);return n<0&&(n+=4294967296),n}function Ub(e,t){var n=wb(e,t,14)^wb(e,t,18)^wb(t,e,9);return n<0&&(n+=4294967296),n}function Wb(e,t){var n=bb(e,t,14)^bb(e,t,18)^bb(t,e,9);return n<0&&(n+=4294967296),n}function Qb(e,t){var n=wb(e,t,1)^wb(e,t,8)^Mb(e,t,7);return n<0&&(n+=4294967296),n}function Yb(e,t){var n=bb(e,t,1)^bb(e,t,8)^Ab(e,t,7);return n<0&&(n+=4294967296),n}function Fb(e,t){var n=wb(e,t,19)^wb(t,e,29)^Mb(e,t,6);return n<0&&(n+=4294967296),n}function Vb(e,t){var n=bb(e,t,19)^bb(t,e,29)^Ab(e,t,6);return n<0&&(n+=4294967296),n}function Hb(){if(!(this instanceof Hb))return new Hb;Db.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Cb.blockSize=1024,Cb.outSize=512,Cb.hmacStrength=192,Cb.padLength=128,Cb.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=Fb(n[r-4],n[r-3]),o=Vb(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=Qb(n[r-30],n[r-29]),c=Yb(n[r-30],n[r-29]),l=n[r-32],d=n[r-31];n[r]=Ib(i,o,a,s,u,c,l,d),n[r+1]=kb(i,o,a,s,u,c,l,d)}},Cb.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],d=this.h[8],h=this.h[9],p=this.h[10],f=this.h[11],m=this.h[12],y=this.h[13],g=this.h[14],v=this.h[15];sv(this.k.length===n.length);for(var w=0;w<n.length;w+=2){var b=g,M=v,A=Ub(d,h),E=Wb(d,h),N=Ob(d,h,p,f,m),T=zb(d,h,p,f,m,y),I=this.k[w],k=this.k[w+1],L=n[w],x=n[w+1],S=Lb(b,M,A,E,N,T,I,k,L,x),j=xb(b,M,A,E,N,T,I,k,L,x);b=Bb(r,i),M=Rb(r,i),A=_b(r,i,o,a,s),E=Pb(r,i,o,a,s,u);var C=Nb(b,M,A,E),D=Tb(b,M,A,E);g=m,v=y,m=p,y=f,p=d,f=h,d=Nb(c,l,S,j),h=Tb(l,l,S,j),c=s,l=u,s=o,u=a,o=r,a=i,r=Nb(S,j,C,D),i=Tb(S,j,C,D)}Eb(this.h,0,r,i),Eb(this.h,2,o,a),Eb(this.h,4,s,u),Eb(this.h,6,c,l),Eb(this.h,8,d,h),Eb(this.h,10,p,f),Eb(this.h,12,m,y),Eb(this.h,14,g,v)},Cb.prototype._digest=function(e){return"hex"===e?_w.toHex32(this.h,"big"):_w.split32(this.h,"big")},_w.inherits(Hb,Db);var Gb=Hb;Hb.blockSize=1024,Hb.outSize=384,Hb.hmacStrength=192,Hb.padLength=128,Hb.prototype._digest=function(e){return"hex"===e?_w.toHex32(this.h.slice(0,12),"big"):_w.split32(this.h.slice(0,12),"big")};var qb={sha1:rb,sha224:vb,sha256:yb,sha384:Gb,sha512:Db},Zb=_w.rotl32,Jb=_w.sum32,Xb=_w.sum32_3,Kb=_w.sum32_4,$b=Rw.BlockHash;function eM(){if(!(this instanceof eM))return new eM;$b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}_w.inherits(eM,$b);var tM=eM;function nM(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function rM(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function iM(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}eM.blockSize=512,eM.outSize=160,eM.hmacStrength=192,eM.padLength=64,eM.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=n,u=r,c=i,l=o,d=a,h=0;h<80;h++){var p=Jb(Zb(Kb(n,nM(h,r,i,o),e[oM[h]+t],rM(h)),sM[h]),a);n=a,a=o,o=Zb(i,10),i=r,r=p,p=Jb(Zb(Kb(s,nM(79-h,u,c,l),e[aM[h]+t],iM(h)),uM[h]),d),s=d,d=l,l=Zb(c,10),c=u,u=p}p=Xb(this.h[1],i,l),this.h[1]=Xb(this.h[2],o,d),this.h[2]=Xb(this.h[3],a,s),this.h[3]=Xb(this.h[4],n,u),this.h[4]=Xb(this.h[0],r,c),this.h[0]=p},eM.prototype._digest=function(e){return"hex"===e?_w.toHex32(this.h,"little"):_w.split32(this.h,"little")};var oM=[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],aM=[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],sM=[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],uM=[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],cM={ripemd160:tM};function lM(e,t,n){if(!(this instanceof lM))return new lM(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(_w.toArray(t,n))}var dM=lM;lM.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),sv(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},lM.prototype.update=function(e,t){return this.inner.update(e,t),this},lM.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var hM=rf((function(e,t){var n=t;n.utils=_w,n.common=Rw,n.sha=qb,n.ripemd=cM,n.hmac=dM,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),pM=hM;function fM(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},e(n,n.exports),n.exports}var mM=yM;function yM(e,t){if(!e)throw new Error(t||"Assertion failed")}yM.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var gM=fM((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16))}else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),vM=fM((function(e,t){var n=t;n.assert=mM,n.toArray=gM.toArray,n.zero2=gM.zero2,n.toHex=gM.toHex,n.encode=gM.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<r.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0==(1&c)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new wf(e,"hex","le")}})),wM=vM.getNAF,bM=vM.getJSF,MM=vM.assert;function AM(e,t){this.type=e,this.p=new wf(t.p,16),this.red=t.prime?wf.red(t.prime):wf.mont(this.p),this.zero=new wf(0).toRed(this.red),this.one=new wf(1).toRed(this.red),this.two=new wf(2).toRed(this.red),this.n=t.n&&new wf(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 n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var EM=AM;function NM(e,t){this.curve=e,this.type=t,this.precomputed=null}AM.prototype.point=function(){throw new Error("Not implemented")},AM.prototype.validate=function(){throw new Error("Not implemented")},AM.prototype._fixedNafMul=function(e,t){MM(e.precomputed);var n=e._getDoubles(),r=wM(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<r.length;o+=n.step){a=0;for(var u=o+n.step-1;u>=o;u--)a=(a<<1)+r[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o<s.length;o++)(a=s[o])===d?l=l.mixedAdd(n.points[o]):a===-d&&(l=l.mixedAdd(n.points[o].neg()));c=c.add(l)}return c.toP()},AM.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=wM(t,n,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];MM(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},AM.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o<r;o++){var h=(s=t[o])._getNAFPoints(e);u[o]=h.wnd,c[o]=h.points}for(o=r-1;o>=1;o-=2){var p=o-1,f=o;if(1===u[p]&&1===u[f]){var m=[t[p],null,null,t[f]];0===t[p].y.cmp(t[f].y)?(m[1]=t[p].add(t[f]),m[2]=t[p].toJ().mixedAdd(t[f].neg())):0===t[p].y.cmp(t[f].y.redNeg())?(m[1]=t[p].toJ().mixedAdd(t[f]),m[2]=t[p].add(t[f].neg())):(m[1]=t[p].toJ().mixedAdd(t[f]),m[2]=t[p].toJ().mixedAdd(t[f].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=bM(n[p],n[f]);for(d=Math.max(g[0].length,d),l[p]=new Array(d),l[f]=new Array(d),a=0;a<d;a++){var v=0|g[0][a],w=0|g[1][a];l[p][a]=y[3*(v+1)+(w+1)],l[f][a]=0,c[p]=m}}else l[p]=wM(n[p],u[p],this._bitLength),l[f]=wM(n[f],u[f],this._bitLength),d=Math.max(l[p].length,d),d=Math.max(l[f].length,d)}var b=this.jpoint(null,null,null),M=this._wnafT4;for(o=d;o>=0;o--){for(var A=0;o>=0;){var E=!0;for(a=0;a<r;a++)M[a]=0|l[a][o],0!==M[a]&&(E=!1);if(!E)break;A++,o--}if(o>=0&&A++,b=b.dblp(A),o<0)break;for(a=0;a<r;a++){var N=M[a];0!==N&&(N>0?s=c[a][N-1>>1]:N<0&&(s=c[a][-N-1>>1].neg()),b="affine"===s.type?b.mixedAdd(s):b.add(s))}}for(o=0;o<r;o++)c[o]=null;return i?b:b.toP()},AM.BasePoint=NM,NM.prototype.eq=function(){throw new Error("Not implemented")},NM.prototype.validate=function(){return this.curve.validate(this)},AM.prototype.decodePoint=function(e,t){e=vM.toArray(e,t);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?MM(e[e.length-1]%2==0):7===e[0]&&MM(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},NM.prototype.encodeCompressed=function(e){return this.encode(e,!0)},NM.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},NM.prototype.encode=function(e,t){return vM.encode(this._encode(t),e)},NM.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},NM.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},NM.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)r=r.dbl();n.push(r)}return{step:e,points:n}},NM.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},NM.prototype._getBeta=function(){return null},NM.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t};var TM=fM((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),IM=vM.assert;function kM(e){EM.call(this,"short",e),this.a=new wf(e.a,16).toRed(this.red),this.b=new wf(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}TM(kM,EM);var LM=kM;function xM(e,t,n,r){EM.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new wf(t,16),this.y=new wf(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function SM(e,t,n,r){EM.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new wf(0)):(this.x=new wf(t,16),this.y=new wf(n,16),this.z=new wf(r,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}kM.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n,r;if(e.beta)t=new wf(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)n=new wf(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?n=o[0]:(n=o[1],IM(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return r=e.basis?e.basis.map((function(e){return{a:new wf(e.a,16),b:new wf(e.b,16)}})):this._getEndoBasis(n),{beta:t,lambda:n,basis:r}}},kM.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:wf.mont(e),n=new wf(2).toRed(t).redInvm(),r=n.redNeg(),i=new wf(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},kM.prototype._getEndoBasis=function(e){for(var t,n,r,i,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new wf(1),f=new wf(0),m=new wf(0),y=new wf(1),g=0;0!==d.cmpn(0);){var v=h.div(d);u=h.sub(v.mul(d)),c=m.sub(v.mul(p));var w=y.sub(v.mul(f));if(!r&&u.cmp(l)<0)t=s.neg(),n=p,r=u.neg(),i=c;else if(r&&2==++g)break;s=u,h=d,d=u,m=p,p=c,y=f,f=w}o=u.neg(),a=c;var b=r.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(b)>=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},kM.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},kM.prototype.pointFromX=function(e,t){(e=new wf(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},kM.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},kM.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,r,i,2*o,n),l=0;l<2*o;l++)r[l]=null,i[l]=null;return c},TM(xM,EM.BasePoint),kM.prototype.point=function(e,t,n){return new xM(this,e,t,n)},kM.prototype.pointFromJSON=function(e,t){return xM.fromJSON(this,e,t)},xM.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},xM.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]},xM.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var o=t[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},xM.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)+">"},xM.prototype.isInfinity=function(){return this.inf},xM.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},xM.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},xM.prototype.getX=function(){return this.x.fromRed()},xM.prototype.getY=function(){return this.y.fromRed()},xM.prototype.mul=function(e){return e=new wf(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},xM.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},xM.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},xM.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},xM.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},xM.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},TM(SM,EM.BasePoint),kM.prototype.jpoint=function(e,t,n){return new SM(this,e,t,n)},SM.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},SM.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},SM.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=r.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),p=u.redMul(d.redISub(h)).redISub(o.redMul(l)),f=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,p,f)},SM.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)},SM.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),d=c.redSqr(),h=d.redSqr(),p=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(u)),f=o.redMul(d),m=p.redSqr().redISub(f.redAdd(f)),y=f.redISub(m),g=p.redMul(y);g=g.redIAdd(g).redISub(h);var v=c.redMul(s);t+1<e&&(u=u.redMul(h)),o=m,s=v,c=g}return this.curve.jpoint(o,c.redMul(i),s)},SM.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},SM.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(l).redISub(h);p=p.redIAdd(p);var f=l.redAdd(l).redIAdd(l),m=f.redSqr(),y=h.redIAdd(h);y=(y=y.redIAdd(y)).redIAdd(y),e=m.redISub(p).redISub(p),t=f.redMul(p.redISub(e)).redISub(y),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},SM.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),p=this.x.redSub(l).redMul(this.x.redAdd(l));p=p.redAdd(p).redIAdd(p);var f=h.redIAdd(h),m=(f=f.redIAdd(f)).redAdd(f);e=p.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var y=d.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=p.redMul(f.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,n)},SM.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=t.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=s.redMul(d).redISub(h),f=n.redAdd(n).redMul(r);return this.curve.jpoint(l,p,f)},SM.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(d,h,p)},SM.prototype.mul=function(e,t){return e=new wf(e,t),this.curve._wnafMul(this,e)},SM.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},SM.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},SM.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)+">"},SM.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var jM=fM((function(e,t){var n=t;n.base=EM,n.short=LM,n.mont=null,n.edwards=null})),CM=fM((function(e,t){var n,r=t,i=vM.assert;function o(e){"short"===e.type?this.curve=new jM.short(e):"edwards"===e.type?this.curve=new jM.edwards(e):this.curve=new jM.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("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:pM.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:pM.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:pM.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:pM.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"]}),a("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:pM.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:pM.sha256,gRed:!1,g:["9"]}),a("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:pM.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(e){n=void 0}a("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:pM.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function DM(e){if(!(this instanceof DM))return new DM(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=gM.toArray(e.entropy,e.entropyEnc||"hex"),n=gM.toArray(e.nonce,e.nonceEnc||"hex"),r=gM.toArray(e.pers,e.persEnc||"hex");mM(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var OM=DM;DM.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},DM.prototype._hmac=function(){return new pM.hmac(this.hash,this.K)},DM.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},DM.prototype.reseed=function(e,t,n,r){"string"!=typeof t&&(r=n,n=t,t=null),e=gM.toArray(e,t),n=gM.toArray(n,r),mM(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},DM.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=gM.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(n),this._reseed++,gM.encode(o,t)};var zM=vM.assert;function _M(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)}var PM=_M;_M.fromPublic=function(e,t,n){return t instanceof _M?t:new _M(e,{pub:t,pubEnc:n})},_M.fromPrivate=function(e,t,n){return t instanceof _M?t:new _M(e,{priv:t,privEnc:n})},_M.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},_M.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},_M.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},_M.prototype._importPrivate=function(e,t){this.priv=new wf(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},_M.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?zM(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||zM(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},_M.prototype.derive=function(e){return e.validate()||zM(e.validate(),"public point not validated"),e.mul(this.priv).getX()},_M.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},_M.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},_M.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var BM=vM.assert;function RM(e,t){if(e instanceof RM)return e;this._importDER(e,t)||(BM(e.r&&e.s,"Signature without r or s"),this.r=new wf(e.r,16),this.s=new wf(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var UM=RM;function WM(){this.place=0}function QM(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o<r;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function YM(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function FM(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}RM.prototype._importDER=function(e,t){e=vM.toArray(e,t);var n=new WM;if(48!==e[n.place++])return!1;var r=QM(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=QM(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=QM(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new wf(o),this.s=new wf(s),this.recoveryParam=null,!0},RM.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=YM(t),n=YM(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];FM(r,t.length),(r=r.concat(t)).push(2),FM(r,n.length);var i=r.concat(n),o=[48];return FM(o,i.length),o=o.concat(i),vM.encode(o,e)};var VM=function(){throw new Error("unsupported")},HM=vM.assert;function GM(e){if(!(this instanceof GM))return new GM(e);"string"==typeof e&&(HM(Object.prototype.hasOwnProperty.call(CM,e),"Unknown curve "+e),e=CM[e]),e instanceof CM.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}var qM=GM;GM.prototype.keyPair=function(e){return new PM(this,e)},GM.prototype.keyFromPrivate=function(e,t){return PM.fromPrivate(this,e,t)},GM.prototype.keyFromPublic=function(e,t){return PM.fromPublic(this,e,t)},GM.prototype.genKeyPair=function(e){e||(e={});for(var t=new OM({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||VM(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new wf(2));;){var i=new wf(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},GM.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},GM.prototype.sign=function(e,t,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new wf(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new OM({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new wf(1)),c=0;;c++){var l=r.k?r.k(c):new wf(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var f=l.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(f=f.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return r.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),m^=1),new UM({r:p,s:f,recoveryParam:m})}}}}}},GM.prototype.verify=function(e,t,n,r){e=this._truncateToN(new wf(e,16)),n=this.keyFromPublic(n,r);var i=(t=new UM(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},GM.prototype.recoverPubKey=function(e,t,n,r){HM((3&n)===n,"The recovery param is more than two bits"),t=new UM(t,r);var i=this.n,o=new wf(e),a=t.r,s=t.s,u=1&n,c=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),d=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(d,a,h)},GM.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new UM(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var ZM=fM((function(e,t){var n=t;n.version="6.5.4",n.utils=vM,n.rand=function(){throw new Error("unsupported")},n.curve=jM,n.curves=CM,n.ec=qM,n.eddsa=null})).ec;const JM=new xf("signing-key/5.7.0");let XM=null;function KM(){return XM||(XM=new ZM("secp256k1")),XM}class $M{constructor(e){Mm(this,"curve","secp256k1"),Mm(this,"privateKey",Qf(e)),32!==Yf(this.privateKey)&&JM.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=KM().keyFromPrivate(_f(this.privateKey));Mm(this,"publicKey","0x"+t.getPublic(!1,"hex")),Mm(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Mm(this,"_isSigningKey",!0)}_addPoint(e){const t=KM().keyFromPublic(_f(this.publicKey)),n=KM().keyFromPublic(_f(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const t=KM().keyFromPrivate(_f(this.privateKey)),n=_f(e);32!==n.length&&JM.throwArgumentError("bad digest length","digest",e);const r=t.sign(n,{canonical:!0});return qf({recoveryParam:r.recoveryParam,r:Gf("0x"+r.r.toString(16),32),s:Gf("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=KM().keyFromPrivate(_f(this.privateKey)),n=KM().keyFromPublic(_f(eA(e)));return Gf("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function eA(e,t){const n=_f(e);if(32===n.length){const e=new $M(n);return t?"0x"+KM().keyFromPrivate(n).getPublic(!0,"hex"):e.publicKey}return 33===n.length?t?Qf(n):"0x"+KM().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+KM().keyFromPublic(n).getPublic(!0,"hex"):Qf(n):JM.throwArgumentError("invalid public or private key","key","[REDACTED]")}const tA=new xf("transactions/5.7.0");var nA;function rA(e){return"0x"===e?null:wy(e)}function iA(e){return"0x"===e?Dy:tm.from(e)}function oA(e,t){return function(e){return wy(Ff(ay(Ff(eA(e),1)),12))}(function(e,t){const n=qf(t),r={r:_f(n.r),s:_f(n.s)};return"0x"+KM().recoverPubKey(_f(e),r,n.recoveryParam).encode("hex",!1)}(_f(e),t))}function aA(e,t){const n=Bf(tm.from(e).toHexString());return n.length>32&&tA.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function sA(e,t){return{address:wy(e),storageKeys:(t||[]).map(((t,n)=>(32!==Yf(t)&&tA.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,t),t.toLowerCase())))}}function uA(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&tA.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),sA(e[0],e[1])):sA(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const n=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return sA(t,Object.keys(n).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function cA(e){return uA(e).map((e=>[e.address,e.storageKeys]))}function lA(e,t){if(null!=e.gasPrice){const t=tm.from(e.gasPrice),n=tm.from(e.maxFeePerGas||0);t.eq(n)||tA.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:n})}const n=[aA(e.chainId||0,"chainId"),aA(e.nonce||0,"nonce"),aA(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),aA(e.maxFeePerGas||0,"maxFeePerGas"),aA(e.gasLimit||0,"gasLimit"),null!=e.to?wy(e.to):"0x",aA(e.value||0,"value"),e.data||"0x",cA(e.accessList||[])];if(t){const e=qf(t);n.push(aA(e.recoveryParam,"recoveryParam")),n.push(Bf(e.r)),n.push(Bf(e.s))}return Vf(["0x02",dy(n)])}function dA(e,t){const n=[aA(e.chainId||0,"chainId"),aA(e.nonce||0,"nonce"),aA(e.gasPrice||0,"gasPrice"),aA(e.gasLimit||0,"gasLimit"),null!=e.to?wy(e.to):"0x",aA(e.value||0,"value"),e.data||"0x",cA(e.accessList||[])];if(t){const e=qf(t);n.push(aA(e.recoveryParam,"recoveryParam")),n.push(Bf(e.r)),n.push(Bf(e.s))}return Vf(["0x01",dy(n)])}function hA(e,t,n){try{const n=iA(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){tA.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Gf(t[1],32),e.s=Gf(t[2],32);try{const t=ay(n(e));e.from=oA(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function pA(e){const t=_f(e);if(t[0]>127)return function(e){const t=fy(e);9!==t.length&&6!==t.length&&tA.throwArgumentError("invalid raw transaction","rawTransaction",e);const n={nonce:iA(t[0]).toNumber(),gasPrice:iA(t[1]),gasLimit:iA(t[2]),to:rA(t[3]),value:iA(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=tm.from(t[6]).toNumber()}catch(e){return n}if(n.r=Gf(t[7],32),n.s=Gf(t[8],32),tm.from(n.r).isZero()&&tm.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=t.slice(0,6);0!==n.chainId&&(i.push(Qf(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=ay(dy(i));try{n.from=oA(o,{r:Qf(n.r),s:Qf(n.s),recoveryParam:r})}catch(e){}n.hash=ay(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){const t=fy(e.slice(1));8!==t.length&&11!==t.length&&tA.throwArgumentError("invalid component count for transaction type: 1","payload",Qf(e));const n={type:1,chainId:iA(t[0]).toNumber(),nonce:iA(t[1]).toNumber(),gasPrice:iA(t[2]),gasLimit:iA(t[3]),to:rA(t[4]),value:iA(t[5]),data:t[6],accessList:uA(t[7])};return 8===t.length||(n.hash=ay(e),hA(n,t.slice(8),dA)),n}(t);case 2:return function(e){const t=fy(e.slice(1));9!==t.length&&12!==t.length&&tA.throwArgumentError("invalid component count for transaction type: 2","payload",Qf(e));const n=iA(t[2]),r=iA(t[3]),i={type:2,chainId:iA(t[0]).toNumber(),nonce:iA(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:iA(t[4]),to:rA(t[5]),value:iA(t[6]),data:t[7],accessList:uA(t[8])};return 9===t.length||(i.hash=ay(e),hA(i,t.slice(9),lA)),i}(t)}return tA.throwError(`unsupported transaction type: ${t[0]}`,xf.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(nA||(nA={}));var fA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const mA=new xf("contracts/5.7.0");function yA(e,t){return fA(this,void 0,void 0,(function*(){const n=yield t;"string"!=typeof n&&mA.throwArgumentError("invalid address or ENS name","name",n);try{return wy(n)}catch(e){}e||mA.throwError("a provider or signer is needed to resolve ENS names",xf.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield e.resolveName(n);return null==r&&mA.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function gA(e,t,n){return fA(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>gA(e,Array.isArray(t)?t[r]:t[n.name],n)))):"address"===n.type?yield yA(e,t):"tuple"===n.type?yield gA(e,t,n.components):"array"===n.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>gA(e,t,n.arrayChildren)))):Promise.reject(mA.makeError("invalid value for array",xf.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function vA(e,t,n){return fA(this,void 0,void 0,(function*(){let r={};n.length===t.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=Nm(n.pop())),mA.checkArgumentCount(n.length,t.inputs.length,"passed to contract"),e.signer?r.from?r.from=Em({override:yA(e.signer,r.from),signer:e.signer.getAddress()}).then((e=>fA(this,void 0,void 0,(function*(){return wy(e.signer)!==e.override&&mA.throwError("Contract with a Signer cannot override from",xf.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):r.from=e.signer.getAddress():r.from&&(r.from=yA(e.provider,r.from));const i=yield Em({args:gA(e.signer||e.provider,n,t.inputs),address:e.resolvedAddress,overrides:Em(r)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=tm.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=tm.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=tm.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=tm.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=tm.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=uA(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const n=_f(o);for(let t=0;t<n.length;t++)e+=4,n[t]&&(e+=64);a.gasLimit=tm.from(t.gas).add(e)}if(s.value){const e=tm.from(s.value);e.isZero()||t.payable||mA.throwError("non-payable method cannot override value",xf.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),a.value=e}s.customData&&(a.customData=Nm(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.ccipReadEnabled),delete r.nonce,delete r.gasLimit,delete r.gasPrice,delete r.from,delete r.value,delete r.type,delete r.accessList,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.customData,delete r.ccipReadEnabled;const u=Object.keys(r).filter((e=>null!=r[e]));return u.length&&mA.throwError(`cannot override ${u.map((e=>JSON.stringify(e))).join(",")}`,xf.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function wA(e,t,n){const r=e.signer||e.provider;return function(...i){return fA(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=Nm(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield vA(e,t,i),s=yield r.call(a,o);try{let r=e.interface.decodeFunctionResult(t,s);return n&&1===t.outputs.length&&(r=r[0]),r}catch(t){throw t.code===xf.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function bA(e,t){return function(...n){return fA(this,void 0,void 0,(function*(){e.signer||mA.throwError("sending a transaction requires a signer",xf.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const r=yield vA(e,t,n),i=yield e.signer.sendTransaction(r);return function(e,t){const n=t.wait.bind(t);t.wait=t=>n(t).then((t=>(t.events=t.logs.map((n=>{let r=Lm(n),i=null;try{i=e.interface.parseLog(n)}catch(e){}return i&&(r.args=i.args,r.decode=(t,n)=>e.interface.decodeEventLog(i.eventFragment,t,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>e.provider,r.getBlock=()=>e.provider.getBlock(t.blockHash),r.getTransaction=()=>e.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(t),r})),t)))}(e,i),i}))}}function MA(e,t,n){return t.constant?wA(e,t,n):bA(e,t)}function AA(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class EA{constructor(e,t){Mm(this,"tag",e),Mm(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((n=>!(!t&&n.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const n=e.slice();return setTimeout((()=>{t.listener.apply(this,n)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class NA extends EA{constructor(){super("error",null)}}class TA extends EA{constructor(e,t,n,r){const i={address:e};let o=t.getEventTopic(n);r?(o!==r[0]&&mA.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(AA(i),i),Mm(this,"address",e),Mm(this,"interface",t),Mm(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=function(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const o=e.slice();o.push(i);try{n(o,r[i])}catch(e){t.push({path:o,error:e})}}};return n([],e),t}(e.args);if(t.length)throw t[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class IA extends EA{constructor(e,t){super("*",{address:e}),Mm(this,"address",e),Mm(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,n)=>this.interface.decodeEventLog(t.eventFragment,e,n),e.args=t.args}catch(e){}}}class kA{constructor(e,t,n){Mm(this,"interface",Am(new.target,"getInterface")(t)),null==n?(Mm(this,"provider",null),Mm(this,"signer",null)):ov.isSigner(n)?(Mm(this,"provider",n.provider||null),Mm(this,"signer",n)):ev.isProvider(n)?(Mm(this,"provider",n),Mm(this,"signer",null)):mA.throwArgumentError("invalid signer or provider","signerOrProvider",n),Mm(this,"callStatic",{}),Mm(this,"estimateGas",{}),Mm(this,"functions",{}),Mm(this,"populateTransaction",{}),Mm(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const n=this.interface.events[t];Mm(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,e)}))),e[n.name]||(e[n.name]=[]),e[n.name].push(t)})),Object.keys(e).forEach((t=>{const n=e[t];1===n.length?Mm(this.filters,t,this.filters[n[0]]):mA.warn(`Duplicate definition of ${t} (${n.join(", ")})`)}))}if(Mm(this,"_runningEvents",{}),Mm(this,"_wrappedEmits",{}),null==e&&mA.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Mm(this,"address",e),this.provider)Mm(this,"resolvedAddress",yA(this.provider,e));else try{Mm(this,"resolvedAddress",Promise.resolve(wy(e)))}catch(e){mA.throwError("provider is required to use ENS name as contract address",xf.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])mA.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const n=t.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(e)}null==this[e]&&Mm(this,e,MA(this,t,!0)),null==this.functions[e]&&Mm(this.functions,e,MA(this,t,!1)),null==this.callStatic[e]&&Mm(this.callStatic,e,wA(this,t,!0)),null==this.populateTransaction[e]&&Mm(this.populateTransaction,e,function(e,t){return function(...n){return vA(e,t,n)}}(this,t)),null==this.estimateGas[e]&&Mm(this.estimateGas,e,function(e,t){const n=e.signer||e.provider;return function(...r){return fA(this,void 0,void 0,(function*(){n||mA.throwError("estimate require a provider or signer",xf.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield vA(e,t,r);return yield n.estimateGas(i)}))}}(this,t))}})),Object.keys(r).forEach((e=>{const t=r[e];if(t.length>1)return;e=e.substring(1);const n=t[0];try{null==this[e]&&Mm(this,e,this[n])}catch(e){}null==this.functions[e]&&Mm(this.functions,e,this.functions[n]),null==this.callStatic[e]&&Mm(this.callStatic,e,this.callStatic[n]),null==this.populateTransaction[e]&&Mm(this.populateTransaction,e,this.populateTransaction[n]),null==this.estimateGas[e]&&Mm(this.estimateGas,e,this.estimateGas[n])}))}static getContractAddress(e){return by(e)}static getInterface(e){return Jg.isInterface(e)?e:new Jg(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&mA.throwError("contract not deployed",xf.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||mA.throwError("sending a transactions require a signer",xf.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=Nm(e||{});return["from","to"].forEach((function(e){null!=t[e]&&mA.throwError("cannot override "+e,xf.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new av(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Mm(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Gg.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new NA);if("event"===e)return this._normalizeRunningEvent(new EA("event",null));if("*"===e)return this._normalizeRunningEvent(new IA(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new TA(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const n=this.interface.getEvent(t);return this._normalizeRunningEvent(new TA(this.address,this.interface,n,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new EA(AA(t),t))}return this._normalizeRunningEvent(new IA(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,n){const r=Lm(t);return r.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},r.getBlock=()=>this.provider.getBlock(t.blockHash),r.getTransaction=()=>this.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(r),r}_addEventListener(e,t,n){if(this.provider||mA.throwError("events require a provider or a signer with a provider",xf.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const n=n=>{let r=this._wrapEvent(e,n,t);if(null==r.decodeError)try{const t=e.getEmit(r);this.emit(e.filter,...t)}catch(e){r.decodeError=e.error}null!=e.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,n){const r=this._getRunningEvent(e),i=Nm(r.filter);return"string"==typeof t&&Uf(t,32)?(null!=n&&mA.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(r,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const n=this._getRunningEvent(e),r=n.run(t)>0;return this._checkRunningEvents(n),r}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}removeListener(e,t){return this.off(e,t)}}class LA extends kA{}class xA{constructor(e){Mm(this,"alphabet",e),Mm(this,"base",e.length),Mm(this,"_alphabetMap",{}),Mm(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=_f(e);if(0===t.length)return"";let n=[0];for(let e=0;e<t.length;++e){let r=t[e];for(let e=0;e<n.length;++e)r+=n[e]<<8,n[e]=r%this.base,r=r/this.base|0;for(;r>0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let e=0;0===t[e]&&e<t.length-1;++e)r+=this._leader;for(let e=n.length-1;e>=0;--e)r+=this.alphabet[n[e]];return r}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let n=0;n<e.length;n++){let r=this._alphabetMap[e[n]];if(void 0===r)throw new Error("Non-base"+this.base+" character");let i=r;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let n=0;e[n]===this._leader&&n<e.length-1;++n)t.push(0);return _f(new Uint8Array(t.reverse()))}}new xA("abcdefghijklmnopqrstuvwxyz234567");const SA=new xA("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function jA(e){return"0x"+pM.sha256().update(_f(e)).digest("hex")}new xf("sha2/5.7.0");const CA=new xf("networks/5.7.1");function DA(e){const t=function(t,n){null==n&&(n={});const r=[];if(t.InfuraProvider&&"-"!==n.infura)try{r.push(new t.InfuraProvider(e,n.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==n.etherscan)try{r.push(new t.EtherscanProvider(e,n.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==n.alchemy)try{r.push(new t.AlchemyProvider(e,n.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==n.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,n.pocket);o.network&&-1===i.indexOf(o.network.name)&&r.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==n.cloudflare)try{r.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==n.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,n.ankr);o.network&&-1===i.indexOf(o.network.name)&&r.push(o)}catch(e){}if(0===r.length)return null;if(t.FallbackProvider){let i=1;return null!=n.quorum?i=n.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(r,i)}return r[0]};return t.renetwork=function(e){return DA(e)},t}function OA(e,t){const n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(e,t):null};return n.renetwork=function(t){return OA(e,t)},n}const zA={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:DA("homestead")},_A={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:DA("ropsten")},PA={chainId:63,name:"classicMordor",_defaultProvider:OA("https://www.ethercluster.com/mordor","classicMordor")},BA={unspecified:{chainId:0,name:"unspecified"},homestead:zA,mainnet:zA,morden:{chainId:2,name:"morden"},ropsten:_A,testnet:_A,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:DA("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:DA("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:DA("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:DA("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:OA("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:PA,classicTestnet:PA,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:OA("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:DA("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:DA("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var RA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function UA(e,t){return RA(this,void 0,void 0,(function*(){null==t&&(t={});const n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(n.mode=e.mode),e.cache&&(n.cache=e.cache),e.credentials&&(n.credentials=e.credentials),e.redirect&&(n.redirect=e.redirect),e.referrer&&(n.referrer=e.referrer)}const r=yield fetch(e,n),i=yield r.arrayBuffer(),o={};return r.headers.forEach?r.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{o[e.toLowerCase()]=r.headers.get(e)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:_f(new Uint8Array(i))}}))}var WA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const QA=new xf("web/5.7.1");function YA(e){return new Promise((t=>{setTimeout(t,e)}))}function FA(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Df(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Fy(e)}catch(e){}return Qf(e)}return e}function VA(e,t,n){let r=null;if(null!=t){r=Yy(t);const n="string"==typeof e?{url:e}:Nm(e);if(n.headers){0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length||(n.headers=Nm(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return function(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;QA.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;QA.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let u=null;const c={method:"GET"};let l=!1,d=12e4;if("string"==typeof e)u=e;else if("object"==typeof e){if(null!=e&&null!=e.url||QA.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&QA.throwError("basic authentication requires a secure https url",xf.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+eg(Yy(t))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=Nm(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=u?u.match(h):null;if(p)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?$y(p[3]):(f=p[3],Yy(f.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(e){QA.throwError("processing response error",xf.errors.SERVER_ERROR,{body:FA(p[1],p[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}var f;t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),c.headers=m;const y=function(){let e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((()=>{null!=e&&(e=null,n(QA.makeError("timeout",xf.errors.TIMEOUT,{requestBody:FA(c.body,m["content-type"]),requestMethod:c.method,timeout:d,url:u})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return WA(this,void 0,void 0,(function*(){for(let e=0;e<r;e++){let t=null;try{if(t=yield UA(u,c),e<r)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===c.method&&e.match(/^https:/)){u=t.headers.location;continue}}else if(429===t.statusCode){let n=!0;if(i&&(n=yield i(e,u)),n){let n=0;const r=t.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):o*parseInt(String(Math.random()*Math.pow(2,e))),yield YA(n);continue}}}catch(e){t=e.response,null==t&&(y.cancel(),QA.throwError("missing response",xf.errors.SERVER_ERROR,{requestBody:FA(c.body,m["content-type"]),requestMethod:c.method,serverError:e,url:u}))}let s=t.body;if(l&&304===t.statusCode?s=null:!a&&(t.statusCode<200||t.statusCode>=300)&&(y.cancel(),QA.throwError("bad response",xf.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:FA(s,t.headers?t.headers["content-type"]:null),requestBody:FA(c.body,m["content-type"]),requestMethod:c.method,url:u})),n)try{const e=yield n(s,t);return y.cancel(),e}catch(n){if(n.throttleRetry&&e<r){let t=!0;if(i&&(t=yield i(e,u)),t){const t=o*parseInt(String(Math.random()*Math.pow(2,e)));yield YA(t);continue}}y.cancel(),QA.throwError("processing response error",xf.errors.SERVER_ERROR,{body:FA(s,t.headers?t.headers["content-type"]:null),error:n,requestBody:FA(c.body,m["content-type"]),requestMethod:c.method,url:u})}return y.cancel(),s}return QA.throwError("failed response",xf.errors.SERVER_ERROR,{requestBody:FA(c.body,m["content-type"]),requestMethod:c.method,url:u})}))}();return Promise.race([y.promise,g])}(e,r,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse(Fy(e))}catch(t){QA.throwError("invalid JSON",xf.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function HA(e,t){return t||(t={}),null==(t=Nm(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&r(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&r(e)}))}()}))}for(var GA="qpzry9x8gf2tvdw0s3jn54khce6mua7l",qA={},ZA=0;ZA<32;ZA++){var JA=GA.charAt(ZA);if(void 0!==qA[JA])throw new TypeError(JA+" is ambiguous");qA[JA]=ZA}function XA(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function KA(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=XA(t)^r>>5}for(t=XA(t),n=0;n<e.length;++n){var i=e.charCodeAt(n);t=XA(t)^31&i}return t}function $A(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=KA(o);if("string"==typeof s)return s;for(var u=[],c=0;c<a.length;++c){var l=a.charAt(c),d=qA[l];if(void 0===d)return"Unknown character "+l;s=XA(s)^d,c+6>=a.length||u.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:u}}function eE(e,t,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=t)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}var tE={decodeUnsafe:function(){var e=$A.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=$A.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,n){if(n=n||90,e.length+7+t.length>n)throw new TypeError("Exceeds length limit");var r=KA(e=e.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=e+"1",o=0;o<t.length;++o){var a=t[o];if(a>>5!=0)throw new Error("Non 5-bit word");r=XA(r)^a,i+=GA.charAt(a)}for(o=0;o<6;++o)r=XA(r);for(r^=1,o=0;o<6;++o){i+=GA.charAt(r>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=eE(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=eE(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=eE(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=eE(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const nE="providers/5.7.2",rE=new xf(nE);class iE{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:o,type:u,accessList:iE.allowNull(this.accessList.bind(this),null),blockHash:iE.allowNull(o,null),blockNumber:iE.allowNull(s,null),transactionIndex:iE.allowNull(s,null),confirmations:iE.allowNull(s,null),from:t,gasPrice:iE.allowNull(n),maxPriorityFeePerGas:iE.allowNull(n),maxFeePerGas:iE.allowNull(n),gasLimit:n,to:iE.allowNull(t,null),value:n,nonce:s,data:i,r:iE.allowNull(this.uint256),s:iE.allowNull(this.uint256),v:iE.allowNull(s),creates:iE.allowNull(t,null),raw:iE.allowNull(i)},e.transactionRequest={from:iE.allowNull(t),nonce:iE.allowNull(s),gasLimit:iE.allowNull(n),gasPrice:iE.allowNull(n),maxPriorityFeePerGas:iE.allowNull(n),maxFeePerGas:iE.allowNull(n),to:iE.allowNull(t),value:iE.allowNull(n),data:iE.allowNull((e=>this.data(e,!0))),type:iE.allowNull(s),accessList:iE.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:iE.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:iE.allowNull(this.address,null),from:iE.allowNull(this.address,null),contractAddress:iE.allowNull(t,null),transactionIndex:s,root:iE.allowNull(a),gasUsed:n,logsBloom:iE.allowNull(i),blockHash:o,transactionHash:o,logs:iE.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:iE.allowNull(s,null),cumulativeGasUsed:n,effectiveGasPrice:iE.allowNull(n),status:iE.allowNull(s),type:u},e.block={hash:iE.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:iE.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:iE.allowNull(t),extraData:i,transactions:iE.allowNull(iE.arrayOf(o)),baseFeePerGas:iE.allowNull(n)},e.blockWithTransactions=Nm(e.block),e.blockWithTransactions.transactions=iE.allowNull(iE.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:iE.allowNull(r,void 0),toBlock:iE.allowNull(r,void 0),blockHash:iE.allowNull(o,void 0),address:iE.allowNull(t,void 0),topics:iE.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:iE.allowNull(s),blockHash:iE.allowNull(o),transactionIndex:s,removed:iE.allowNull(this.boolean.bind(this)),address:t,data:iE.allowFalsish(i,"0x"),topics:iE.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return uA(e||[])}number(e){return"0x"===e?0:tm.from(e).toNumber()}type(e){return"0x"===e||null==e?0:tm.from(e).toNumber()}bigNumber(e){return tm.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Uf(e))?e.toLowerCase():rE.throwArgumentError("invalid hash","value",e)}data(e,t){const n=this.hex(e,t);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return wy(e)}callAddress(e){if(!Uf(e,32))return null;const t=wy(Ff(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return by(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Uf(e))return Hf(e);throw new Error("invalid blockTag")}hash(e,t){const n=this.hex(e,t);return 32!==Yf(n)?rE.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(null==e)return null;const t=tm.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Uf(e))throw new Error("invalid uint256");return Gf(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const n=null!=e._difficulty?e._difficulty:e.difficulty,r=iE.check(t,e);return r._difficulty=null==n?null:tm.from(n),r}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return iE.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&tm.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=iE.check(this.formats.transaction,e);if(null!=e.chainId){let n=e.chainId;Uf(n)&&(n=tm.from(n).toNumber()),t.chainId=n}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),Uf(n)&&(n=tm.from(n).toNumber()),"number"!=typeof n&&null!=t.v&&(n=(t.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return pA(e)}receiptLog(e){return iE.check(this.formats.receiptLog,e)}receipt(e){const t=iE.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=tm.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&rE.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):rE.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&rE.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return iE.check(this.formats.filter,e)}filterLog(e){return iE.check(this.formats.filterLog,e)}static check(e,t){const n={};for(const r in e)try{const i=e[r](t[r]);void 0!==i&&(n[r]=i)}catch(e){throw e.checkKey=r,e.checkValue=t[r],e}return n}static allowNull(e,t){return function(n){return null==n?t:e(n)}}static allowFalsish(e,t){return function(n){return n?e(n):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const n=[];return t.forEach((function(t){n.push(e(t))})),n}}}var oE=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const aE=new xf(nE);function sE(e){return null==e?"null":(32!==Yf(e)&&aE.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function uE(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[sE(e)]=!0}));const n=Object.keys(t);return n.sort(),n.join("|")}return sE(e)})).join("&")}function cE(e){if("string"==typeof e){if(32===Yf(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+uE(e);if($g.isForkEvent(e))throw aE.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+uE(e.topics||[])}throw new Error("invalid event - "+e)}function lE(){return(new Date).getTime()}function dE(e){return new Promise((t=>{setTimeout(t,e)}))}const hE=["block","network","pending","poll"];class pE{constructor(e,t,n){Mm(this,"tag",e),Mm(this,"listener",t),Mm(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],n=""===(r=e[2])?[]:r.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var r;const i={};return n.length>0&&(i.topics=n),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||hE.indexOf(this.tag)>=0}}const fE={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function mE(e){return Gf(tm.from(e).toHexString(),32)}function yE(e){return SA.encode(Pf([e,Ff(jA(jA(e)),0,4)]))}const gE=new RegExp("^(ipfs)://(.*)$","i"),vE=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),gE,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function wE(e,t){try{return Fy(bE(e,t))}catch(e){}return null}function bE(e,t){if("0x"===e)return null;const n=tm.from(Ff(e,t,t+32)).toNumber(),r=tm.from(Ff(e,n,n+32)).toNumber();return Ff(e,n+32,n+32+r)}function ME(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):aE.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function AE(e){const t=_f(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function EE(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function NE(e){const t=[];let n=0;for(let r=0;r<e.length;r++)t.push(null),n+=32;for(let r=0;r<e.length;r++){const i=_f(e[r]);t[r]=AE(n),t.push(AE(i.length)),t.push(EE(i)),n+=32+32*Math.ceil(i.length/32)}return Vf(t)}class TE{constructor(e,t,n,r){Mm(this,"provider",e),Mm(this,"name",n),Mm(this,"address",e.formatter.address(t)),Mm(this,"_resolvedAddress",r)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>tm.from(e).eq(1))).catch((e=>{if(e.code===xf.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return oE(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:Vf([e,Ig(this.name),t||"0x"])};let r=!1;var i;(yield this.supportsWildcard())&&(r=!0,n.data=Vf(["0x9061b923",NE([(i=this.name,Qf(Pf(Tg(i).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),n.data])]));try{let e=yield this.provider.call(n);return _f(e).length%32==4&&aE.throwError("resolver threw error",xf.errors.CALL_EXCEPTION,{transaction:n,data:e}),r&&(e=bE(e,0)),e}catch(e){if(e.code===xf.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return oE(this,void 0,void 0,(function*(){const n=yield this._fetch(e,t);return null!=n?bE(n,0):null}))}_getAddress(e,t){const n=fE[String(e)];if(null==n&&aE.throwError(`unsupported coin type: ${e}`,xf.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===n.ilk)return this.provider.formatter.address(t);const r=_f(t);if(null!=n.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return yE(Pf([[n.p2pkh],"0x"+e[2]]))}}if(null!=n.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return yE(Pf([[n.p2sh],"0x"+e[2]]))}}if(null!=n.prefix){const e=r[1];let t=r[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&r.length===2+e&&e>=1&&e<=75){const e=tE.toWords(r.slice(2));return e.unshift(t),tE.encode(n.prefix,e)}}return null}getAddress(e){return oE(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===xf.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",mE(e));if(null==t||"0x"===t)return null;const n=this._getAddress(e,t);return null==n&&aE.throwError("invalid or unsupported coin data",xf.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),n}))}getAvatar(){return oE(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let n=0;n<vE.length;n++){const r=t.match(vE[n]);if(null==r)continue;const i=r[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:ME(t)};case"erc721":case"erc1155":{const n="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),a=(r[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),u=Gf(tm.from(a[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:Vf(["0x6352211e",u])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=tm.from(yield this.provider.call({to:s,data:Vf(["0x00fdd58e",Gf(o,32),u])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const c={to:this.provider.formatter.address(a[0]),data:Vf([n,u])};let l=wE(yield this.provider.call(c),0);if(null==l)return null;e.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=ME(l)),e.push({type:"metadata-url",content:l});const d=yield VA(l);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let h=d.image;if("string"!=typeof h)return null;if(h.match(/^(https:\/\/|data:)/i));else{if(null==h.match(gE))return null;e.push({type:"url-ipfs",content:h}),h=ME(h)}return e.push({type:"url",content:h}),{linkage:e,url:h}}}}}catch(e){}return null}))}getContentHash(){return oE(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+SA.encode("0x"+t[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const e=parseInt(n[3],16);if(n[4].length===2*e)return"ipns://"+SA.encode("0x"+n[1])}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return"bzz://"+r[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+eg("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return aE.throwError("invalid or unsupported content hash data",xf.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return oE(this,void 0,void 0,(function*(){let t=Yy(e);t=Pf([mE(64),mE(t.length),t]),t.length%32!=0&&(t=Pf([t,Gf("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Qf(t));return null==n||"0x"===n?null:Fy(n)}))}}let IE=null,kE=1;class LE extends ev{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Mm(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=Am(new.target,"getNetwork")(e);t?(Mm(this,"_network",t),this.emit("network",t,null)):aE.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return oE(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||aE.throwError("no network detected",xf.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:Mm(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return HA((()=>this._ready().then((e=>e),(e=>{if(e.code!==xf.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==IE&&(IE=new iE),IE}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in BA){const n=BA[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=BA[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=BA[e.name];if(!t)return"number"!=typeof e.chainId&&CA.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&CA.throwArgumentError("network chainId mismatch","network",e);let n=e._defaultProvider||null;var r;return null==n&&t._defaultProvider&&(n=(r=t._defaultProvider)&&"function"==typeof r.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:n}}(null==e?"homestead":e)}ccipReadFetch(e,t,n){return oE(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<n.length;e++){const t=n[e],a=t.replace("{sender}",r).replace("{data}",i),s=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:r}),u=yield VA({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return aE.throwError(`response not found during CCIP fetch: ${c}`,xf.errors.SERVER_ERROR,{url:t,errorMessage:c});o.push(c)}return aE.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,xf.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(e){return oE(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(lE()-n.respTime<=e)return n.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=lE(),n=Em({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=lE();return(e=tm.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:i}}));return this._internalBlockNumber=n,n.catch((e=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return oE(this,void 0,void 0,(function*(){const e=kE++,t=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)aE.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",aE.makeError("network block skew detected",xf.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let e=this._emitted.block+1;e<=n;e++)this.emit("block",e);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&n-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((e=>{switch(e.type){case"tx":{const n=e.hash;let r=this.getTransactionReceipt(n).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(r);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);const r=e.filter;r.fromBlock=e._lastBlockNumber+1,r.toBlock=n;const i=r.toBlock-this._maxFilterBlockRange;i>r.fromBlock&&(r.fromBlock=i),r.fromBlock<0&&(r.fromBlock=0);const o=this.getLogs(r).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(r,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=n,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return oE(this,void 0,void 0,(function*(){return aE.throwError("provider does not support network detection",xf.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return oE(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield dE(0),this._network;const n=aE.makeError("underlying network changed",xf.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",n),n}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=lE();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=lE(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,n){return oE(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,n||0,null)}))}_waitForTransaction(e,t,n,r){return oE(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},c=e=>{e.confirmations<t||u()||i(e)};if(this.on(e,c),a.push((()=>{this.removeListener(e,c)})),r){let n=r.startBlock,i=null;const c=a=>oE(this,void 0,void 0,(function*(){s||(yield dE(1e3),this.getTransactionCount(r.from).then((l=>oE(this,void 0,void 0,(function*(){if(!s){if(l<=r.nonce)n=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=n-3,i<r.startBlock&&(i=r.startBlock));i<=a;){if(s)return;const n=yield this.getBlockWithTransactions(i);for(let i=0;i<n.transactions.length;i++){const a=n.transactions[i];if(a.hash===e)return;if(a.from===r.from&&a.nonce===r.nonce){if(s)return;const n=yield this.waitForTransaction(a.hash,t);if(u())return;let i="replaced";return a.data===r.data&&a.to===r.to&&a.value.eq(r.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(aE.makeError("transaction was replaced",xf.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:e,receipt:n}))}}i++}}s||this.once("block",c)}}))),(e=>{s||this.once("block",c)})))}));if(s)return;this.once("block",c),a.push((()=>{this.removeListener("block",c)}))}if("number"==typeof n&&n>0){const e=setTimeout((()=>{u()||o(aE.makeError("timeout exceeded",xf.errors.TIMEOUT,{timeout:n}))}),n);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return oE(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return tm.from(e)}catch(t){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Em({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getBalance",n);try{return tm.from(r)}catch(e){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:e})}}))}getTransactionCount(e,t){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Em({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getTransactionCount",n);try{return tm.from(r).toNumber()}catch(e){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:e})}}))}getCode(e,t){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Em({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getCode",n);try{return Qf(r)}catch(e){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:e})}}))}getStorageAt(e,t,n){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Em({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((e=>Hf(e)))}),i=yield this.perform("getStorageAt",r);try{return Qf(i)}catch(e){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:e})}}))}_wrapTransaction(e,t,n){if(null!=t&&32!==Yf(t))throw new Error("invalid response - sendTransaction");const r=e;return null!=t&&e.hash!==t&&aE.throwError("Transaction hash mismatch from Provider.sendTransaction.",xf.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),r.wait=(t,r)=>oE(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==r&&(r=0),0!==t&&null!=n&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const o=yield this._waitForTransaction(e.hash,t,r,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&aE.throwError("transaction failed",xf.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),r}sendTransaction(e){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Qf(e))),n=this.formatter.transaction(e);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(n,e,r)}catch(e){throw e.transaction=n,e.transactionHash=n.hash,e}}))}_getTransactionRequest(e){return oE(this,void 0,void 0,(function*(){const t=yield e,n={};return["from","to"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?tm.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?Qf(e):null)))})),this.formatter.transactionRequest(yield Em(n))}))}_getFilter(e){return oE(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((n=>{null!=e[n]&&(t[n]=e[n])})),["fromBlock","toBlock"].forEach((n=>{null!=e[n]&&(t[n]=this._getBlockTag(e[n]))})),this.formatter.filter(yield Em(t))}))}_call(e,t,n){return oE(this,void 0,void 0,(function*(){n>=10&&aE.throwError("CCIP read exceeded maximum redirections",xf.errors.SERVER_ERROR,{redirects:n,transaction:e});const r=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(n>=0&&"latest"===t&&null!=r&&"0x556f1830"===i.substring(0,10)&&Yf(i)%32==4)try{const o=Ff(i,4),a=Ff(o,0,32);tm.from(a).eq(r)||aE.throwError("CCIP Read sender did not match",xf.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],u=tm.from(Ff(o,32,64)).toNumber(),c=tm.from(Ff(o,u,u+32)).toNumber(),l=Ff(o,u+32);for(let t=0;t<c;t++){const n=wE(l,32*t);null==n&&aE.throwError("CCIP Read contained corrupt URL string",xf.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),s.push(n)}const d=bE(o,64);tm.from(Ff(o,100,128)).isZero()||aE.throwError("CCIP Read callback selector included junk",xf.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const h=Ff(o,96,100),p=bE(o,128),f=yield this.ccipReadFetch(e,d,s);null==f&&aE.throwError("CCIP Read disabled or provided no URLs",xf.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const m={to:r,data:Vf([h,NE([f,p])])};return this._call(m,t,n+1)}catch(e){if(e.code===xf.errors.SERVER_ERROR)throw e}try{return Qf(i)}catch(n){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:n})}}))}call(e,t){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Em({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)}))}estimateGas(e){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Em({transaction:this._getTransactionRequest(e)}),n=yield this.perform("estimateGas",t);try{return tm.from(n)}catch(e){return aE.throwError("bad result from backend",xf.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:n,error:e})}}))}_getAddress(e){return oE(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&aE.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&aE.throwError("ENS name not configured",xf.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return oE(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let n=-128;const r={includeTransactions:!!t};if(Uf(e,32))r.blockHash=e;else try{r.blockTag=yield this._getBlockTag(e),Uf(r.blockTag)&&(n=parseInt(r.blockTag.substring(2),16))}catch(t){aE.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return HA((()=>oE(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",r);if(null==e)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;n<e.transactions.length;n++){const r=e.transactions[n];if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}}const n=this.formatter.blockWithTransactions(e);return n.transactions=n.transactions.map((e=>this._wrapTransaction(e))),n}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return oE(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return HA((()=>oE(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(e){return oE(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return HA((()=>oE(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return r}))),{oncePoll:this})}))}getLogs(e){return oE(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Em({filter:this._getFilter(e)}),n=yield this.perform("getLogs",t);return n.forEach((e=>{null==e.removed&&(e.removed=!1)})),iE.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return oE(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return oE(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&aE.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return oE(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const n=yield this._getResolver(t,"getResolver");if(null!=n){const r=new TE(this,n,e);return t===e||(yield r.supportsWildcard())?r:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return oE(this,void 0,void 0,(function*(){null==t&&(t="ENS");const n=yield this.getNetwork();n.ensAddress||aE.throwError("network does not support ENS",xf.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name});try{const t=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Ig(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return oE(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Uf(e))throw t}"string"!=typeof e&&aE.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return oE(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(t,"lookupAddress");if(null==n)return null;const r=wE(yield this.call({to:n,data:"0x691f3431"+Ig(t).substring(2)}),0);return(yield this.resolveName(r))!=e?null:r}))}getAvatar(e){return oE(this,void 0,void 0,(function*(){let t=null;if(Uf(e)){const n=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;t=new TE(this,r,n);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==xf.errors.CALL_EXCEPTION)throw e}try{const e=wE(yield this.call({to:r,data:"0x691f3431"+Ig(n).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==xf.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const n=yield t.getAvatar();return null==n?null:n.url}))}perform(e,t){return aE.throwError(e+" not implemented",xf.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,n){const r=new pE(cE(e),t,n);return this._events.push(r),this._startEvent(r),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let n=!1,r=[],i=cE(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),n=!0,!e.once||(r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),n}listenerCount(e){if(!e)return this._events.length;let t=cE(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=cE(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const n=[];let r=!1,i=cE(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!r||(r=!0,n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const n=cE(e);this._events=this._events.filter((e=>e.tag!==n||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var xE=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const SE=new xf(nE),jE=["call","estimateGas"];function CE(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const n=Uf(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"==typeof e){for(const n in e){const r=CE(e[n],t);if(r)return r}return null}if("string"==typeof e)try{return CE(JSON.parse(e),t)}catch(e){}return null}function DE(e,t,n){const r=n.transaction||n.signedTransaction;if("call"===e){const e=CE(t,!0);if(e)return e.data;SE.throwError("missing revert data in call exception; Transaction reverted without a reason string",xf.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){let n=CE(t.body,!1);null==n&&(n=CE(t,!1)),n&&SE.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xf.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:e,transaction:r,error:t})}let i=t.message;throw t.code===xf.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&SE.throwError("insufficient funds for intrinsic transaction cost",xf.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/nonce (is )?too low/i)&&SE.throwError("nonce has already been used",xf.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&SE.throwError("replacement fee too low",xf.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/only replay-protected/i)&&SE.throwError("legacy pre-eip-155 transactions not supported",xf.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),jE.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&SE.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xf.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function OE(e){return new Promise((function(t){setTimeout(t,e)}))}function zE(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function _E(e){return e?e.toLowerCase():e}const PE={};class BE extends ov{constructor(e,t,n){if(super(),e!==PE)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Mm(this,"provider",t),null==n&&(n=0),"string"==typeof n?(Mm(this,"_address",this.provider.formatter.address(n)),Mm(this,"_index",null)):"number"==typeof n?(Mm(this,"_index",n),Mm(this,"_address",null)):SE.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return SE.throwError("cannot alter JSON-RPC Signer connection",xf.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new RE(PE,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&SE.throwError("unknown account #"+this._index,xf.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=Nm(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const n=Nm(e);n.from=t,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>xE(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&SE.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),Em({tx:Em(e),sender:t}).then((({tx:t,sender:n})=>{null!=t.from?t.from.toLowerCase()!==n&&SE.throwArgumentError("from address mismatch","transaction",e):t.from=n;const r=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&SE.throwError("user rejected transaction",xf.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),DE("sendTransaction",e,r))))}))}signTransaction(e){return SE.throwError("signing transactions is unsupported",xf.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return xE(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield HA((()=>xE(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(n);if(null!==e)return this.provider._wrapTransaction(e,n,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=n,e}}))}signMessage(e){return xE(this,void 0,void 0,(function*(){const t="string"==typeof e?Yy(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Qf(t),n.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&SE.throwError("user rejected signing",xf.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t}}))}_legacySignMessage(e){return xE(this,void 0,void 0,(function*(){const t="string"==typeof e?Yy(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Qf(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&SE.throwError("user rejected signing",xf.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t}}))}_signTypedData(e,t,n){return xE(this,void 0,void 0,(function*(){const r=yield Qg.resolveNames(e,t,n,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Qg.getPayload(r.domain,t,r.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&SE.throwError("user rejected signing",xf.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:r.domain,types:t,value:r.value}}),e}}))}unlock(e){return xE(this,void 0,void 0,(function*(){const t=this.provider,n=yield this.getAddress();return t.send("personal_unlockAccount",[n.toLowerCase(),e,null])}))}}class RE extends BE{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const UE={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class WE extends LE{constructor(e,t){let n=t;null==n&&(n=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(n),e||(e=Am(this.constructor,"defaultUrl")()),Mm(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(Nm(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return xE(this,void 0,void 0,(function*(){yield OE(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=Am(this.constructor,"getNetwork");try{return t(tm.from(e).toNumber())}catch(t){return SE.throwError("could not detect network",xf.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return SE.throwError("could not detect network",xf.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new BE(PE,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Lm(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const i=VA(this.connection,JSON.stringify(n),zE).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[_E(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[_E(t.address),t.blockTag]];case"getCode":return["eth_getCode",[_E(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[_E(t.address),Gf(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Am(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Am(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=_E(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return xE(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&tm.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=Nm(t)).transaction=Nm(e),delete t.transaction.type)}}const n=this.prepareRequest(e,t);null==n&&SE.throwError(e+" not implemented",xf.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(n){return DE(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;let r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return OE(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((e=>{}))}(),n})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const n=Nm(UE);if(t)for(const e in t)t[e]&&(n[e]=!0);var r,i;i=n,(r=e)&&"object"==typeof r||bm.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((e=>{i[e]||bm.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const n=Hf(tm.from(e[t]));"gasLimit"===t&&(t="gas"),o[t]=n})),["from","to","data"].forEach((function(t){null!=e[t]&&(o[t]=Qf(e[t]))})),e.accessList&&(o.accessList=uA(e.accessList)),o}}const QE=new xf(nE);let YE=1;function FE(e,t){const n="Web3LegacyFetcher";return function(e,r){const i={method:e,params:r,id:YE++,jsonrpc:"2.0"};return new Promise(((e,r)=>{this.emit("debug",{action:"request",fetcher:n,request:Lm(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:n,error:t,request:i,provider:this}),r(t);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,r(e)}e(o.result)}))}))}}class VE extends WE{constructor(e,t){null==e&&QE.throwArgumentError("missing provider","provider",e);let n=null,r=null,i=null;"function"==typeof e?(n="unknown:",r=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),i=e,e.request?(""===n&&(n="eip-1193:"),r=function(e){return function(t,n){null==n&&(n=[]);const r={method:t,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Lm(r),provider:this}),e.request(r).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:e,provider:this}),e}))}}(e)):e.sendAsync?r=FE(0,e.sendAsync.bind(e)):e.send?r=FE(0,e.send.bind(e)):QE.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,t),Mm(this,"jsonRpcFetchFunc",r),Mm(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const HE=new RegExp("^bytes([0-9]+)$"),GE=new RegExp("^(u?int)([0-9]*)$"),qE=new RegExp("^(.*)\\[([0-9]*)\\]$"),ZE="0000000000000000000000000000000000000000000000000000000000000000",JE=new xf("solidity/5.7.0");function XE(e,t,n){switch(e){case"address":return n?Rf(t,32):_f(t);case"string":return Yy(t);case"bytes":return _f(t);case"bool":return t=t?"0x01":"0x00",n?Rf(t,32):_f(t)}let r=e.match(GE);if(r){let i=parseInt(r[2]||"256");return(r[2]&&String(i)!==r[2]||i%8!=0||0===i||i>256)&&JE.throwArgumentError("invalid number type","type",e),n&&(i=256),Rf(t=tm.from(t).toTwos(i),i/8)}if(r=e.match(HE),r){const i=parseInt(r[1]);return(String(i)!==r[1]||0===i||i>32)&&JE.throwArgumentError("invalid bytes type","type",e),_f(t).byteLength!==i&&JE.throwArgumentError(`invalid value for ${e}`,"value",t),n?_f((t+ZE).substring(0,66)):t}if(r=e.match(qE),r&&Array.isArray(t)){const n=r[1];parseInt(r[2]||String(t.length))!=t.length&&JE.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(XE(n,e,!0))})),Pf(i)}return JE.throwArgumentError("invalid type","type",e)}function KE(e,t){e.length!=t.length&&JE.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,r){n.push(XE(e,t[r]))})),Qf(Pf(n))}const $E=new xf("units/5.7.0"),eN=["wei","kwei","mwei","gwei","szabo","finney","ether"];function tN(e,t){if("string"==typeof t){const e=eN.indexOf(t);-1!==e&&(t=3*e)}return pm(e,null!=t?t:18)}function nN(e,t){if("string"!=typeof e&&$E.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=eN.indexOf(t);-1!==e&&(t=3*e)}return fm(e,null!=t?t:18)}let rN,iN=()=>rN||(rN="object"==typeof r?r:window,rN);const oN=()=>(void 0===iN()._Web3ClientConfiguration&&(iN()._Web3ClientConfiguration={}),iN()._Web3ClientConfiguration);function aN(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...e)=>n.call(t,...e))),t=void 0)}return n}class sN extends WE{constructor(e,t,n,r){super(e),this._network=t,this._endpoint=e,this._endpoints=n,this._failover=r,this._pendingBatch=[]}detectNetwork(){return Promise.resolve(ef.findByName(this._network).id)}requestChunk(e,t){try{const n=e.map((e=>e.request));return VA(t,JSON.stringify(n)).then((t=>{e.forEach(((e,n)=>{const r=t[n];if(aN([r,"optionalAccess",e=>e.error])){const t=new Error(r.error.message);t.code=r.error.code,t.data=r.error.data,e.reject(t)}else aN([r,"optionalAccess",e=>e.result])?e.resolve(r.result):e.reject()}))})).catch((t=>{if(t&&"SERVER_ERROR"==t.code){const t=this._endpoints.indexOf(this._endpoint)+1;this._failover(),this._endpoint=t>=this._endpoints.length?this._endpoints[0]:this._endpoints[t],this.requestChunk(e,this._endpoint)}else e.forEach((e=>{e.reject(t)}))}))}catch(t){e.forEach((e=>{e.reject()}))}}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const r={request:n,resolve:null,reject:null},i=new Promise(((e,t)=>{r.resolve=e,r.reject=t}));return this._pendingBatch.push(r),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=[],this._pendingBatchAggregator=null;const t=[];for(let n=0;n<Math.ceil(e.length/99);n++)t[n]=e.slice(99*n,99*(n+1));t.forEach((e=>(e.map((e=>e.request)),this.requestChunk(e,this._endpoint))))}),oN().batchInterval||10)),i}}const uN=()=>(null==iN()._Web3ClientProviders&&(iN()._Web3ClientProviders={}),iN()._Web3ClientProviders),cN=(e,t)=>{void 0===uN()[e]&&(uN()[e]=[]);const n=uN()[e].indexOf(t);n>-1&&uN()[e].splice(n,1),uN()[e].unshift(t)},lN=async(e,t,n=!0)=>{let r;uN()[e]=t.map(((r,i)=>new sN(r,e,t,(()=>{1===uN()[e].length?lN(e,t,n):uN()[e].splice(i,1)}))));let i=iN();if(null==i.fetch||void 0!==L&&L.env&&"test"==L.env.NODE_ENV||void 0!==i.cy||!1===n)r=uN()[e][0];else{let n=await Promise.all(t.map((e=>new Promise((async t=>{let n=(new Date).getTime();setTimeout((()=>t(900)),900);if(!(await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"net_version",id:1,jsonrpc:"2.0"})})).ok)return t(999);let r=(new Date).getTime();t(r-n)})))));const i=Math.min(...n),o=n.indexOf(i);r=uN()[e][o]}cN(e,r)};var dN={getProvider:async e=>{let t=uN();if(t&&t[e])return t[e][0];let n=iN();return n._Web3ClientGetProviderPromise&&n._Web3ClientGetProviderPromise[e]||(n._Web3ClientGetProviderPromise||(n._Web3ClientGetProviderPromise={}),n._Web3ClientGetProviderPromise[e]=new Promise((async t=>{await lN(e,ef[e].endpoints),t(iN()._Web3ClientProviders[e][0])}))),await n._Web3ClientGetProviderPromise[e]},getProviders:async e=>{let t=uN();if(t&&t[e])return t[e];let n=iN();return n._Web3ClientGetProvidersPromise&&n._Web3ClientGetProvidersPromise[e]||(n._Web3ClientGetProvidersPromise||(n._Web3ClientGetProvidersPromise={}),n._Web3ClientGetProvidersPromise[e]=new Promise((async t=>{await lN(e,ef[e].endpoints),t(iN()._Web3ClientProviders[e])}))),await n._Web3ClientGetProvidersPromise[e]},setProviderEndpoints:lN,setProvider:cN};class hN extends Kl{constructor(e,t,n,r){super(e),this._provider=new Kl(e),this._network=t,this._endpoint=e,this._endpoints=n,this._failover=r,this._pendingBatch=[],this._rpcRequest=this._rpcRequestReplacement.bind(this)}requestChunk(e){const t=e.map((e=>e.request)),n=t=>{if(t&&["Failed to fetch","limit reached","504","503","502","500","429","426","422","413","409","408","406","405","404","403","402","401","400"].some((e=>t.toString().match(e)))){const t=this._endpoints.indexOf(this._endpoint)+1;this._endpoint=t>=this._endpoints.length?this._endpoints[0]:this._endpoints[t],this._provider=new Kl(this._endpoint),this.requestChunk(e)}else e.forEach((e=>{e.reject(t)}))};try{return this._provider._rpcBatchRequest(t).then((t=>{e.forEach(((e,n)=>{const r=t[n];if(function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...e)=>n.call(t,...e))),t=void 0)}return n}([r,"optionalAccess",e=>e.error])){const t=new Error(r.error.message);t.code=r.error.code,t.data=r.error.data,e.reject(t)}else r?e.resolve(r):e.reject()}))})).catch(n)}catch(e){return n(e)}}_rpcRequestReplacement(e,t){const n={methodName:e,args:t};null==this._pendingBatch&&(this._pendingBatch=[]);const r={request:n,resolve:null,reject:null},i=new Promise(((e,t)=>{r.resolve=e,r.reject=t}));return this._pendingBatch.push(r),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=[],this._pendingBatchAggregator=null;const t=[];for(let n=0;n<Math.ceil(e.length/99);n++)t[n]=e.slice(99*n,99*(n+1));t.forEach((e=>(e.map((e=>e.request)),this.requestChunk(e))))}),oN().batchInterval||10)),i}}const pN=()=>(null==iN()._Web3ClientProviders&&(iN()._Web3ClientProviders={}),iN()._Web3ClientProviders),fN=(e,t)=>{void 0===pN()[e]&&(pN()[e]=[]);const n=pN()[e].indexOf(t);n>-1&&pN()[e].splice(n,1),pN()[e].unshift(t)},mN=async(e,t,n=!0)=>{let r;pN()[e]=t.map(((r,i)=>new hN(r,e,t,(()=>{1===pN()[e].length?mN(e,t,n):pN()[e].splice(i,1)}))));let i=iN();if(null==i.fetch||void 0!==L&&L.env&&"test"==L.env.NODE_ENV||void 0!==i.cy||!1===n)r=pN()[e][0];else{let n=await Promise.all(t.map((e=>new Promise((async t=>{let n=(new Date).getTime();setTimeout((()=>t(900)),900);if(!(await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"getIdentity",id:1,jsonrpc:"2.0"})})).ok)return t(999);let r=(new Date).getTime();t(r-n)})))));const i=Math.min(...n),o=n.indexOf(i);r=pN()[e][o]}fN(e,r)};var yN={getProvider:async e=>{let t=pN();if(t&&t[e])return t[e][0];let n=iN();return n._Web3ClientGetProviderPromise&&n._Web3ClientGetProviderPromise[e]||(n._Web3ClientGetProviderPromise||(n._Web3ClientGetProviderPromise={}),n._Web3ClientGetProviderPromise[e]=new Promise((async t=>{await mN(e,ef[e].endpoints),t(iN()._Web3ClientProviders[e][0])}))),await n._Web3ClientGetProviderPromise[e]},getProviders:async e=>{let t=pN();if(t&&t[e])return t[e];let n=iN();return n._Web3ClientGetProvidersPromise&&n._Web3ClientGetProvidersPromise[e]||(n._Web3ClientGetProvidersPromise||(n._Web3ClientGetProvidersPromise={}),n._Web3ClientGetProvidersPromise[e]=new Promise((async t=>{await mN(e,ef[e].endpoints),t(iN()._Web3ClientProviders[e])}))),await n._Web3ClientGetProvidersPromise[e]},setProviderEndpoints:mN,setProvider:fN};let gN=["ethereum","bsc","polygon","solana","fantom","arbitrum","avalanche","gnosis","optimism","base"];gN.evm=["ethereum","bsc","polygon","fantom","arbitrum","avalanche","gnosis","optimism","base"],gN.solana=["solana"];let vN=()=>(null==iN()._Web3ClientCacheStore&&(iN()._Web3ClientCacheStore={}),iN()._Web3ClientCacheStore),wN=()=>(null==iN()._Web3ClientPromiseStore&&(iN()._Web3ClientPromiseStore={}),iN()._Web3ClientPromiseStore),bN=function({key:e}){wN()[e]=void 0},MN=function({call:e,key:t,expires:n=0}){return new Promise(((r,i)=>{let o,a=function({key:e}){return wN()[e]}({key:t=JSON.stringify(t)});if(a)return a.then(r).catch(i);(function({key:e,promise:t}){return wN()[e]=t,t})({key:t,promise:new Promise(((a,s)=>0===n?e().then((e=>{r(e),a(e)})).catch((e=>{i(e),s(e)})):(o=function({key:e,expires:t}){let n=vN()[e];if(function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...e)=>n.call(t,...e))),t=void 0)}return n}([n,"optionalAccess",e=>e.expiresAt])>Date.now())return n.value}({key:t,expires:n}),o?(r(o),a(o),o):void e().then((e=>{e&&function({key:e,value:t,expires:n}){vN()[e]={expiresAt:Date.now()+n,value:t}}({key:t,value:e,expires:n}),r(e),a(e)})).catch((e=>{i(e),s(e)})))))}).then((()=>{bN({key:t})})).catch((()=>{bN({key:t})}))}))};const AN=async e=>{if(gN.evm.includes(e))return await dN.getProvider(e);if(gN.solana.includes(e))return await yN.getProvider(e);throw"Unknown blockchain: "+e},EN=e=>`(${e.map((e=>"tuple"===e.type?EN(e.components):e.type)).join(",")})`;var NN=({provider:e,from:t,to:n,value:r,method:i,api:o,params:a})=>{if(void 0===o)return e.estimateGas({from:t,to:n,value:r});{let s=new LA(n,o,e),u=s.interface.fragments.find((e=>e.name==i)),c=(({contract:e,method:t,params:n})=>{let r=e.interface.fragments.find((e=>e.name==t));return n instanceof Array?n:n instanceof Object?r.inputs.map((e=>n[e.name])):void 0})({contract:s,method:i,params:a});void 0===s[i]&&(i=`${i}(${u.inputs.map((e=>"tuple"===e.type?EN(e.components):e.type)).join(",")})`);let l=s.estimateGas[i];return c?l(...c,{from:t,value:r}):l({from:t,value:r})}};let TN=async function({blockchain:e,from:t,to:n,value:r,method:i,api:o,params:a,cache:s}){if(!gN.includes(e))throw"Unknown blockchain: "+e;void 0===r&&(r="0");const u=await AN(e);return await MN({expires:s||0,key:[e,t,n,r,i,a],call:async()=>NN({provider:u,from:t,to:n,value:r,method:i,api:o,params:a})})};const IN=({address:e,api:t,method:n,params:r,provider:i,block:o})=>{const a=new LA(e,t,i),s=(({contract:e,method:t,params:n})=>e.interface.fragments.find((e=>e.name==t)).inputs.map(((e,t)=>Array.isArray(n)?n[t]:n[e.name])))({contract:a,method:n,params:r}),u=a.interface.fragments.find((e=>e.name===n));return void 0===a[n]&&(n=`${n}(${u.inputs.map((e=>e.type)).join(",")})`),u&&"nonpayable"===u.stateMutability?a.callStatic[n](...s,{blockTag:o}):a[n](...s,{blockTag:o})},kN=({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a})=>n?IN({address:t,api:n,method:r,params:i,provider:a,block:o}):"latestBlockNumber"===r?a.getBlockNumber():"balance"===r?(({address:e,provider:t})=>t.getBalance(e))({address:t,provider:a}):"transactionCount"===r?(({address:e,provider:t})=>t.getTransactionCount(e))({address:t,provider:a}):void 0;const LN=async({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a,providers:s})=>{try{if(null==r||"getAccountInfo"===r)return null==n&&(n=hp),await(async({address:e,api:t,method:n,params:r,provider:i,block:o})=>{const a=await i.getAccountInfo(new Ks(e));if(a&&a.data)return t.decode(a.data)})({address:t,api:n,method:r,params:i,provider:a,block:o});if("getProgramAccounts"===r)return await a.getProgramAccounts(new Ks(t),i).then((e=>n?e.map((e=>(e.data=n.decode(e.account.data),e))):e));if("getTokenAccountBalance"===r)return await a.getTokenAccountBalance(new Ks(t));if("latestBlockNumber"===r)return await a.getSlot(i||void 0);if("balance"===r)return await(({address:e,provider:t})=>t.getBalance(new Ks(e)))({address:t,provider:a})}catch(u){if(s&&u&&["Failed to fetch","limit reached","504","503","502","500","429","426","422","413","409","408","406","405","404","403","402","401","400"].some((e=>u.toString().match(e)))){let u=s[s.indexOf(a)+1]||s[0];return LN({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:u,providers:s})}throw u}};const xN=async function(e,t){const{blockchain:n,address:r,method:i}=(e=>{if("object"==typeof e)return e;let t=e.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+)*)?/);return null==t.groups.part2?t.groups.part1.match(/\d/)?{blockchain:t.groups.blockchain,address:t.groups.part1}:{blockchain:t.groups.blockchain,method:t.groups.part1}:{blockchain:t.groups.blockchain,address:t.groups.part1,method:t.groups.part2}})(e),{api:o,params:a,cache:s,block:u,timeout:c,strategy:l,cacheKey:d}=("object"==typeof e?e:t)||{};return await MN({expires:s||0,key:d||[n,r,i,a,u],call:async()=>{if(gN.evm.includes(n))return await(async({blockchain:e,address:t,api:n,method:r,params:i,block:o,timeout:a,strategy:s})=>{if(s=s||oN().strategy||"failover",a=a||oN().timeout||void 0,"fastest"===s){const s=await dN.getProviders(e);let u=[];const c=s.map((a=>new Promise((s=>{u.push(kN({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a}).then(s))})))),l=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a||1e4)));return u=Promise.all(u.map((e=>new Promise((t=>{e.catch(t)}))))).then((()=>{})),Promise.race([...c,l,u])}{const s=await dN.getProvider(e),u=kN({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:s});return a?(a=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a))),Promise.race([u,a])):u}})({blockchain:n,address:r,api:o,method:i,params:a,block:u,strategy:l,timeout:c});if(gN.solana.includes(n))return await(async({blockchain:e,address:t,api:n,method:r,params:i,block:o,timeout:a,strategy:s})=>{s=s||oN().strategy||"failover",a=a||oN().timeout||void 0;const u=await yN.getProviders(e);if("fastest"===s){let s=[];const c=u.map((a=>new Promise((u=>{s.push(LN({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a}).then(u))})))),l=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a||1e4)));return s=Promise.all(s.map((e=>new Promise((t=>{e.catch(t)}))))).then((()=>{})),Promise.race([...c,l,s])}{const s=await yN.getProvider(e),c=LN({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:s,providers:u});return a?(a=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a))),Promise.race([c,a])):c}})({blockchain:n,address:r,api:o,method:i,params:a,block:u,strategy:l,timeout:c});throw"Unknown blockchain: "+n}})};var SN=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=92)}([function(e,t,n){(function(e){n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return f})),n.d(t,"o",(function(){return m})),n.d(t,"n",(function(){return y})),n.d(t,"p",(function(){return g})),n.d(t,"A",(function(){return v})),n.d(t,"z",(function(){return w})),n.d(t,"B",(function(){return b})),n.d(t,"v",(function(){return M})),n.d(t,"u",(function(){return A})),n.d(t,"s",(function(){return T})),n.d(t,"r",(function(){return I})),n.d(t,"t",(function(){return k})),n.d(t,"q",(function(){return L})),n.d(t,"m",(function(){return x})),n.d(t,"l",(function(){return S})),n.d(t,"k",(function(){return j})),n.d(t,"j",(function(){return C})),n.d(t,"x",(function(){return O})),n.d(t,"a",(function(){return z})),n.d(t,"y",(function(){return _})),n.d(t,"w",(function(){return P}));var r=n(22),i=n.n(r),o=n(49),a=n.n(o);function s(e){return new Uint8Array(e)}function u(e,t=!1){const n=e.toString("hex");return t?z(n):n}function c(e){return e.toString("utf8")}function l(e){return e.readUIntBE(0,e.length)}function d(e){return a()(e)}function h(e,t=!1){return u(d(e),t)}function p(e){return c(d(e))}function f(e){return l(d(e))}function m(t){return e.from(O(t),"hex")}function y(e){return s(m(e))}function g(e){return c(m(e))}function v(t){return e.from(t,"utf8")}function w(e){return s(v(e))}function b(e,t=!1){return u(v(e),t)}function M(e){return d(N(E(e)))}function A(e){return N(E(e))}function E(e){return D((e>>>0).toString(2))}function N(e){return new Uint8Array(function(e,t=8){const n=D(e).match(new RegExp(`.{${t}}`,"gi"));return Array.from(n||[])}(e).map((e=>parseInt(e,2))))}function T(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function I(t){return e.isBuffer(t)}function k(e){return i.a.strict(e)&&!I(e)}function L(e){return!k(e)&&!I(e)&&void 0!==e.byteLength}function x(e){return I(e)?"buffer":k(e)?"typed-array":L(e)?"array-buffer":Array.isArray(e)?"array":typeof e}function S(e){return function(e){return!("string"!=typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8==0}(e)?"binary":T(e)?"hex":"utf8"}function j(...t){return e.concat(t)}function C(...e){let t=[];return e.forEach((e=>t=t.concat(Array.from(e)))),new Uint8Array([...t])}function D(e,t=8,n="0"){return function(e,t,n="0"){return function(e,t,n,r="0"){const i=t-e.length;let o=e;if(i>0){const t=r.repeat(i);o=n?t+e:e+t}return o}(e,t,!0,n)}(e,function(e,t=8){const n=e%t;return n?(e-n)/t*t+t:e}(e.length,t),n)}function O(e){return e.replace(/^0x/,"")}function z(e){return e.startsWith("0x")?e:"0x"+e}function _(e){return(e=D(e=O(e),2))&&(e=z(e)),e}function P(e){const t=e.startsWith("0x");return e=(e=O(e)).startsWith("0")?e.substring(1):e,t?z(e):e}}).call(this,n(18).Buffer)},function(e,t,n){n.d(t,"g",(function(){return r.detectEnv})),n.d(t,"r",(function(){return r.isMobile})),n.d(t,"m",(function(){return r.isBrowser})),n.d(t,"k",(function(){return r.getLocation})),n.d(t,"i",(function(){return r.getClientMeta})),n.d(t,"B",(function(){return r.setLocal})),n.d(t,"j",(function(){return r.getLocal})),n.d(t,"A",(function(){return r.removeLocal})),n.d(t,"v",(function(){return r.mobileLinkChoiceKey})),n.d(t,"C",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"w",(function(){return T})),n.d(t,"x",(function(){return I})),n.d(t,"z",(function(){return y})),n.d(t,"D",(function(){return g})),n.d(t,"h",(function(){return k})),n.d(t,"u",(function(){return C})),n.d(t,"y",(function(){return D})),n.d(t,"l",(function(){return x})),n.d(t,"a",(function(){return S})),n.d(t,"o",(function(){return w})),n.d(t,"q",(function(){return b})),n.d(t,"p",(function(){return M})),n.d(t,"n",(function(){return A})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return N}));var r=n(21);const i=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],o=["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 a=n(16),s=n.n(a),u=n(0);function c(e){return u.b(new Uint8Array(e))}function l(e,t){return u.c(new Uint8Array(e),!t)}function d(e){return u.f(e).buffer}function h(e){return u.n(e).buffer}function p(e,t){const n=u.x(u.y(new s.a(e).toString(16)));return t?n:u.a(n)}var f=n(50);function m(e){return u.y(e)}const y=n(51).payloadId;function g(){return((e,t)=>{for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t})()}function v(e,t){return u.s(e,t)}function w(e){return void 0!==e.method}function b(e){return void 0!==e.result}function M(e){return void 0!==e.error}function A(e){return void 0!==e.event}function E(e){return i.includes(e)||e.startsWith("wc_")}function N(e){return!!e.method.startsWith("wc_")||!o.includes(e.method)}function T(e){var t,n;return(n=e)&&n.length&&!v(e[0])&&(e[0]=(t=e[0],u.B(t,!0))),e}function I(e){if(void 0!==e.type&&"0"!==e.type)return e;if(void 0===e.from||!(t=e.from)||"0x"!==t.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(t)||!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t)&&t!==function(e){e=Object(u.x)(e.toLowerCase());const t=Object(u.x)(Object(f.keccak_256)((n=e,u.A(n))));var n;let r="";for(let n=0;n<e.length;n++)parseInt(t[n],16)>7?r+=e[n].toUpperCase():r+=e[n];return Object(u.a)(r)}(t))throw new Error("Transaction object must include a valid 'from' value.");var t;function n(e){let t=e;var n;return("number"==typeof e||"string"==typeof e&&!function(e){return""===e||"string"==typeof e&&""===e.trim()}(e))&&(v(e)?"string"==typeof e&&(t=m(e)):t=p(e)),"string"==typeof t&&(n=t,t=u.w(u.a(n))),t}const r={from:m(e.from),to:void 0===e.to?void 0:m(e.to),gasPrice:void 0===e.gasPrice?"":n(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":n(e.gasLimit):n(e.gas),value:void 0===e.value?"":n(e.value),nonce:void 0===e.nonce?"":n(e.nonce),data:void 0===e.data?"":m(e.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach((e=>{(void 0===r[e]||"string"==typeof r[e]&&!r[e].trim().length)&&i.includes(e)&&delete r[e]})),r}function k(e){const t=e.message||"Failed or Rejected Request";let n=-32e3;if(e&&!e.code)switch(t){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}const r={code:n,message:t};return e.data&&(r.data=e.data),r}var L=n(23);function x(e){const t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""}function S(e,t){let n=j(e);return n=Object.assign(Object.assign({},n),t),function(e){return L.stringify(e)}(n)}function j(e){return L.parse(e)}function C(e){return void 0!==e.bridge}function D(e){const t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=function(e){const t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,n)),o=function(e){const t=j(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==n?e.substr(n):"");return Object.assign(Object.assign({protocol:r},i),o)}},function(e,t,n){n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"j",(function(){return l})),n.d(t,"h",(function(){return r})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return f}));const r=512,i=256,o=256,a="AES-CBC",s="SHA-"+i,u="HMAC",c="SHA-256",l="SHA-512",d="encrypt",h="decrypt",p="sign",f="verify"},function(e,t,n){n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"a",(function(){return u}));const r="INTERNAL_ERROR",i="SERVER_ERROR",o=[-32700,-32600,-32601,-32602,-32603],a=[-32e3,-32099],s={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[r]:{code:-32603,message:"Internal error"},[i]:{code:-32e3,message:"Server error"}},u=i},function(e,t,n){function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){const t=r(e);if(!t)throw new Error(e+" is not defined in Window");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67),t),i(n(68),t)},function(e,t,n){n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return d}));var r=n(5),i=n(2);async function o(e,t=i.a){return r.getSubtleCrypto().importKey("raw",e,function(e){return e===i.a?{length:i.b,name:i.a}:{hash:{name:i.f},name:i.e}}(t),!0,function(e){return e===i.a?[i.d,i.c]:[i.k,i.l]}(t))}async function a(e,t,n){const a=r.getSubtleCrypto(),s=await o(t,i.a),u=await a.encrypt({iv:e,name:i.a},s,n);return new Uint8Array(u)}async function s(e,t,n){const a=r.getSubtleCrypto(),s=await o(t,i.a),u=await a.decrypt({iv:e,name:i.a},s,n);return new Uint8Array(u)}async function u(e,t){const n=r.getSubtleCrypto(),a=await o(e,i.e),s=await n.sign({length:i.g,name:i.e},a,t);return new Uint8Array(s)}async function c(e,t){const n=r.getSubtleCrypto(),a=await o(e,i.e),s=await n.sign({length:i.h,name:i.e},a,t);return new Uint8Array(s)}async function l(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.i},e);return new Uint8Array(n)}async function d(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.j},e);return new Uint8Array(n)}},function(e,t){var n,r=[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];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},function(e,t,n){var r=n(44),i=n(45);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},function(e,t,n){n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(3);function i(e){return r.c.includes(e)}function o(e){return Object.keys(r.f).includes(e)?r.f[e]:r.f[r.a]}function a(e){return Object.values(r.f).find((t=>t.code===e))||r.f[r.a]}},function(e,t,n){var r=n(19);o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var i=o.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function o(e,t,n){return o.TYPED_ARRAY_SUPPORT||this instanceof o?"number"==typeof e?u(this,e):function(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");var i;return i=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?i.__proto__=o.prototype:i=c(e,i),i}(e,t,n,r):"string"==typeof t?function(e,t){var n=0|d(t),r=s(e,n),i=r.write(t);return i!==n&&(r=r.slice(0,i)),r}(e,t):function(e,t){if(o.isBuffer(t)){var n=0|a(t.length),r=s(e,n);return 0===r.length||t.copy(r,0,0,n),r}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?s(e,0):c(e,t);if("Buffer"===t.type&&Array.isArray(t.data))return c(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}(this,e,t,n):new o(e,t,n)}function a(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function s(e,t){var n;return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=o.prototype:(null===(n=e)&&(n=new o(t)),n.length=t),n}function u(e,t){var n=s(e,t<0?0:0|a(t));if(!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)n[r]=0;return n}function c(e,t){for(var n=t.length<0?0:0|a(t.length),r=s(e,n),i=0;i<n;i+=1)r[i]=255&t[i];return r}function l(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function d(e){return o.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:l(e).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(e,t,n){void 0===t||void 0===n&&"string"==typeof t?(n=this.length,t=0):isFinite(t)&&(t|=0,isFinite(n)?n|=0:n=void 0);var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,n,r){return function(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}(l(t,e.length-n),e,n,r)}(this,e,t,n)},o.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),o.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},o.prototype.fill=function(e,t,n){if("string"==typeof e){if("string"==typeof t?(t=0,n=this.length):"string"==typeof n&&(n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=o.isBuffer(e)?e:new o(e),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this},o.concat=function(e,t){if(!r(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s(null,0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=u(null,t),a=0;for(n=0;n<e.length;++n){var c=e[n];if(!o.isBuffer(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(i,a),a+=c.length}return i},o.byteLength=d,o.prototype._isBuffer=!0,o.isBuffer=function(e){return!(null==e||!e._isBuffer)},e.exports.alloc=function(e){var t=new o(e);return t.fill(0),t},e.exports.from=function(e){return new o(e)}},function(e,t,n){var r=n(34);n.d(t,"randomBytes",(function(){return r.a}));var i=n(35);n.d(t,"aesCbcDecrypt",(function(){return i.a})),n.d(t,"aesCbcEncrypt",(function(){return i.b}));var o=n(36);n.d(t,"hmacSha256Sign",(function(){return o.a})),n(41),n(15),n(2)},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,d=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||l||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){n.d(t,"a",(function(){return r}));class r{}},function(e,t,n){var r=n(37);n.o(r,"isConstantTime")&&n.d(t,"isConstantTime",(function(){return r.isConstantTime})),n(38);var i=n(39);n.o(i,"isConstantTime")&&n.d(t,"isConstantTime",(function(){return i.isConstantTime}));var o=n(40);n.d(t,"isConstantTime",(function(){return o.a}))},function(e,t,n){(function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=n(55).Buffer}catch(e){}function s(e,t,n){for(var r=0,i=Math.min(e.length,n),o=t;o<i;o++){var a=e.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,i,o=0;for(n=e.length-6,r=0;n>=t;n-=6)i=s(e,n,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==t&&(i=s(e,t,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(e,l,l+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],l=[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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);n=0!=(o=s>>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],p=d[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modn(p).toString(e);n=(f=f.idivn(p)).isZero()?m+n:c[h-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,p=0|a[1],f=8191&p,m=p>>>13,y=0|a[2],g=8191&y,v=y>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],E=8191&A,N=A>>>13,T=0|a[5],I=8191&T,k=T>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(m,W)|0,o=Math.imul(m,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(m,F)|0,o=o+Math.imul(m,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,W),i=(i=Math.imul(b,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var we=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(N,W)|0,o=Math.imul(N,Q),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ne=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(B,W),i=(i=Math.imul(B,Q))+Math.imul(R,W)|0,o=Math.imul(R,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Te=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Le=(c+(r=r+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(N,fe)|0))<<13)|0;c=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(R,ue)|0,o=Math.imul(R,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,de),i=(i=Math.imul(B,he))+Math.imul(R,de)|0,o=Math.imul(R,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(B,fe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(R,fe)|0))<<13)|0;return c=((o=Math.imul(R,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=we,u[4]=be,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Ne,u[9]=Te,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function f(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):f(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},m.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},m.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},m.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,h=c,p=0;p<a;p++){var f=n[l+p],m=r[l+p],y=n[l+p+a],g=r[l+p+a],v=d*y-h*g;g=d*g+h*y,y=v,n[l+p]=f+y,r[l+p]=m+g,n[l+p+a]=f-y,r[l+p+a]=m-g,p!==s&&(v=u*d-c*h,h=u*h+c*d,d=v)}},m.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},m.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},m.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},m.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),d=new Array(r),h=n.words;h.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,c,r),this.transform(a,o,s,u,r,i),this.transform(c,o,l,d,r,i);for(var p=0;p<r;p++){var f=s[p]*l[p]-u[p]*d[p];u[p]=s[p]*d[p]+u[p]*l[p],s[p]=f}return this.conjugate(s,u,r),this.transform(s,u,h,o,r,i),this.conjugate(h,o,r),this.normalize13b(h,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),f(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<n;this.words[t]=u|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=n;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)s=(o=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!=(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(i,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var f=0,m=1;0==(n.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(n.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,r=10;r<e.length;r++){var o=0|e.words[r];e.words[r-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(b,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return y[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),f=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y<f);var g=this.pow(d,new o(1).iushln(f-y-1));h=h.redMul(g),d=g.redSqr(),p=p.redMul(d),f=y}return h},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(54)(e))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(60);r.__exportStar(n(61),t),r.__exportStar(n(62),t)},function(e,t,n){(function(e){
12
12
  /*!
13
13
  * The buffer module from node.js, for the browser.