diff --git a/kinode/src/register-ui/.sample.env b/kinode/src/register-ui/.sample.env deleted file mode 100644 index dd92abcaf..000000000 --- a/kinode/src/register-ui/.sample.env +++ /dev/null @@ -1,10 +0,0 @@ -# local -REACT_APP_INVITE_GET= -REACT_APP_BUILD_USER_OP_POST= -REACT_APP_BROADCAST_USER_OP_POST= - -REACT_APP_SEPOLIA_RPC_URL= -REACT_APP_OPTIMISM_RPC_URL= -REACT_APP_MAINNET_RPC_URL= -DANGEROUSLY_DISABLE_HOST_CHECK=true # needed for local development - diff --git a/kinode/src/register-ui/add-inline-tags.js b/kinode/src/register-ui/add-inline-tags.js deleted file mode 100644 index 2ea475eaa..000000000 --- a/kinode/src/register-ui/add-inline-tags.js +++ /dev/null @@ -1,19 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -const indexPath = path.join(__dirname, 'build', 'index.html'); - -fs.readFile(indexPath, 'utf8', (err, data) => { - if (err) { - console.error(err); - return; - } - - let modifiedHtml = data - .replace(/') - .replace(//g, ''); - - fs.writeFile(indexPath, modifiedHtml, 'utf8', (err) => { - if (err) return console.log(err); - }); -}); diff --git a/kinode/src/register-ui/build/assets/___vite-browser-external_commonjs-proxy-CQs3Tny8.js b/kinode/src/register-ui/build/assets/___vite-browser-external_commonjs-proxy-CQs3Tny8.js deleted file mode 100644 index 42bd8f347..000000000 --- a/kinode/src/register-ui/build/assets/___vite-browser-external_commonjs-proxy-CQs3Tny8.js +++ /dev/null @@ -1 +0,0 @@ -import{f as e,h as t}from"./index-C3h8FZ1j.js";var n,r={exports:{}},i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}r.exports=u,r.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var f=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function v(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function a(e,t,n,r){var i,o,s,u;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=v(e))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=s.length,u=f,console&&console.warn&&console.warn(u)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=p.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var f=i[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var c=f.length,v=d(f,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return h(this,e,!0)},u.prototype.rawListeners=function(e){return h(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};var g=r.exports;const L=e(g),_=t(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));export{L as W,g as e,_ as r}; diff --git a/kinode/src/register-ui/build/assets/___vite-browser-external_commonjs-proxy-Cr8b7DRk.js b/kinode/src/register-ui/build/assets/___vite-browser-external_commonjs-proxy-Cr8b7DRk.js new file mode 100644 index 000000000..948dca3cd --- /dev/null +++ b/kinode/src/register-ui/build/assets/___vite-browser-external_commonjs-proxy-Cr8b7DRk.js @@ -0,0 +1 @@ +import{f as j,h as C}from"./index-GhRs5oKC.js";var p={exports:{}},a=typeof Reflect=="object"?Reflect:null,h=a&&typeof a.apply=="function"?a.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},l;a&&typeof a.ownKeys=="function"?l=a.ownKeys:Object.getOwnPropertySymbols?l=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:l=function(e){return Object.getOwnPropertyNames(e)};function N(t){console&&console.warn&&console.warn(t)}var L=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}p.exports=o;p.exports.once=P;o.EventEmitter=o;o.prototype._events=void 0;o.prototype._eventsCount=0;o.prototype._maxListeners=void 0;var m=10;function v(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!="number"||t<0||L(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");m=t}});o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};o.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function y(t){return t._maxListeners===void 0?o.defaultMaxListeners:t._maxListeners}o.prototype.getMaxListeners=function(){return y(this)};o.prototype.emit=function(e){for(var n=[],r=1;r0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")h(c,this,n);else for(var d=c.length,O=E(c,d),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,N(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():M(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?A(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r` ${a(e)}`))],` Sender: ${n}`,` Data: ${s}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class i extends e{constructor({result:e,url:s}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${a(s)}`,`Response: ${t(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class f extends e{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const p="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function h(e,{blockNumber:a,blockTag:t,data:l,to:d}){const{args:i}=s({data:l,abi:[b]}),[p,h,y,w,g]=i,{ccipRead:k}=e,x=k&&"function"==typeof(null==k?void 0:k.request)?k.request:m;try{if(!r(d,p))throw new f({sender:p,to:d});const s=await x({data:y,sender:p,urls:h}),{data:l}=await n(e,{blockNumber:a,blockTag:t,data:o([w,c([{type:"bytes"},{type:"bytes"}],[s,g])]),to:d});return l}catch(O){throw new u({callbackSelector:w,cause:O,data:l,extraData:g,sender:p,urls:h})}}async function m({data:e,sender:a,urls:s}){var r;let n=new Error("An unknown error occurred.");for(let c=0;c` ${m(f)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${s}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class R extends p{constructor({result:s,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(e)}`,`Response: ${y(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class $ extends p{constructor({sender:s,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${s}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const j="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function v(o,{blockNumber:s,blockTag:e,data:n,to:c}){const{args:u}=w({data:n,abi:[S]}),[t,i,f,a,r]=u,{ccipRead:d}=o,b=d&&typeof(d==null?void 0:d.request)=="function"?d.request:q;try{if(!k(c,t))throw new $({sender:t,to:c});const l=await b({data:f,sender:t,urls:i}),{data:g}=await O(o,{blockNumber:s,blockTag:e,data:E([a,L([{type:"bytes"},{type:"bytes"}],[l,r])]),to:c});return g}catch(l){throw new M({callbackSelector:a,cause:l,data:n,extraData:r,sender:t,urls:i})}}async function q({data:o,sender:s,urls:e}){var c;let n=new Error("An unknown error occurred.");for(let u=0;u0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return l.alloc(0);for(var e,r,i,n=l.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=n,i=s,l.prototype.copy.call(e,r,i),s+=a.data.length,a=a.next;return n}},{key:"consume",value:function(t,e){var r;return tn.length?n.length:t;if(a===n.length?i+=n:i+=n.slice(0,t),0===(t-=a)){a===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(a));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=l.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,a=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,a),0===(t-=a)){a===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(a));break}++i}return this.length-=i,e}},{key:f,value:function(t,e){return u(this,r(r({},e),{},{depth:0,customInspect:!1}))}}]),t}()}function u(t,e){c(t,e),f(t)}function f(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function c(t,e){t.emit("error",e)}var d={destroy:function(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(c,this,t)):process.nextTick(c,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?process.nextTick(f,r):(r._writableState.errorEmitted=!0,process.nextTick(u,r,t)):process.nextTick(u,r,t):e?(process.nextTick(f,r),e(t)):process.nextTick(f,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}},p={};var _={};function b(t,e,r){r||(r=Error);var i=function(t){var r,i;function n(r,i,n){return t.call(this,function(t,r,i){return"string"==typeof e?e:e(t,r,i)}(r,i,n))||this}return i=t,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n}(r);i.prototype.name=r.name,i.prototype.code=t,_[t]=i}function g(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}b("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),b("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n,a;if("string"==typeof e&&(n="not ",e.substr(0,n.length)===n)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(g(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(g(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),b("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),b("ERR_STREAM_PREMATURE_CLOSE","Premature close"),b("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),b("ERR_STREAM_WRITE_AFTER_END","write after end"),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),p.codes=_;var y=p.codes.ERR_INVALID_OPT_VALUE;var w={getHighWaterMark:function(t,e,r,i){var n=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new y(i?r:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}},v={exports:{}};"function"==typeof Object.create?v.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:v.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var m,S,E,R,k=v.exports,T=function(t,e){if(M("noDeprecation"))return t;var r=!1;return function(){if(!r){if(M("throwDeprecation"))throw new Error(e);M("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}};function M(t){try{if(!e.localStorage)return!1}catch(i){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}function B(){if(S)return m;function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;t.entry=null;for(;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var i;S=1,m=j,j.WritableState=O;var n={deprecate:T},a=h,s=t.Buffer,o=(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,u=d,f=w.getHighWaterMark,c=p.codes,_=c.ERR_INVALID_ARG_TYPE,b=c.ERR_METHOD_NOT_IMPLEMENTED,g=c.ERR_MULTIPLE_CALLBACK,y=c.ERR_STREAM_CANNOT_PIPE,v=c.ERR_STREAM_DESTROYED,E=c.ERR_STREAM_NULL_VALUES,R=c.ERR_STREAM_WRITE_AFTER_END,M=c.ERR_UNKNOWN_ENCODING,B=u.errorOrDestroy;function L(){}function O(t,e,n){i=i||x(),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(D,t,e),t._writableState.errorEmitted=!0,B(t,i)):(n(i),t._writableState.errorEmitted=!0,B(t,i),D(t,e))}(t,r,i,e,n);else{var a=C(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||I(t,r),i?process.nextTick(N,t,r,a,n):N(t,r,a,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function j(t){var e=this instanceof(i=i||x());if(!e&&!l.call(j,this))return new j(t);this._writableState=new O(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function A(t,e,r,i,n,a,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):r?t._writev(n,e.onwrite):t._write(n,a,e.onwrite),e.sync=!1}function N(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),D(t,e)}function I(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,a=new Array(n),s=e.corkedRequestsFree;s.entry=i;for(var o=0,h=!0;i;)a[o]=i,i.isBuf||(h=!1),i=i.next,o+=1;a.allBuffers=h,A(t,e,!0,e.length,a,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,u=i.encoding,f=i.callback;if(A(t,e,!1,e.objectMode?1:l.length,l,u,f),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function C(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(r){e.pendingcb--,r&&B(t,r),e.prefinished=!0,t.emit("prefinish"),D(t,e)}))}function D(t,e){var r=C(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}return k(j,a),O.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(O.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===j&&(t&&t._writableState instanceof O)}})):l=function(t){return t instanceof this},j.prototype.pipe=function(){B(this,new y)},j.prototype.write=function(t,e,r){var i,n=this._writableState,a=!1,h=!n.objectMode&&(i=t,s.isBuffer(i)||i instanceof o);return h&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof e&&(r=e,e=null),h?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=L),n.ending?function(t,e){var r=new R;B(t,r),process.nextTick(e,r)}(this,r):(h||function(t,e,r,i){var n;return null===r?n=new E:"string"==typeof r||e.objectMode||(n=new _("chunk",["string","Buffer"],r)),!n||(B(t,n),process.nextTick(i,n),!1)}(this,n,t,r))&&(n.pendingcb++,a=function(t,e,r,i,n,a){if(!r){var o=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,r));return e}(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var h=e.objectMode?1:i.length;e.length+=h;var l=e.length-1))throw new M(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(t,e,r){r(new b("_write()"))},j.prototype._writev=null,j.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),j.prototype.destroy=u.destroy,j.prototype._undestroy=u.undestroy,j.prototype._destroy=function(t,e){e(t)},m}function x(){if(R)return E;R=1;var t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};E=s;var e=V(),r=B();k(s,e);for(var i=t(r.prototype),n=0;n */ -!function(e,r){var i=t,n=i.Buffer;function a(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(a(i,r),r.Buffer=s),s.prototype=Object.create(n.prototype),a(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}}(O,O.exports);var j,A=O.exports;function N(){if(j)return L;j=1;var t=A.Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var i;switch(this.encoding=function(r){var i=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof i&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return i||r}(r),this.encoding){case"utf16le":this.text=a,this.end=s,i=4;break;case"utf8":this.fillLast=n,i=4;break;case"base64":this.text=o,this.end=h,i=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(i)}function i(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function n(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function o(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function u(t){return t&&t.length?this.write(t):""}return L.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(t.lastNeed=a-1),a;if(--n=0)return a>0&&(t.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},L}var I=p.codes.ERR_STREAM_PREMATURE_CLOSE;function C(){}var P,D,z,q,U,W,F=function t(e,r,i){if("function"==typeof r)return t(e,null,r);r||(r={}),i=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i)s.endEmitted?B(t,new M):I(t,s,e,!0);else if(s.ended)B(t,new R);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?I(t,s,e,!1):V(t,s)):I(t,s,e,!1)}else i||(s.reading=!1,V(t,s));return!s.ended&&(s.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=C?t=C:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function D(t){var e=t._readableState;f("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(F,t))}function F(t){var e=t._readableState;f("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Q(t)}function V(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(G,t,e))}function G(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function K(t){f("readable nexttick read 0"),t.read(0)}function J(t,e){f("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Q(t),e.flowing&&!e.reading&&t.read(0)}function Q(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function X(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function Z(t){var e=t._readableState;f("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick($,e,t))}function $(t,e){if(f("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function tt(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Z(this):D(this),null;if(0===(t=P(t,e))&&e.ended)return 0===e.length&&Z(this),null;var i,n=e.needReadable;return f("need readable",n),(0===e.length||e.length-t0?X(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Z(this)),null!==i&&this.emit("data",i),i},j.prototype._read=function(t){B(this,new T("_read()"))},j.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?o:_;function s(e,n){f("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,f("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",h),t.removeListener("error",c),t.removeListener("unpipe",s),r.removeListener("end",o),r.removeListener("end",_),r.removeListener("data",u),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function o(){f("onend"),t.end()}i.endEmitted?process.nextTick(n):r.once("end",n),t.on("unpipe",s);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,Q(t))}}(r);t.on("drain",h);var l=!1;function u(e){f("ondata");var n=t.write(e);f("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==tt(i.pipes,t))&&!l&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function c(e){f("onerror",e),_(),t.removeListener("error",c),0===a(t,"error")&&B(t,e)}function d(){t.removeListener("finish",p),_()}function p(){f("onfinish"),t.removeListener("close",d),_()}function _(){f("unpipe"),r.unpipe(t)}return r.on("data",u),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",c),t.once("close",d),t.once("finish",p),t.emit("pipe",r),i.flowing||(f("pipe resume"),r.resume()),t},j.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?D(this):i.reading||process.nextTick(K,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(Y,this),r},j.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(Y,this),e},j.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(J,t,e))}(this,t)),t.paused=!1,this},j.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(f("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(f("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var a=0;a0,(function(t){i||(i=t),t&&a.forEach(ft),s||(a.forEach(ft),n(i))}))}));return e.reduce(ct)};dt=o.exports,(dt=o.exports=V()).Stream=dt,dt.Readable=dt,dt.Writable=B(),dt.Duplex=x(),dt.Transform=G,dt.PassThrough=nt,dt.finished=F,dt.pipeline=pt;var _t=o.exports;const{Transform:bt}=_t;const{Transform:gt}=_t;const yt=t=>class e extends bt{constructor(e,r,i,n,a){super(a),this._rate=e,this._capacity=r,this._delimitedSuffix=i,this._hashBitLength=n,this._options=a,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let i=null;try{this.update(t,e)}catch(n){i=n}r(i)}_flush(t){let e=null;try{this.push(this.digest())}catch(r){e=r}t(e)}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},wt=t=>class e extends gt{constructor(e,r,i,n){super(n),this._rate=e,this._capacity=r,this._delimitedSuffix=i,this._options=n,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let i=null;try{this.update(t,e)}catch(n){i=n}r(i)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}};var vt={};const mt=[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];vt.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],n=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],o=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let c=u^(n<<1|a>>>31),d=f^(a<<1|n>>>31);const p=t[0]^c,_=t[1]^d,b=t[10]^c,g=t[11]^d,y=t[20]^c,w=t[21]^d,v=t[30]^c,m=t[31]^d,S=t[40]^c,E=t[41]^d;c=r^(s<<1|o>>>31),d=i^(o<<1|s>>>31);const R=t[2]^c,k=t[3]^d,T=t[12]^c,M=t[13]^d,B=t[22]^c,x=t[23]^d,L=t[32]^c,O=t[33]^d,j=t[42]^c,A=t[43]^d;c=n^(h<<1|l>>>31),d=a^(l<<1|h>>>31);const N=t[4]^c,I=t[5]^d,C=t[14]^c,P=t[15]^d,D=t[24]^c,z=t[25]^d,q=t[34]^c,U=t[35]^d,W=t[44]^c,F=t[45]^d;c=s^(u<<1|f>>>31),d=o^(f<<1|u>>>31);const H=t[6]^c,V=t[7]^d,G=t[16]^c,Y=t[17]^d,K=t[26]^c,J=t[27]^d,Q=t[36]^c,X=t[37]^d,Z=t[46]^c,$=t[47]^d;c=h^(r<<1|i>>>31),d=l^(i<<1|r>>>31);const tt=t[8]^c,et=t[9]^d,rt=t[18]^c,it=t[19]^d,nt=t[28]^c,at=t[29]^d,st=t[38]^c,ot=t[39]^d,ht=t[48]^c,lt=t[49]^d,ut=p,ft=_,ct=g<<4|b>>>28,dt=b<<4|g>>>28,pt=y<<3|w>>>29,_t=w<<3|y>>>29,bt=m<<9|v>>>23,gt=v<<9|m>>>23,yt=S<<18|E>>>14,wt=E<<18|S>>>14,vt=R<<1|k>>>31,St=k<<1|R>>>31,Et=M<<12|T>>>20,Rt=T<<12|M>>>20,kt=B<<10|x>>>22,Tt=x<<10|B>>>22,Mt=O<<13|L>>>19,Bt=L<<13|O>>>19,xt=j<<2|A>>>30,Lt=A<<2|j>>>30,Ot=I<<30|N>>>2,jt=N<<30|I>>>2,At=C<<6|P>>>26,Nt=P<<6|C>>>26,It=z<<11|D>>>21,Ct=D<<11|z>>>21,Pt=q<<15|U>>>17,Dt=U<<15|q>>>17,zt=F<<29|W>>>3,qt=W<<29|F>>>3,Ut=H<<28|V>>>4,Wt=V<<28|H>>>4,Ft=Y<<23|G>>>9,Ht=G<<23|Y>>>9,Vt=K<<25|J>>>7,Gt=J<<25|K>>>7,Yt=Q<<21|X>>>11,Kt=X<<21|Q>>>11,Jt=$<<24|Z>>>8,Qt=Z<<24|$>>>8,Xt=tt<<27|et>>>5,Zt=et<<27|tt>>>5,$t=rt<<20|it>>>12,te=it<<20|rt>>>12,ee=at<<7|nt>>>25,re=nt<<7|at>>>25,ie=st<<8|ot>>>24,ne=ot<<8|st>>>24,ae=ht<<14|lt>>>18,se=lt<<14|ht>>>18;t[0]=ut^~Et&It,t[1]=ft^~Rt&Ct,t[10]=Ut^~$t&pt,t[11]=Wt^~te&_t,t[20]=vt^~At&Vt,t[21]=St^~Nt&Gt,t[30]=Xt^~ct&kt,t[31]=Zt^~dt&Tt,t[40]=Ot^~Ft&ee,t[41]=jt^~Ht&re,t[2]=Et^~It&Yt,t[3]=Rt^~Ct&Kt,t[12]=$t^~pt&Mt,t[13]=te^~_t&Bt,t[22]=At^~Vt&ie,t[23]=Nt^~Gt&ne,t[32]=ct^~kt&Pt,t[33]=dt^~Tt&Dt,t[42]=Ft^~ee&bt,t[43]=Ht^~re>,t[4]=It^~Yt&ae,t[5]=Ct^~Kt&se,t[14]=pt^~Mt&zt,t[15]=_t^~Bt&qt,t[24]=Vt^~ie&yt,t[25]=Gt^~ne&wt,t[34]=kt^~Pt&Jt,t[35]=Tt^~Dt&Qt,t[44]=ee^~bt&xt,t[45]=re^~gt&Lt,t[6]=Yt^~ae&ut,t[7]=Kt^~se&ft,t[16]=Mt^~zt&Ut,t[17]=Bt^~qt&Wt,t[26]=ie^~yt&vt,t[27]=ne^~wt&St,t[36]=Pt^~Jt&Xt,t[37]=Dt^~Qt&Zt,t[46]=bt^~xt&Ot,t[47]=gt^~Lt&jt,t[8]=ae^~ut&Et,t[9]=se^~ft&Rt,t[18]=zt^~Ut&$t,t[19]=qt^~Wt&te,t[28]=yt^~vt&At,t[29]=wt^~St&Nt,t[38]=Jt^~Xt&ct,t[39]=Qt^~Zt&dt,t[48]=xt^~Ot&Ft,t[49]=Lt^~jt&Ht,t[0]^=mt[2*e],t[1]^=mt[2*e+1]}};const St=vt;function Et(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Et.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},Et.prototype.absorb=function(t){for(let e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(St.p1600(this.state),this.count=0);return e},Et.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var Rt=function(t){const e=yt(t),r=wt(t);return function(t,i){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+t)}}}(Et),kt={exports:{}},Tt=A.Buffer;function Mt(t,e){this._block=Tt.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Mt.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=Tt.from(t,e));for(var r=this._block,i=this._blockSize,n=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a},Mt.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Bt=Mt,xt=k,Lt=Bt,Ot=A.Buffer,jt=[1518500249,1859775393,-1894007588,-899497514],At=new Array(80);function Nt(){this.init(),this._w=At,Lt.call(this,64,56)}function It(t){return t<<30|t>>>2}function Ct(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}xt(Nt,Lt),Nt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Nt.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,a=0|this._c,s=0|this._d,o=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var l=0;l<80;++l){var u=~~(l/20),f=0|((e=i)<<5|e>>>27)+Ct(u,n,a,s)+o+r[l]+jt[u];o=s,s=a,a=It(n),n=i,i=f}this._a=i+this._a|0,this._b=n+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},Nt.prototype._hash=function(){var t=Ot.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var Pt=Nt,Dt=k,zt=Bt,qt=A.Buffer,Ut=[1518500249,1859775393,-1894007588,-899497514],Wt=new Array(80);function Ft(){this.init(),this._w=Wt,zt.call(this,64,56)}function Ht(t){return t<<5|t>>>27}function Vt(t){return t<<30|t>>>2}function Gt(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}Dt(Ft,zt),Ft.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Ft.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,a=0|this._c,s=0|this._d,o=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var l=0;l<80;++l){var u=~~(l/20),f=Ht(i)+Gt(u,n,a,s)+o+r[l]+Ut[u]|0;o=s,s=a,a=Vt(n),n=i,i=f}this._a=i+this._a|0,this._b=n+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},Ft.prototype._hash=function(){var t=qt.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var Yt=Ft,Kt=k,Jt=Bt,Qt=A.Buffer,Xt=[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],Zt=new Array(64);function $t(){this.init(),this._w=Zt,Jt.call(this,64,56)}function te(t,e,r){return r^t&(e^r)}function ee(t,e,r){return t&e|r&(t|e)}function re(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function ie(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function ne(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}Kt($t,Jt),$t.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},$t.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,a=0|this._c,s=0|this._d,o=0|this._e,h=0|this._f,l=0|this._g,u=0|this._h,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<64;++f)r[f]=0|(((e=r[f-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[f-7]+ne(r[f-15])+r[f-16];for(var c=0;c<64;++c){var d=u+ie(o)+te(o,h,l)+Xt[c]+r[c]|0,p=re(i)+ee(i,n,a)|0;u=l,l=h,h=o,o=s+d|0,s=a,a=n,n=i,i=d+p|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=h+this._f|0,this._g=l+this._g|0,this._h=u+this._h|0},$t.prototype._hash=function(){var t=Qt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var ae=$t,se=k,oe=ae,he=Bt,le=A.Buffer,ue=new Array(64);function fe(){this.init(),this._w=ue,he.call(this,64,56)}se(fe,oe),fe.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},fe.prototype._hash=function(){var t=le.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var ce=fe,de=k,pe=Bt,_e=A.Buffer,be=[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],ge=new Array(160);function ye(){this.init(),this._w=ge,pe.call(this,128,112)}function we(t,e,r){return r^t&(e^r)}function ve(t,e,r){return t&e|r&(t|e)}function me(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Se(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Ee(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Re(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function ke(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Te(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Me(t,e){return t>>>0>>0?1:0}de(ye,pe),ye.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},ye.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,a=0|this._dh,s=0|this._eh,o=0|this._fh,h=0|this._gh,l=0|this._hh,u=0|this._al,f=0|this._bl,c=0|this._cl,d=0|this._dl,p=0|this._el,_=0|this._fl,b=0|this._gl,g=0|this._hl,y=0;y<32;y+=2)e[y]=t.readInt32BE(4*y),e[y+1]=t.readInt32BE(4*y+4);for(;y<160;y+=2){var w=e[y-30],v=e[y-30+1],m=Ee(w,v),S=Re(v,w),E=ke(w=e[y-4],v=e[y-4+1]),R=Te(v,w),k=e[y-14],T=e[y-14+1],M=e[y-32],B=e[y-32+1],x=S+T|0,L=m+k+Me(x,S)|0;L=(L=L+E+Me(x=x+R|0,R)|0)+M+Me(x=x+B|0,B)|0,e[y]=L,e[y+1]=x}for(var O=0;O<160;O+=2){L=e[O],x=e[O+1];var j=ve(r,i,n),A=ve(u,f,c),N=me(r,u),I=me(u,r),C=Se(s,p),P=Se(p,s),D=be[O],z=be[O+1],q=we(s,o,h),U=we(p,_,b),W=g+P|0,F=l+C+Me(W,g)|0;F=(F=(F=F+q+Me(W=W+U|0,U)|0)+D+Me(W=W+z|0,z)|0)+L+Me(W=W+x|0,x)|0;var H=I+A|0,V=N+j+Me(H,I)|0;l=h,g=b,h=o,b=_,o=s,_=p,s=a+F+Me(p=d+W|0,d)|0,a=n,d=c,n=i,c=f,i=r,f=u,r=F+V+Me(u=W+H|0,W)|0}this._al=this._al+u|0,this._bl=this._bl+f|0,this._cl=this._cl+c|0,this._dl=this._dl+d|0,this._el=this._el+p|0,this._fl=this._fl+_|0,this._gl=this._gl+b|0,this._hl=this._hl+g|0,this._ah=this._ah+r+Me(this._al,u)|0,this._bh=this._bh+i+Me(this._bl,f)|0,this._ch=this._ch+n+Me(this._cl,c)|0,this._dh=this._dh+a+Me(this._dl,d)|0,this._eh=this._eh+s+Me(this._el,p)|0,this._fh=this._fh+o+Me(this._fl,_)|0,this._gh=this._gh+h+Me(this._gl,b)|0,this._hh=this._hh+l+Me(this._hl,g)|0},ye.prototype._hash=function(){var t=_e.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Be=ye,xe=k,Le=Be,Oe=Bt,je=A.Buffer,Ae=new Array(160);function Ne(){this.init(),this._w=Ae,Oe.call(this,128,112)}xe(Ne,Le),Ne.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Ne.prototype._hash=function(){var t=je.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var Ie=Ne,Ce=kt.exports=function(t){t=t.toLowerCase();var e=Ce[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};Ce.sha=Pt,Ce.sha1=Yt,Ce.sha224=ce,Ce.sha256=ae,Ce.sha384=Ie,Ce.sha512=Be;var Pe=kt.exports;function De(t){var e,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(y){var a={data:y,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var a=this.head,h=""+a.data;a=a.next;)h+=y+a.data;return h}},{key:"concat",value:function(y){if(this.length===0)return w.alloc(0);for(var a=w.allocUnsafe(y>>>0),h=this.head,p=0;h;)T(h.data,a,p),p+=h.data.length,h=h.next;return a}},{key:"consume",value:function(y,a){var h;return yg.length?g.length:y;if(x===g.length?p+=g:p+=g.slice(0,y),y-=x,y===0){x===g.length?(++h,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=g.slice(x));break}++h}return this.length-=h,p}},{key:"_getBuffer",value:function(y){var a=w.allocUnsafe(y),h=this.head,p=1;for(h.data.copy(a),y-=h.data.length;h=h.next;){var g=h.data,x=y>g.length?g.length:y;if(g.copy(a,a.length-y,0,x),y-=x,y===0){x===g.length?(++p,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=g.slice(x));break}++p}return this.length-=p,a}},{key:R,value:function(y,a){return C(this,t(t({},a),{},{depth:0,customInspect:!1}))}}]),S}(),Ct}function Fr(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return o||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(jt,this,e)):process.nextTick(jt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(d){!t&&d?n._writableState?n._writableState.errorEmitted?process.nextTick(Ae,n):(n._writableState.errorEmitted=!0,process.nextTick(zt,n,d)):process.nextTick(zt,n,d):t?(process.nextTick(Ae,n),t(d)):process.nextTick(Ae,n)}),this)}function zt(e,t){jt(e,t),Ae(e)}function Ae(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function qr(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function jt(e,t){e.emit("error",t)}function jr(e,t){var n=e._readableState,o=e._writableState;n&&n.autoDestroy||o&&o.autoDestroy?e.destroy(t):e.emit("error",t)}var _r={destroy:Fr,undestroy:qr,errorOrDestroy:jr},he={};function Ur(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var br={};function G(e,t,n){n||(n=Error);function o(d,_,v){return typeof t=="string"?t:t(d,_,v)}var l=function(d){Ur(_,d);function _(v,u,w){return d.call(this,o(v,u,w))||this}return _}(n);l.prototype.name=n.name,l.prototype.code=e,br[e]=l}function Gt(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(o){return String(o)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:n===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Hr(e,t,n){return e.substr(0,t.length)===t}function $r(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function Wr(e,t,n){return typeof n!="number"&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}G("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);G("ERR_INVALID_ARG_TYPE",function(e,t,n){var o;typeof t=="string"&&Hr(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be";var l;if($r(e," argument"))l="The ".concat(e," ").concat(o," ").concat(Gt(t,"type"));else{var d=Wr(e,".")?"property":"argument";l='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(Gt(t,"type"))}return l+=". Received type ".concat(typeof n),l},TypeError);G("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");G("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});G("ERR_STREAM_PREMATURE_CLOSE","Premature close");G("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});G("ERR_MULTIPLE_CALLBACK","Callback called multiple times");G("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");G("ERR_STREAM_WRITE_AFTER_END","write after end");G("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);G("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);G("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");he.codes=br;var zr=he.codes.ERR_INVALID_OPT_VALUE;function Gr(e,t,n){return e.highWaterMark!=null?e.highWaterMark:t?e[n]:null}function Kr(e,t,n,o){var l=Gr(t,o,n);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var d=o?n:"highWaterMark";throw new zr(d,l)}return Math.floor(l)}return e.objectMode?16:16*1024}var pr={getHighWaterMark:Kr},Ut={exports:{}};typeof Object.create=="function"?Ut.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ut.exports=function(t,n){if(n){t.super_=n;var o=function(){};o.prototype=n.prototype,t.prototype=new o,t.prototype.constructor=t}};var K=Ut.exports,Vr=Yr;function Yr(e,t){if(Dt("noDeprecation"))return e;var n=!1;function o(){if(!n){if(Dt("throwDeprecation"))throw new Error(t);Dt("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return o}function Dt(e){try{if(!be.localStorage)return!1}catch{return!1}var t=be.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Ot,Kt;function vr(){if(Kt)return Ot;Kt=1,Ot=O;function e(f){var s=this;this.next=null,this.entry=null,this.finish=function(){ee(s,f)}}var t;O.WritableState=D;var n={deprecate:Vr},o=dr,l=Me.Buffer,d=(typeof be<"u"?be:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _(f){return l.from(f)}function v(f){return l.isBuffer(f)||f instanceof d}var u=_r,w=pr,A=w.getHighWaterMark,C=he.codes,R=C.ERR_INVALID_ARG_TYPE,T=C.ERR_METHOD_NOT_IMPLEMENTED,S=C.ERR_MULTIPLE_CALLBACK,m=C.ERR_STREAM_CANNOT_PIPE,y=C.ERR_STREAM_DESTROYED,a=C.ERR_STREAM_NULL_VALUES,h=C.ERR_STREAM_WRITE_AFTER_END,p=C.ERR_UNKNOWN_ENCODING,g=u.errorOrDestroy;K(O,o);function x(){}function D(f,s,b){t=t||pe(),f=f||{},typeof b!="boolean"&&(b=s instanceof t),this.objectMode=!!f.objectMode,b&&(this.objectMode=this.objectMode||!!f.writableObjectMode),this.highWaterMark=A(this,f,"writableHighWaterMark",b),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var B=f.decodeStrings===!1;this.decodeStrings=!B,this.defaultEncoding=f.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(k){ne(s,k)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=f.emitClose!==!1,this.autoDestroy=!!f.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}D.prototype.getBuffer=function(){for(var s=this.bufferedRequest,b=[];s;)b.push(s),s=s.next;return b},function(){try{Object.defineProperty(D.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(s){return I.call(this,s)?!0:this!==O?!1:s&&s._writableState instanceof D}})):I=function(s){return s instanceof this};function O(f){t=t||pe();var s=this instanceof t;if(!s&&!I.call(O,this))return new O(f);this._writableState=new D(f,this,s),this.writable=!0,f&&(typeof f.write=="function"&&(this._write=f.write),typeof f.writev=="function"&&(this._writev=f.writev),typeof f.destroy=="function"&&(this._destroy=f.destroy),typeof f.final=="function"&&(this._final=f.final)),o.call(this)}O.prototype.pipe=function(){g(this,new m)};function M(f,s){var b=new h;g(f,b),process.nextTick(s,b)}function j(f,s,b,B){var k;return b===null?k=new a:typeof b!="string"&&!s.objectMode&&(k=new R("chunk",["string","Buffer"],b)),k?(g(f,k),process.nextTick(B,k),!1):!0}O.prototype.write=function(f,s,b){var B=this._writableState,k=!1,r=!B.objectMode&&v(f);return r&&!l.isBuffer(f)&&(f=_(f)),typeof s=="function"&&(b=s,s=null),r?s="buffer":s||(s=B.defaultEncoding),typeof b!="function"&&(b=x),B.ending?M(this,b):(r||j(this,B,f,b))&&(B.pendingcb++,k=X(this,B,r,f,s,b)),k},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var f=this._writableState;f.corked&&(f.corked--,!f.writing&&!f.corked&&!f.bufferProcessing&&f.bufferedRequest&&z(this,f))},O.prototype.setDefaultEncoding=function(s){if(typeof s=="string"&&(s=s.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((s+"").toLowerCase())>-1))throw new p(s);return this._writableState.defaultEncoding=s,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function V(f,s,b){return!f.objectMode&&f.decodeStrings!==!1&&typeof s=="string"&&(s=l.from(s,b)),s}Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function X(f,s,b,B,k,r){if(!b){var i=V(s,B,k);B!==i&&(b=!0,k="buffer",B=i)}var c=s.objectMode?1:B.length;s.length+=c;var E=s.length */(function(e,t){var n=Me,o=n.Buffer;function l(_,v){for(var u in _)v[u]=_[u]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(l(n,t),t.Buffer=d);function d(_,v,u){return o(_,v,u)}d.prototype=Object.create(o.prototype),l(o,d),d.from=function(_,v,u){if(typeof _=="number")throw new TypeError("Argument must not be a number");return o(_,v,u)},d.alloc=function(_,v,u){if(typeof _!="number")throw new TypeError("Argument must be a number");var w=o(_);return v!==void 0?typeof u=="string"?w.fill(v,u):w.fill(v):w.fill(0),w},d.allocUnsafe=function(_){if(typeof _!="number")throw new TypeError("Argument must be a number");return o(_)},d.allocUnsafeSlow=function(_){if(typeof _!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(_)}})(Ht,Ht.exports);var fe=Ht.exports,Yt;function Xt(){if(Yt)return kt;Yt=1;var e=fe.Buffer,t=e.isEncoding||function(a){switch(a=""+a,a&&a.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(a){if(!a)return"utf8";for(var h;;)switch(a){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return a;default:if(h)return;a=(""+a).toLowerCase(),h=!0}}function o(a){var h=n(a);if(typeof h!="string"&&(e.isEncoding===t||!t(a)))throw new Error("Unknown encoding: "+a);return h||a}kt.StringDecoder=l;function l(a){this.encoding=o(a);var h;switch(this.encoding){case"utf16le":this.text=C,this.end=R,h=4;break;case"utf8":this.fillLast=u,h=4;break;case"base64":this.text=T,this.end=S,h=3;break;default:this.write=m,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(h)}l.prototype.write=function(a){if(a.length===0)return"";var h,p;if(this.lastNeed){if(h=this.fillLast(a),h===void 0)return"";p=this.lastNeed,this.lastNeed=0}else p=0;return p>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function _(a,h,p){var g=h.length-1;if(g=0?(x>0&&(a.lastNeed=x-1),x):--g=0?(x>0&&(a.lastNeed=x-2),x):--g=0?(x>0&&(x===2?x=0:a.lastNeed=x-3),x):0))}function v(a,h,p){if((h[0]&192)!==128)return a.lastNeed=0,"�";if(a.lastNeed>1&&h.length>1){if((h[1]&192)!==128)return a.lastNeed=1,"�";if(a.lastNeed>2&&h.length>2&&(h[2]&192)!==128)return a.lastNeed=2,"�"}}function u(a){var h=this.lastTotal-this.lastNeed,p=v(this,a);if(p!==void 0)return p;if(this.lastNeed<=a.length)return a.copy(this.lastChar,h,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,h,0,a.length),this.lastNeed-=a.length}function w(a,h){var p=_(this,a,h);if(!this.lastNeed)return a.toString("utf8",h);this.lastTotal=p;var g=a.length-(p-this.lastNeed);return a.copy(this.lastChar,0,g),a.toString("utf8",h,g)}function A(a){var h=a&&a.length?this.write(a):"";return this.lastNeed?h+"�":h}function C(a,h){if((a.length-h)%2===0){var p=a.toString("utf16le",h);if(p){var g=p.charCodeAt(p.length-1);if(g>=55296&&g<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],p.slice(0,-1)}return p}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",h,a.length-1)}function R(a){var h=a&&a.length?this.write(a):"";if(this.lastNeed){var p=this.lastTotal-this.lastNeed;return h+this.lastChar.toString("utf16le",0,p)}return h}function T(a,h){var p=(a.length-h)%3;return p===0?a.toString("base64",h):(this.lastNeed=3-p,this.lastTotal=3,p===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",h,a.length-p))}function S(a){var h=a&&a.length?this.write(a):"";return this.lastNeed?h+this.lastChar.toString("base64",0,3-this.lastNeed):h}function m(a){return a.toString(this.encoding)}function y(a){return a&&a.length?this.write(a):""}return kt}var Jt=he.codes.ERR_STREAM_PREMATURE_CLOSE;function Xr(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,o=new Array(n),l=0;l0)if(typeof i!="string"&&!L.objectMode&&Object.getPrototypeOf(i)!==o.prototype&&(i=d(i)),E)L.endEmitted?x(r,new a):V(r,L,i,!0);else if(L.ended)x(r,new m);else{if(L.destroyed)return!1;L.reading=!1,L.decoder&&!c?(i=L.decoder.write(i),L.objectMode||i.length!==0?V(r,L,i,!1):z(r,L)):V(r,L,i,!1)}else E||(L.reading=!1,z(r,L))}return!L.ended&&(L.length=F?r=F:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function H(r,i){return r<=0||i.length===0&&i.ended?0:i.objectMode?1:r!==r?i.flowing&&i.length?i.buffer.head.data.length:i.length:(r>i.highWaterMark&&(i.highWaterMark=U(r)),r<=i.length?r:i.ended?i.length:(i.needReadable=!0,0))}M.prototype.read=function(r){u("read",r),r=parseInt(r,10);var i=this._readableState,c=r;if(r!==0&&(i.emittedReadable=!1),r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended))return u("read: emitReadable",i.length,i.ended),i.length===0&&i.ended?b(this):W(this),null;if(r=H(r,i),r===0&&i.ended)return i.length===0&&b(this),null;var E=i.needReadable;u("need readable",E),(i.length===0||i.length-r0?P=s(r,i):P=null,P===null?(i.needReadable=i.length<=i.highWaterMark,r=0):(i.length-=r,i.awaitDrain=0),i.length===0&&(i.ended||(i.needReadable=!0),c!==r&&i.ended&&b(this)),P!==null&&this.emit("data",P),P};function ne(r,i){if(u("onEofChunk"),!i.ended){if(i.decoder){var c=i.decoder.end();c&&c.length&&(i.buffer.push(c),i.length+=i.objectMode?1:c.length)}i.ended=!0,i.sync?W(r):(i.needReadable=!1,i.emittedReadable||(i.emittedReadable=!0,J(r)))}}function W(r){var i=r._readableState;u("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(u("emitReadable",i.flowing),i.emittedReadable=!0,process.nextTick(J,r))}function J(r){var i=r._readableState;u("emitReadable_",i.destroyed,i.length,i.ended),!i.destroyed&&(i.length||i.ended)&&(r.emit("readable"),i.emittedReadable=!1),i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark,f(r)}function z(r,i){i.readingMore||(i.readingMore=!0,process.nextTick(Q,r,i))}function Q(r,i){for(;!i.reading&&!i.ended&&(i.length1&&k(E.pipes,r)!==-1)&&!ye&&(u("false write response, pause",E.awaitDrain),E.awaitDrain++),c.pause())}function ce(re){u("onerror",re),se(),r.removeListener("error",ce),t(r,"error")===0&&x(r,re)}I(r,"error",ce);function de(){r.removeListener("finish",_e),se()}r.once("close",de);function _e(){u("onfinish"),r.removeListener("close",de),se()}r.once("finish",_e);function se(){u("unpipe"),c.unpipe(r)}return r.emit("pipe",c),E.flowing||(u("pipe resume"),c.resume()),r};function ae(r){return function(){var c=r._readableState;u("pipeOnDrain",c.awaitDrain),c.awaitDrain&&c.awaitDrain--,c.awaitDrain===0&&t(r,"data")&&(c.flowing=!0,f(r))}}M.prototype.unpipe=function(r){var i=this._readableState,c={hasUnpiped:!1};if(i.pipesCount===0)return this;if(i.pipesCount===1)return r&&r!==i.pipes?this:(r||(r=i.pipes),i.pipes=null,i.pipesCount=0,i.flowing=!1,r&&r.emit("unpipe",this,c),this);if(!r){var E=i.pipes,P=i.pipesCount;i.pipes=null,i.pipesCount=0,i.flowing=!1;for(var L=0;L0,E.flowing!==!1&&this.resume()):r==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,u("on readable",E.length,E.reading),E.length?W(this):E.reading||process.nextTick($,this)),c},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(r,i){var c=n.prototype.removeListener.call(this,r,i);return r==="readable"&&process.nextTick(Z,this),c},M.prototype.removeAllListeners=function(r){var i=n.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&process.nextTick(Z,this),i};function Z(r){var i=r._readableState;i.readableListening=r.listenerCount("readable")>0,i.resumeScheduled&&!i.paused?i.flowing=!0:r.listenerCount("data")>0&&r.resume()}function $(r){u("readable nexttick read 0"),r.read(0)}M.prototype.resume=function(){var r=this._readableState;return r.flowing||(u("resume"),r.flowing=!r.readableListening,oe(this,r)),r.paused=!1,this};function oe(r,i){i.resumeScheduled||(i.resumeScheduled=!0,process.nextTick(ee,r,i))}function ee(r,i){u("resume",i.reading),i.reading||r.read(0),i.resumeScheduled=!1,r.emit("resume"),f(r),i.flowing&&!i.reading&&r.read(0)}M.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function f(r){var i=r._readableState;for(u("flow",i.flowing);i.flowing&&r.read()!==null;);}M.prototype.wrap=function(r){var i=this,c=this._readableState,E=!1;r.on("end",function(){if(u("wrapped end"),c.decoder&&!c.ended){var N=c.decoder.end();N&&N.length&&i.push(N)}i.push(null)}),r.on("data",function(N){if(u("wrapped data"),c.decoder&&(N=c.decoder.write(N)),!(c.objectMode&&N==null)&&!(!c.objectMode&&(!N||!N.length))){var te=i.push(N);te||(E=!0,r.pause())}});for(var P in r)this[P]===void 0&&typeof r[P]=="function"&&(this[P]=function(te){return function(){return r[te].apply(r,arguments)}}(P));for(var L=0;L=i.length?(i.decoder?c=i.buffer.join(""):i.buffer.length===1?c=i.buffer.first():c=i.buffer.concat(i.length),i.buffer.clear()):c=i.buffer.consume(r,i.decoder),c}function b(r){var i=r._readableState;u("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,process.nextTick(B,i,r))}function B(r,i){if(u("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,i.readable=!1,i.emit("end"),r.autoDestroy)){var c=i._writableState;(!c||c.autoDestroy&&c.finished)&&i.destroy()}}typeof Symbol=="function"&&(M.from=function(r,i){return g===void 0&&(g=ei()),g(M,r,i)});function k(r,i){for(var c=0,E=r.length;c0;return ci(_,u,w,function(A){l||(l=A),A&&d.forEach(ir),!u&&(d.forEach(ir),o(l))})});return t.reduce(di)}var pi=bi;(function(e,t){t=e.exports=yr(),t.Stream=t,t.Readable=t,t.Writable=vr(),t.Duplex=pe(),t.Transform=wr,t.PassThrough=si,t.finished=$t,t.pipeline=pi})(qt,qt.exports);var Sr=qt.exports;const{Transform:vi}=Sr;var gi=e=>class Rr extends vi{constructor(n,o,l,d,_){super(_),this._rate=n,this._capacity=o,this._delimitedSuffix=l,this._hashBitLength=d,this._options=_,this._state=new e,this._state.initialize(n,o),this._finalized=!1}_transform(n,o,l){let d=null;try{this.update(n,o)}catch(_){d=_}l(d)}_flush(n){let o=null;try{this.push(this.digest())}catch(l){o=l}n(o)}update(n,o){if(!Buffer.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(n)||(n=Buffer.from(n,o)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let o=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(o=o.toString(n)),this._resetState(),o}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new Rr(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const{Transform:yi}=Sr;var wi=e=>class mr extends yi{constructor(n,o,l,d){super(d),this._rate=n,this._capacity=o,this._delimitedSuffix=l,this._options=d,this._state=new e,this._state.initialize(n,o),this._finalized=!1}_transform(n,o,l){let d=null;try{this.update(n,o)}catch(_){d=_}l(d)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,o){if(!Buffer.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(n)||(n=Buffer.from(n,o)),this._state.absorb(n),this}squeeze(n,o){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let l=this._state.squeeze(n);return o!==void 0&&(l=l.toString(o)),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new mr(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const xi=gi,Ei=wi;var Si=function(e){const t=xi(e),n=Ei(e);return function(o,l){switch(typeof o=="string"?o.toLowerCase():o){case"keccak224":return new t(1152,448,null,224,l);case"keccak256":return new t(1088,512,null,256,l);case"keccak384":return new t(832,768,null,384,l);case"keccak512":return new t(576,1024,null,512,l);case"sha3-224":return new t(1152,448,6,224,l);case"sha3-256":return new t(1088,512,6,256,l);case"sha3-384":return new t(832,768,6,384,l);case"sha3-512":return new t(576,1024,6,512,l);case"shake128":return new n(1344,256,31,l);case"shake256":return new n(1088,512,31,l);default:throw new Error("Invald algorithm: "+o)}}},Tr={};const nr=[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];Tr.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],l=e[2]^e[12]^e[22]^e[32]^e[42],d=e[3]^e[13]^e[23]^e[33]^e[43],_=e[4]^e[14]^e[24]^e[34]^e[44],v=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],w=e[7]^e[17]^e[27]^e[37]^e[47],A=e[8]^e[18]^e[28]^e[38]^e[48],C=e[9]^e[19]^e[29]^e[39]^e[49];let R=A^(l<<1|d>>>31),T=C^(d<<1|l>>>31);const S=e[0]^R,m=e[1]^T,y=e[10]^R,a=e[11]^T,h=e[20]^R,p=e[21]^T,g=e[30]^R,x=e[31]^T,D=e[40]^R,I=e[41]^T;R=n^(_<<1|v>>>31),T=o^(v<<1|_>>>31);const O=e[2]^R,M=e[3]^T,j=e[12]^R,V=e[13]^T,X=e[22]^R,F=e[23]^T,U=e[32]^R,H=e[33]^T,ne=e[42]^R,W=e[43]^T;R=l^(u<<1|w>>>31),T=d^(w<<1|u>>>31);const J=e[4]^R,z=e[5]^T,Q=e[14]^R,ae=e[15]^T,Z=e[24]^R,$=e[25]^T,oe=e[34]^R,ee=e[35]^T,f=e[44]^R,s=e[45]^T;R=_^(A<<1|C>>>31),T=v^(C<<1|A>>>31);const b=e[6]^R,B=e[7]^T,k=e[16]^R,r=e[17]^T,i=e[26]^R,c=e[27]^T,E=e[36]^R,P=e[37]^T,L=e[46]^R,N=e[47]^T;R=u^(n<<1|o>>>31),T=w^(o<<1|n>>>31);const te=e[8]^R,le=e[9]^T,ye=e[18]^R,Te=e[19]^T,we=e[28]^R,ce=e[29]^T,de=e[38]^R,_e=e[39]^T,se=e[48]^R,re=e[49]^T,Y=S,Ne=m,Ie=a<<4|y>>>28,Pe=y<<4|a>>>28,Fe=h<<3|p>>>29,qe=p<<3|h>>>29,je=x<<9|g>>>23,Ue=g<<9|x>>>23,He=D<<18|I>>>14,$e=I<<18|D>>>14,We=O<<1|M>>>31,ze=M<<1|O>>>31,Ge=V<<12|j>>>20,Ke=j<<12|V>>>20,Ve=X<<10|F>>>22,Ye=F<<10|X>>>22,Xe=H<<13|U>>>19,Je=U<<13|H>>>19,Qe=ne<<2|W>>>30,Ze=W<<2|ne>>>30,et=z<<30|J>>>2,tt=J<<30|z>>>2,rt=Q<<6|ae>>>26,it=ae<<6|Q>>>26,nt=$<<11|Z>>>21,at=Z<<11|$>>>21,ot=oe<<15|ee>>>17,st=ee<<15|oe>>>17,ft=s<<29|f>>>3,lt=f<<29|s>>>3,ht=b<<28|B>>>4,ut=B<<28|b>>>4,ct=r<<23|k>>>9,dt=k<<23|r>>>9,_t=i<<25|c>>>7,bt=c<<25|i>>>7,pt=E<<21|P>>>11,vt=P<<21|E>>>11,gt=N<<24|L>>>8,yt=L<<24|N>>>8,wt=te<<27|le>>>5,xt=le<<27|te>>>5,Et=ye<<20|Te>>>12,St=Te<<20|ye>>>12,Rt=ce<<7|we>>>25,mt=we<<7|ce>>>25,Tt=de<<8|_e>>>24,At=_e<<8|de>>>24,Bt=se<<14|re>>>18,Mt=re<<14|se>>>18;e[0]=Y^~Ge&nt,e[1]=Ne^~Ke&at,e[10]=ht^~Et&Fe,e[11]=ut^~St&qe,e[20]=We^~rt&_t,e[21]=ze^~it&bt,e[30]=wt^~Ie&Ve,e[31]=xt^~Pe&Ye,e[40]=et^~ct&Rt,e[41]=tt^~dt&mt,e[2]=Ge^~nt&pt,e[3]=Ke^~at&vt,e[12]=Et^~Fe&Xe,e[13]=St^~qe&Je,e[22]=rt^~_t&Tt,e[23]=it^~bt&At,e[32]=Ie^~Ve&ot,e[33]=Pe^~Ye&st,e[42]=ct^~Rt&je,e[43]=dt^~mt&Ue,e[4]=nt^~pt&Bt,e[5]=at^~vt&Mt,e[14]=Fe^~Xe&ft,e[15]=qe^~Je<,e[24]=_t^~Tt&He,e[25]=bt^~At&$e,e[34]=Ve^~ot>,e[35]=Ye^~st&yt,e[44]=Rt^~je&Qe,e[45]=mt^~Ue&Ze,e[6]=pt^~Bt&Y,e[7]=vt^~Mt&Ne,e[16]=Xe^~ft&ht,e[17]=Je^~lt&ut,e[26]=Tt^~He&We,e[27]=At^~$e&ze,e[36]=ot^~gt&wt,e[37]=st^~yt&xt,e[46]=je^~Qe&et,e[47]=Ue^~Ze&tt,e[8]=Bt^~Y&Ge,e[9]=Mt^~Ne&Ke,e[18]=ft^~ht&Et,e[19]=lt^~ut&St,e[28]=He^~We&rt,e[29]=$e^~ze&it,e[38]=gt^~wt&Ie,e[39]=yt^~xt&Pe,e[48]=Qe^~et&ct,e[49]=Ze^~tt&dt,e[0]^=nr[t*2],e[1]^=nr[t*2+1]}};const Be=Tr;function ve(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}ve.prototype.initialize=function(e,t){for(let n=0;n<50;++n)this.state[n]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};ve.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Be.p1600(this.state),this.count=0);return t};ve.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Ri=ve,xn=Si(Ri),Ar={exports:{}},Br=fe.Buffer;function Oe(e,t){this._block=Br.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Oe.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Br.from(e,t));for(var n=this._block,o=this._blockSize,l=e.length,d=this._len,_=0;_=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var o=(n&4294967295)>>>0,l=(n-o)/4294967296;this._block.writeUInt32BE(l,this._blockSize-8),this._block.writeUInt32BE(o,this._blockSize-4)}this._update(this._block);var d=this._hash();return e?d.toString(e):d};Oe.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ge=Oe,mi=K,Mr=ge,Ti=fe.Buffer,Ai=[1518500249,1859775393,-1894007588,-899497514],Bi=new Array(80);function Ee(){this.init(),this._w=Bi,Mr.call(this,64,56)}mi(Ee,Mr);Ee.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Mi(e){return e<<5|e>>>27}function Ci(e){return e<<30|e>>>2}function Di(e,t,n,o){return e===0?t&n|~t&o:e===2?t&n|t&o|n&o:t^n^o}Ee.prototype._update=function(e){for(var t=this._w,n=this._a|0,o=this._b|0,l=this._c|0,d=this._d|0,_=this._e|0,v=0;v<16;++v)t[v]=e.readInt32BE(v*4);for(;v<80;++v)t[v]=t[v-3]^t[v-8]^t[v-14]^t[v-16];for(var u=0;u<80;++u){var w=~~(u/20),A=Mi(n)+Di(w,o,l,d)+_+t[u]+Ai[w]|0;_=d,d=l,l=Ci(o),o=n,n=A}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=d+this._d|0,this._e=_+this._e|0};Ee.prototype._hash=function(){var e=Ti.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Oi=Ee,Li=K,Cr=ge,ki=fe.Buffer,Ni=[1518500249,1859775393,-1894007588,-899497514],Ii=new Array(80);function Se(){this.init(),this._w=Ii,Cr.call(this,64,56)}Li(Se,Cr);Se.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Pi(e){return e<<1|e>>>31}function Fi(e){return e<<5|e>>>27}function qi(e){return e<<30|e>>>2}function ji(e,t,n,o){return e===0?t&n|~t&o:e===2?t&n|t&o|n&o:t^n^o}Se.prototype._update=function(e){for(var t=this._w,n=this._a|0,o=this._b|0,l=this._c|0,d=this._d|0,_=this._e|0,v=0;v<16;++v)t[v]=e.readInt32BE(v*4);for(;v<80;++v)t[v]=Pi(t[v-3]^t[v-8]^t[v-14]^t[v-16]);for(var u=0;u<80;++u){var w=~~(u/20),A=Fi(n)+ji(w,o,l,d)+_+t[u]+Ni[w]|0;_=d,d=l,l=qi(o),o=n,n=A}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=d+this._d|0,this._e=_+this._e|0};Se.prototype._hash=function(){var e=ki.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Ui=Se,Hi=K,Dr=ge,$i=fe.Buffer,Wi=[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],zi=new Array(64);function Re(){this.init(),this._w=zi,Dr.call(this,64,56)}Hi(Re,Dr);Re.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Gi(e,t,n){return n^e&(t^n)}function Ki(e,t,n){return e&t|n&(e|t)}function Vi(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Yi(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Xi(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Ji(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Re.prototype._update=function(e){for(var t=this._w,n=this._a|0,o=this._b|0,l=this._c|0,d=this._d|0,_=this._e|0,v=this._f|0,u=this._g|0,w=this._h|0,A=0;A<16;++A)t[A]=e.readInt32BE(A*4);for(;A<64;++A)t[A]=Ji(t[A-2])+t[A-7]+Xi(t[A-15])+t[A-16]|0;for(var C=0;C<64;++C){var R=w+Yi(_)+Gi(_,v,u)+Wi[C]+t[C]|0,T=Vi(n)+Ki(n,o,l)|0;w=u,u=v,v=_,_=d+R|0,d=l,l=o,o=n,n=R+T|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=d+this._d|0,this._e=_+this._e|0,this._f=v+this._f|0,this._g=u+this._g|0,this._h=w+this._h|0};Re.prototype._hash=function(){var e=$i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Or=Re,Qi=K,Zi=Or,en=ge,tn=fe.Buffer,rn=new Array(64);function Le(){this.init(),this._w=rn,en.call(this,64,56)}Qi(Le,Zi);Le.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Le.prototype._hash=function(){var e=tn.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var nn=Le,an=K,Lr=ge,on=fe.Buffer,ar=[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],sn=new Array(160);function me(){this.init(),this._w=sn,Lr.call(this,128,112)}an(me,Lr);me.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function or(e,t,n){return n^e&(t^n)}function sr(e,t,n){return e&t|n&(e|t)}function fr(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function lr(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function fn(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function ln(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function hn(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function un(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function q(e,t){return e>>>0>>0?1:0}me.prototype._update=function(e){for(var t=this._w,n=this._ah|0,o=this._bh|0,l=this._ch|0,d=this._dh|0,_=this._eh|0,v=this._fh|0,u=this._gh|0,w=this._hh|0,A=this._al|0,C=this._bl|0,R=this._cl|0,T=this._dl|0,S=this._el|0,m=this._fl|0,y=this._gl|0,a=this._hl|0,h=0;h<32;h+=2)t[h]=e.readInt32BE(h*4),t[h+1]=e.readInt32BE(h*4+4);for(;h<160;h+=2){var p=t[h-30],g=t[h-15*2+1],x=fn(p,g),D=ln(g,p);p=t[h-2*2],g=t[h-2*2+1];var I=hn(p,g),O=un(g,p),M=t[h-7*2],j=t[h-7*2+1],V=t[h-16*2],X=t[h-16*2+1],F=D+j|0,U=x+M+q(F,D)|0;F=F+O|0,U=U+I+q(F,O)|0,F=F+X|0,U=U+V+q(F,X)|0,t[h]=U,t[h+1]=F}for(var H=0;H<160;H+=2){U=t[H],F=t[H+1];var ne=sr(n,o,l),W=sr(A,C,R),J=fr(n,A),z=fr(A,n),Q=lr(_,S),ae=lr(S,_),Z=ar[H],$=ar[H+1],oe=or(_,v,u),ee=or(S,m,y),f=a+ae|0,s=w+Q+q(f,a)|0;f=f+ee|0,s=s+oe+q(f,ee)|0,f=f+$|0,s=s+Z+q(f,$)|0,f=f+F|0,s=s+U+q(f,F)|0;var b=z+W|0,B=J+ne+q(b,z)|0;w=u,a=y,u=v,y=m,v=_,m=S,S=T+f|0,_=d+s+q(S,T)|0,d=l,T=R,l=o,R=C,o=n,C=A,A=f+b|0,n=s+B+q(A,f)|0}this._al=this._al+A|0,this._bl=this._bl+C|0,this._cl=this._cl+R|0,this._dl=this._dl+T|0,this._el=this._el+S|0,this._fl=this._fl+m|0,this._gl=this._gl+y|0,this._hl=this._hl+a|0,this._ah=this._ah+n+q(this._al,A)|0,this._bh=this._bh+o+q(this._bl,C)|0,this._ch=this._ch+l+q(this._cl,R)|0,this._dh=this._dh+d+q(this._dl,T)|0,this._eh=this._eh+_+q(this._el,S)|0,this._fh=this._fh+v+q(this._fl,m)|0,this._gh=this._gh+u+q(this._gl,y)|0,this._hh=this._hh+w+q(this._hl,a)|0};me.prototype._hash=function(){var e=on.allocUnsafe(64);function t(n,o,l){e.writeInt32BE(n,l),e.writeInt32BE(o,l+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var kr=me,cn=K,dn=kr,_n=ge,bn=fe.Buffer,pn=new Array(160);function ke(){this.init(),this._w=pn,_n.call(this,128,112)}cn(ke,dn);ke.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};ke.prototype._hash=function(){var e=bn.allocUnsafe(48);function t(n,o,l){e.writeInt32BE(n,l),e.writeInt32BE(o,l+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var vn=ke,ue=Ar.exports=function(t){t=t.toLowerCase();var n=ue[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n};ue.sha=Oi;ue.sha1=Ui;ue.sha224=nn;ue.sha256=Or;ue.sha384=vn;ue.sha512=kr;var En=Ar.exports;function Nr(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};An.walletLogo=yu;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.LINK_API_URL=void 0;Nn.LINK_API_URL="https://www.walletlink.org";var T={},Ei={exports:{}};Ei.exports;(function(t){(function(e,r){function n(y,o){if(!y)throw new Error(o||"Assertion failed")}function i(y,o){y.super_=o;var d=function(){};d.prototype=o.prototype,y.prototype=new d,y.prototype.constructor=y}function s(y,o,d){if(s.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((o==="le"||o==="be")&&(d=o,o=10),this._init(y||0,o||10,d||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=mu.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,d){return o.cmp(d)>0?o:d},s.min=function(o,d){return o.cmp(d)<0?o:d},s.prototype._init=function(o,d,g){if(typeof o=="number")return this._initNumber(o,d,g);if(typeof o=="object")return this._initArray(o,d,g);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m=0;m-=3)E=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[w]|=E<>>26-k&67108863,k+=24,k>=26&&(k-=26,w++);else if(g==="le")for(m=0,w=0;m>>26-k&67108863,k+=24,k>=26&&(k-=26,w++);return this._strip()};function c(y,o){var d=y.charCodeAt(o);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+y)}function h(y,o,d){var g=c(y,d);return d-1>=o&&(g|=c(y,d-1)<<4),g}s.prototype._parseHex=function(o,d,g){this.length=Math.ceil((o.length-d)/6),this.words=new Array(this.length);for(var m=0;m=d;m-=2)k=h(o,d,m)<=18?(w-=18,E+=1,this.words[E]|=k>>>26):w+=8;else{var _=o.length-d;for(m=_%2===0?d+1:d;m=18?(w-=18,E+=1,this.words[E]|=k>>>26):w+=8}this._strip()};function u(y,o,d,g){for(var m=0,w=0,E=Math.min(y.length,d),k=o;k=49?w=_-49+10:_>=17?w=_-17+10:w=_,n(_>=0&&w1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var v=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],C=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,d){o=o||10,d=d|0||1;var g;if(o===16||o==="hex"){g="";for(var m=0,w=0,E=0;E>>24-m&16777215,m+=2,m>=26&&(m-=26,E--),w!==0||E!==this.length-1?g=v[6-_.length]+_+g:g=_+g}for(w!==0&&(g=w.toString(16)+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(o===(o|0)&&o>=2&&o<=36){var l=S[o],b=C[o];g="";var L=this.clone();for(L.negative=0;!L.isZero();){var O=L.modrn(b).toString(o);L=L.idivn(b),L.isZero()?g=O+g:g=v[l-O.length]+O+g}for(this.isZero()&&(g="0"+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,d){return this.toArrayLike(a,o,d)}),s.prototype.toArray=function(o,d){return this.toArrayLike(Array,o,d)};var N=function(o,d){return o.allocUnsafe?o.allocUnsafe(d):new o(d)};s.prototype.toArrayLike=function(o,d,g){this._strip();var m=this.byteLength(),w=g||Math.max(1,m);n(m<=w,"byte array longer than desired length"),n(w>0,"Requested array length <= 0");var E=N(o,w),k=d==="le"?"LE":"BE";return this["_toArrayLike"+k](E,m),E},s.prototype._toArrayLikeLE=function(o,d){for(var g=0,m=0,w=0,E=0;w>8&255),g>16&255),E===6?(g>24&255),m=0,E=0):(m=k>>>24,E+=2)}if(g=0&&(o[g--]=k>>8&255),g>=0&&(o[g--]=k>>16&255),E===6?(g>=0&&(o[g--]=k>>24&255),m=0,E=0):(m=k>>>24,E+=2)}if(g>=0)for(o[g--]=m;g>=0;)o[g--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var d=o,g=0;return d>=4096&&(g+=13,d>>>=13),d>=64&&(g+=7,d>>>=7),d>=8&&(g+=4,d>>>=4),d>=2&&(g+=2,d>>>=2),g+d},s.prototype._zeroBits=function(o){if(o===0)return 26;var d=o,g=0;return d&8191||(g+=13,d>>>=13),d&127||(g+=7,d>>>=7),d&15||(g+=4,d>>>=4),d&3||(g+=2,d>>>=2),d&1||g++,g},s.prototype.bitLength=function(){var o=this.words[this.length-1],d=this._countBits(o);return(this.length-1)*26+d};function M(y){for(var o=new Array(y.bitLength()),d=0;d>>m&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,d=0;do.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var d;this.length>o.length?d=o:d=this;for(var g=0;go.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var d,g;this.length>o.length?(d=this,g=o):(d=o,g=this);for(var m=0;mo.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var d=Math.ceil(o/26)|0,g=o%26;this._expand(d),g>0&&d--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-g),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,d){n(typeof o=="number"&&o>=0);var g=o/26|0,m=o%26;return this._expand(g+1),d?this.words[g]=this.words[g]|1<o.length?(g=this,m=o):(g=o,m=this);for(var w=0,E=0;E>>26;for(;w!==0&&E>>26;if(this.length=g.length,w!==0)this.words[this.length]=w,this.length++;else if(g!==this)for(;Eo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var d=this.iadd(o);return o.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var g=this.cmp(o);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,w;g>0?(m=this,w=o):(m=o,w=this);for(var E=0,k=0;k>26,this.words[k]=d&67108863;for(;E!==0&&k>26,this.words[k]=d&67108863;if(E===0&&k>>26,L=_&67108863,O=Math.min(l,o.length-1),F=Math.max(0,l-y.length+1);F<=O;F++){var Ze=l-F|0;m=y.words[Ze]|0,w=o.words[F]|0,E=m*w+L,b+=E/67108864|0,L=E&67108863}d.words[l]=L|0,_=b|0}return _!==0?d.words[l]=_|0:d.length--,d._strip()}var I=function(o,d,g){var m=o.words,w=d.words,E=g.words,k=0,_,l,b,L=m[0]|0,O=L&8191,F=L>>>13,Ze=m[1]|0,K=Ze&8191,ee=Ze>>>13,ho=m[2]|0,oe=ho&8191,ae=ho>>>13,fo=m[3]|0,ce=fo&8191,le=fo>>>13,po=m[4]|0,ue=po&8191,de=po>>>13,go=m[5]|0,he=go&8191,fe=go>>>13,mo=m[6]|0,pe=mo&8191,ge=mo>>>13,_o=m[7]|0,me=_o&8191,_e=_o>>>13,vo=m[8]|0,ve=vo&8191,ye=vo>>>13,yo=m[9]|0,we=yo&8191,be=yo>>>13,wo=w[0]|0,Ee=wo&8191,Se=wo>>>13,bo=w[1]|0,ke=bo&8191,Ce=bo>>>13,Eo=w[2]|0,Me=Eo&8191,Re=Eo>>>13,So=w[3]|0,Ie=So&8191,Ae=So>>>13,ko=w[4]|0,Ne=ko&8191,xe=ko>>>13,Co=w[5]|0,Le=Co&8191,Te=Co>>>13,Mo=w[6]|0,Pe=Mo&8191,Oe=Mo>>>13,Ro=w[7]|0,$e=Ro&8191,Be=Ro>>>13,Io=w[8]|0,Fe=Io&8191,je=Io>>>13,Ao=w[9]|0,De=Ao&8191,He=Ao>>>13;g.negative=o.negative^d.negative,g.length=19,_=Math.imul(O,Ee),l=Math.imul(O,Se),l=l+Math.imul(F,Ee)|0,b=Math.imul(F,Se);var Es=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Es>>>26)|0,Es&=67108863,_=Math.imul(K,Ee),l=Math.imul(K,Se),l=l+Math.imul(ee,Ee)|0,b=Math.imul(ee,Se),_=_+Math.imul(O,ke)|0,l=l+Math.imul(O,Ce)|0,l=l+Math.imul(F,ke)|0,b=b+Math.imul(F,Ce)|0;var Ss=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,_=Math.imul(oe,Ee),l=Math.imul(oe,Se),l=l+Math.imul(ae,Ee)|0,b=Math.imul(ae,Se),_=_+Math.imul(K,ke)|0,l=l+Math.imul(K,Ce)|0,l=l+Math.imul(ee,ke)|0,b=b+Math.imul(ee,Ce)|0,_=_+Math.imul(O,Me)|0,l=l+Math.imul(O,Re)|0,l=l+Math.imul(F,Me)|0,b=b+Math.imul(F,Re)|0;var ks=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(ks>>>26)|0,ks&=67108863,_=Math.imul(ce,Ee),l=Math.imul(ce,Se),l=l+Math.imul(le,Ee)|0,b=Math.imul(le,Se),_=_+Math.imul(oe,ke)|0,l=l+Math.imul(oe,Ce)|0,l=l+Math.imul(ae,ke)|0,b=b+Math.imul(ae,Ce)|0,_=_+Math.imul(K,Me)|0,l=l+Math.imul(K,Re)|0,l=l+Math.imul(ee,Me)|0,b=b+Math.imul(ee,Re)|0,_=_+Math.imul(O,Ie)|0,l=l+Math.imul(O,Ae)|0,l=l+Math.imul(F,Ie)|0,b=b+Math.imul(F,Ae)|0;var Cs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,_=Math.imul(ue,Ee),l=Math.imul(ue,Se),l=l+Math.imul(de,Ee)|0,b=Math.imul(de,Se),_=_+Math.imul(ce,ke)|0,l=l+Math.imul(ce,Ce)|0,l=l+Math.imul(le,ke)|0,b=b+Math.imul(le,Ce)|0,_=_+Math.imul(oe,Me)|0,l=l+Math.imul(oe,Re)|0,l=l+Math.imul(ae,Me)|0,b=b+Math.imul(ae,Re)|0,_=_+Math.imul(K,Ie)|0,l=l+Math.imul(K,Ae)|0,l=l+Math.imul(ee,Ie)|0,b=b+Math.imul(ee,Ae)|0,_=_+Math.imul(O,Ne)|0,l=l+Math.imul(O,xe)|0,l=l+Math.imul(F,Ne)|0,b=b+Math.imul(F,xe)|0;var Ms=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,_=Math.imul(he,Ee),l=Math.imul(he,Se),l=l+Math.imul(fe,Ee)|0,b=Math.imul(fe,Se),_=_+Math.imul(ue,ke)|0,l=l+Math.imul(ue,Ce)|0,l=l+Math.imul(de,ke)|0,b=b+Math.imul(de,Ce)|0,_=_+Math.imul(ce,Me)|0,l=l+Math.imul(ce,Re)|0,l=l+Math.imul(le,Me)|0,b=b+Math.imul(le,Re)|0,_=_+Math.imul(oe,Ie)|0,l=l+Math.imul(oe,Ae)|0,l=l+Math.imul(ae,Ie)|0,b=b+Math.imul(ae,Ae)|0,_=_+Math.imul(K,Ne)|0,l=l+Math.imul(K,xe)|0,l=l+Math.imul(ee,Ne)|0,b=b+Math.imul(ee,xe)|0,_=_+Math.imul(O,Le)|0,l=l+Math.imul(O,Te)|0,l=l+Math.imul(F,Le)|0,b=b+Math.imul(F,Te)|0;var Rs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,_=Math.imul(pe,Ee),l=Math.imul(pe,Se),l=l+Math.imul(ge,Ee)|0,b=Math.imul(ge,Se),_=_+Math.imul(he,ke)|0,l=l+Math.imul(he,Ce)|0,l=l+Math.imul(fe,ke)|0,b=b+Math.imul(fe,Ce)|0,_=_+Math.imul(ue,Me)|0,l=l+Math.imul(ue,Re)|0,l=l+Math.imul(de,Me)|0,b=b+Math.imul(de,Re)|0,_=_+Math.imul(ce,Ie)|0,l=l+Math.imul(ce,Ae)|0,l=l+Math.imul(le,Ie)|0,b=b+Math.imul(le,Ae)|0,_=_+Math.imul(oe,Ne)|0,l=l+Math.imul(oe,xe)|0,l=l+Math.imul(ae,Ne)|0,b=b+Math.imul(ae,xe)|0,_=_+Math.imul(K,Le)|0,l=l+Math.imul(K,Te)|0,l=l+Math.imul(ee,Le)|0,b=b+Math.imul(ee,Te)|0,_=_+Math.imul(O,Pe)|0,l=l+Math.imul(O,Oe)|0,l=l+Math.imul(F,Pe)|0,b=b+Math.imul(F,Oe)|0;var Is=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Is>>>26)|0,Is&=67108863,_=Math.imul(me,Ee),l=Math.imul(me,Se),l=l+Math.imul(_e,Ee)|0,b=Math.imul(_e,Se),_=_+Math.imul(pe,ke)|0,l=l+Math.imul(pe,Ce)|0,l=l+Math.imul(ge,ke)|0,b=b+Math.imul(ge,Ce)|0,_=_+Math.imul(he,Me)|0,l=l+Math.imul(he,Re)|0,l=l+Math.imul(fe,Me)|0,b=b+Math.imul(fe,Re)|0,_=_+Math.imul(ue,Ie)|0,l=l+Math.imul(ue,Ae)|0,l=l+Math.imul(de,Ie)|0,b=b+Math.imul(de,Ae)|0,_=_+Math.imul(ce,Ne)|0,l=l+Math.imul(ce,xe)|0,l=l+Math.imul(le,Ne)|0,b=b+Math.imul(le,xe)|0,_=_+Math.imul(oe,Le)|0,l=l+Math.imul(oe,Te)|0,l=l+Math.imul(ae,Le)|0,b=b+Math.imul(ae,Te)|0,_=_+Math.imul(K,Pe)|0,l=l+Math.imul(K,Oe)|0,l=l+Math.imul(ee,Pe)|0,b=b+Math.imul(ee,Oe)|0,_=_+Math.imul(O,$e)|0,l=l+Math.imul(O,Be)|0,l=l+Math.imul(F,$e)|0,b=b+Math.imul(F,Be)|0;var As=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(As>>>26)|0,As&=67108863,_=Math.imul(ve,Ee),l=Math.imul(ve,Se),l=l+Math.imul(ye,Ee)|0,b=Math.imul(ye,Se),_=_+Math.imul(me,ke)|0,l=l+Math.imul(me,Ce)|0,l=l+Math.imul(_e,ke)|0,b=b+Math.imul(_e,Ce)|0,_=_+Math.imul(pe,Me)|0,l=l+Math.imul(pe,Re)|0,l=l+Math.imul(ge,Me)|0,b=b+Math.imul(ge,Re)|0,_=_+Math.imul(he,Ie)|0,l=l+Math.imul(he,Ae)|0,l=l+Math.imul(fe,Ie)|0,b=b+Math.imul(fe,Ae)|0,_=_+Math.imul(ue,Ne)|0,l=l+Math.imul(ue,xe)|0,l=l+Math.imul(de,Ne)|0,b=b+Math.imul(de,xe)|0,_=_+Math.imul(ce,Le)|0,l=l+Math.imul(ce,Te)|0,l=l+Math.imul(le,Le)|0,b=b+Math.imul(le,Te)|0,_=_+Math.imul(oe,Pe)|0,l=l+Math.imul(oe,Oe)|0,l=l+Math.imul(ae,Pe)|0,b=b+Math.imul(ae,Oe)|0,_=_+Math.imul(K,$e)|0,l=l+Math.imul(K,Be)|0,l=l+Math.imul(ee,$e)|0,b=b+Math.imul(ee,Be)|0,_=_+Math.imul(O,Fe)|0,l=l+Math.imul(O,je)|0,l=l+Math.imul(F,Fe)|0,b=b+Math.imul(F,je)|0;var Ns=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,_=Math.imul(we,Ee),l=Math.imul(we,Se),l=l+Math.imul(be,Ee)|0,b=Math.imul(be,Se),_=_+Math.imul(ve,ke)|0,l=l+Math.imul(ve,Ce)|0,l=l+Math.imul(ye,ke)|0,b=b+Math.imul(ye,Ce)|0,_=_+Math.imul(me,Me)|0,l=l+Math.imul(me,Re)|0,l=l+Math.imul(_e,Me)|0,b=b+Math.imul(_e,Re)|0,_=_+Math.imul(pe,Ie)|0,l=l+Math.imul(pe,Ae)|0,l=l+Math.imul(ge,Ie)|0,b=b+Math.imul(ge,Ae)|0,_=_+Math.imul(he,Ne)|0,l=l+Math.imul(he,xe)|0,l=l+Math.imul(fe,Ne)|0,b=b+Math.imul(fe,xe)|0,_=_+Math.imul(ue,Le)|0,l=l+Math.imul(ue,Te)|0,l=l+Math.imul(de,Le)|0,b=b+Math.imul(de,Te)|0,_=_+Math.imul(ce,Pe)|0,l=l+Math.imul(ce,Oe)|0,l=l+Math.imul(le,Pe)|0,b=b+Math.imul(le,Oe)|0,_=_+Math.imul(oe,$e)|0,l=l+Math.imul(oe,Be)|0,l=l+Math.imul(ae,$e)|0,b=b+Math.imul(ae,Be)|0,_=_+Math.imul(K,Fe)|0,l=l+Math.imul(K,je)|0,l=l+Math.imul(ee,Fe)|0,b=b+Math.imul(ee,je)|0,_=_+Math.imul(O,De)|0,l=l+Math.imul(O,He)|0,l=l+Math.imul(F,De)|0,b=b+Math.imul(F,He)|0;var xs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(xs>>>26)|0,xs&=67108863,_=Math.imul(we,ke),l=Math.imul(we,Ce),l=l+Math.imul(be,ke)|0,b=Math.imul(be,Ce),_=_+Math.imul(ve,Me)|0,l=l+Math.imul(ve,Re)|0,l=l+Math.imul(ye,Me)|0,b=b+Math.imul(ye,Re)|0,_=_+Math.imul(me,Ie)|0,l=l+Math.imul(me,Ae)|0,l=l+Math.imul(_e,Ie)|0,b=b+Math.imul(_e,Ae)|0,_=_+Math.imul(pe,Ne)|0,l=l+Math.imul(pe,xe)|0,l=l+Math.imul(ge,Ne)|0,b=b+Math.imul(ge,xe)|0,_=_+Math.imul(he,Le)|0,l=l+Math.imul(he,Te)|0,l=l+Math.imul(fe,Le)|0,b=b+Math.imul(fe,Te)|0,_=_+Math.imul(ue,Pe)|0,l=l+Math.imul(ue,Oe)|0,l=l+Math.imul(de,Pe)|0,b=b+Math.imul(de,Oe)|0,_=_+Math.imul(ce,$e)|0,l=l+Math.imul(ce,Be)|0,l=l+Math.imul(le,$e)|0,b=b+Math.imul(le,Be)|0,_=_+Math.imul(oe,Fe)|0,l=l+Math.imul(oe,je)|0,l=l+Math.imul(ae,Fe)|0,b=b+Math.imul(ae,je)|0,_=_+Math.imul(K,De)|0,l=l+Math.imul(K,He)|0,l=l+Math.imul(ee,De)|0,b=b+Math.imul(ee,He)|0;var Ls=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,_=Math.imul(we,Me),l=Math.imul(we,Re),l=l+Math.imul(be,Me)|0,b=Math.imul(be,Re),_=_+Math.imul(ve,Ie)|0,l=l+Math.imul(ve,Ae)|0,l=l+Math.imul(ye,Ie)|0,b=b+Math.imul(ye,Ae)|0,_=_+Math.imul(me,Ne)|0,l=l+Math.imul(me,xe)|0,l=l+Math.imul(_e,Ne)|0,b=b+Math.imul(_e,xe)|0,_=_+Math.imul(pe,Le)|0,l=l+Math.imul(pe,Te)|0,l=l+Math.imul(ge,Le)|0,b=b+Math.imul(ge,Te)|0,_=_+Math.imul(he,Pe)|0,l=l+Math.imul(he,Oe)|0,l=l+Math.imul(fe,Pe)|0,b=b+Math.imul(fe,Oe)|0,_=_+Math.imul(ue,$e)|0,l=l+Math.imul(ue,Be)|0,l=l+Math.imul(de,$e)|0,b=b+Math.imul(de,Be)|0,_=_+Math.imul(ce,Fe)|0,l=l+Math.imul(ce,je)|0,l=l+Math.imul(le,Fe)|0,b=b+Math.imul(le,je)|0,_=_+Math.imul(oe,De)|0,l=l+Math.imul(oe,He)|0,l=l+Math.imul(ae,De)|0,b=b+Math.imul(ae,He)|0;var Ts=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,_=Math.imul(we,Ie),l=Math.imul(we,Ae),l=l+Math.imul(be,Ie)|0,b=Math.imul(be,Ae),_=_+Math.imul(ve,Ne)|0,l=l+Math.imul(ve,xe)|0,l=l+Math.imul(ye,Ne)|0,b=b+Math.imul(ye,xe)|0,_=_+Math.imul(me,Le)|0,l=l+Math.imul(me,Te)|0,l=l+Math.imul(_e,Le)|0,b=b+Math.imul(_e,Te)|0,_=_+Math.imul(pe,Pe)|0,l=l+Math.imul(pe,Oe)|0,l=l+Math.imul(ge,Pe)|0,b=b+Math.imul(ge,Oe)|0,_=_+Math.imul(he,$e)|0,l=l+Math.imul(he,Be)|0,l=l+Math.imul(fe,$e)|0,b=b+Math.imul(fe,Be)|0,_=_+Math.imul(ue,Fe)|0,l=l+Math.imul(ue,je)|0,l=l+Math.imul(de,Fe)|0,b=b+Math.imul(de,je)|0,_=_+Math.imul(ce,De)|0,l=l+Math.imul(ce,He)|0,l=l+Math.imul(le,De)|0,b=b+Math.imul(le,He)|0;var Ps=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,_=Math.imul(we,Ne),l=Math.imul(we,xe),l=l+Math.imul(be,Ne)|0,b=Math.imul(be,xe),_=_+Math.imul(ve,Le)|0,l=l+Math.imul(ve,Te)|0,l=l+Math.imul(ye,Le)|0,b=b+Math.imul(ye,Te)|0,_=_+Math.imul(me,Pe)|0,l=l+Math.imul(me,Oe)|0,l=l+Math.imul(_e,Pe)|0,b=b+Math.imul(_e,Oe)|0,_=_+Math.imul(pe,$e)|0,l=l+Math.imul(pe,Be)|0,l=l+Math.imul(ge,$e)|0,b=b+Math.imul(ge,Be)|0,_=_+Math.imul(he,Fe)|0,l=l+Math.imul(he,je)|0,l=l+Math.imul(fe,Fe)|0,b=b+Math.imul(fe,je)|0,_=_+Math.imul(ue,De)|0,l=l+Math.imul(ue,He)|0,l=l+Math.imul(de,De)|0,b=b+Math.imul(de,He)|0;var Os=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Os>>>26)|0,Os&=67108863,_=Math.imul(we,Le),l=Math.imul(we,Te),l=l+Math.imul(be,Le)|0,b=Math.imul(be,Te),_=_+Math.imul(ve,Pe)|0,l=l+Math.imul(ve,Oe)|0,l=l+Math.imul(ye,Pe)|0,b=b+Math.imul(ye,Oe)|0,_=_+Math.imul(me,$e)|0,l=l+Math.imul(me,Be)|0,l=l+Math.imul(_e,$e)|0,b=b+Math.imul(_e,Be)|0,_=_+Math.imul(pe,Fe)|0,l=l+Math.imul(pe,je)|0,l=l+Math.imul(ge,Fe)|0,b=b+Math.imul(ge,je)|0,_=_+Math.imul(he,De)|0,l=l+Math.imul(he,He)|0,l=l+Math.imul(fe,De)|0,b=b+Math.imul(fe,He)|0;var $s=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+($s>>>26)|0,$s&=67108863,_=Math.imul(we,Pe),l=Math.imul(we,Oe),l=l+Math.imul(be,Pe)|0,b=Math.imul(be,Oe),_=_+Math.imul(ve,$e)|0,l=l+Math.imul(ve,Be)|0,l=l+Math.imul(ye,$e)|0,b=b+Math.imul(ye,Be)|0,_=_+Math.imul(me,Fe)|0,l=l+Math.imul(me,je)|0,l=l+Math.imul(_e,Fe)|0,b=b+Math.imul(_e,je)|0,_=_+Math.imul(pe,De)|0,l=l+Math.imul(pe,He)|0,l=l+Math.imul(ge,De)|0,b=b+Math.imul(ge,He)|0;var Bs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,_=Math.imul(we,$e),l=Math.imul(we,Be),l=l+Math.imul(be,$e)|0,b=Math.imul(be,Be),_=_+Math.imul(ve,Fe)|0,l=l+Math.imul(ve,je)|0,l=l+Math.imul(ye,Fe)|0,b=b+Math.imul(ye,je)|0,_=_+Math.imul(me,De)|0,l=l+Math.imul(me,He)|0,l=l+Math.imul(_e,De)|0,b=b+Math.imul(_e,He)|0;var Fs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,_=Math.imul(we,Fe),l=Math.imul(we,je),l=l+Math.imul(be,Fe)|0,b=Math.imul(be,je),_=_+Math.imul(ve,De)|0,l=l+Math.imul(ve,He)|0,l=l+Math.imul(ye,De)|0,b=b+Math.imul(ye,He)|0;var js=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(js>>>26)|0,js&=67108863,_=Math.imul(we,De),l=Math.imul(we,He),l=l+Math.imul(be,De)|0,b=Math.imul(be,He);var Ds=(k+_|0)+((l&8191)<<13)|0;return k=(b+(l>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,E[0]=Es,E[1]=Ss,E[2]=ks,E[3]=Cs,E[4]=Ms,E[5]=Rs,E[6]=Is,E[7]=As,E[8]=Ns,E[9]=xs,E[10]=Ls,E[11]=Ts,E[12]=Ps,E[13]=Os,E[14]=$s,E[15]=Bs,E[16]=Fs,E[17]=js,E[18]=Ds,k!==0&&(E[19]=k,g.length++),g};Math.imul||(I=A);function R(y,o,d){d.negative=o.negative^y.negative,d.length=y.length+o.length;for(var g=0,m=0,w=0;w>>26)|0,m+=E>>>26,E&=67108863}d.words[w]=k,g=E,E=m}return g!==0?d.words[w]=g:d.length--,d._strip()}function j(y,o,d){return R(y,o,d)}s.prototype.mulTo=function(o,d){var g,m=this.length+o.length;return this.length===10&&o.length===10?g=I(this,o,d):m<63?g=A(this,o,d):m<1024?g=R(this,o,d):g=j(this,o,d),g},s.prototype.mul=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),this.mulTo(o,d)},s.prototype.mulf=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),j(this,o,d)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var d=o<0;d&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var g=0,m=0;m>=26,g+=w/67108864|0,g+=E>>>26,this.words[m]=E&67108863}return g!==0&&(this.words[m]=g,this.length++),d?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var d=M(o);if(d.length===0)return new s(1);for(var g=this,m=0;m=0);var d=o%26,g=(o-d)/26,m=67108863>>>26-d<<26-d,w;if(d!==0){var E=0;for(w=0;w>>26-d}E&&(this.words[w]=E,this.length++)}if(g!==0){for(w=this.length-1;w>=0;w--)this.words[w+g]=this.words[w];for(w=0;w=0);var m;d?m=(d-d%26)/26:m=0;var w=o%26,E=Math.min((o-w)/26,this.length),k=67108863^67108863>>>w<E)for(this.length-=E,l=0;l=0&&(b!==0||l>=m);l--){var L=this.words[l]|0;this.words[l]=b<<26-w|L>>>w,b=L&k}return _&&b!==0&&(_.words[_.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,d,g){return n(this.negative===0),this.iushrn(o,d,g)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,g=(o-d)/26,m=1<=0);var d=o%26,g=(o-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(d!==0&&g++,this.length=Math.min(g,this.length),d!==0){var m=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-(_/67108864|0),this.words[w+g]=E&67108863}for(;w>26,this.words[w+g]=E&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,w=0;w>26,this.words[w]=E&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,d){var g=this.length-o.length,m=this.clone(),w=o,E=w.words[w.length-1]|0,k=this._countBits(E);g=26-k,g!==0&&(w=w.ushln(g),m.iushln(g),E=w.words[w.length-1]|0);var _=m.length-w.length,l;if(d!=="mod"){l=new s(null),l.length=_+1,l.words=new Array(l.length);for(var b=0;b=0;O--){var F=(m.words[w.length+O]|0)*67108864+(m.words[w.length+O-1]|0);for(F=Math.min(F/E|0,67108863),m._ishlnsubmul(w,F,O);m.negative!==0;)F--,m.negative=0,m._ishlnsubmul(w,1,O),m.isZero()||(m.negative^=1);l&&(l.words[O]=F)}return l&&l._strip(),m._strip(),d!=="div"&&g!==0&&m.iushrn(g),{div:l||null,mod:m}},s.prototype.divmod=function(o,d,g){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,w,E;return this.negative!==0&&o.negative===0?(E=this.neg().divmod(o,d),d!=="mod"&&(m=E.div.neg()),d!=="div"&&(w=E.mod.neg(),g&&w.negative!==0&&w.iadd(o)),{div:m,mod:w}):this.negative===0&&o.negative!==0?(E=this.divmod(o.neg(),d),d!=="mod"&&(m=E.div.neg()),{div:m,mod:E.mod}):this.negative&o.negative?(E=this.neg().divmod(o.neg(),d),d!=="div"&&(w=E.mod.neg(),g&&w.negative!==0&&w.isub(o)),{div:E.div,mod:w}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?d==="div"?{div:this.divn(o.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,d)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var d=this.divmod(o);if(d.mod.isZero())return d.div;var g=d.div.negative!==0?d.mod.isub(o):d.mod,m=o.ushrn(1),w=o.andln(1),E=g.cmp(m);return E<0||w===1&&E===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var g=(1<<26)%o,m=0,w=this.length-1;w>=0;w--)m=(g*m+(this.words[w]|0))%o;return d?-m:m},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var g=0,m=this.length-1;m>=0;m--){var w=(this.words[m]|0)+g*67108864;this.words[m]=w/o|0,g=w%o}return this._strip(),d?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var d=this,g=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var m=new s(1),w=new s(0),E=new s(0),k=new s(1),_=0;d.isEven()&&g.isEven();)d.iushrn(1),g.iushrn(1),++_;for(var l=g.clone(),b=d.clone();!d.isZero();){for(var L=0,O=1;!(d.words[0]&O)&&L<26;++L,O<<=1);if(L>0)for(d.iushrn(L);L-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(l),w.isub(b)),m.iushrn(1),w.iushrn(1);for(var F=0,Ze=1;!(g.words[0]&Ze)&&F<26;++F,Ze<<=1);if(F>0)for(g.iushrn(F);F-- >0;)(E.isOdd()||k.isOdd())&&(E.iadd(l),k.isub(b)),E.iushrn(1),k.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(E),w.isub(k)):(g.isub(d),E.isub(m),k.isub(w))}return{a:E,b:k,gcd:g.iushln(_)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var d=this,g=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var m=new s(1),w=new s(0),E=g.clone();d.cmpn(1)>0&&g.cmpn(1)>0;){for(var k=0,_=1;!(d.words[0]&_)&&k<26;++k,_<<=1);if(k>0)for(d.iushrn(k);k-- >0;)m.isOdd()&&m.iadd(E),m.iushrn(1);for(var l=0,b=1;!(g.words[0]&b)&&l<26;++l,b<<=1);if(l>0)for(g.iushrn(l);l-- >0;)w.isOdd()&&w.iadd(E),w.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(w)):(g.isub(d),w.isub(m))}var L;return d.cmpn(1)===0?L=m:L=w,L.cmpn(0)<0&&L.iadd(o),L},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var d=this.clone(),g=o.clone();d.negative=0,g.negative=0;for(var m=0;d.isEven()&&g.isEven();m++)d.iushrn(1),g.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;g.isEven();)g.iushrn(1);var w=d.cmp(g);if(w<0){var E=d;d=g,g=E}else if(w===0||g.cmpn(1)===0)break;d.isub(g)}while(!0);return g.iushln(m)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var d=o%26,g=(o-d)/26,m=1<>>26,k&=67108863,this.words[E]=k}return w!==0&&(this.words[E]=w,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var d=o<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var g;if(this.length>1)g=1;else{d&&(o=-o),n(o<=67108863,"Number is too big");var m=this.words[0]|0;g=m===o?0:mo.length)return 1;if(this.length=0;g--){var m=this.words[g]|0,w=o.words[g]|0;if(m!==w){mw&&(d=1);break}}return d},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new U(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var x={k256:null,p224:null,p192:null,p25519:null};function P(y,o){this.name=y,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var d=o,g;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),g=d.bitLength();while(g>this.n);var m=g0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},P.prototype.split=function(o,d){o.iushrn(this.n,0,d)},P.prototype.imulK=function(o){return o.imul(this.k)};function q(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(q,P),q.prototype.split=function(o,d){for(var g=4194303,m=Math.min(o.length,9),w=0;w>>22,E=k}E>>>=22,o.words[w-10]=E,E===0&&o.length>10?o.length-=10:o.length-=9},q.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var d=0,g=0;g>>=26,o.words[g]=w,d=m}return d!==0&&(o.words[o.length++]=d),o},s._prime=function(o){if(x[o])return x[o];var d;if(o==="k256")d=new q;else if(o==="p224")d=new Y;else if(o==="p192")d=new J;else if(o==="p25519")d=new G;else throw new Error("Unknown prime "+o);return x[o]=d,d};function U(y){if(typeof y=="string"){var o=s._prime(y);this.m=o.p,this.prime=o}else n(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}U.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},U.prototype._verify2=function(o,d){n((o.negative|d.negative)===0,"red works only with positives"),n(o.red&&o.red===d.red,"red works only with red numbers")},U.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(p(o,o.umod(this.m)._forceRed(this)),o)},U.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},U.prototype.add=function(o,d){this._verify2(o,d);var g=o.add(d);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},U.prototype.iadd=function(o,d){this._verify2(o,d);var g=o.iadd(d);return g.cmp(this.m)>=0&&g.isub(this.m),g},U.prototype.sub=function(o,d){this._verify2(o,d);var g=o.sub(d);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},U.prototype.isub=function(o,d){this._verify2(o,d);var g=o.isub(d);return g.cmpn(0)<0&&g.iadd(this.m),g},U.prototype.shl=function(o,d){return this._verify1(o),this.imod(o.ushln(d))},U.prototype.imul=function(o,d){return this._verify2(o,d),this.imod(o.imul(d))},U.prototype.mul=function(o,d){return this._verify2(o,d),this.imod(o.mul(d))},U.prototype.isqr=function(o){return this.imul(o,o.clone())},U.prototype.sqr=function(o){return this.mul(o,o)},U.prototype.sqrt=function(o){if(o.isZero())return o.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(o,g)}for(var m=this.m.subn(1),w=0;!m.isZero()&&m.andln(1)===0;)w++,m.iushrn(1);n(!m.isZero());var E=new s(1).toRed(this),k=E.redNeg(),_=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);this.pow(l,_).cmp(k)!==0;)l.redIAdd(k);for(var b=this.pow(l,m),L=this.pow(o,m.addn(1).iushrn(1)),O=this.pow(o,m),F=w;O.cmp(E)!==0;){for(var Ze=O,K=0;Ze.cmp(E)!==0;K++)Ze=Ze.redSqr();n(K=0;w--){for(var b=d.words[w],L=l-1;L>=0;L--){var O=b>>L&1;if(E!==m[0]&&(E=this.sqr(E)),O===0&&k===0){_=0;continue}k<<=1,k|=O,_++,!(_!==g&&(w!==0||L!==0))&&(E=this.mul(E,m[k]),_=0,k=0)}l=26}return E},U.prototype.convertTo=function(o){var d=o.umod(this.m);return d===o?d.clone():d},U.prototype.convertFrom=function(o){var d=o.clone();return d.red=null,d},s.mont=function(o){return new Q(o)};function Q(y){U.call(this,y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Q,U),Q.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},Q.prototype.convertFrom=function(o){var d=this.imod(o.mul(this.rinv));return d.red=null,d},Q.prototype.imul=function(o,d){if(o.isZero()||d.isZero())return o.words[0]=0,o.length=1,o;var g=o.imul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=g.isub(m).iushrn(this.shift),E=w;return w.cmp(this.m)>=0?E=w.isub(this.m):w.cmpn(0)<0&&(E=w.iadd(this.m)),E._forceRed(this)},Q.prototype.mul=function(o,d){if(o.isZero()||d.isZero())return new s(0)._forceRed(this);var g=o.mul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=g.isub(m).iushrn(this.shift),E=w;return w.cmp(this.m)>=0?E=w.isub(this.m):w.cmpn(0)<0&&(E=w.iadd(this.m)),E._forceRed(this)},Q.prototype.invm=function(o){var d=this.imod(o._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(t,$)})(Ei);var xn=Ei.exports,Br={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.errorValues=Rt.standardErrorCodes=void 0;Rt.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Rt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Ln={},Tn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Rt,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(v,S=r){if(v&&Number.isInteger(v)){const C=v.toString();if(p(e.errorValues,C))return e.errorValues[C].message;if(h(v))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return S}t.getMessageFromCode=n;function i(v){if(!Number.isInteger(v))return!1;const S=v.toString();return!!(e.errorValues[S]||h(v))}t.isValidCode=i;function s(v){var S;if(typeof v=="number")return v;if(a(v))return(S=v.code)!==null&&S!==void 0?S:v.errorCode}t.getErrorCode=s;function a(v){return typeof v=="object"&&v!==null&&(typeof v.code=="number"||typeof v.errorCode=="number")}function c(v,{shouldIncludeStack:S=!1}={}){const C={};if(v&&typeof v=="object"&&!Array.isArray(v)&&p(v,"code")&&i(v.code)){const N=v;C.code=N.code,N.message&&typeof N.message=="string"?(C.message=N.message,p(N,"data")&&(C.data=N.data)):(C.message=n(C.code),C.data={originalError:u(v)})}else C.code=e.standardErrorCodes.rpc.internal,C.message=f(v,"message")?v.message:r,C.data={originalError:u(v)};return S&&(C.stack=f(v,"stack")?v.stack:void 0),C}t.serialize=c;function h(v){return v>=-32099&&v<=-32e3}function u(v){return v&&typeof v=="object"&&!Array.isArray(v)?Object.assign({},v):v}function p(v,S){return Object.prototype.hasOwnProperty.call(v,S)}function f(v,S){return typeof v=="object"&&v!==null&&S in v&&typeof v[S]=="string"}})(Tn);Object.defineProperty(Ln,"__esModule",{value:!0});Ln.standardErrors=void 0;const qe=Rt,ec=Tn;Ln.standardErrors={rpc:{parse:t=>it(qe.standardErrorCodes.rpc.parse,t),invalidRequest:t=>it(qe.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>it(qe.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>it(qe.standardErrorCodes.rpc.methodNotFound,t),internal:t=>it(qe.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return it(e,t)},invalidInput:t=>it(qe.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>it(qe.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>it(qe.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>it(qe.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>it(qe.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>it(qe.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Xt(qe.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Xt(qe.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Xt(qe.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Xt(qe.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Xt(qe.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Xt(qe.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new nc(e,r,n)}}};function it(t,e){const[r,n]=tc(e);return new rc(t,r||(0,ec.getMessageFromCode)(t),n)}function Xt(t,e){const[r,n]=tc(e);return new nc(t,r||(0,ec.getMessageFromCode)(t),n)}function tc(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let rc=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},nc=class extends rc{constructor(e,r,n){if(!wu(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function wu(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var Pn={},vr={};Object.defineProperty(vr,"__esModule",{value:!0});vr.isErrorResponse=void 0;function bu(t){return t.errorMessage!==void 0}vr.isErrorResponse=bu;var yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.LIB_VERSION=void 0;yr.LIB_VERSION="3.9.3";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.serializeError=void 0;const Eu=vr,Su=yr,ku=Rt,Cu=Tn;function Mu(t,e){const r=(0,Cu.serialize)(Ru(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Su.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Iu(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Pn.serializeError=Mu;function Ru(t){return typeof t=="string"?{message:t,code:ku.standardErrorCodes.rpc.internal}:(0,Eu.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function Iu(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=Rt;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=Ln;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Pn;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Tn;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Br);var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.ProviderType=Ve.RegExpString=Ve.IntNumber=Ve.BigIntString=Ve.AddressString=Ve.HexString=Ve.OpaqueType=void 0;function Fr(){return t=>t}Ve.OpaqueType=Fr;Ve.HexString=Fr();Ve.AddressString=Fr();Ve.BigIntString=Fr();function Au(t){return Math.floor(t)}Ve.IntNumber=Au;Ve.RegExpString=Fr();var No;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(No||(Ve.ProviderType=No={}));var Nu=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(T,"__esModule",{value:!0});T.isMobileWeb=T.getLocation=T.isInIFrame=T.createQrUrl=T.getFavicon=T.range=T.isBigNumber=T.ensureParsedJSONObject=T.ensureBN=T.ensureRegExpString=T.ensureIntNumber=T.ensureBuffer=T.ensureAddressString=T.ensureEvenLengthHexString=T.ensureHexString=T.isHexString=T.prepend0x=T.strip0x=T.has0xPrefix=T.hexStringFromIntNumber=T.intNumberFromHexString=T.bigIntStringFromBN=T.hexStringFromBuffer=T.hexStringToUint8Array=T.uint8ArrayToHex=T.randomBytesHex=void 0;const xt=Nu(xn),Gt=Br,lt=Ve,sc=/^[0-9]*$/,ic=/^[a-f0-9]*$/;function xu(t){return oc(crypto.getRandomValues(new Uint8Array(t)))}T.randomBytesHex=xu;function oc(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}T.uint8ArrayToHex=oc;function Lu(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}T.hexStringToUint8Array=Lu;function Tu(t,e=!1){const r=t.toString("hex");return(0,lt.HexString)(e?`0x${r}`:r)}T.hexStringFromBuffer=Tu;function Pu(t){return(0,lt.BigIntString)(t.toString(10))}T.bigIntStringFromBN=Pu;function Ou(t){return(0,lt.IntNumber)(new xt.default(Dr(t,!1),16).toNumber())}T.intNumberFromHexString=Ou;function $u(t){return(0,lt.HexString)(`0x${new xt.default(t).toString(16)}`)}T.hexStringFromIntNumber=$u;function Si(t){return t.startsWith("0x")||t.startsWith("0X")}T.has0xPrefix=Si;function On(t){return Si(t)?t.slice(2):t}T.strip0x=On;function ac(t){return Si(t)?`0x${t.slice(2)}`:`0x${t}`}T.prepend0x=ac;function jr(t){if(typeof t!="string")return!1;const e=On(t).toLowerCase();return ic.test(e)}T.isHexString=jr;function cc(t,e=!1){if(typeof t=="string"){const r=On(t).toLowerCase();if(ic.test(r))return(0,lt.HexString)(e?`0x${r}`:r)}throw Gt.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}T.ensureHexString=cc;function Dr(t,e=!1){let r=cc(t,!1);return r.length%2===1&&(r=(0,lt.HexString)(`0${r}`)),e?(0,lt.HexString)(`0x${r}`):r}T.ensureEvenLengthHexString=Dr;function Bu(t){if(typeof t=="string"){const e=On(t).toLowerCase();if(jr(e)&&e.length===40)return(0,lt.AddressString)(ac(e))}throw Gt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}T.ensureAddressString=Bu;function Fu(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(jr(t)){const e=Dr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Gt.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}T.ensureBuffer=Fu;function lc(t){if(typeof t=="number"&&Number.isInteger(t))return(0,lt.IntNumber)(t);if(typeof t=="string"){if(sc.test(t))return(0,lt.IntNumber)(Number(t));if(jr(t))return(0,lt.IntNumber)(new xt.default(Dr(t,!1),16).toNumber())}throw Gt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}T.ensureIntNumber=lc;function ju(t){if(t instanceof RegExp)return(0,lt.RegExpString)(t.toString());throw Gt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}T.ensureRegExpString=ju;function Du(t){if(t!==null&&(xt.default.isBN(t)||uc(t)))return new xt.default(t.toString(10),10);if(typeof t=="number")return new xt.default(lc(t));if(typeof t=="string"){if(sc.test(t))return new xt.default(t,10);if(jr(t))return new xt.default(Dr(t,!1),16)}throw Gt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}T.ensureBN=Du;function Hu(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Gt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}T.ensureParsedJSONObject=Hu;function uc(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}T.isBigNumber=uc;function Uu(t,e){return Array.from({length:e-t},(r,n)=>t+n)}T.range=Uu;function Vu(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}T.getFavicon=Vu;function Wu(t,e,r,n,i,s){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}T.createQrUrl=Wu;function dc(){try{return window.frameElement!==null}catch{return!1}}T.isInIFrame=dc;function zu(){try{return dc()&&window.top?window.top.location:window.location}catch{return window.location}}T.getLocation=zu;function qu(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}T.isMobileWeb=qu;var $n={};Object.defineProperty($n,"__esModule",{value:!0});$n.ScopedLocalStorage=void 0;class Ju{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}$n.ScopedLocalStorage=Ju;var ur={},hc={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,u,p){this.fn=h,this.context=u,this.once=p||!1}function s(h,u,p,f,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var S=new i(p,f||h,v),C=r?r+u:u;return h._events[C]?h._events[C].fn?h._events[C]=[h._events[C],S]:h._events[C].push(S):(h._events[C]=S,h._eventsCount++),h}function a(h,u){--h._eventsCount===0?h._events=new n:delete h._events[u]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],p,f;if(this._eventsCount===0)return u;for(f in p=this._events)e.call(p,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},c.prototype.listeners=function(u){var p=r?r+u:u,f=this._events[p];if(!f)return[];if(f.fn)return[f.fn];for(var v=0,S=f.length,C=new Array(S);vn.json()).then(n=>{if(!n)throw xo.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,xo.serializeError)(s,e.method);return i})}}ct.RelayAbstract=Zu;var br={};Object.defineProperty(br,"__esModule",{value:!0});br.Session=void 0;const Lo=_u,To=T,Po="session:id",Oo="session:secret",$o="session:linked";class ki{constructor(e,r,n,i){this._storage=e,this._id=r||(0,To.randomBytesHex)(16),this._secret=n||(0,To.randomBytesHex)(32),this._key=new Lo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(Po),n=e.getItem($o),i=e.getItem(Oo);return r&&i?new ki(e,r,i,n==="1"):null}static hash(e){return new Lo.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Po,this._id),this._storage.setItem(Oo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem($o,this._linked?"1":"0")}}br.Session=ki;var Bn={},Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Cipher=void 0;const on=T;class Qu{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,on.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),c=16,h=a.slice(a.byteLength-c),u=a.slice(0,a.byteLength-c),p=new Uint8Array(h),f=new Uint8Array(u),v=new Uint8Array([...n,...p,...f]);return(0,on.uint8ArrayToHex)(v)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,on.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,on.hexStringToUint8Array)(e),c=a.slice(0,12),h=a.slice(12,28),u=a.slice(28),p=new Uint8Array([...u,...h]),f={name:"AES-GCM",iv:new Uint8Array(c)};try{const v=await window.crypto.subtle.decrypt(f,s,p),S=new TextDecoder;n(S.decode(v))}catch(v){i(v)}})()})}}Fn.Cipher=Qu;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.WalletLinkHTTP=void 0;class Ku{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}jn.WalletLinkHTTP=Ku;var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.WalletLinkWebSocket=dr.ConnectionState=void 0;var ir;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(ir||(dr.ConnectionState=ir={}));class Xu{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,ir.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,ir.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,ir.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,c;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,ir.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}dr.WalletLinkWebSocket=Xu;Object.defineProperty(Bn,"__esModule",{value:!0});Bn.WalletLinkConnection=void 0;const Yt=Ve,Yu=Fn,gt=wr,Bo=ct,er=br,ed=jn,an=dr,Fo=1e4,td=6e4;class rd{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Yt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",u=>c.JsonRpcUrl&&this.handleChainUpdated(u,c.JsonRpcUrl)]]).forEach((u,p)=>{const f=c[p];f!==void 0&&u(f)})},this.handleDestroyed=c=>{var h,u;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(u=this.diagnostic)===null||u===void 0||u.log(gt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:er.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,u;try{const p=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(p)}catch{(u=this.diagnostic)===null||u===void 0||u.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var u,p;try{const f=await this.cipher.decrypt(h);(u=this.listener)===null||u===void 0||u.metadataUpdated(c,f)}catch{(p=this.diagnostic)===null||p===void 0||p.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(Bo.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(Bo.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var u,p;try{const f=await this.cipher.decrypt(c),v=await this.cipher.decrypt(h);(u=this.listener)===null||u===void 0||u.chainUpdated(f,v)}catch{(p=this.diagnostic)===null||p===void 0||p.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new Yu.Cipher(e.secret),this.diagnostic=i,this.listener=n;const a=new an.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(gt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:er.Session.hash(e.id)});let u=!1;switch(c){case an.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(f=>setTimeout(f,5e3)),this.destroyed||a.connect().catch(()=>{p()})};p()}break;case an.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),u=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Fo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case an.ConnectionState.CONNECTING:break}this.connected!==u&&(this.connected=u)}),a.setIncomingDataListener(c=>{var h,u,p;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const f=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(gt.EVENTS.LINKED,{sessionIdHash:er.Session.hash(e.id),linked:f,type:c.type,onlineGuests:c.onlineGuests}),this.linked=f||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(u=this.diagnostic)===null||u===void 0||u.log(gt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:er.Session.hash(e.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((p=this.requestResolutions.get(c.id))===null||p===void 0||p(c))}),this.ws=a,this.http=new ed.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(gt.EVENTS.STARTED_CONNECTING,{sessionIdHash:er.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(gt.EVENTS.DISCONNECTED,{sessionIdHash:er.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Fo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=td){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Bn.WalletLinkConnection=rd;var Vr={},Wr={},Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var nd=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.injectCssReset=void 0;const sd=nd(Ci);function id(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(sd.default)),document.documentElement.appendChild(t)}Wr.injectCssReset=id;var Dn={},zr,X,fc,pc,jt,jo,gc,ci,Mi,li,ui,mc,Tr={},_c=[],od=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Hn=Array.isArray;function Mt(t,e){for(var r in e)t[r]=e[r];return t}function vc(t){var e=t.parentNode;e&&e.removeChild(t)}function di(t,e,r){var n,i,s,a={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?zr.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return Ar(t,a,n,i,null)}function Ar(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++fc,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(s),s}function ad(){return{current:null}}function qr(t){return t.children}function Nr(t,e){this.props=t,this.context=e}function zt(t,e){if(e==null)return t.__?zt(t.__,t.__i+1):null;for(var r;ee&&jt.sort(ci));Sn.__r=0}function wc(t,e,r,n,i,s,a,c,h,u,p){var f,v,S,C,N,M=n&&n.__k||_c,A=e.length;for(r.__d=h,cd(r,e,M),h=r.__d,f=0;f0?Ar(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,c=ld(i,r,a,p),i.__i=c,s=null,c!==-1&&(p--,(s=r[c])&&(s.__u|=131072)),s==null||s.__v===null?(c==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?f++:c>a?p>h-a?f+=c-a:f--:c(h!=null&&!(131072&h.__u)?1:0))for(;a>=0||c=0){if((h=e[a])&&!(131072&h.__u)&&i==h.key&&s===h.type)return a;a--}if(c2&&(c.children=arguments.length>3?zr.call(arguments,2):r),Ar(t.type,c,n||t.key,i||t.ref,null)}function fd(t,e){var r={__c:e="__cC"+mc++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(c){c.__e=!0,hi(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}zr=_c.slice,X={__e:function(t,e,r,n){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),a=i.__d),a)return i.__E=i}catch(c){t=c}throw t}},fc=0,pc=function(t){return t!=null&&t.constructor==null},Nr.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Mt({},this.state),typeof t=="function"&&(t=t(Mt({},r),this.props)),t&&Mt(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),hi(this))},Nr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),hi(this))},Nr.prototype.render=qr,jt=[],gc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ci=function(t,e){return t.__v.__b-e.__v.__b},Sn.__r=0,Mi=0,li=Ho(!1),ui=Ho(!0),mc=0;const pd=Object.freeze(Object.defineProperty({__proto__:null,Component:Nr,Fragment:qr,cloneElement:hd,createContext:fd,createElement:di,createRef:ad,h:di,hydrate:Cc,get isValidElement(){return pc},get options(){return X},render:kc,toChildArray:Ec},Symbol.toStringTag,{value:"Module"})),et=In(pd);var Un={},It,Z,Hs,Uo,hr=0,Mc=[],wn=[],ne=X,Vo=ne.__b,Wo=ne.__r,zo=ne.diffed,qo=ne.__c,Jo=ne.unmount,Go=ne.__;function Zt(t,e){ne.__h&&ne.__h(Z,t,hr||e),hr=0;var r=Z.__H||(Z.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:wn}),r.__[t]}function Rc(t){return hr=1,Ic(Nc,t)}function Ic(t,e,r){var n=Zt(It++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):Nc(void 0,e),function(c){var h=n.__N?n.__N[0]:n.__[0],u=n.t(h,c);h!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=Z,!Z.u)){var i=function(c,h,u){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(v){return!!v.__c});if(p.every(function(v){return!v.__N}))return!s||s.call(this,c,h,u);var f=!1;return p.forEach(function(v){if(v.__N){var S=v.__[0];v.__=v.__N,v.__N=void 0,S!==v.__[0]&&(f=!0)}}),!(!f&&n.__c.props===c)&&(!s||s.call(this,c,h,u))};Z.u=!0;var s=Z.shouldComponentUpdate,a=Z.componentWillUpdate;Z.componentWillUpdate=function(c,h,u){if(this.__e){var p=s;s=void 0,i(c,h,u),s=p}a&&a.call(this,c,h,u)},Z.shouldComponentUpdate=i}return n.__N||n.__}function gd(t,e){var r=Zt(It++,3);!ne.__s&&Ni(r.__H,e)&&(r.__=t,r.i=e,Z.__H.__h.push(r))}function Ac(t,e){var r=Zt(It++,4);!ne.__s&&Ni(r.__H,e)&&(r.__=t,r.i=e,Z.__h.push(r))}function md(t){return hr=5,Ai(function(){return{current:t}},[])}function _d(t,e,r){hr=6,Ac(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Ai(t,e){var r=Zt(It++,7);return Ni(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function vd(t,e){return hr=8,Ai(function(){return t},e)}function yd(t){var e=Z.context[t.__c],r=Zt(It++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Z)),e.props.value):t.__}function wd(t,e){ne.useDebugValue&&ne.useDebugValue(e?e(t):t)}function bd(t){var e=Zt(It++,10),r=Rc();return e.__=t,Z.componentDidCatch||(Z.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Ed(){var t=Zt(It++,11);if(!t.__){for(var e=Z.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function Sd(){for(var t;t=Mc.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(bn),t.__H.__h.forEach(pi),t.__H.__h=[]}catch(e){t.__H.__h=[],ne.__e(e,t.__v)}}ne.__b=function(t){Z=null,Vo&&Vo(t)},ne.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Go&&Go(t,e)},ne.__r=function(t){Wo&&Wo(t),It=0;var e=(Z=t.__c).__H;e&&(Hs===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=wn,r.__N=r.i=void 0})):(e.__h.forEach(bn),e.__h.forEach(pi),e.__h=[],It=0)),Hs=Z},ne.diffed=function(t){zo&&zo(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Mc.push(e)!==1&&Uo===ne.requestAnimationFrame||((Uo=ne.requestAnimationFrame)||kd)(Sd)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==wn&&(r.__=r.__V),r.i=void 0,r.__V=wn})),Hs=Z=null},ne.__c=function(t,e){e.some(function(r){try{r.__h.forEach(bn),r.__h=r.__h.filter(function(n){return!n.__||pi(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],ne.__e(n,r.__v)}}),qo&&qo(t,e)},ne.unmount=function(t){Jo&&Jo(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{bn(n)}catch(i){e=i}}),r.__H=void 0,e&&ne.__e(e,r.__v))};var Zo=typeof requestAnimationFrame=="function";function kd(t){var e,r=function(){clearTimeout(n),Zo&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Zo&&(e=requestAnimationFrame(r))}function bn(t){var e=Z,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Z=e}function pi(t){var e=Z;t.__c=t.__(),Z=e}function Ni(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Nc(t,e){return typeof e=="function"?e(t):e}const Cd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:vd,useContext:yd,useDebugValue:wd,useEffect:gd,useErrorBoundary:bd,useId:Ed,useImperativeHandle:_d,useLayoutEffect:Ac,useMemo:Ai,useReducer:Ic,useRef:md,useState:Rc},Symbol.toStringTag,{value:"Module"})),Vn=In(Cd);var fr={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CloseIcon=void 0;const Qo=et;function Md(t){return(0,Qo.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Qo.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Wn.CloseIcon=Md;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.CoinbaseWalletRound=void 0;const ln=et;function Rd(t){return(0,ln.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,ln.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,ln.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,ln.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}zn.CoinbaseWalletRound=Rd;var qn={};Object.defineProperty(qn,"__esModule",{value:!0});qn.QRCodeIcon=void 0;const Cr=et;function Id(t){return(0,Cr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,Cr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Cr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Cr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Cr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}qn.QRCodeIcon=Id;var Jn={};function xc(t){this.mode=nt.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}xc.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=bt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=re.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=re.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;s>>i&1)==1);var u=re.getMask(e,n,a-c);u&&(h=!h),this.modules[n][a-c]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};bt.PAD0=236;bt.PAD1=17;bt.createData=function(t,e,r){for(var n=wt.getRSBlocks(t,e),i=new Lc,s=0;sc*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(bt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(bt.PAD1,8);return bt.createBytes(i,n)};bt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),a=new Array(e.length),c=0;c=0?S.get(C):0}}for(var N=0,p=0;p=0;)e^=re.G15<=0;)e^=re.G18<>>=1;return e},getPatternPosition:function(t){return re.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case At.PATTERN000:return(e+r)%2==0;case At.PATTERN001:return e%2==0;case At.PATTERN010:return r%3==0;case At.PATTERN011:return(e+r)%3==0;case At.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case At.PATTERN101:return e*r%2+e*r%3==0;case At.PATTERN110:return(e*r%2+e*r%3)%2==0;case At.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new or([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return ze.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Je=0;Je<8;Je++)ze.EXP_TABLE[Je]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Us=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Tc(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Lt.L;case"M":return Lt.M;case"Q":return Lt.Q;case"H":return Lt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,u){for(var p=i(h),f=1,v=0,S=0,C=Us.length;S<=C;S++){var N=Us[S];if(!N)throw new Error("Content too long: expected "+v+" but got "+p);switch(u){case"L":v=N[0];break;case"M":v=N[1];break;case"Q":v=N[2];break;case"H":v=N[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(p<=v)break;f++}if(f>Us.length)throw new Error("Content too long");return f}function i(h){var u=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new bt(a,c),this.qrcode.addData(s),this.qrcode.make()}Tc.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r +`:"",a=e.width,c=e.height,h=r.length,u=a/(h+2*e.padding),p=c/(h+2*e.padding),f=typeof e.join<"u"?!!e.join:!1,v=typeof e.swap<"u"?!!e.swap:!1,S=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,C=typeof e.predefined<"u"?!!e.predefined:!1,N=C?i+''+s:"",M=i+''+s,A="",I="",R=0;R'+s:A+=i+''+s}}f&&(A=i+'');let U="";if(this.options.image!==void 0&&this.options.image.svg){const y=a*this.options.image.width/100,o=c*this.options.image.height/100,d=a/2-y/2,g=c/2-o/2;U+=``,U+=this.options.image.svg+s,U+=""}var Q="";switch(t.container){case"svg":S&&(Q+=''+s),Q+=''+s,Q+=N+M+A,Q+=U,Q+="";break;case"svg-viewbox":S&&(Q+=''+s),Q+=''+s,Q+=N+M+A,Q+=U,Q+="";break;case"g":Q+=''+s,Q+=N+M+A,Q+=U,Q+="";break;default:Q+=(N+M+A+U).replace(/^\s+/,"");break}return Q};var Ad=Tc,Nd=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.QRCode=void 0;const xd=et,Ko=Vn,Ld=Nd(Ad),Td=t=>{const[e,r]=(0,Ko.useState)("");return(0,Ko.useEffect)(()=>{var n,i;const s=new Ld.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),a=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,xd.h)("img",{src:e,alt:"QR Code"}):null};Jn.QRCode=Td;var Gn={},xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Pd=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Spinner=void 0;const un=et,Od=Pd(xi),$d=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,un.h)("div",{class:"-cbwsdk-spinner"},(0,un.h)("style",null,Od.default),(0,un.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,un.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Gn.Spinner=$d;var Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var Pc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.CoinbaseWalletSteps=fr.ConnectContent=void 0;const Wt=Pc($r),W=et,Bd=T,Fd=yr,jd=Wn,Dd=zn,Hd=qn,Ud=Jn,Vd=Gn,Wd=Pc(Li),Vs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Oc},zd=t=>t==="light"?"#FFFFFF":"#0A0B0D";function qd(t){const{theme:e}=t,r=(0,Bd.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=Vs.steps;return(0,W.h)("div",{"data-testid":"connect-content",className:(0,Wt.default)("-cbwsdk-connect-content",e)},(0,W.h)("style",null,Wd.default),(0,W.h)("div",{className:"-cbwsdk-connect-content-header"},(0,W.h)("h2",{className:(0,Wt.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,W.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,W.h)(jd.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,W.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,W.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,W.h)(Jd,{title:Vs.title,description:Vs.description,theme:e})),(0,W.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,W.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,W.h)(Ud.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,W.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Fd.LIB_VERSION}),(0,W.h)("input",{type:"hidden",value:r})),(0,W.h)(n,{theme:e}),!t.isConnected&&(0,W.h)("div",{"data-testid":"connecting-spinner",className:(0,Wt.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,W.h)(Vd.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,W.h)("p",null,"Connecting...")))))}fr.ConnectContent=qd;function Jd({title:t,description:e,theme:r}){return(0,W.h)("div",{className:(0,Wt.default)("-cbwsdk-connect-item",r)},(0,W.h)("div",null,(0,W.h)(Dd.CoinbaseWalletRound,null)),(0,W.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,W.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,W.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function Oc({theme:t}){return(0,W.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,W.h)("li",{className:(0,Wt.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,W.h)("li",{className:(0,Wt.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,W.h)("span",null,"Tap ",(0,W.h)("strong",null,"Scan")," "),(0,W.h)("span",{className:(0,Wt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,W.h)(Hd.QRCodeIcon,{fill:zd(t)})))))}fr.CoinbaseWalletSteps=Oc;var Zn={},Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ArrowLeftIcon=void 0;const Xo=et;function Gd(t){return(0,Xo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Xo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Qn.ArrowLeftIcon=Gd;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.LaptopIcon=void 0;const Ws=et;function Zd(t){return(0,Ws.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ws.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ws.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Kn.LaptopIcon=Zd;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.SafeIcon=void 0;const Yo=et;function Qd(t){return(0,Yo.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Yo.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Xn.SafeIcon=Qd;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var $c=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TryExtensionContent=void 0;const Ot=$c($r),Ue=et,zs=Vn,Kd=Qn,Xd=Kn,Yd=Xn,eh=$c(Ti);function th({theme:t}){const[e,r]=(0,zs.useState)(!1),n=(0,zs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,zs.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Ue.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension",t)},(0,Ue.h)("style",null,eh.default),(0,Ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ue.h)("h3",{class:(0,Ot.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Ue.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ue.h)("button",{class:(0,Ot.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Ue.h)("div",null,!e&&(0,Ue.h)(Kd.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ue.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ue.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ue.h)(Xd.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ue.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ue.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ue.h)(Yd.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ue.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Zn.TryExtensionContent=th;var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Bc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Un,"__esModule",{value:!0});Un.ConnectDialog=void 0;const qs=Bc($r),$t=et,Js=Vn,rh=fr,nh=Zn,sh=Bc(Pi),ih=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,Js.useState)(!e),[s,a]=(0,Js.useState)(!e);(0,Js.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!e)},10)];return e?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[e]);const c=r?"dark":"light";return(0,$t.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,$t.h)("style",null,sh.default),(0,$t.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,$t.h)("div",{class:"-cbwsdk-connect-dialog"},(0,$t.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,$t.h)(rh.ConnectContent,{theme:c,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,$t.h)(nh.TryExtensionContent,{theme:c}))))};Un.ConnectDialog=ih;Object.defineProperty(Dn,"__esModule",{value:!0});Dn.LinkFlow=void 0;const Gs=et,oh=Un;class ah{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,Gs.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Gs.render)((0,Gs.h)(oh.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}Dn.LinkFlow=ah;var Oi={},$i={};Object.defineProperty($i,"__esModule",{value:!0});$i.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=$&&$.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e($r),n=et,i=Vn,s=e($i),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(v){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=v.darkMode}attach(v){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",v.appendChild(this.root),this.render()}presentItem(v){const S=this.nextItemKey++;return this.items.set(S,v),this.render(),()=>{this.items.delete(S),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([v,S])=>(0,n.h)(t.SnackbarInstance,Object.assign({},S,{key:v}))))),this.root)}}t.Snackbar=h;const u=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=u;const p=({autoExpand:f,message:v,menuItems:S})=>{const[C,N]=(0,i.useState)(!0),[M,A]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const R=[window.setTimeout(()=>{N(!1)},1),window.setTimeout(()=>{A(!0)},1e4)];return()=>{R.forEach(window.clearTimeout)}});const I=()=>{A(!M)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",C&&"-cbwsdk-snackbar-instance-hidden",M&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:I},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},v),(0,n.h)("div",{class:"-gear-container"},!M&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),S&&S.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},S.map((R,j)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:R.onClick,key:j},(0,n.h)("svg",{width:R.svgWidth,height:R.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":R.defaultFillRule,"clip-rule":R.defaultClipRule,d:R.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},R.info)))))};t.SnackbarInstance=p})(Oi);Object.defineProperty(Vr,"__esModule",{value:!0});Vr.WalletLinkRelayUI=void 0;const ch=Wr,lh=Dn,uh=Oi;class dh{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new uh.Snackbar({darkMode:e.darkMode}),this.linkFlow=new lh.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,ch.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Vr.WalletLinkRelayUI=dh;Object.defineProperty(Ur,"__esModule",{value:!0});Ur.WalletLinkRelay=void 0;const tr=Br,hh=Ve,te=T,Bt=wr,ea=ct,Nt=br,fh=Bn,Ft=vr,ph=Vr;class Ct extends ea.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var c;this.isLinked=a;const h=this.storage.getItem(ea.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const u=h.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(u[0]!==""&&!a&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const f=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(Bt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:f})}}},this.metadataUpdated=(a,c)=>{this.storage.setItem(a,c)},this.chainUpdated=(a,c)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:a,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(a,c))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Ct.accountRequestCallbackIds.size>0&&(Array.from(Ct.accountRequestCallbackIds.values()).forEach(c=>{const h={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:c}))}),Ct.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const e=Nt.Session.load(this.storage)||new Nt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new fh.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:e});return i.connect(),{session:e,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;const n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(Bt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Nt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Bt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Nt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Bt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,te.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,te.hexStringFromBuffer)(e,!0),signature:(0,te.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,te.bigIntStringFromBN)(e.weiValue),data:(0,te.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,te.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,te.bigIntStringFromBN)(e.weiValue),data:(0,te.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,te.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,te.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,te.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,te.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,te.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,te.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,Ft.isErrorResponse)(h))return c(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof ph.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;const i={type:"WEB3_REQUEST",id:e,request:r},s=Nt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Bt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Nt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Bt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Nt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Bt.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ct.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Ct.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,tr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,te.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,Ft.isErrorResponse)(c))return a(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=tr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}Ct.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:"selectProvider",params:{providerOptions:e}},n=(0,te.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,Ft.isErrorResponse)(p))return c(new Error(p.errorMessage));a(p)});const h=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:hh.ProviderType.Unselected}})},u=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:h,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,a){const c={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const u=(0,te.randomBytesHex)(8),p=v=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,v),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const f=new Promise((v,S)=>{this.relayEventManager.callbacks.set(u,M=>{if(h==null||h(),(0,Ft.isErrorResponse)(M))return S(new Error(M.errorMessage));v(M)});const C=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},N=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:N,onCancel:C,type:e,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,c)});return{cancel:p,promise:f}}addEthereumChain(e,r,n,i,s,a){const c={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const u=(0,te.randomBytesHex)(8),p=v=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,v),h==null||h()};return this.ui.inlineAddEthereumChain(e)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((v,S)=>{this.relayEventManager.callbacks.set(u,M=>{if(h==null||h(),(0,Ft.isErrorResponse)(M))return S(new Error(M.errorMessage));v(M)});const C=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},N=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:M}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:C,onApprove:N,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,c)}),cancel:p}}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,te.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,h)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,Ft.isErrorResponse)(f)&&f.errorCode)return h(tr.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Ft.isErrorResponse)(f))return h(new Error(f.errorMessage));c(f)});const u=f=>{var v;if(f){const S=(v=(0,tr.getErrorCode)(f))!==null&&v!==void 0?v:tr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",f instanceof Error?f:tr.standardErrors.provider.unsupportedChain(e),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:f}}})};this.ui.switchEthereumChain({onCancel:u,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Nt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Ur.WalletLinkRelay=Ct;Ct.accountRequestCallbackIds=new Set;var Jr={},Yn={},Fc={};(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Oi,t)})(Fc);var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var jc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.RedirectDialog=void 0;const gh=jc($r),yt=et,mh=Wr,_h=Fc,vh=jc(Bi);class yh{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,mh.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,yt.render)(null,this.root),e&&(0,yt.render)((0,yt.h)(wh,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}Yn.RedirectDialog=yh;const wh=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,yt.h)(_h.SnackbarContainer,{darkMode:r},(0,yt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,yt.h)("style",null,vh.default),(0,yt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,yt.h)("div",{class:(0,gh.default)("-cbwsdk-redirect-dialog-box",s)},(0,yt.h)("p",null,t),(0,yt.h)("button",{onClick:n},e))))};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.MobileRelayUI=void 0;const bh=Yn;class Eh{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new bh.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Jr.MobileRelayUI=Eh;Object.defineProperty(Hr,"__esModule",{value:!0});Hr.MobileRelay=void 0;const Sh=T,kh=Ur,Ch=Jr;class Mh extends kh.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const e=(0,Sh.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof Ch.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}Hr.MobileRelay=Mh;const Rh=vu,Ih=xn;function Dc(t){return Buffer.allocUnsafe(t).fill(0)}function Hc(t,e,r){const n=Dc(e);return t=es(t),r?t.length"u")throw new Error("Not an array?");if(r=qc(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(vt(t,e[s]));if(r==="dynamic"){var a=vt("uint256",e.length);i.unshift(a)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([vt("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,qt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=ar(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return qt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=ar(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Dt(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=ar(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Dt(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=ta(t),n=Dt(e),n<0)throw new Error("Supplied ufixed is negative");return vt("uint256",n.mul(new Ut(2).pow(new Ut(r[1]))))}else if(t.startsWith("fixed"))return r=ta(t),vt("int256",Dt(e).mul(new Ut(2).pow(new Ut(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Th(t){return t==="string"||t==="bytes"||qc(t)==="dynamic"}function Ph(t){return t.lastIndexOf("]")===t.length-1}function Oh(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var a=zc(t[s]),c=e[s],h=vt(a,c);Th(a)?(r.push(vt("uint256",i)),n.push(h),i+=h.length):r.push(h)}return Buffer.concat(r.concat(n))}function Jc(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(qt.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=ar(a),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Dt(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=ar(a),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Dt(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function $h(t,e){return qt.keccak(Jc(t,e))}var Bh={rawEncode:Oh,solidityPack:Jc,soliditySHA3:$h};const ht=Wc,xr=Bh,Gc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Zs={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const a=(c,h,u)=>{if(r[h]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ht.keccak(this.encodeData(h,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${c} of type ${h}`);if(h==="bytes")return["bytes32",ht.keccak(u)];if(h==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ht.keccak(u)];if(h.lastIndexOf("]")===h.length-1){const p=h.slice(0,h.lastIndexOf("[")),f=u.map(v=>a(c,p,v));return["bytes32",ht.keccak(xr.rawEncode(f.map(([v])=>v),f.map(([,v])=>v)))]}return[h,u]};for(const c of r[t]){const[h,u]=a(c.name,c.type,e[c.name]);i.push(h),s.push(u)}}else for(const a of r[t]){let c=e[a.name];if(c!==void 0)if(a.type==="bytes")i.push("bytes32"),c=ht.keccak(c),s.push(c);else if(a.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=ht.keccak(c),s.push(c);else if(r[a.type]!==void 0)i.push("bytes32"),c=ht.keccak(this.encodeData(a.type,c,r,n)),s.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(c)}}return xr.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ht.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ht.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Gc.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ht.keccak(Buffer.concat(n))}};var Fh={TYPED_MESSAGE_SCHEMA:Gc,TypedDataUtils:Zs,hashForSignTypedDataLegacy:function(t){return jh(t.data)},hashForSignTypedData_v3:function(t){return Zs.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Zs.hash(t.data)}};function jh(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?ht.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return xr.soliditySHA3(["bytes32","bytes32"],[xr.soliditySHA3(new Array(t.length).fill("string"),i),xr.soliditySHA3(n,r)])}var pr={};Object.defineProperty(pr,"__esModule",{value:!0});pr.filterFromParam=pr.FilterPolyfill=void 0;const sr=Ve,Ke=T,Dh=5*60*1e3,Ht={jsonrpc:"2.0",id:0};class Hh{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,sr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){const r=Zc(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ke.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Ke.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Ke.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Ke.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Ke.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(dn())}async getFilterLogs(e){const r=(0,Ke.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getLogs",params:[ra(n)]})):dn()}makeFilterId(){return(0,sr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return dn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return hn();console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getLogs",params:[ra(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const c=a.result.map(u=>(0,Ke.intNumberFromHexString)(u.blockNumber||"0x0")),h=Math.max(...c);if(h&&h>n){const u=(0,sr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return a}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return dn();const n=await this.getCurrentBlockHeight();if(r>n)return hn();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Ke.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,sr.IntNumber)(a))))).filter(a=>!!a),s=(0,sr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Ht),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(hn())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},Dh);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_blockNumber",params:[]}));return(0,Ke.intNumberFromHexString)((0,Ke.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getBlockByNumber",params:[(0,Ke.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ke.ensureHexString)(r.result.hash):null}}pr.FilterPolyfill=Hh;function Zc(t){return{fromBlock:na(t.fromBlock),toBlock:na(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}pr.filterFromParam=Zc;function ra(t){const e={fromBlock:sa(t.fromBlock),toBlock:sa(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function na(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,sr.IntNumber)(0);if((0,Ke.isHexString)(t))return(0,Ke.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function sa(t){return t==="latest"?t:(0,Ke.hexStringFromIntNumber)(t)}function dn(){return Object.assign(Object.assign({},Ht),{error:{code:-32e3,message:"filter not found"}})}function hn(){return Object.assign(Object.assign({},Ht),{result:[]})}var ts={},Qc={},rs={},Fi=Uh;function Uh(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const ia=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(a,c){if(e.multiArgs){const h=new Array(arguments.length-1);for(let u=1;u{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):ia(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?ia(s,e):s}return n},Gr={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});const Wh=Xa;function oa(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function zh(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")oa(s,this,r);else{const a=s.length,c=zh(s);for(let h=0;ht+e,aa=["sync","latest"];class Kh extends Gh.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Zh,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){aa.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return aa.map(e=>this.listenerCount(e)).reduce(Qh)}_shouldUseNewBlock(e){const r=this._currentBlock;if(!r)return!0;const n=ca(e),i=ca(r);return this._usePastBlocks&&ni}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Gr.BaseBlockTracker=Kh;function ca(t){return Number.parseInt(t,16)}var Kc={},Xc={},Ge={};class Yc extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...a}=e,{path:c}=e,h=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Xh(t){return ut(t)&&typeof t[Symbol.iterator]=="function"}function ut(t){return typeof t=="object"&&t!=null}function la(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function We(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Yh(t){const{done:e,value:r}=t.next();return e?void 0:r}function ef(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:a}=r,{refinement:c,message:h=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${We(n)}\``}=t;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:s,...t,message:h}}function*gi(t,e,r,n){Xh(t)||(t=[t]);for(const i of t){const s=ef(i,e,r,n);s&&(yield s)}}function*ji(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:a=!1}=r,c={path:n,branch:i};if(s&&(t=e.coercer(t,c),a&&e.type!=="type"&&ut(e.schema)&&ut(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let h="valid";for(const u of e.validator(t,c))u.explanation=r.message,h="not_valid",yield[u,void 0];for(let[u,p,f]of e.entries(t,c)){const v=ji(p,f,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,p],coerce:s,mask:a,message:r.message});for(const S of v)S[0]?(h=S[0].refinement!=null?"not_refined":"not_valid",yield[S[0],void 0]):s&&(p=S[1],u===void 0?t=p:t instanceof Map?t.set(u,p):t instanceof Set?t.add(p):ut(t)&&(p!==void 0||u in t)&&(t[u]=p))}if(h!=="not_valid")for(const u of e.refiner(t,c))u.explanation=r.message,h="not_refined",yield[u,void 0];h==="valid"&&(yield[void 0,t])}class ie{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:c=function*(){}}=e;this.type=r,this.schema=n,this.entries=c,this.coercer=a,i?this.validator=(h,u)=>{const p=i(h,u);return gi(p,u,this,h)}:this.validator=()=>[],s?this.refiner=(h,u)=>{const p=s(h,u);return gi(p,u,this,h)}:this.refiner=()=>[]}assert(e,r){return el(e,this,r)}create(e,r){return tl(e,this,r)}is(e){return Di(e,this)}mask(e,r){return rl(e,this,r)}validate(e,r={}){return Er(e,this,r)}}function el(t,e,r){const n=Er(t,e,{message:r});if(n[0])throw n[0]}function tl(t,e,r){const n=Er(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function rl(t,e,r){const n=Er(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Di(t,e){return!Er(t,e)[0]}function Er(t,e,r={}){const n=ji(t,e,r),i=Yh(n);return i[0]?[new Yc(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function tf(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Kr(n):Qr(n)}function tt(t,e){return new ie({type:t,schema:null,validator:e})}function rf(t,e){return new ie({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function nf(t){return new ie({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function sf(t){let e;return new ie({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function of(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Kr(n);default:return Qr(n)}}function af(t){const e=t instanceof ie,r=e?{...t.schema}:{...t};for(const n in r)r[n]=nl(r[n]);return e&&t.type==="type"?Kr(r):Qr(r)}function cf(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];switch(t.type){case"type":return Kr(n);default:return Qr(n)}}function lf(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),tt(t,e)}function uf(){return tt("any",()=>!0)}function df(t){return new ie({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${We(e)}`}})}function hf(){return tt("bigint",t=>typeof t=="bigint")}function ff(){return tt("boolean",t=>typeof t=="boolean")}function pf(){return tt("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${We(t)}`)}function gf(t){const e={},r=t.map(n=>We(n)).join();for(const n of t)e[n]=n;return new ie({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${We(n)}`}})}function mf(){return tt("func",t=>typeof t=="function"||`Expected a function, but received: ${We(t)}`)}function _f(t){return tt("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${We(e)}`)}function vf(){return tt("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${We(t)}`)}function yf(t){return new ie({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function wf(t){const e=We(t),r=typeof t;return new ie({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${We(n)}`}})}function bf(t,e){return new ie({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${We(r)}`}})}function Hi(){return tt("never",()=>!1)}function Ef(t){return new ie({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Sf(){return tt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${We(t)}`)}function Qr(t){const e=t?Object.keys(t):[],r=Hi();return new ie({type:"object",schema:t||null,*entries(n){if(t&&ut(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return ut(n)||`Expected an object, but received: ${We(n)}`},coercer(n){return ut(n)?{...n}:n}})}function nl(t){return new ie({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function kf(t,e){return new ie({type:"record",schema:null,*entries(r){if(ut(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return ut(r)||`Expected an object, but received: ${We(r)}`}})}function Cf(){return tt("regexp",t=>t instanceof RegExp)}function Mf(t){return new ie({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${We(e)}`}})}function sl(){return tt("string",t=>typeof t=="string"||`Expected a string, but received: ${We(t)}`)}function Rf(t){const e=Hi();return new ie({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new ie({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...a]=ji(r,s,n),[c]=a;if(c[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${We(r)}`,...i]}})}function il(){return tt("unknown",()=>!0)}function Ui(t,e,r){return new ie({...t,coercer:(n,i)=>Di(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Af(t,e,r={}){return Ui(t,il(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&la(n)&&la(i)){const s={...n};let a=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],a=!0);if(a)return s}return n})}function Nf(t){return Ui(t,sl(),e=>e.trim())}function xf(t){return Qt(t,"empty",e=>{const r=ol(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function ol(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Lf(t,e,r={}){const{exclusive:n}=r;return Qt(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Pf(t){return Qt(t,"nonempty",e=>ol(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function Of(t,e){return Qt(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function $f(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Qt(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return e<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return e<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function Qt(t,e,r){return new ie({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),a=gi(s,i,t,n);for(const c of a)yield{...c,refinement:e}}})}const Bf=Object.freeze(Object.defineProperty({__proto__:null,Struct:ie,StructError:Yc,any:uf,array:df,assert:el,assign:tf,bigint:hf,boolean:ff,coerce:Ui,create:tl,date:pf,defaulted:Af,define:tt,deprecated:rf,dynamic:nf,empty:xf,enums:gf,func:mf,instance:_f,integer:vf,intersection:yf,is:Di,lazy:sf,literal:wf,map:bf,mask:rl,max:Lf,min:Tf,never:Hi,nonempty:Pf,nullable:Ef,number:Sf,object:Qr,omit:of,optional:nl,partial:af,pattern:Of,pick:cf,record:kf,refine:Qt,regexp:Cf,set:Mf,size:$f,string:sl,struct:lf,trimmed:Nf,tuple:Rf,type:Kr,union:If,unknown:il,validate:Er},Symbol.toStringTag,{value:"Module"})),Kt=In(Bf);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.assertExhaustive=Ge.assertStruct=Ge.assert=Ge.AssertionError=void 0;const Ff=Kt;function jf(t){return typeof t=="object"&&t!==null&&"message"in t}function Df(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function Hf(t){const e=jf(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function al(t,e){return Df(t)?new t({message:e}):t({message:e})}class Vi extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Ge.AssertionError=Vi;function Uf(t,e="Assertion failed.",r=Vi){if(!t)throw e instanceof Error?e:al(r,e)}Ge.assert=Uf;function Vf(t,e,r="Assertion failed",n=Vi){try{(0,Ff.assert)(t,e)}catch(i){throw al(n,`${r}: ${Hf(i)}.`)}}Ge.assertStruct=Vf;function Wf(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ge.assertExhaustive=Wf;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.base64=void 0;const zf=Kt,qf=Ge,Jf=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,qf.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):c=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,zf.pattern)(t,c)};Xr.base64=Jf;var z={},Yr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Kt,r=Ge;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=n;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function a(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=a;function c(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=c;function h(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=h})(Yr);Object.defineProperty(z,"__esModule",{value:!0});z.createDataView=z.concatBytes=z.valueToBytes=z.stringToBytes=z.numberToBytes=z.signedBigIntToBytes=z.bigIntToBytes=z.hexToBytes=z.bytesToString=z.bytesToNumber=z.bytesToSignedBigInt=z.bytesToBigInt=z.bytesToHex=z.assertIsBytes=z.isBytes=void 0;const st=Ge,mi=Yr,ua=48,da=58,ha=87;function Gf(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const Zf=Gf();function Wi(t){return t instanceof Uint8Array}z.isBytes=Wi;function Sr(t){(0,st.assert)(Wi(t),"Value must be a Uint8Array.")}z.assertIsBytes=Sr;function cl(t){if(Sr(t),t.length===0)return"0x";const e=Zf(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return ns(e)}z.bigIntToBytes=ul;function Yf(t,e){(0,st.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function e0(t,e){(0,st.assert)(typeof t=="bigint","Value must be a bigint."),(0,st.assert)(typeof e=="number","Byte length must be a number."),(0,st.assert)(e>0,"Byte length must be greater than 0."),(0,st.assert)(Yf(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}z.signedBigIntToBytes=e0;function dl(t){(0,st.assert)(typeof t=="number","Value must be a number."),(0,st.assert)(t>=0,"Value must be a non-negative number."),(0,st.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return ns(e)}z.numberToBytes=dl;function hl(t){return(0,st.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}z.stringToBytes=hl;function fl(t){if(typeof t=="bigint")return ul(t);if(typeof t=="number")return dl(t);if(typeof t=="string")return t.startsWith("0x")?ns(t):hl(t);if(Wi(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}z.valueToBytes=fl;function t0(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Xe(this,dt,"f").get(e)}has(e){return Xe(this,dt,"f").has(e)}keys(){return Xe(this,dt,"f").keys()}values(){return Xe(this,dt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}gr.FrozenMap=zi;class qi{constructor(e){mt.set(this,void 0),ml(this,mt,new Set(e),"f"),Object.freeze(this)}get size(){return Xe(this,mt,"f").size}[(mt=new WeakMap,Symbol.iterator)](){return Xe(this,mt,"f")[Symbol.iterator]()}entries(){return Xe(this,mt,"f").entries()}forEach(e,r){return Xe(this,mt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Xe(this,mt,"f").has(e)}keys(){return Xe(this,mt,"f").keys()}values(){return Xe(this,mt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}gr.FrozenSet=qi;Object.freeze(zi);Object.freeze(zi.prototype);Object.freeze(qi);Object.freeze(qi.prototype);var _l={};Object.defineProperty(_l,"__esModule",{value:!0});var vl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const e=Kt,r=Ge,n=()=>(0,e.define)("finite number",x=>(0,e.is)(x,(0,e.number)())&&Number.isFinite(x));t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),n(),(0,e.string)(),(0,e.array)((0,e.lazy)(()=>t.UnsafeJsonStruct)),(0,e.record)((0,e.string)(),(0,e.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,e.define)("Json",(x,P)=>{function q(Y,J){const U=[...J.validator(Y,P)];return U.length>0?U:!0}try{const Y=q(x,t.UnsafeJsonStruct);return Y!==!0?Y:q(JSON.parse(JSON.stringify(x)),t.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function i(x){return(0,e.is)(x,t.JsonStruct)}t.isValidJson=i;function s(x){(0,r.assertStruct)(x,t.JsonStruct,"Invalid JSON value");const P=JSON.stringify(x);return new TextEncoder().encode(P).byteLength}t.getJsonSize=s,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function a(x){return(0,e.is)(x,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=a;function c(x,P){(0,r.assertStruct)(x,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}t.assertIsJsonRpcNotification=c;function h(x){return(0,e.is)(x,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=h;function u(x,P){(0,r.assertStruct)(x,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}t.assertIsJsonRpcRequest=u,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function p(x){return(0,e.is)(x,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=p;function f(x,P){(0,r.assertStruct)(x,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}t.assertIsPendingJsonRpcResponse=f;function v(x){return(0,e.is)(x,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=v;function S(x,P){(0,r.assertStruct)(x,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}t.assertIsJsonRpcResponse=S;function C(x){return(0,e.is)(x,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function N(x,P){(0,r.assertStruct)(x,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}t.assertIsJsonRpcSuccess=N;function M(x){return(0,e.is)(x,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=M;function A(x,P){(0,r.assertStruct)(x,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}t.assertIsJsonRpcFailure=A;function I(x){return(0,e.is)(x,t.JsonRpcErrorStruct)}t.isJsonRpcError=I;function R(x,P){(0,r.assertStruct)(x,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}t.assertIsJsonRpcError=R;function j(x){const{permitEmptyString:P,permitFractions:q,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},x);return G=>!!(typeof G=="number"&&(q||Number.isInteger(G))||typeof G=="string"&&(P||G.length>0)||Y&&G===null)}t.getJsonRpcIdValidator=j})(vl);var yl={};Object.defineProperty(yl,"__esModule",{value:!0});var mr={},_i={exports:{}},Qs,pa;function f0(){if(pa)return Qs;pa=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;Qs=function(p,f){f=f||{};var v=typeof p;if(v==="string"&&p.length>0)return a(p);if(v==="number"&&isFinite(p))return f.long?h(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function a(p){if(p=String(p),!(p.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(f){var v=parseFloat(f[1]),S=(f[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return v*s;case"weeks":case"week":case"w":return v*i;case"days":case"day":case"d":return v*n;case"hours":case"hour":case"hrs":case"hr":case"h":return v*r;case"minutes":case"minute":case"mins":case"min":case"m":return v*e;case"seconds":case"second":case"secs":case"sec":case"s":return v*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function c(p){var f=Math.abs(p);return f>=n?Math.round(p/n)+"d":f>=r?Math.round(p/r)+"h":f>=e?Math.round(p/e)+"m":f>=t?Math.round(p/t)+"s":p+"ms"}function h(p){var f=Math.abs(p);return f>=n?u(p,f,n,"day"):f>=r?u(p,f,r,"hour"):f>=e?u(p,f,e,"minute"):f>=t?u(p,f,t,"second"):p+" ms"}function u(p,f,v,S){var C=f>=v*1.5;return Math.round(p/v)+" "+S+(C?"s":"")}return Qs}function p0(t){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=i,r.enabled=a,r.humanize=f0(),r.destroy=u,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let f=0;for(let v=0;v{if(P==="%%")return"%";j++;const Y=r.formatters[q];if(typeof Y=="function"){const J=M[j];P=Y.call(A,J),M.splice(j,1),j--}return P}),r.formatArgs.call(A,M),(A.log||r.log).apply(A,M)}return N.namespace=p,N.useColors=r.useColors(),N.color=r.selectColor(p),N.extend=n,N.destroy=r.destroy,Object.defineProperty(N,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(S!==r.namespaces&&(S=r.namespaces,C=r.enabled(p)),C),set:M=>{v=M}}),typeof r.init=="function"&&r.init(N),N}function n(p,f){const v=r(this.namespace+(typeof f>"u"?":":f)+p);return v.log=this.log,v}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let f;const v=(typeof p=="string"?p:"").split(/[\s,]+/),S=v.length;for(f=0;f"-"+f)].join(",");return r.enable(""),p}function a(p){if(p[p.length-1]==="*")return!0;let f,v;for(f=0,v=r.skips.length;f{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;u.splice(1,0,p,"color: inherit");let f=0,v=0;u[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(f++,S==="%c"&&(v=f))}),u.splice(v,0,p)}e.log=console.debug||console.log||(()=>{});function s(u){try{u?e.storage.setItem("debug",u):e.storage.removeItem("debug")}catch{}}function a(){let u;try{u=e.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=r.DEBUG),u}function c(){try{return localStorage}catch{}}t.exports=g0(e);const{formatters:h}=t.exports;h.j=function(u){try{return JSON.stringify(u)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(_i,_i.exports);var m0=_i.exports,_0=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mr,"__esModule",{value:!0});mr.createModuleLogger=mr.createProjectLogger=void 0;const v0=_0(m0),y0=(0,v0.default)("metamask");function w0(t){return y0.extend(t)}mr.createProjectLogger=w0;function b0(t,e){return t.extend(e)}mr.createModuleLogger=b0;var wl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function r(u){return u==null}t.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=n;const i=(u,p)=>Object.hasOwnProperty.call(u,p);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let p=u;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(u)===p}catch{return!1}}t.isPlainObject=s;function a(u){return u.charCodeAt(0)<=127}t.isASCII=a;function c(u){var p;return u.split("").reduce((v,S)=>a(S)?v+1:v+2,0)+((p=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}t.calculateStringSize=c;function h(u){return u.toString().length}t.calculateNumberSize=h})(wl);var St={};Object.defineProperty(St,"__esModule",{value:!0});St.hexToBigInt=St.hexToNumber=St.bigIntToHex=St.numberToHex=void 0;const cr=Ge,Pr=Yr,E0=t=>((0,cr.assert)(typeof t=="number","Value must be a number."),(0,cr.assert)(t>=0,"Value must be a non-negative number."),(0,cr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Pr.add0x)(t.toString(16)));St.numberToHex=E0;const S0=t=>((0,cr.assert)(typeof t=="bigint","Value must be a bigint."),(0,cr.assert)(t>=0,"Value must be a non-negative bigint."),(0,Pr.add0x)(t.toString(16)));St.bigIntToHex=S0;const k0=t=>{(0,Pr.assertIsHexString)(t);const e=parseInt(t,16);return(0,cr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};St.hexToNumber=k0;const C0=t=>((0,Pr.assertIsHexString)(t),BigInt((0,Pr.add0x)(t)));St.hexToBigInt=C0;var bl={};Object.defineProperty(bl,"__esModule",{value:!0});var El={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!e(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(El);var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});var kl={},vi={exports:{}};const M0="2.0.0",Cl=256,R0=Number.MAX_SAFE_INTEGER||9007199254740991,I0=16,A0=Cl-6,N0=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var os={MAX_LENGTH:Cl,MAX_SAFE_COMPONENT_LENGTH:I0,MAX_SAFE_BUILD_LENGTH:A0,MAX_SAFE_INTEGER:R0,RELEASE_TYPES:N0,SEMVER_SPEC_VERSION:M0,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ks={};const x0=typeof process=="object"&&Ks&&Ks.NODE_DEBUG&&/\bsemver\b/i.test(Ks.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var as=x0;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=os,s=as;e=t.exports={};const a=e.re=[],c=e.safeRe=[],h=e.src=[],u=e.t={};let p=0;const f="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",i],[f,n]],S=N=>{for(const[M,A]of v)N=N.split(`${M}*`).join(`${M}{0,${A}}`).split(`${M}+`).join(`${M}{1,${A}}`);return N},C=(N,M,A)=>{const I=S(M),R=p++;s(N,R,M),u[N]=R,h[R]=M,a[R]=new RegExp(M,A?"g":void 0),c[R]=new RegExp(I,A?"g":void 0)};C("NUMERICIDENTIFIER","0|[1-9]\\d*"),C("NUMERICIDENTIFIERLOOSE","\\d+"),C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),C("MAINVERSION",`(${h[u.NUMERICIDENTIFIER]})\\.(${h[u.NUMERICIDENTIFIER]})\\.(${h[u.NUMERICIDENTIFIER]})`),C("MAINVERSIONLOOSE",`(${h[u.NUMERICIDENTIFIERLOOSE]})\\.(${h[u.NUMERICIDENTIFIERLOOSE]})\\.(${h[u.NUMERICIDENTIFIERLOOSE]})`),C("PRERELEASEIDENTIFIER",`(?:${h[u.NUMERICIDENTIFIER]}|${h[u.NONNUMERICIDENTIFIER]})`),C("PRERELEASEIDENTIFIERLOOSE",`(?:${h[u.NUMERICIDENTIFIERLOOSE]}|${h[u.NONNUMERICIDENTIFIER]})`),C("PRERELEASE",`(?:-(${h[u.PRERELEASEIDENTIFIER]}(?:\\.${h[u.PRERELEASEIDENTIFIER]})*))`),C("PRERELEASELOOSE",`(?:-?(${h[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[u.PRERELEASEIDENTIFIERLOOSE]})*))`),C("BUILDIDENTIFIER",`${f}+`),C("BUILD",`(?:\\+(${h[u.BUILDIDENTIFIER]}(?:\\.${h[u.BUILDIDENTIFIER]})*))`),C("FULLPLAIN",`v?${h[u.MAINVERSION]}${h[u.PRERELEASE]}?${h[u.BUILD]}?`),C("FULL",`^${h[u.FULLPLAIN]}$`),C("LOOSEPLAIN",`[v=\\s]*${h[u.MAINVERSIONLOOSE]}${h[u.PRERELEASELOOSE]}?${h[u.BUILD]}?`),C("LOOSE",`^${h[u.LOOSEPLAIN]}$`),C("GTLT","((?:<|>)?=?)"),C("XRANGEIDENTIFIERLOOSE",`${h[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),C("XRANGEIDENTIFIER",`${h[u.NUMERICIDENTIFIER]}|x|X|\\*`),C("XRANGEPLAIN",`[v=\\s]*(${h[u.XRANGEIDENTIFIER]})(?:\\.(${h[u.XRANGEIDENTIFIER]})(?:\\.(${h[u.XRANGEIDENTIFIER]})(?:${h[u.PRERELEASE]})?${h[u.BUILD]}?)?)?`),C("XRANGEPLAINLOOSE",`[v=\\s]*(${h[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[u.XRANGEIDENTIFIERLOOSE]})(?:${h[u.PRERELEASELOOSE]})?${h[u.BUILD]}?)?)?`),C("XRANGE",`^${h[u.GTLT]}\\s*${h[u.XRANGEPLAIN]}$`),C("XRANGELOOSE",`^${h[u.GTLT]}\\s*${h[u.XRANGEPLAINLOOSE]}$`),C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),C("COERCE",`${h[u.COERCEPLAIN]}(?:$|[^\\d])`),C("COERCEFULL",h[u.COERCEPLAIN]+`(?:${h[u.PRERELEASE]})?(?:${h[u.BUILD]})?(?:$|[^\\d])`),C("COERCERTL",h[u.COERCE],!0),C("COERCERTLFULL",h[u.COERCEFULL],!0),C("LONETILDE","(?:~>?)"),C("TILDETRIM",`(\\s*)${h[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",C("TILDE",`^${h[u.LONETILDE]}${h[u.XRANGEPLAIN]}$`),C("TILDELOOSE",`^${h[u.LONETILDE]}${h[u.XRANGEPLAINLOOSE]}$`),C("LONECARET","(?:\\^)"),C("CARETTRIM",`(\\s*)${h[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",C("CARET",`^${h[u.LONECARET]}${h[u.XRANGEPLAIN]}$`),C("CARETLOOSE",`^${h[u.LONECARET]}${h[u.XRANGEPLAINLOOSE]}$`),C("COMPARATORLOOSE",`^${h[u.GTLT]}\\s*(${h[u.LOOSEPLAIN]})$|^$`),C("COMPARATOR",`^${h[u.GTLT]}\\s*(${h[u.FULLPLAIN]})$|^$`),C("COMPARATORTRIM",`(\\s*)${h[u.GTLT]}\\s*(${h[u.LOOSEPLAIN]}|${h[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",C("HYPHENRANGE",`^\\s*(${h[u.XRANGEPLAIN]})\\s+-\\s+(${h[u.XRANGEPLAIN]})\\s*$`),C("HYPHENRANGELOOSE",`^\\s*(${h[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[u.XRANGEPLAINLOOSE]})\\s*$`),C("STAR","(<|>)?=?\\s*\\*"),C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(vi,vi.exports);var en=vi.exports;const L0=Object.freeze({loose:!0}),T0=Object.freeze({}),P0=t=>t?typeof t!="object"?L0:t:T0;var Ji=P0;const ga=/^[0-9]+$/,Ml=(t,e)=>{const r=ga.test(t),n=ga.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tMl(e,t);var Rl={compareIdentifiers:Ml,rcompareIdentifiers:O0};const fn=as,{MAX_LENGTH:ma,MAX_SAFE_INTEGER:pn}=os,{safeRe:_a,t:va}=en,$0=Ji,{compareIdentifiers:rr}=Rl;let B0=class _t{constructor(e,r){if(r=$0(r),e instanceof _t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ma)throw new TypeError(`version is longer than ${ma} characters`);fn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?_a[va.LOOSE]:_a[va.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>pn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),rr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Ye=B0;const ya=Ye,F0=(t,e,r=!1)=>{if(t instanceof ya)return t;try{return new ya(t,e)}catch(n){if(!r)return null;throw n}};var kr=F0;const j0=kr,D0=(t,e)=>{const r=j0(t,e);return r?r.version:null};var H0=D0;const U0=kr,V0=(t,e)=>{const r=U0(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var W0=V0;const wa=Ye,z0=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new wa(t instanceof wa?t.version:t,r).inc(e,n,i).version}catch{return null}};var q0=z0;const ba=kr,J0=(t,e)=>{const r=ba(t,null,!0),n=ba(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,c=s?n:r,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h)return!c.patch&&!c.minor?"major":a.patch?"patch":a.minor?"minor":"major";const p=h?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var G0=J0;const Z0=Ye,Q0=(t,e)=>new Z0(t,e).major;var K0=Q0;const X0=Ye,Y0=(t,e)=>new X0(t,e).minor;var ep=Y0;const tp=Ye,rp=(t,e)=>new tp(t,e).patch;var np=rp;const sp=kr,ip=(t,e)=>{const r=sp(t,e);return r&&r.prerelease.length?r.prerelease:null};var op=ip;const Ea=Ye,ap=(t,e,r)=>new Ea(t,r).compare(new Ea(e,r));var ft=ap;const cp=ft,lp=(t,e,r)=>cp(e,t,r);var up=lp;const dp=ft,hp=(t,e)=>dp(t,e,!0);var fp=hp;const Sa=Ye,pp=(t,e,r)=>{const n=new Sa(t,r),i=new Sa(e,r);return n.compare(i)||n.compareBuild(i)};var Gi=pp;const gp=Gi,mp=(t,e)=>t.sort((r,n)=>gp(r,n,e));var _p=mp;const vp=Gi,yp=(t,e)=>t.sort((r,n)=>vp(n,r,e));var wp=yp;const bp=ft,Ep=(t,e,r)=>bp(t,e,r)>0;var cs=Ep;const Sp=ft,kp=(t,e,r)=>Sp(t,e,r)<0;var Zi=kp;const Cp=ft,Mp=(t,e,r)=>Cp(t,e,r)===0;var Il=Mp;const Rp=ft,Ip=(t,e,r)=>Rp(t,e,r)!==0;var Al=Ip;const Ap=ft,Np=(t,e,r)=>Ap(t,e,r)>=0;var Qi=Np;const xp=ft,Lp=(t,e,r)=>xp(t,e,r)<=0;var Ki=Lp;const Tp=Il,Pp=Al,Op=cs,$p=Qi,Bp=Zi,Fp=Ki,jp=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Tp(t,r,n);case"!=":return Pp(t,r,n);case">":return Op(t,r,n);case">=":return $p(t,r,n);case"<":return Bp(t,r,n);case"<=":return Fp(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Nl=jp;const Dp=Ye,Hp=kr,{safeRe:gn,t:mn}=en,Up=(t,e)=>{if(t instanceof Dp)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?gn[mn.COERCEFULL]:gn[mn.COERCE]);else{const h=e.includePrerelease?gn[mn.COERCERTLFULL]:gn[mn.COERCERTL];let u;for(;(u=h.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",c=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Hp(`${n}.${i}.${s}${a}${c}`,e)};var Vp=Up;class Wp{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}}var zp=Wp,Xs,ka;function pt(){if(ka)return Xs;ka=1;class t{constructor(o,d){if(d=n(d),o instanceof t)return o.loose===!!d.loose&&o.includePrerelease===!!d.includePrerelease?o:new t(o.raw,d);if(o instanceof i)return this.raw=o.value,this.set=[[o]],this.format(),this;if(this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease,this.raw=o.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(m=>!C(m[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const m of this.set)if(m.length===1&&N(m[0])){this.set=[m];break}}}this.format()}format(){return this.range=this.set.map(o=>o.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(o){const g=((this.options.includePrerelease&&v)|(this.options.loose&&S))+":"+o,m=r.get(g);if(m)return m;const w=this.options.loose,E=w?c[h.HYPHENRANGELOOSE]:c[h.HYPHENRANGE];o=o.replace(E,U(this.options.includePrerelease)),s("hyphen replace",o),o=o.replace(c[h.COMPARATORTRIM],u),s("comparator trim",o),o=o.replace(c[h.TILDETRIM],p),s("tilde trim",o),o=o.replace(c[h.CARETTRIM],f),s("caret trim",o);let k=o.split(" ").map(L=>A(L,this.options)).join(" ").split(/\s+/).map(L=>G(L,this.options));w&&(k=k.filter(L=>(s("loose invalid filter",L,this.options),!!L.match(c[h.COMPARATORLOOSE])))),s("range list",k);const _=new Map,l=k.map(L=>new i(L,this.options));for(const L of l){if(C(L))return[L];_.set(L.value,L)}_.size>1&&_.has("")&&_.delete("");const b=[..._.values()];return r.set(g,b),b}intersects(o,d){if(!(o instanceof t))throw new TypeError("a Range is required");return this.set.some(g=>M(g,d)&&o.set.some(m=>M(m,d)&&g.every(w=>m.every(E=>w.intersects(E,d)))))}test(o){if(!o)return!1;if(typeof o=="string")try{o=new a(o,this.options)}catch{return!1}for(let d=0;dy.value==="<0.0.0-0",N=y=>y.value==="",M=(y,o)=>{let d=!0;const g=y.slice();let m=g.pop();for(;d&&g.length;)d=g.every(w=>m.intersects(w,o)),m=g.pop();return d},A=(y,o)=>(s("comp",y,o),y=x(y,o),s("caret",y),y=R(y,o),s("tildes",y),y=q(y,o),s("xrange",y),y=J(y,o),s("stars",y),y),I=y=>!y||y.toLowerCase()==="x"||y==="*",R=(y,o)=>y.trim().split(/\s+/).map(d=>j(d,o)).join(" "),j=(y,o)=>{const d=o.loose?c[h.TILDELOOSE]:c[h.TILDE];return y.replace(d,(g,m,w,E,k)=>{s("tilde",y,g,m,w,E,k);let _;return I(m)?_="":I(w)?_=`>=${m}.0.0 <${+m+1}.0.0-0`:I(E)?_=`>=${m}.${w}.0 <${m}.${+w+1}.0-0`:k?(s("replaceTilde pr",k),_=`>=${m}.${w}.${E}-${k} <${m}.${+w+1}.0-0`):_=`>=${m}.${w}.${E} <${m}.${+w+1}.0-0`,s("tilde return",_),_})},x=(y,o)=>y.trim().split(/\s+/).map(d=>P(d,o)).join(" "),P=(y,o)=>{s("caret",y,o);const d=o.loose?c[h.CARETLOOSE]:c[h.CARET],g=o.includePrerelease?"-0":"";return y.replace(d,(m,w,E,k,_)=>{s("caret",y,m,w,E,k,_);let l;return I(w)?l="":I(E)?l=`>=${w}.0.0${g} <${+w+1}.0.0-0`:I(k)?w==="0"?l=`>=${w}.${E}.0${g} <${w}.${+E+1}.0-0`:l=`>=${w}.${E}.0${g} <${+w+1}.0.0-0`:_?(s("replaceCaret pr",_),w==="0"?E==="0"?l=`>=${w}.${E}.${k}-${_} <${w}.${E}.${+k+1}-0`:l=`>=${w}.${E}.${k}-${_} <${w}.${+E+1}.0-0`:l=`>=${w}.${E}.${k}-${_} <${+w+1}.0.0-0`):(s("no pr"),w==="0"?E==="0"?l=`>=${w}.${E}.${k}${g} <${w}.${E}.${+k+1}-0`:l=`>=${w}.${E}.${k}${g} <${w}.${+E+1}.0-0`:l=`>=${w}.${E}.${k} <${+w+1}.0.0-0`),s("caret return",l),l})},q=(y,o)=>(s("replaceXRanges",y,o),y.split(/\s+/).map(d=>Y(d,o)).join(" ")),Y=(y,o)=>{y=y.trim();const d=o.loose?c[h.XRANGELOOSE]:c[h.XRANGE];return y.replace(d,(g,m,w,E,k,_)=>{s("xRange",y,g,m,w,E,k,_);const l=I(w),b=l||I(E),L=b||I(k),O=L;return m==="="&&O&&(m=""),_=o.includePrerelease?"-0":"",l?m===">"||m==="<"?g="<0.0.0-0":g="*":m&&O?(b&&(E=0),k=0,m===">"?(m=">=",b?(w=+w+1,E=0,k=0):(E=+E+1,k=0)):m==="<="&&(m="<",b?w=+w+1:E=+E+1),m==="<"&&(_="-0"),g=`${m+w}.${E}.${k}${_}`):b?g=`>=${w}.0.0${_} <${+w+1}.0.0-0`:L&&(g=`>=${w}.${E}.0${_} <${w}.${+E+1}.0-0`),s("xRange return",g),g})},J=(y,o)=>(s("replaceStars",y,o),y.trim().replace(c[h.STAR],"")),G=(y,o)=>(s("replaceGTE0",y,o),y.trim().replace(c[o.includePrerelease?h.GTE0PRE:h.GTE0],"")),U=y=>(o,d,g,m,w,E,k,_,l,b,L,O)=>(I(g)?d="":I(m)?d=`>=${g}.0.0${y?"-0":""}`:I(w)?d=`>=${g}.${m}.0${y?"-0":""}`:E?d=`>=${d}`:d=`>=${d}${y?"-0":""}`,I(l)?_="":I(b)?_=`<${+l+1}.0.0-0`:I(L)?_=`<${l}.${+b+1}.0-0`:O?_=`<=${l}.${b}.${L}-${O}`:y?_=`<${l}.${b}.${+L+1}-0`:_=`<=${_}`,`${d} ${_}`.trim()),Q=(y,o,d)=>{for(let g=0;g0){const m=y[g].semver;if(m.major===o.major&&m.minor===o.minor&&m.patch===o.patch)return!0}return!1}return!0};return Xs}var Ys,Ca;function ls(){if(Ca)return Ys;Ca=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(p,f){if(f=r(f),p instanceof e){if(p.loose===!!f.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),a("comparator",p,f),this.options=f,this.loose=!!f.loose,this.parse(p),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(p){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],v=p.match(f);if(!v)throw new TypeError(`Invalid comparator: ${p}`);this.operator=v[1]!==void 0?v[1]:"",this.operator==="="&&(this.operator=""),v[2]?this.semver=new c(v[2],this.options.loose):this.semver=t}toString(){return this.value}test(p){if(a("Comparator.test",p,this.options.loose),this.semver===t||p===t)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,f){if(!(p instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(p.value,f).test(this.value):p.operator===""?p.value===""?!0:new h(this.value,f).test(p.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,f)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,f)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}Ys=e;const r=Ji,{safeRe:n,t:i}=en,s=Nl,a=as,c=Ye,h=pt();return Ys}const qp=pt(),Jp=(t,e,r)=>{try{e=new qp(e,r)}catch{return!1}return e.test(t)};var us=Jp;const Gp=pt(),Zp=(t,e)=>new Gp(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Qp=Zp;const Kp=Ye,Xp=pt(),Yp=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Xp(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new Kp(n,r))}),n};var e1=Yp;const t1=Ye,r1=pt(),n1=(t,e,r)=>{let n=null,i=null,s=null;try{s=new r1(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new t1(n,r))}),n};var s1=n1;const ei=Ye,i1=pt(),Ma=cs,o1=(t,e)=>{t=new i1(t,e);let r=new ei("0.0.0");if(t.test(r)||(r=new ei("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const c=new ei(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Ma(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Ma(r,s))&&(r=s)}return r&&t.test(r)?r:null};var a1=o1;const c1=pt(),l1=(t,e)=>{try{return new c1(t,e).range||"*"}catch{return null}};var u1=l1;const d1=Ye,xl=ls(),{ANY:h1}=xl,f1=pt(),p1=us,Ra=cs,Ia=Zi,g1=Ki,m1=Qi,_1=(t,e,r,n)=>{t=new d1(t,n),e=new f1(e,n);let i,s,a,c,h;switch(r){case">":i=Ra,s=g1,a=Ia,c=">",h=">=";break;case"<":i=Ia,s=m1,a=Ra,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(p1(t,e,n))return!1;for(let u=0;u{S.semver===h1&&(S=new xl(">=0.0.0")),f=f||S,v=v||S,i(S.semver,f.semver,n)?f=S:a(S.semver,v.semver,n)&&(v=S)}),f.operator===c||f.operator===h||(!v.operator||v.operator===c)&&s(t,v.semver))return!1;if(v.operator===h&&a(t,v.semver))return!1}return!0};var Xi=_1;const v1=Xi,y1=(t,e,r)=>v1(t,e,">",r);var w1=y1;const b1=Xi,E1=(t,e,r)=>b1(t,e,"<",r);var S1=E1;const Aa=pt(),k1=(t,e,r)=>(t=new Aa(t,r),e=new Aa(e,r),t.intersects(e,r));var C1=k1;const M1=us,R1=ft;var I1=(t,e,r)=>{const n=[];let i=null,s=null;const a=t.sort((p,f)=>R1(p,f,r));for(const p of a)M1(p,e,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[p,f]of n)p===f?c.push(p):!f&&p===a[0]?c.push("*"):f?p===a[0]?c.push(`<=${f}`):c.push(`${p} - ${f}`):c.push(`>=${p}`);const h=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return h.length{if(t===e)return!0;t=new Na(t,r),e=new Na(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const a=x1(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},N1=[new Yi(">=0.0.0-0")],xa=[new Yi(">=0.0.0")],x1=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===ti){if(e.length===1&&e[0].semver===ti)return!0;r.includePrerelease?t=N1:t=xa}if(e.length===1&&e[0].semver===ti){if(r.includePrerelease)return!0;e=xa}const n=new Set;let i,s;for(const S of t)S.operator===">"||S.operator===">="?i=La(i,S,r):S.operator==="<"||S.operator==="<="?s=Ta(s,S,r):n.add(S.semver);if(n.size>1)return null;let a;if(i&&s){if(a=eo(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const S of n){if(i&&!Mr(S,String(i),r)||s&&!Mr(S,String(s),r))return null;for(const C of e)if(!Mr(S,String(C),r))return!1;return!0}let c,h,u,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,v=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const S of e){if(p=p||S.operator===">"||S.operator===">=",u=u||S.operator==="<"||S.operator==="<=",i){if(v&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===v.major&&S.semver.minor===v.minor&&S.semver.patch===v.patch&&(v=!1),S.operator===">"||S.operator===">="){if(c=La(i,S,r),c===S&&c!==i)return!1}else if(i.operator===">="&&!Mr(i.semver,String(S),r))return!1}if(s){if(f&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===f.major&&S.semver.minor===f.minor&&S.semver.patch===f.patch&&(f=!1),S.operator==="<"||S.operator==="<="){if(h=Ta(s,S,r),h===S&&h!==s)return!1}else if(s.operator==="<="&&!Mr(s.semver,String(S),r))return!1}if(!S.operator&&(s||i)&&a!==0)return!1}return!(i&&u&&!s&&a!==0||s&&p&&!i&&a!==0||v||f)},La=(t,e,r)=>{if(!t)return e;const n=eo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ta=(t,e,r)=>{if(!t)return e;const n=eo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var L1=A1;const ri=en,Pa=os,T1=Ye,Oa=Rl,P1=kr,O1=H0,$1=W0,B1=q0,F1=G0,j1=K0,D1=ep,H1=np,U1=op,V1=ft,W1=up,z1=fp,q1=Gi,J1=_p,G1=wp,Z1=cs,Q1=Zi,K1=Il,X1=Al,Y1=Qi,eg=Ki,tg=Nl,rg=Vp,ng=ls(),sg=pt(),ig=us,og=Qp,ag=e1,cg=s1,lg=a1,ug=u1,dg=Xi,hg=w1,fg=S1,pg=C1,gg=I1,mg=L1;var _g={parse:P1,valid:O1,clean:$1,inc:B1,diff:F1,major:j1,minor:D1,patch:H1,prerelease:U1,compare:V1,rcompare:W1,compareLoose:z1,compareBuild:q1,sort:J1,rsort:G1,gt:Z1,lt:Q1,eq:K1,neq:X1,gte:Y1,lte:eg,cmp:tg,coerce:rg,Comparator:ng,Range:sg,satisfies:ig,toComparators:og,maxSatisfying:ag,minSatisfying:cg,minVersion:lg,validRange:ug,outside:dg,gtr:hg,ltr:fg,intersects:pg,simplifyRange:gg,subset:mg,SemVer:T1,re:ri.re,src:ri.src,tokens:ri.t,SEMVER_SPEC_VERSION:Pa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Pa.RELEASE_TYPES,compareIdentifiers:Oa.compareIdentifiers,rcompareIdentifiers:Oa.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=_g,r=Kt,n=Ge;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,e.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,e.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,t.VersionStruct)}t.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,t.VersionRangeStruct)}t.isValidSemVerRange=s;function a(f){(0,n.assertStruct)(f,t.VersionStruct)}t.assertIsSemVerVersion=a;function c(f){(0,n.assertStruct)(f,t.VersionRangeStruct)}t.assertIsSemVerRange=c;function h(f,v){return(0,e.gt)(f,v)}t.gtVersion=h;function u(f,v){return(0,e.gtr)(f,v)}t.gtRange=u;function p(f,v){return(0,e.satisfies)(f,v,{includePrerelease:!0})}t.satisfiesVersionRange=p})(kl);(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ge,t),r(Xr,t),r(z,t),r(ss,t),r(Et,t),r(gr,t),r(_l,t),r(Yr,t),r(vl,t),r(yl,t),r(mr,t),r(wl,t),r(St,t),r(bl,t),r(El,t),r(Sl,t),r(kl,t)})(Xc);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Xc;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Kc);var Ll=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rs,"__esModule",{value:!0});rs.PollingBlockTracker=void 0;const vg=Ll(Fi),yg=Ll(Vh),wg=Gr,$a=Kc,Ba=(0,$a.createModuleLogger)($a.projectLogger,"polling-block-tracker"),bg=(0,vg.default)(),Eg=1e3;class Sg extends wg.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*Eg,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Fa(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Fa(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:bg(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Ba("Making request",e);const r=await(0,yg.default)(n=>this._provider.sendAsync(e,n))();if(Ba("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}rs.PollingBlockTracker=Sg;function Fa(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var ds={},kg=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ds,"__esModule",{value:!0});ds.SubscribeBlockTracker=void 0;const Cg=kg(Fi),Mg=Gr,Rg=(0,Cg.default)();class Ig extends Mg.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:Rg(),method:e,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ds.SubscribeBlockTracker=Ig;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(rs,t),r(ds,t)})(Qc);var to={},hs={},tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.getUniqueId=void 0;const Tl=4294967295;let ni=Math.floor(Math.random()*Tl);function Ag(){return ni=(ni+1)%Tl,ni}tn.getUniqueId=Ag;Object.defineProperty(hs,"__esModule",{value:!0});hs.createIdRemapMiddleware=void 0;const Ng=tn;function xg(){return(t,e,r,n)=>{const i=t.id,s=Ng.getUniqueId();t.id=s,e.id=s,r(a=>{t.id=i,e.id=i,a()})}}hs.createIdRemapMiddleware=xg;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.createAsyncMiddleware=void 0;function Lg(t){return async(e,r,n,i)=>{let s;const a=new Promise(p=>{s=p});let c=null,h=!1;const u=async()=>{h=!0,n(p=>{c=p,s()}),await a};try{await t(e,r,u),h?(await a,c(null)):i(null)}catch(p){c?c(p):i(p)}}}fs.createAsyncMiddleware=Lg;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.createScaffoldMiddleware=void 0;function Tg(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}ps.createScaffoldMiddleware=Tg;var rn={},ro={};Object.defineProperty(ro,"__esModule",{value:!0});const Pg=Xa;function ja(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Og(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")ja(s,this,r);else{const a=s.length,c=Og(s);for(let h=0;h"u"&&(n=$l()),yi(t,"",0,[],void 0,0,n);var i;try{Vt.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Fl(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Jt.length!==0;){var s=Jt.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function lr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),Jt.push([n,r,e,i])):Vt.push([e,r,t]):(n[r]=t,Jt.push([n,r,e]))}function yi(t,e,r,n,i,s,a){s+=1;var c;if(typeof t=="object"&&t!==null){for(c=0;ca.depthLimit){lr(kn,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){lr(kn,t,e,i);return}if(n.push(t),Array.isArray(t))for(c=0;ce?1:0}function Bl(t,e,r,n){typeof n>"u"&&(n=$l());var i=wi(t,"",0,[],void 0,0,n)||t,s;try{Vt.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Fl(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Jt.length!==0;){var a=Jt.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function wi(t,e,r,n,i,s,a){s+=1;var c;if(typeof t=="object"&&t!==null){for(c=0;ca.depthLimit){lr(kn,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){lr(kn,t,e,i);return}if(n.push(t),Array.isArray(t))for(c=0;c0)for(var n=0;n=1e3&&t<=4999}function Ug(t,e){if(e!=="[Circular]")return e}var no={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.errorValues=Pt.errorCodes=void 0;Pt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Pt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Pt,r=Tt,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(v,S=i){if(Number.isInteger(v)){const C=v.toString();if(f(e.errorValues,C))return e.errorValues[C].message;if(u(v))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return S}t.getMessageFromCode=a;function c(v){if(!Number.isInteger(v))return!1;const S=v.toString();return!!(e.errorValues[S]||u(v))}t.isValidCode=c;function h(v,{fallbackError:S=s,shouldIncludeStack:C=!1}={}){var N,M;if(!S||!Number.isInteger(S.code)||typeof S.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(v instanceof r.EthereumRpcError)return v.serialize();const A={};if(v&&typeof v=="object"&&!Array.isArray(v)&&f(v,"code")&&c(v.code)){const R=v;A.code=R.code,R.message&&typeof R.message=="string"?(A.message=R.message,f(R,"data")&&(A.data=R.data)):(A.message=a(A.code),A.data={originalError:p(v)})}else{A.code=S.code;const R=(N=v)===null||N===void 0?void 0:N.message;A.message=R&&typeof R=="string"?R:S.message,A.data={originalError:p(v)}}const I=(M=v)===null||M===void 0?void 0:M.stack;return C&&v&&I&&typeof I=="string"&&(A.stack=I),A}t.serializeError=h;function u(v){return v>=-32099&&v<=-32e3}function p(v){return v&&typeof v=="object"&&!Array.isArray(v)?Object.assign({},v):v}function f(v,S){return Object.prototype.hasOwnProperty.call(v,S)}})(no);var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.ethErrors=void 0;const so=Tt,Dl=no,Qe=Pt;gs.ethErrors={rpc:{parse:t=>ot(Qe.errorCodes.rpc.parse,t),invalidRequest:t=>ot(Qe.errorCodes.rpc.invalidRequest,t),invalidParams:t=>ot(Qe.errorCodes.rpc.invalidParams,t),methodNotFound:t=>ot(Qe.errorCodes.rpc.methodNotFound,t),internal:t=>ot(Qe.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ot(e,t)},invalidInput:t=>ot(Qe.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>ot(Qe.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>ot(Qe.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>ot(Qe.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>ot(Qe.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>ot(Qe.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Rr(Qe.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Rr(Qe.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Rr(Qe.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Rr(Qe.errorCodes.provider.disconnected,t),chainDisconnected:t=>Rr(Qe.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new so.EthereumProviderError(e,r,n)}}};function ot(t,e){const[r,n]=Hl(e);return new so.EthereumRpcError(t,r||Dl.getMessageFromCode(t),n)}function Rr(t,e){const[r,n]=Hl(e);return new so.EthereumProviderError(t,r||Dl.getMessageFromCode(t),n)}function Hl(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Tt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=no;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=gs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Pt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Pl);var Vg=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rn,"__esModule",{value:!0});rn.JsonRpcEngine=void 0;const Wg=Vg(ro),at=Pl;class kt extends Wg.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,a,c]=await kt._runAllMiddleware(e,r,this._middleware);return a?(await kt._runReturnHandlers(c),i(s)):n(async h=>{try{await kt._runReturnHandlers(c)}catch(u){return h(u)}return h()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const a=new at.EthereumRpcError(at.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof e.method!="string"){const a=new at.EthereumRpcError(at.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(a,{id:e.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=at.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await kt._runAllMiddleware(e,r,this._middleware);if(kt._checkForCompletion(e,r,i),await kt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,a=!1;for(const c of n)if([s,a]=await kt._runMiddleware(e,r,c,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const a=h=>{const u=h||r.error;u&&(r.error=at.serializeError(u)),s([u,!0])},c=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new at.EthereumRpcError(at.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request: +${si(e)}`,{request:e})),i.push(h)),s([null,!1]))};try{n(e,r,c,a)}catch(h){a(h)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new at.EthereumRpcError(at.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${si(e)}`,{request:e});if(!n)throw new at.EthereumRpcError(at.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${si(e)}`,{request:e})}}rn.JsonRpcEngine=kt;function si(t){return JSON.stringify(t,null,2)}var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.mergeMiddleware=void 0;const zg=rn;function qg(t){const e=new zg.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}ms.mergeMiddleware=qg;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(hs,t),r(fs,t),r(ps,t),r(tn,t),r(rn,t),r(ms,t)})(to);var Ul={},io={},bi=function(t,e){return bi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},bi(t,e)};function Vl(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");bi(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Cn=function(){return Cn=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;c--)(a=t[c])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function ql(t,e){return function(r,n){e(r,n,t)}}function Jg(t,e,r,n,i,s){function a(A){if(A!==void 0&&typeof A!="function")throw new TypeError("Function expected");return A}for(var c=n.kind,h=c==="getter"?"get":c==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f,v=!1,S=r.length-1;S>=0;S--){var C={};for(var N in n)C[N]=N==="access"?{}:n[N];for(var N in n.access)C.access[N]=n.access[N];C.addInitializer=function(A){if(v)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(A||null))};var M=(0,r[S])(c==="accessor"?{get:p.get,set:p.set}:p[h],C);if(c==="accessor"){if(M===void 0)continue;if(M===null||typeof M!="object")throw new TypeError("Object expected");(f=a(M.get))&&(p.get=f),(f=a(M.set))&&(p.set=f),(f=a(M.init))&&i.unshift(f)}else(f=a(M))&&(c==="field"?i.unshift(f):p[h]=f)}u&&Object.defineProperty(u,n.name,p),v=!0}function Gg(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function Kl(){for(var t=[],e=0;e1||c(v,S)})})}function c(v,S){try{h(n[v](S))}catch(C){f(s[0][3],C)}}function h(v){v.value instanceof _r?Promise.resolve(v.value.v).then(u,p):f(s[0][2],v)}function u(v){c("next",v)}function p(v){c("throw",v)}function f(v,S){v(S),s.shift(),s.length&&c(s[0][0],s[0][1])}}function tu(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(a){return(r=!r)?{value:_r(t[i](a)),done:!1}:s?s(a):a}:s}}function ru(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Mn=="function"?Mn(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(c,h){a=t[s](a),i(c,h,a.done,a.value)})}}function i(s,a,c,h){Promise.resolve(h).then(function(u){s({value:u,done:c})},a)}}function nu(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Kg=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function su(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_s(e,t,r);return Kg(e,t),e}function iu(t){return t&&t.__esModule?t:{default:t}}function ou(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function au(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function cu(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function lu(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Xg=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function uu(t){function e(n){t.error=t.hasError?new Xg(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const Yg={__extends:Vl,__assign:Cn,__rest:Wl,__decorate:zl,__param:ql,__metadata:Jl,__awaiter:Gl,__generator:Zl,__createBinding:_s,__exportStar:Ql,__values:Mn,__read:oo,__spread:Kl,__spreadArrays:Xl,__spreadArray:Yl,__await:_r,__asyncGenerator:eu,__asyncDelegator:tu,__asyncValues:ru,__makeTemplateObject:nu,__importStar:su,__importDefault:iu,__classPrivateFieldGet:ou,__classPrivateFieldSet:au,__classPrivateFieldIn:cu,__addDisposableResource:lu,__disposeResources:uu},em=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:lu,get __assign(){return Cn},__asyncDelegator:tu,__asyncGenerator:eu,__asyncValues:ru,__await:_r,__awaiter:Gl,__classPrivateFieldGet:ou,__classPrivateFieldIn:cu,__classPrivateFieldSet:au,__createBinding:_s,__decorate:zl,__disposeResources:uu,__esDecorate:Jg,__exportStar:Ql,__extends:Vl,__generator:Zl,__importDefault:iu,__importStar:su,__makeTemplateObject:nu,__metadata:Jl,__param:ql,__propKey:Zg,__read:oo,__rest:Wl,__runInitializers:Gg,__setFunctionName:Qg,__spread:Kl,__spreadArray:Yl,__spreadArrays:Xl,__values:Mn,default:Yg},Symbol.toStringTag,{value:"Module"})),ao=In(em);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});var Da=ao,tm=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Da.__awaiter(this,void 0,void 0,function(){var r,n,i;return Da.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();vs.default=tm;Object.defineProperty(io,"__esModule",{value:!0});var Ha=ao,rm=vs,nm=function(){function t(){this._semaphore=new rm.default(1)}return t.prototype.acquire=function(){return Ha.__awaiter(this,void 0,void 0,function(){var e,r;return Ha.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();io.default=nm;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.withTimeout=void 0;var _n=ao;function sm(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return _n.__awaiter(n,void 0,void 0,function(){var a,c,h;return _n.__generator(this,function(u){switch(u.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},e),[4,t.acquire()];case 1:return c=u.sent(),a?(h=Array.isArray(c)?c[1]:c,h()):i(c),[2]}})})})},runExclusive:function(i){return _n.__awaiter(this,void 0,void 0,function(){var s,a;return _n.__generator(this,function(c){switch(c.label){case 0:s=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=c.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,c.sent()];case 4:return s=a,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}ys.withTimeout=sm;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=io;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=vs;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ys;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Ul);var im=am,om=Object.prototype.hasOwnProperty;function am(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((a,c)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?c(u):(u.shift(),a(u)):a(u)}):e.errorFirst?i.push((u,p)=>{u?c(u):a(p)}):i.push(a),Reflect.apply(t,this===r?n:this,i)})},Va=new WeakMap;var hm=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(a,c)=>{let h=Va.get(a);if(h||(h={},Va.set(a,h)),c in h)return h[c];const u=C=>typeof C=="string"||typeof c=="symbol"?c===C:C.test(c),p=Reflect.getOwnPropertyDescriptor(a,c),f=p===void 0||p.writable||p.configurable,S=(e.include?e.include.some(u):!e.exclude.some(u))&&f;return h[c]=S,S},i=new WeakMap,s=new Proxy(t,{apply(a,c,h){const u=i.get(a);if(u)return Reflect.apply(u,c,h);const p=e.excludeMain?a:Ua(a,e,s,a);return i.set(a,p),Reflect.apply(p,c,h)},get(a,c){const h=a[c];if(!n(a,c)||h===Function.prototype[c])return h;const u=i.get(h);if(u)return u;if(typeof h=="function"){const p=Ua(h,e,s,a);return i.set(h,p),p}return h}});return s};const fm=Zr.default;let pm=class extends fm{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var co=pm;const gm=co;let mm=class extends gm{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var _m=mm,sn={minBlockRef:vm,maxBlockRef:ym,sortBlockRefs:lo,bnToHex:wm,blockRefIsNumber:bm,hexToInt:Rn,incrementHexInt:Em,intToHex:du,unsafeRandomBytes:Sm};function vm(...t){return lo(t)[0]}function ym(...t){const e=lo(t);return e[e.length-1]}function lo(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Rn(e)-Rn(r))}function wm(t){return"0x"+t.toString(16)}function bm(t){return t&&!["earliest","latest","pending"].includes(t)}function Rn(t){return t==null?t:Number.parseInt(t,16)}function Em(t){if(t==null)return t;const e=Rn(t);return du(e+1)}function du(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Sm(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=Im(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=Rm(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(s)).filter(h=>this.matchLog(h));this.addResults(c)}async _fetchLogs(e){return await Cm(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(vn(this.params.fromBlock)>=vn(e.blockNumber)||Am(this.params.toBlock)&&vn(this.params.toBlock)<=vn(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=e.topics[s];if(!a)return!1;a=a.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(p=>p.toLowerCase()),c.includes(a))})}};var xm=Nm,uo=Lm;async function Lm({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=za(e),s=za(r)-n+1,a=Array(s).fill().map((h,u)=>n+u).map(Tm);let c=await Promise.all(a.map(h=>Om(t,"eth_getBlockByNumber",[h,!1])));return c=c.filter(h=>h!==null),c}function za(t){return t==null?t:Number.parseInt(t,16)}function Tm(t){return t==null?t:"0x"+t.toString(16)}function Pm(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Om(t,e,r){for(let n=0;n<3;n++)try{return await Pm(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const $m=co,Bm=uo,{incrementHexInt:Fm}=sn;let jm=class extends $m{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=Fm(e),a=(await Bm({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(a)}};var Dm=jm;const Hm=co,Um=uo,{incrementHexInt:Vm}=sn;let Wm=class extends Hm{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=Vm(e),i=await Um({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var zm=Wm;const qm=Ul.Mutex,{createAsyncMiddleware:Jm,createScaffoldMiddleware:Gm}=to,Zm=xm,Qm=Dm,Km=zm,{intToHex:hu,hexToInt:ii}=sn;var Xm=Ym;function Ym({blockTracker:t,provider:e}){let r=0,n={};const i=new qm,s=e_({mutex:i}),a=Gm({eth_newFilter:s(oi(h)),eth_newBlockFilter:s(oi(u)),eth_newPendingTransactionFilter:s(oi(p)),eth_uninstallFilter:s(En(S)),eth_getFilterChanges:s(En(f)),eth_getFilterLogs:s(En(v))}),c=async({oldBlock:I,newBlock:R})=>{if(n.length===0)return;const j=await i.acquire();try{await Promise.all(nr(n).map(async x=>{try{await x.update({oldBlock:I,newBlock:R})}catch(P){console.error(P)}}))}catch(x){console.error(x)}j()};return a.newLogFilter=h,a.newBlockFilter=u,a.newPendingTransactionFilter=p,a.uninstallFilter=S,a.getFilterChanges=f,a.getFilterLogs=v,a.destroy=()=>{M()},a;async function h(I){const R=new Zm({provider:e,params:I});return await C(R),R}async function u(){const I=new Qm({provider:e});return await C(I),I}async function p(){const I=new Km({provider:e});return await C(I),I}async function f(I){const R=ii(I),j=n[R];if(!j)throw new Error(`No filter for index "${R}"`);return j.getChangesAndClear()}async function v(I){const R=ii(I),j=n[R];if(!j)throw new Error(`No filter for index "${R}"`);let x=[];return j.type==="log"&&(x=j.getAllResults()),x}async function S(I){const R=ii(I),x=!!n[R];return x&&await N(R),x}async function C(I){const R=nr(n).length,j=await t.getLatestBlock();await I.initialize({currentBlock:j}),r++,n[r]=I,I.id=r,I.idHex=hu(r);const x=nr(n).length;return A({prevFilterCount:R,newFilterCount:x}),r}async function N(I){const R=nr(n).length;delete n[I];const j=nr(n).length;A({prevFilterCount:R,newFilterCount:j})}async function M(){const I=nr(n).length;n={},A({prevFilterCount:I,newFilterCount:0})}function A({prevFilterCount:I,newFilterCount:R}){if(I===0&&R>0){t.on("sync",c);return}if(I>0&&R===0){t.removeListener("sync",c);return}}}function oi(t){return En(async(...e)=>{const r=await t(...e);return hu(r.id)})}function En(t){return Jm(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function e_({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function nr(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const t_=Zr.default,{createAsyncMiddleware:qa,createScaffoldMiddleware:r_}=to,n_=Xm,{unsafeRandomBytes:s_,incrementHexInt:i_}=sn,o_=uo;var a_=c_;function c_({blockTracker:t,provider:e}){const r={},n=n_({blockTracker:t,provider:e});let i=!1;const s=new t_,a=r_({eth_subscribe:qa(c),eth_unsubscribe:qa(h)});return a.destroy=p,{events:s,middleware:a};async function c(f,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const S=f.params[0],C=s_(16);let N;switch(S){case"newHeads":N=M({subId:C});break;case"logs":const I=f.params[1],R=await n.newLogFilter(I);N=A({subId:C,filter:R});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${S}"`)}r[C]=N,v.result=C;return;function M({subId:I}){const R={type:S,destroy:async()=>{t.removeListener("sync",R.update)},update:async({oldBlock:j,newBlock:x})=>{const P=x,q=i_(j);(await o_({provider:e,fromBlock:q,toBlock:P})).map(l_).filter(G=>G!==null).forEach(G=>{u(I,G)})}};return t.on("sync",R.update),R}function A({subId:I,filter:R}){return R.on("update",x=>u(I,x)),{type:S,destroy:async()=>await n.uninstallFilter(R.idHex)}}}async function h(f,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const S=f.params[0],C=r[S];if(!C){v.result=!1;return}delete r[S],await C.destroy(),v.result=!0}function u(f,v){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:v}})}function p(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function l_(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(ts,"__esModule",{value:!0});ts.SubscriptionManager=void 0;const u_=Qc,d_=a_,Ja=()=>{};class h_{constructor(e){const r=new u_.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=d_({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,Ja,Ja),r}destroy(){this.subscriptionMiddleware.destroy()}}ts.SubscriptionManager=h_;var fu=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ur,"__esModule",{value:!0});ur.CoinbaseWalletProvider=void 0;const f_=fu(xn),p_=Gu,V=Br,D=T,g_=Hr,Ga=ct,yn=br,rt=vr,ai=fu(Fh),Ir=wr,m_=pr,__=ts,Za="DefaultChainId",Qa="DefaultJsonRpcUrl";class v_ extends p_.EventEmitter{constructor(e){var r,n;super(),this._filterPolyfill=new m_.FilterPolyfill(this),this._subscriptionManager=new __.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,D.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(Ga.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(h=>(0,D.ensureAddressString)(h)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",c=>{var h;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"&&c.data.data.action==="dappChainSwitched"){const u=c.data.data.chainId,p=(h=c.data.data.jsonRpcUrl)!==null&&h!==void 0?h:this.jsonRpcUrl;this.updateProviderInfo(p,Number(u))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,D.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Qa))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Qa,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Za,r.toString(10)),((0,D.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,a){const h=await(await this.initializeRelay()).watchAsset(e,r,n,i,s,a==null?void 0:a.toString()).promise;return(0,rt.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(e,r,n,i,s,a){var c,h;if((0,D.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),p=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!p&&await u.requestEthereumAccounts().promise;const f=await u.addEthereumChain(e.toString(),r,s,n,i,a).promise;return(0,rt.isErrorResponse)(f)?!1:(((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],e),((h=f.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,rt.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===V.standardErrorCodes.provider.unsupportedChain?V.standardErrors.provider.unsupportedChain():V.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Ir.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,V.serializeError)(i,e)})}catch(n){throw(0,V.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(c=>c.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,V.serializeError)(n,e)})}catch(n){return Promise.reject((0,V.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,V.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,V.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw V.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw V.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw V.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){const n=await(await this.initializeRelay()).scanQRCode((0,D.ensureRegExpString)(e)).promise;if((0,rt.isErrorResponse)(n))throw(0,V.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,V.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(e,r){const i=await(await this.initializeRelay()).genericRequest(e,r).promise;if((0,rt.isErrorResponse)(i))throw(0,V.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,V.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(e){var r;(r=this.diagnostic)===null||r===void 0||r.log(Ir.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof g_.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(e).promise,(0,rt.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(e){const n=await(await this.initializeRelay()).selectProvider(e).promise;if((0,rt.isErrorResponse)(n))throw(0,V.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,V.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,D.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Ga.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(c=>r(Object.assign(Object.assign({},c),{id:e.id}))).catch(c=>n(c));return}const a=this._handleSubscriptionMethods(e);if(a!==void 0){a.then(c=>r({jsonrpc:"2.0",id:e.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===V.standardErrorCodes.rpc.methodNotFound||s.code===V.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(Ir.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,D.ensureAddressString)(e);return this._addresses.map(i=>(0,D.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(Ir.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,D.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,D.ensureAddressString)(e.to):null,i=e.value!=null?(0,D.ensureBN)(e.value):new f_.default(0),s=e.data?(0,D.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,D.ensureIntNumber)(e.nonce):null,c=e.gasPrice!=null?(0,D.ensureBN)(e.gasPrice):null,h=e.maxFeePerGas!=null?(0,D.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,D.ensureBN)(e.maxPriorityFeePerGas):null,p=e.gas!=null?(0,D.ensureBN)(e.gas):null,f=e.chainId?(0,D.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:c,maxFeePerGas:h,maxPriorityFeePerGas:u,gasLimit:p,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw V.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw V.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;if((0,rt.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;if((0,rt.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,D.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Za);if(!e)return(0,D.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,D.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Ir.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,rt.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,D.ensureAddressString)(e[0]),n=(0,D.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,D.ensureBuffer)(e[0]),n=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,D.ensureBuffer)(e[0]),n=(0,D.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,D.ensureBuffer)(e[0]),n=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,rt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,D.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,rt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,rt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,D.ensureParsedJSONObject)(e[0]),n=(0,D.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=ai.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,D.ensureAddressString)(e[0]),n=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=ai.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,D.ensureAddressString)(e[0]),n=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=ai.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const a=e[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw V.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw V.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const c=parseInt(a.chainId,16);return await this.addEthereumChain(c,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw V.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw V.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw V.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw V.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:c}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,c,a,n)}}_eth_uninstallFilter(e){const r=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}ur.CoinbaseWalletProvider=v_;var ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.RelayEventManager=void 0;const y_=T;class w_{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,y_.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}ws.RelayEventManager=w_;Object.defineProperty(Lr,"__esModule",{value:!0});Lr.CoinbaseWalletSDK=void 0;const b_=An,E_=Nn,Ka=T,S_=$n,k_=ur,C_=Hr,M_=Jr,R_=ws,I_=Vr,A_=Ur,pu=yr;class bs{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||E_.LINK_API_URL;typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;if(this._storage=new S_.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",bs.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new R_.RelayEventManager;const h=(0,Ka.isMobileWeb)(),u=e.uiConstructor||(f=>h?new M_.MobileRelayUI(f):new I_.WalletLinkRelayUI(f)),p={linkAPIUrl:s,version:pu.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:u,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=h?new C_.MobileRelay(p):new A_.WalletLinkRelay(p),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI()}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new k_.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,Ka.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,b_.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Lr.CoinbaseWalletSDK=bs;bs.VERSION=pu.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Lr,r=ur;var n=Lr;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=ur;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Ya);const N_=gu(Ya),W_=Object.freeze(Object.defineProperty({__proto__:null,default:N_},Symbol.toStringTag,{value:"Module"}));export{W_ as i}; diff --git a/kinode/src/register-ui/build/assets/index-C3h8FZ1j.js b/kinode/src/register-ui/build/assets/index-C3h8FZ1j.js deleted file mode 100644 index 51e882d86..000000000 --- a/kinode/src/register-ui/build/assets/index-C3h8FZ1j.js +++ /dev/null @@ -1,114 +0,0 @@ -const __vite__fileDeps=["assets/index-gj1MhC63.js","assets/___vite-browser-external_commonjs-proxy-CQs3Tny8.js","assets/clsx.m-BnvdjbFk.js","assets/index-DRmNTW-M.js","assets/index.es-DLVXSpXp.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); -var e,t,n,r,o,a,u,i,s,l,c,d,f,h,p,m,g,y,b,v,w,A,C,E,B,F,D,x,k,j,I,S,P,U,O,N,T,M,R,_,z,L,W,q,Q,H,V,$,G,K,J,Y,Z,X,ee,te,ne,re,oe,ae,ue,ie,se,le,ce,de,fe,he,pe,me,ge,ye,be=e=>{throw TypeError(e)},ve=(e,t,n)=>t.has(e)||be("Cannot "+n),we=(e,t,n)=>(ve(e,t,"read from private field"),n?n.call(e):t.get(e)),Ae=(e,t,n)=>t.has(e)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(ve(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ee=(e,t,n)=>(ve(e,t,"access private method"),n),Be=(e,t,n,r)=>({set _(r){Ce(e,t,r,n)},get _(){return we(e,t,r)}});function Fe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var De="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ke(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var je={exports:{}},Ie={},Se={exports:{}},Pe={},Ue=Symbol.for("react.element"),Oe=Symbol.for("react.portal"),Ne=Symbol.for("react.fragment"),Te=Symbol.for("react.strict_mode"),Me=Symbol.for("react.profiler"),Re=Symbol.for("react.provider"),_e=Symbol.for("react.context"),ze=Symbol.for("react.forward_ref"),Le=Symbol.for("react.suspense"),We=Symbol.for("react.memo"),qe=Symbol.for("react.lazy"),Qe=Symbol.iterator;var He={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ve=Object.assign,$e={};function Ge(e,t,n){this.props=e,this.context=t,this.refs=$e,this.updater=n||He}function Ke(){}function Je(e,t,n){this.props=e,this.context=t,this.refs=$e,this.updater=n||He}Ge.prototype.isReactComponent={},Ge.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},Ke.prototype=Ge.prototype;var Ye=Je.prototype=new Ke;Ye.constructor=Je,Ve(Ye,Ge.prototype),Ye.isPureReactComponent=!0;var Ze=Array.isArray,Xe=Object.prototype.hasOwnProperty,et={current:null},tt={key:!0,ref:!0,__self:!0,__source:!0};function nt(e,t,n){var r,o={},a=null,u=null;if(null!=t)for(r in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(a=""+t.key),t)Xe.call(t,r)&&!tt.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1>>1,a=e[r];if(!(0>>1;ro(s,n))lo(c,s)?(e[r]=c,e[l]=n,r=l):(e[r]=s,e[i]=n,r=i);else{if(!(lo(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,i=u.now();e.unstable_now=function(){return u.now()-i}}var s=[],l=[],c=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var o=n(l);null!==o;){if(null===o.callback)r(l);else{if(!(o.startTime<=e))break;r(l),o.sortIndex=o.expirationTime,t(s,o)}o=n(l)}}function w(e){if(m=!1,v(e),!p)if(null!==n(s))p=!0,P(A);else{var t=n(l);null!==t&&U(w,t.startTime-e)}}function A(t,o){p=!1,m&&(m=!1,y(F),F=-1),h=!0;var a=f;try{for(v(o),d=n(s);null!==d&&(!(d.expirationTime>o)||t&&!k());){var u=d.callback;if("function"==typeof u){d.callback=null,f=d.priorityLevel;var i=u(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof i?d.callback=i:d===n(s)&&r(s),v(o)}else r(s);d=n(s)}if(null!==d)var c=!0;else{var g=n(l);null!==g&&U(w,g.startTime-o),c=!1}return c}finally{d=null,f=a,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,B=null,F=-1,D=5,x=-1;function k(){return!(e.unstable_now()-xe||125u?(r.sortIndex=a,t(l,r),null===n(s)&&r===n(l)&&(m?(y(F),F=-1):m=!0,U(w,a-u))):(r.sortIndex=i,t(s,r),p||h||(p=!0,P(A))),r},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(xt),Dt.exports=xt;var kt=Dt.exports,jt=ft,It=kt; -/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */function St(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n