@walletconnect/ethereum-provider 2.13.2 → 2.13.3-13604ac8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +35 -35
- package/dist/index.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/EthereumProvider.d.ts +4 -4
- package/dist/types/EthereumProvider.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Vn,jr){typeof exports=="object"&&typeof module<"u"?jr(exports):typeof define=="function"&&define.amd?define(["exports"],jr):(Vn=typeof globalThis<"u"?globalThis:Vn||self,jr(Vn["@walletconnect/ethereum-provider"]={}))})(this,function(Vn){"use strict";var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function il(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Dr={exports:{}},To=typeof Reflect=="object"?Reflect:null,jp=To&&typeof To.apply=="function"?To.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},sl;To&&typeof To.ownKeys=="function"?sl=To.ownKeys:Object.getOwnPropertySymbols?sl=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:sl=function(e){return Object.getOwnPropertyNames(e)};function r3(t){console&&console.warn&&console.warn(t)}var kp=Number.isNaN||function(e){return e!==e};function zt(){zt.init.call(this)}Dr.exports=zt,Dr.exports.once=o3,zt.EventEmitter=zt,zt.prototype._events=void 0,zt.prototype._eventsCount=0,zt.prototype._maxListeners=void 0;var qp=10;function ol(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(zt,"defaultMaxListeners",{enumerable:!0,get:function(){return qp},set:function(t){if(typeof t!="number"||t<0||kp(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");qp=t}}),zt.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},zt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||kp(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 zp(t){return t._maxListeners===void 0?zt.defaultMaxListeners:t._maxListeners}zt.prototype.getMaxListeners=function(){return zp(this)},zt.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")jp(f,this,r);else for(var h=f.length,g=Gp(f,h),n=0;n<h;++n)jp(g[n],this,r);return!0};function Hp(t,e,r,n){var i,o,c;if(ol(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=zp(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,r3(l)}return t}zt.prototype.addListener=function(e,r){return Hp(this,e,r,!1)},zt.prototype.on=zt.prototype.addListener,zt.prototype.prependListener=function(e,r){return Hp(this,e,r,!0)};function n3(){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 Kp(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=n3.bind(n);return i.listener=r,n.wrapFn=i,i}zt.prototype.once=function(e,r){return ol(r),this.on(e,Kp(this,e,r)),this},zt.prototype.prependOnceListener=function(e,r){return ol(r),this.prependListener(e,Kp(this,e,r)),this},zt.prototype.removeListener=function(e,r){var n,i,o,c,l;if(ol(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():i3(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},zt.prototype.off=zt.prototype.removeListener,zt.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Wp(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?s3(i):Gp(i,i.length)}zt.prototype.listeners=function(e){return Wp(this,e,!0)},zt.prototype.rawListeners=function(e){return Wp(this,e,!1)},zt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Vp.call(t,e)},zt.prototype.listenerCount=Vp;function Vp(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}zt.prototype.eventNames=function(){return this._eventsCount>0?sl(this._events):[]};function Gp(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function i3(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function s3(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function o3(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Yp(t,e,o,{once:!0}),e!=="error"&&a3(t,i,{once:!0})})}function a3(t,e,r){typeof t.on=="function"&&Yp(t,"error",e,r)}function Yp(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Qp=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},c3=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),l3=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),u3=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),h3=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),f3=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),d3=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,p3=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Jp=3,g3=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",d3]],Zp=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function m3(t){return t?Xp(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new f3:typeof navigator<"u"?Xp(navigator.userAgent):y3()}function v3(t){return t!==""&&g3.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function Xp(t){var e=v3(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new h3;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Jp&&(i=Qp(Qp([],i,!0),b3(Jp-i.length),!0)):i=[];var o=i.join("."),c=w3(t),l=p3.exec(t);return l&&l[1]?new u3(r,o,c,l[1]):new c3(r,o,c)}function w3(t){for(var e=0,r=Zp.length;e<r;e++){var n=Zp[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function y3(){var t=typeof process<"u"&&process.version;return t?new l3(process.version.slice(1)):null}function b3(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var ye={};/*! *****************************************************************************
|
|
1
|
+
(function(Vn,jr){typeof exports=="object"&&typeof module<"u"?jr(exports):typeof define=="function"&&define.amd?define(["exports"],jr):(Vn=typeof globalThis<"u"?globalThis:Vn||self,jr(Vn["@walletconnect/ethereum-provider"]={}))})(this,function(Vn){"use strict";var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function il(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Cr={exports:{}},To=typeof Reflect=="object"?Reflect:null,Fp=To&&typeof To.apply=="function"?To.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},sl;To&&typeof To.ownKeys=="function"?sl=To.ownKeys:Object.getOwnPropertySymbols?sl=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:sl=function(e){return Object.getOwnPropertyNames(e)};function r3(t){console&&console.warn&&console.warn(t)}var jp=Number.isNaN||function(e){return e!==e};function zt(){zt.init.call(this)}Cr.exports=zt,Cr.exports.once=o3,zt.EventEmitter=zt,zt.prototype._events=void 0,zt.prototype._eventsCount=0,zt.prototype._maxListeners=void 0;var kp=10;function ol(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(zt,"defaultMaxListeners",{enumerable:!0,get:function(){return kp},set:function(t){if(typeof t!="number"||t<0||jp(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");kp=t}}),zt.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},zt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||jp(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 qp(t){return t._maxListeners===void 0?zt.defaultMaxListeners:t._maxListeners}zt.prototype.getMaxListeners=function(){return qp(this)},zt.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")Fp(f,this,r);else for(var h=f.length,g=Vp(f,h),n=0;n<h;++n)Fp(g[n],this,r);return!0};function zp(t,e,r,n){var i,o,c;if(ol(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=qp(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,r3(l)}return t}zt.prototype.addListener=function(e,r){return zp(this,e,r,!1)},zt.prototype.on=zt.prototype.addListener,zt.prototype.prependListener=function(e,r){return zp(this,e,r,!0)};function n3(){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 Hp(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=n3.bind(n);return i.listener=r,n.wrapFn=i,i}zt.prototype.once=function(e,r){return ol(r),this.on(e,Hp(this,e,r)),this},zt.prototype.prependOnceListener=function(e,r){return ol(r),this.prependListener(e,Hp(this,e,r)),this},zt.prototype.removeListener=function(e,r){var n,i,o,c,l;if(ol(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():i3(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},zt.prototype.off=zt.prototype.removeListener,zt.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Kp(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?s3(i):Vp(i,i.length)}zt.prototype.listeners=function(e){return Kp(this,e,!0)},zt.prototype.rawListeners=function(e){return Kp(this,e,!1)},zt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Wp.call(t,e)},zt.prototype.listenerCount=Wp;function Wp(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}zt.prototype.eventNames=function(){return this._eventsCount>0?sl(this._events):[]};function Vp(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function i3(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function s3(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function o3(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Gp(t,e,o,{once:!0}),e!=="error"&&a3(t,i,{once:!0})})}function a3(t,e,r){typeof t.on=="function"&&Gp(t,"error",e,r)}function Gp(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}const c3=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,l3=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,u3=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function h3(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){f3(t);return}return e}function f3(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function al(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!u3.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(c3.test(t)||l3.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,h3)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function d3(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function _r(t,...e){try{return d3(t(...e))}catch(r){return Promise.reject(r)}}function p3(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function g3(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function cl(t){if(p3(t))return String(t);if(g3(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return cl(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Yp(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Th="base64:";function m3(t){if(typeof t=="string")return t;Yp();const e=Buffer.from(t).toString("base64");return Th+e}function v3(t){return typeof t!="string"||!t.startsWith(Th)?t:(Yp(),Buffer.from(t.slice(Th.length),"base64"))}function Xr(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function w3(...t){return Xr(t.join(":"))}function ll(t){return t=Xr(t),t?t+":":""}function gF(t){return t}const y3="memory",b3=()=>{const t=new Map;return{name:y3,options:{},hasItem(e){return t.has(e)},getItem(e){return t.get(e)||null},getItemRaw(e){return t.get(e)||null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return Array.from(t.keys())},clear(){t.clear()},dispose(){t.clear()}}};function _3(t={}){const e={mounts:{"":t.driver||b3()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=h=>{for(const g of e.mountpoints)if(h.startsWith(g))return{base:g,relativeKey:h.slice(g.length),driver:e.mounts[g]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,g)=>e.mountpoints.filter(_=>_.startsWith(h)||g&&h.startsWith(_)).map(_=>({relativeBase:h.length>_.length?h.slice(_.length):void 0,mountpoint:_,driver:e.mounts[_]})),i=(h,g)=>{if(e.watching){g=Xr(g);for(const _ of e.watchListeners)_(h,g)}},o=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await Qp(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},l=(h,g,_)=>{const E=new Map,x=I=>{let F=E.get(I.base);return F||(F={driver:I.driver,base:I.base,items:[]},E.set(I.base,F)),F};for(const I of h){const F=typeof I=="string",W=Xr(F?I:I.key),Y=F?void 0:I.value,B=F||!I.options?g:{...g,...I.options},z=r(W);x(z).items.push({key:W,value:Y,relativeKey:z.relativeKey,options:B})}return Promise.all([...E.values()].map(I=>_(I))).then(I=>I.flat())},f={hasItem(h,g={}){h=Xr(h);const{relativeKey:_,driver:E}=r(h);return _r(E.hasItem,_,g)},getItem(h,g={}){h=Xr(h);const{relativeKey:_,driver:E}=r(h);return _r(E.getItem,_,g).then(x=>al(x))},getItems(h,g){return l(h,g,_=>_.driver.getItems?_r(_.driver.getItems,_.items.map(E=>({key:E.relativeKey,options:E.options})),g).then(E=>E.map(x=>({key:w3(_.base,x.key),value:al(x.value)}))):Promise.all(_.items.map(E=>_r(_.driver.getItem,E.relativeKey,E.options).then(x=>({key:E.key,value:al(x)})))))},getItemRaw(h,g={}){h=Xr(h);const{relativeKey:_,driver:E}=r(h);return E.getItemRaw?_r(E.getItemRaw,_,g):_r(E.getItem,_,g).then(x=>v3(x))},async setItem(h,g,_={}){if(g===void 0)return f.removeItem(h);h=Xr(h);const{relativeKey:E,driver:x}=r(h);x.setItem&&(await _r(x.setItem,E,cl(g),_),x.watch||i("update",h))},async setItems(h,g){await l(h,g,async _=>{_.driver.setItems&&await _r(_.driver.setItems,_.items.map(E=>({key:E.relativeKey,value:cl(E.value),options:E.options})),g),_.driver.setItem&&await Promise.all(_.items.map(E=>_r(_.driver.setItem,E.relativeKey,cl(E.value),E.options)))})},async setItemRaw(h,g,_={}){if(g===void 0)return f.removeItem(h,_);h=Xr(h);const{relativeKey:E,driver:x}=r(h);if(x.setItemRaw)await _r(x.setItemRaw,E,g,_);else if(x.setItem)await _r(x.setItem,E,m3(g),_);else return;x.watch||i("update",h)},async removeItem(h,g={}){typeof g=="boolean"&&(g={removeMeta:g}),h=Xr(h);const{relativeKey:_,driver:E}=r(h);E.removeItem&&(await _r(E.removeItem,_,g),(g.removeMeta||g.removeMata)&&await _r(E.removeItem,_+"$",g),E.watch||i("remove",h))},async getMeta(h,g={}){typeof g=="boolean"&&(g={nativeOnly:g}),h=Xr(h);const{relativeKey:_,driver:E}=r(h),x=Object.create(null);if(E.getMeta&&Object.assign(x,await _r(E.getMeta,_,g)),!g.nativeOnly){const I=await _r(E.getItem,_+"$",g).then(F=>al(F));I&&typeof I=="object"&&(typeof I.atime=="string"&&(I.atime=new Date(I.atime)),typeof I.mtime=="string"&&(I.mtime=new Date(I.mtime)),Object.assign(x,I))}return x},setMeta(h,g,_={}){return this.setItem(h+"$",g,_)},removeMeta(h,g={}){return this.removeItem(h+"$",g)},async getKeys(h,g={}){h=ll(h);const _=n(h,!0);let E=[];const x=[];for(const I of _){const W=(await _r(I.driver.getKeys,I.relativeBase,g)).map(Y=>I.mountpoint+Xr(Y)).filter(Y=>!E.some(B=>Y.startsWith(B)));x.push(...W),E=[I.mountpoint,...E.filter(Y=>!Y.startsWith(I.mountpoint))]}return h?x.filter(I=>I.startsWith(h)&&!I.endsWith("$")):x.filter(I=>!I.endsWith("$"))},async clear(h,g={}){h=ll(h),await Promise.all(n(h,!1).map(async _=>{if(_.driver.clear)return _r(_.driver.clear,_.relativeBase,g);if(_.driver.removeItem){const E=await _.driver.getKeys(_.relativeBase||"",g);return Promise.all(E.map(x=>_.driver.removeItem(x,g)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>Jp(h)))},async watch(h){return await o(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(g=>g!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,g){if(h=ll(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((_,E)=>E.length-_.length)),e.mounts[h]=g,e.watching&&Promise.resolve(Qp(g,i,h)).then(_=>{e.unwatch[h]=_}).catch(console.error),f},async unmount(h,g=!0){h=ll(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),g&&await Jp(e.mounts[h]),e.mountpoints=e.mountpoints.filter(_=>_!==h),delete e.mounts[h])},getMount(h=""){h=Xr(h)+":";const g=r(h);return{driver:g.driver,base:g.base}},getMounts(h="",g={}){return h=Xr(h),n(h,g.parents).map(E=>({driver:E.driver,base:E.mountpoint}))}};return f}function Qp(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function Jp(t){typeof t.dispose=="function"&&await _r(t.dispose)}function Us(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Zp(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Us(r);return(i,o)=>n.then(c=>o(c.transaction(e,i).objectStore(e)))}let Nh;function Fa(){return Nh||(Nh=Zp("keyval-store","keyval")),Nh}function Xp(t,e=Fa()){return e("readonly",r=>Us(r.get(t)))}function E3(t,e,r=Fa()){return r("readwrite",n=>(n.put(e,t),Us(n.transaction)))}function A3(t,e=Fa()){return e("readwrite",r=>(r.delete(t),Us(r.transaction)))}function x3(t=Fa()){return t("readwrite",e=>(e.clear(),Us(e.transaction)))}function I3(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Us(t.transaction)}function S3(t=Fa()){return t("readonly",e=>{if(e.getAllKeys)return Us(e.getAllKeys());const r=[];return I3(e,n=>r.push(n.key)).then(()=>r)})}const C3=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),D3=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ja(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return D3(t)}catch{return t}}function Li(t){return typeof t=="string"?t:C3(t)||""}const O3="idb-keyval";var M3=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Zp(t.dbName,t.storeName)),{name:O3,options:t,async hasItem(i){return!(typeof await Xp(r(i),n)>"u")},async getItem(i){return await Xp(r(i),n)??null},setItem(i,o){return E3(r(i),o,n)},removeItem(i){return A3(r(i),n)},getKeys(){return S3(n)},clear(){return x3(n)}}};const P3="WALLET_CONNECT_V2_INDEXED_DB",$3="keyvaluestorage";class T3{constructor(){this.indexedDb=_3({driver:M3({dbName:P3,storeName:$3})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Li(r))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Rh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ul={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Rh<"u"&&Rh.localStorage?ul.exports=Rh.localStorage:typeof window<"u"&&window.localStorage?ul.exports=window.localStorage:ul.exports=new e})();function N3(t){var e;return[t[0],ja((e=t[1])!=null?e:"")]}class R3{constructor(){this.localStorage=ul.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(N3)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return ja(r)}async setItem(e,r){this.localStorage.setItem(e,Li(r))}async removeItem(e){this.localStorage.removeItem(e)}}const L3="wc_storage_version",e1=1,B3=async(t,e,r)=>{const n=L3,i=await e.getItem(n);if(i&&i>=e1){r(e);return}const o=await t.getKeys();if(!o.length){r(e);return}const c=[];for(;o.length;){const l=o.shift();if(!l)continue;const f=l.toLowerCase();if(f.includes("wc@")||f.includes("walletconnect")||f.includes("wc_")||f.includes("wallet_connect")){const h=await t.getItem(l);await e.setItem(l,h),c.push(l)}}await e.setItem(n,e1),r(e),U3(t,c)},U3=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class F3{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new R3;this.storage=e;try{const r=new T3;B3(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}}var ye={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */var Th=function(t,e){return Th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Th(t,e)};function _3(t,e){Th(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Nh=function(){return Nh=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Nh.apply(this,arguments)};function E3(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function A3(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function x3(t,e){return function(r,n){e(r,n,t)}}function S3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function I3(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(g){try{h(n.next(g))}catch(_){c(_)}}function f(g){try{h(n.throw(g))}catch(_){c(_)}}function h(g){g.done?o(g.value):i(g.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function D3(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(h){return function(g){return f([h,g])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function C3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function O3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Rh(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 e1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function M3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(e1(arguments[e]));return t}function P3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function ja(t){return this instanceof ja?(this.v=t,this):new ja(t)}function $3(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(E){n[E]&&(i[E]=function(x){return new Promise(function(I,k){o.push([E,x,I,k])>1||l(E,x)})})}function l(E,x){try{f(n[E](x))}catch(I){_(o[0][3],I)}}function f(E){E.value instanceof ja?Promise.resolve(E.value.v).then(h,g):_(o[0][2],E)}function h(E){l("next",E)}function g(E){l("throw",E)}function _(E,x){E(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function T3(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:ja(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function N3(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 Rh=="function"?Rh(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function R3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function L3(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function B3(t){return t&&t.__esModule?t:{default:t}}function U3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function F3(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var j3=Object.freeze({__proto__:null,__extends:_3,get __assign(){return Nh},__rest:E3,__decorate:A3,__param:x3,__metadata:S3,__awaiter:I3,__generator:D3,__createBinding:C3,__exportStar:O3,__values:Rh,__read:e1,__spread:M3,__spreadArrays:P3,__await:ja,__asyncGenerator:$3,__asyncDelegator:T3,__asyncValues:N3,__makeTemplateObject:R3,__importStar:L3,__importDefault:B3,__classPrivateFieldGet:U3,__classPrivateFieldSet:F3}),al=il(j3),Lh={},ka={},t1;function k3(){if(t1)return ka;t1=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ka.delay=t,ka}var Us={},Bh={},Fs={},r1;function q3(){return r1||(r1=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.ONE_THOUSAND=Fs.ONE_HUNDRED=void 0,Fs.ONE_HUNDRED=100,Fs.ONE_THOUSAND=1e3),Fs}var Uh={},n1;function z3(){return n1||(n1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Uh)),Uh}var i1;function s1(){return i1||(i1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=al;e.__exportStar(q3(),t),e.__exportStar(z3(),t)}(Bh)),Bh}var o1;function H3(){if(o1)return Us;o1=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.fromMiliseconds=Us.toMiliseconds=void 0;const t=s1();function e(n){return n*t.ONE_THOUSAND}Us.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Us.fromMiliseconds=r,Us}var a1;function K3(){return a1||(a1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=al;e.__exportStar(k3(),t),e.__exportStar(H3(),t)}(Lh)),Lh}var No={},c1;function W3(){if(c1)return No;c1=1,Object.defineProperty(No,"__esModule",{value:!0}),No.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return No.Watch=t,No.default=t,No}var Fh={},qa={},l1;function V3(){if(l1)return qa;l1=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.IWatch=void 0;class t{}return qa.IWatch=t,qa}var u1;function G3(){return u1||(u1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),al.__exportStar(V3(),t)}(Fh)),Fh}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=al;e.__exportStar(K3(),t),e.__exportStar(W3(),t),e.__exportStar(G3(),t),e.__exportStar(s1(),t)})(ye);var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.getLocalStorage=Qt.getLocalStorageOrThrow=Qt.getCrypto=Qt.getCryptoOrThrow=h1=Qt.getLocation=Qt.getLocationOrThrow=kh=Qt.getNavigator=Qt.getNavigatorOrThrow=jh=Qt.getDocument=Qt.getDocumentOrThrow=Qt.getFromWindowOrThrow=Qt.getFromWindow=void 0;function js(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Qt.getFromWindow=js;function Ro(t){const e=js(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Qt.getFromWindowOrThrow=Ro;function Y3(){return Ro("document")}Qt.getDocumentOrThrow=Y3;function Q3(){return js("document")}var jh=Qt.getDocument=Q3;function J3(){return Ro("navigator")}Qt.getNavigatorOrThrow=J3;function Z3(){return js("navigator")}var kh=Qt.getNavigator=Z3;function X3(){return Ro("location")}Qt.getLocationOrThrow=X3;function e6(){return js("location")}var h1=Qt.getLocation=e6;function t6(){return Ro("crypto")}Qt.getCryptoOrThrow=t6;function r6(){return js("crypto")}Qt.getCrypto=r6;function n6(){return Ro("localStorage")}Qt.getLocalStorageOrThrow=n6;function i6(){return js("localStorage")}Qt.getLocalStorage=i6;var qh={};Object.defineProperty(qh,"__esModule",{value:!0});var f1=qh.getWindowMetadata=void 0;const d1=Qt;function s6(){let t,e;try{t=d1.getDocumentOrThrow(),e=d1.getLocationOrThrow()}catch{return null}function r(){const _=t.getElementsByTagName("link"),E=[];for(let x=0;x<_.length;x++){const I=_[x],k=I.getAttribute("rel");if(k&&k.toLowerCase().indexOf("icon")>-1){const W=I.getAttribute("href");if(W)if(W.toLowerCase().indexOf("https:")===-1&&W.toLowerCase().indexOf("http:")===-1&&W.indexOf("//")!==0){let Y=e.protocol+"//"+e.host;if(W.indexOf("/")===0)Y+=W;else{const B=e.pathname.split("/");B.pop();const z=B.join("/");Y+=z+"/"+W}E.push(Y)}else if(W.indexOf("//")===0){const Y=e.protocol+W;E.push(Y)}else E.push(W)}}return E}function n(..._){const E=t.getElementsByTagName("meta");for(let x=0;x<E.length;x++){const I=E[x],k=["itemprop","property","name"].map(W=>I.getAttribute(W)).filter(W=>W?_.includes(W):!1);if(k.length&&k){const W=I.getAttribute("content");if(W)return W}}return""}function i(){let _=n("name","og:site_name","og:title","twitter:title");return _||(_=t.title),_}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),f=e.origin,h=r();return{description:l,url:f,icons:h,name:c}}f1=qh.getWindowMetadata=s6;var za={},o6=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),p1="%[a-f0-9]{2}",g1=new RegExp("("+p1+")|([^%]+?)","gi"),m1=new RegExp("("+p1+")+","gi");function zh(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],zh(r),zh(n))}function a6(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(g1)||[],r=1;r<e.length;r++)t=zh(e,r).join(""),e=t.match(g1)||[];return t}}function c6(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=m1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=a6(r[0]);n!==r[0]&&(e[r[0]]=n)}r=m1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var l6=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return c6(t)}},u6=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},h6=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=o6,r=l6,n=u6,i=h6,o=B=>B==null,c=Symbol("encodeFragmentIdentifier");function l(B){switch(B.arrayFormat){case"index":return z=>(M,U)=>{const F=M.length;return U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,[g(z,B),"[",F,"]"].join("")]:[...M,[g(z,B),"[",g(F,B),"]=",g(U,B)].join("")]};case"bracket":return z=>(M,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,[g(z,B),"[]"].join("")]:[...M,[g(z,B),"[]=",g(U,B)].join("")];case"colon-list-separator":return z=>(M,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,[g(z,B),":list="].join("")]:[...M,[g(z,B),":list=",g(U,B)].join("")];case"comma":case"separator":case"bracket-separator":{const z=B.arrayFormat==="bracket-separator"?"[]=":"=";return M=>(U,F)=>F===void 0||B.skipNull&&F===null||B.skipEmptyString&&F===""?U:(F=F===null?"":F,U.length===0?[[g(M,B),z,g(F,B)].join("")]:[[U,g(F,B)].join(B.arrayFormatSeparator)])}default:return z=>(M,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,g(z,B)]:[...M,[g(z,B),"=",g(U,B)].join("")]}}function f(B){let z;switch(B.arrayFormat){case"index":return(M,U,F)=>{if(z=/\[(\d*)\]$/.exec(M),M=M.replace(/\[\d*\]$/,""),!z){F[M]=U;return}F[M]===void 0&&(F[M]={}),F[M][z[1]]=U};case"bracket":return(M,U,F)=>{if(z=/(\[\])$/.exec(M),M=M.replace(/\[\]$/,""),!z){F[M]=U;return}if(F[M]===void 0){F[M]=[U];return}F[M]=[].concat(F[M],U)};case"colon-list-separator":return(M,U,F)=>{if(z=/(:list)$/.exec(M),M=M.replace(/:list$/,""),!z){F[M]=U;return}if(F[M]===void 0){F[M]=[U];return}F[M]=[].concat(F[M],U)};case"comma":case"separator":return(M,U,F)=>{const m=typeof U=="string"&&U.includes(B.arrayFormatSeparator),$=typeof U=="string"&&!m&&_(U,B).includes(B.arrayFormatSeparator);U=$?_(U,B):U;const te=m||$?U.split(B.arrayFormatSeparator).map(ee=>_(ee,B)):U===null?U:_(U,B);F[M]=te};case"bracket-separator":return(M,U,F)=>{const m=/(\[\])$/.test(M);if(M=M.replace(/\[\]$/,""),!m){F[M]=U&&_(U,B);return}const $=U===null?[]:U.split(B.arrayFormatSeparator).map(te=>_(te,B));if(F[M]===void 0){F[M]=$;return}F[M]=[].concat(F[M],$)};default:return(M,U,F)=>{if(F[M]===void 0){F[M]=U;return}F[M]=[].concat(F[M],U)}}}function h(B){if(typeof B!="string"||B.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(B,z){return z.encode?z.strict?e(B):encodeURIComponent(B):B}function _(B,z){return z.decode?r(B):B}function E(B){return Array.isArray(B)?B.sort():typeof B=="object"?E(Object.keys(B)).sort((z,M)=>Number(z)-Number(M)).map(z=>B[z]):B}function x(B){const z=B.indexOf("#");return z!==-1&&(B=B.slice(0,z)),B}function I(B){let z="";const M=B.indexOf("#");return M!==-1&&(z=B.slice(M)),z}function k(B){B=x(B);const z=B.indexOf("?");return z===-1?"":B.slice(z+1)}function W(B,z){return z.parseNumbers&&!Number.isNaN(Number(B))&&typeof B=="string"&&B.trim()!==""?B=Number(B):z.parseBooleans&&B!==null&&(B.toLowerCase()==="true"||B.toLowerCase()==="false")&&(B=B.toLowerCase()==="true"),B}function Y(B,z){z=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},z),h(z.arrayFormatSeparator);const M=f(z),U=Object.create(null);if(typeof B!="string"||(B=B.trim().replace(/^[?#&]/,""),!B))return U;for(const F of B.split("&")){if(F==="")continue;let[m,$]=n(z.decode?F.replace(/\+/g," "):F,"=");$=$===void 0?null:["comma","separator","bracket-separator"].includes(z.arrayFormat)?$:_($,z),M(_(m,z),$,U)}for(const F of Object.keys(U)){const m=U[F];if(typeof m=="object"&&m!==null)for(const $ of Object.keys(m))m[$]=W(m[$],z);else U[F]=W(m,z)}return z.sort===!1?U:(z.sort===!0?Object.keys(U).sort():Object.keys(U).sort(z.sort)).reduce((F,m)=>{const $=U[m];return $&&typeof $=="object"&&!Array.isArray($)?F[m]=E($):F[m]=$,F},Object.create(null))}t.extract=k,t.parse=Y,t.stringify=(B,z)=>{if(!B)return"";z=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},z),h(z.arrayFormatSeparator);const M=$=>z.skipNull&&o(B[$])||z.skipEmptyString&&B[$]==="",U=l(z),F={};for(const $ of Object.keys(B))M($)||(F[$]=B[$]);const m=Object.keys(F);return z.sort!==!1&&m.sort(z.sort),m.map($=>{const te=B[$];return te===void 0?"":te===null?g($,z):Array.isArray(te)?te.length===0&&z.arrayFormat==="bracket-separator"?g($,z)+"[]":te.reduce(U($),[]).join("&"):g($,z)+"="+g(te,z)}).filter($=>$.length>0).join("&")},t.parseUrl=(B,z)=>{z=Object.assign({decode:!0},z);const[M,U]=n(B,"#");return Object.assign({url:M.split("?")[0]||"",query:Y(k(B),z)},z&&z.parseFragmentIdentifier&&U?{fragmentIdentifier:_(U,z)}:{})},t.stringifyUrl=(B,z)=>{z=Object.assign({encode:!0,strict:!0,[c]:!0},z);const M=x(B.url).split("?")[0]||"",U=t.extract(B.url),F=t.parse(U,{sort:!1}),m=Object.assign(F,B.query);let $=t.stringify(m,z);$&&($=`?${$}`);let te=I(B.url);return B.fragmentIdentifier&&(te=`#${z[c]?g(B.fragmentIdentifier,z):B.fragmentIdentifier}`),`${M}${$}${te}`},t.pick=(B,z,M)=>{M=Object.assign({parseFragmentIdentifier:!0,[c]:!1},M);const{url:U,query:F,fragmentIdentifier:m}=t.parseUrl(B,M);return t.stringifyUrl({url:U,query:i(F,z),fragmentIdentifier:m},M)},t.exclude=(B,z,M)=>{const U=Array.isArray(z)?F=>!z.includes(F):(F,m)=>!z(F,m);return t.pick(B,U,M)}})(za);var Hh={},cl={},ct={},v1={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,f){var h=l>>>16&65535,g=l&65535,_=f>>>16&65535,E=f&65535;return g*E+(h*E+g*_<<16>>>0)|0}t.mul=Math.imul||e;function r(l,f){return l+f|0}t.add=r;function n(l,f){return l-f|0}t.sub=n;function i(l,f){return l<<f|l>>>32-f}t.rotl=i;function o(l,f){return l<<32-f|l>>>f}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(v1),Object.defineProperty(ct,"__esModule",{value:!0});var w1=v1;function f6(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ct.readInt16BE=f6;function d6(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ct.readUint16BE=d6;function p6(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ct.readInt16LE=p6;function g6(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ct.readUint16LE=g6;function y1(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}ct.writeUint16BE=y1,ct.writeInt16BE=y1;function b1(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}ct.writeUint16LE=b1,ct.writeInt16LE=b1;function Kh(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ct.readInt32BE=Kh;function Wh(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ct.readUint32BE=Wh;function Vh(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ct.readInt32LE=Vh;function Gh(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ct.readUint32LE=Gh;function ll(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}ct.writeUint32BE=ll,ct.writeInt32BE=ll;function ul(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}ct.writeUint32LE=ul,ct.writeInt32LE=ul;function m6(t,e){e===void 0&&(e=0);var r=Kh(t,e),n=Kh(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ct.readInt64BE=m6;function v6(t,e){e===void 0&&(e=0);var r=Wh(t,e),n=Wh(t,e+4);return r*4294967296+n}ct.readUint64BE=v6;function w6(t,e){e===void 0&&(e=0);var r=Vh(t,e),n=Vh(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ct.readInt64LE=w6;function y6(t,e){e===void 0&&(e=0);var r=Gh(t,e),n=Gh(t,e+4);return n*4294967296+r}ct.readUint64LE=y6;function _1(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ll(t/4294967296>>>0,e,r),ll(t>>>0,e,r+4),e}ct.writeUint64BE=_1,ct.writeInt64BE=_1;function E1(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ul(t>>>0,e,r),ul(t/4294967296>>>0,e,r+4),e}ct.writeUint64LE=E1,ct.writeInt64LE=E1;function b6(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}ct.readUintBE=b6;function _6(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}ct.readUintLE=_6;function E6(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!w1.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}ct.writeUintBE=E6;function A6(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!w1.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}ct.writeUintLE=A6;function x6(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}ct.readFloat32BE=x6;function S6(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}ct.readFloat32LE=S6;function I6(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}ct.readFloat64BE=I6;function D6(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}ct.readFloat64LE=D6;function C6(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}ct.writeFloat32BE=C6;function O6(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}ct.writeFloat32LE=O6;function M6(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}ct.writeFloat64BE=M6;function P6(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}ct.writeFloat64LE=P6;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});function $6(t){for(var e=0;e<t.length;e++)t[e]=0;return t}pn.wipe=$6,Object.defineProperty(cl,"__esModule",{value:!0});var Rr=ct,Yh=pn,T6=20;function N6(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],f=r[7]<<24|r[6]<<16|r[5]<<8|r[4],h=r[11]<<24|r[10]<<16|r[9]<<8|r[8],g=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=r[19]<<24|r[18]<<16|r[17]<<8|r[16],E=r[23]<<24|r[22]<<16|r[21]<<8|r[20],x=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],W=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Y=e[11]<<24|e[10]<<16|e[9]<<8|e[8],B=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,M=i,U=o,F=c,m=l,$=f,te=h,ee=g,ne=_,de=E,d=x,p=I,b=k,D=W,O=Y,T=B,L=0;L<T6;L+=2)z=z+m|0,b^=z,b=b>>>32-16|b<<16,ne=ne+b|0,m^=ne,m=m>>>32-12|m<<12,M=M+$|0,D^=M,D=D>>>32-16|D<<16,de=de+D|0,$^=de,$=$>>>32-12|$<<12,U=U+te|0,O^=U,O=O>>>32-16|O<<16,d=d+O|0,te^=d,te=te>>>32-12|te<<12,F=F+ee|0,T^=F,T=T>>>32-16|T<<16,p=p+T|0,ee^=p,ee=ee>>>32-12|ee<<12,U=U+te|0,O^=U,O=O>>>32-8|O<<8,d=d+O|0,te^=d,te=te>>>32-7|te<<7,F=F+ee|0,T^=F,T=T>>>32-8|T<<8,p=p+T|0,ee^=p,ee=ee>>>32-7|ee<<7,M=M+$|0,D^=M,D=D>>>32-8|D<<8,de=de+D|0,$^=de,$=$>>>32-7|$<<7,z=z+m|0,b^=z,b=b>>>32-8|b<<8,ne=ne+b|0,m^=ne,m=m>>>32-7|m<<7,z=z+$|0,T^=z,T=T>>>32-16|T<<16,d=d+T|0,$^=d,$=$>>>32-12|$<<12,M=M+te|0,b^=M,b=b>>>32-16|b<<16,p=p+b|0,te^=p,te=te>>>32-12|te<<12,U=U+ee|0,D^=U,D=D>>>32-16|D<<16,ne=ne+D|0,ee^=ne,ee=ee>>>32-12|ee<<12,F=F+m|0,O^=F,O=O>>>32-16|O<<16,de=de+O|0,m^=de,m=m>>>32-12|m<<12,U=U+ee|0,D^=U,D=D>>>32-8|D<<8,ne=ne+D|0,ee^=ne,ee=ee>>>32-7|ee<<7,F=F+m|0,O^=F,O=O>>>32-8|O<<8,de=de+O|0,m^=de,m=m>>>32-7|m<<7,M=M+te|0,b^=M,b=b>>>32-8|b<<8,p=p+b|0,te^=p,te=te>>>32-7|te<<7,z=z+$|0,T^=z,T=T>>>32-8|T<<8,d=d+T|0,$^=d,$=$>>>32-7|$<<7;Rr.writeUint32LE(z+n|0,t,0),Rr.writeUint32LE(M+i|0,t,4),Rr.writeUint32LE(U+o|0,t,8),Rr.writeUint32LE(F+c|0,t,12),Rr.writeUint32LE(m+l|0,t,16),Rr.writeUint32LE($+f|0,t,20),Rr.writeUint32LE(te+h|0,t,24),Rr.writeUint32LE(ee+g|0,t,28),Rr.writeUint32LE(ne+_|0,t,32),Rr.writeUint32LE(de+E|0,t,36),Rr.writeUint32LE(d+x|0,t,40),Rr.writeUint32LE(p+I|0,t,44),Rr.writeUint32LE(b+k|0,t,48),Rr.writeUint32LE(D+W|0,t,52),Rr.writeUint32LE(O+Y|0,t,56),Rr.writeUint32LE(T+B|0,t,60)}function A1(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),f=0;f<r.length;f+=64){N6(l,o,t);for(var h=f;h<f+64&&h<r.length;h++)n[h]=r[h]^l[h-f];L6(o,0,c)}return Yh.wipe(l),i===0&&Yh.wipe(o),n}cl.streamXOR=A1;function R6(t,e,r,n){return n===void 0&&(n=0),Yh.wipe(r),A1(t,e,r,r,n)}cl.stream=R6;function L6(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var x1={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});function B6(t,e,r){return~(t-1)&e|t-1&r}ss.select=B6;function U6(t,e){return(t|0)-(e|0)-1>>>31&1}ss.lessOrEqual=U6;function S1(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}ss.compare=S1;function F6(t,e){return t.length===0||e.length===0?!1:S1(t,e)!==0}ss.equal=F6,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ss,r=pn;t.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var f=l[0]|l[1]<<8;this._r[0]=f&8191;var h=l[2]|l[3]<<8;this._r[1]=(f>>>13|h<<3)&8191;var g=l[4]|l[5]<<8;this._r[2]=(h>>>10|g<<6)&7939;var _=l[6]|l[7]<<8;this._r[3]=(g>>>7|_<<9)&8191;var E=l[8]|l[9]<<8;this._r[4]=(_>>>4|E<<12)&255,this._r[5]=E>>>1&8190;var x=l[10]|l[11]<<8;this._r[6]=(E>>>14|x<<2)&8191;var I=l[12]|l[13]<<8;this._r[7]=(x>>>11|I<<5)&8065;var k=l[14]|l[15]<<8;this._r[8]=(I>>>8|k<<8)&8191,this._r[9]=k>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,f,h){for(var g=this._fin?0:2048,_=this._h[0],E=this._h[1],x=this._h[2],I=this._h[3],k=this._h[4],W=this._h[5],Y=this._h[6],B=this._h[7],z=this._h[8],M=this._h[9],U=this._r[0],F=this._r[1],m=this._r[2],$=this._r[3],te=this._r[4],ee=this._r[5],ne=this._r[6],de=this._r[7],d=this._r[8],p=this._r[9];h>=16;){var b=l[f+0]|l[f+1]<<8;_+=b&8191;var D=l[f+2]|l[f+3]<<8;E+=(b>>>13|D<<3)&8191;var O=l[f+4]|l[f+5]<<8;x+=(D>>>10|O<<6)&8191;var T=l[f+6]|l[f+7]<<8;I+=(O>>>7|T<<9)&8191;var L=l[f+8]|l[f+9]<<8;k+=(T>>>4|L<<12)&8191,W+=L>>>1&8191;var C=l[f+10]|l[f+11]<<8;Y+=(L>>>14|C<<2)&8191;var v=l[f+12]|l[f+13]<<8;B+=(C>>>11|v<<5)&8191;var N=l[f+14]|l[f+15]<<8;z+=(v>>>8|N<<8)&8191,M+=N>>>5|g;var oe=0,pe=oe;pe+=_*U,pe+=E*(5*p),pe+=x*(5*d),pe+=I*(5*de),pe+=k*(5*ne),oe=pe>>>13,pe&=8191,pe+=W*(5*ee),pe+=Y*(5*te),pe+=B*(5*$),pe+=z*(5*m),pe+=M*(5*F),oe+=pe>>>13,pe&=8191;var A=oe;A+=_*F,A+=E*U,A+=x*(5*p),A+=I*(5*d),A+=k*(5*de),oe=A>>>13,A&=8191,A+=W*(5*ne),A+=Y*(5*ee),A+=B*(5*te),A+=z*(5*$),A+=M*(5*m),oe+=A>>>13,A&=8191;var re=oe;re+=_*m,re+=E*F,re+=x*U,re+=I*(5*p),re+=k*(5*d),oe=re>>>13,re&=8191,re+=W*(5*de),re+=Y*(5*ne),re+=B*(5*ee),re+=z*(5*te),re+=M*(5*$),oe+=re>>>13,re&=8191;var q=oe;q+=_*$,q+=E*m,q+=x*F,q+=I*U,q+=k*(5*p),oe=q>>>13,q&=8191,q+=W*(5*d),q+=Y*(5*de),q+=B*(5*ne),q+=z*(5*ee),q+=M*(5*te),oe+=q>>>13,q&=8191;var H=oe;H+=_*te,H+=E*$,H+=x*m,H+=I*F,H+=k*U,oe=H>>>13,H&=8191,H+=W*(5*p),H+=Y*(5*d),H+=B*(5*de),H+=z*(5*ne),H+=M*(5*ee),oe+=H>>>13,H&=8191;var V=oe;V+=_*ee,V+=E*te,V+=x*$,V+=I*m,V+=k*F,oe=V>>>13,V&=8191,V+=W*U,V+=Y*(5*p),V+=B*(5*d),V+=z*(5*de),V+=M*(5*ne),oe+=V>>>13,V&=8191;var w=oe;w+=_*ne,w+=E*ee,w+=x*te,w+=I*$,w+=k*m,oe=w>>>13,w&=8191,w+=W*F,w+=Y*U,w+=B*(5*p),w+=z*(5*d),w+=M*(5*de),oe+=w>>>13,w&=8191;var j=oe;j+=_*de,j+=E*ne,j+=x*ee,j+=I*te,j+=k*$,oe=j>>>13,j&=8191,j+=W*m,j+=Y*F,j+=B*U,j+=z*(5*p),j+=M*(5*d),oe+=j>>>13,j&=8191;var ie=oe;ie+=_*d,ie+=E*de,ie+=x*ne,ie+=I*ee,ie+=k*te,oe=ie>>>13,ie&=8191,ie+=W*$,ie+=Y*m,ie+=B*F,ie+=z*U,ie+=M*(5*p),oe+=ie>>>13,ie&=8191;var he=oe;he+=_*p,he+=E*d,he+=x*de,he+=I*ne,he+=k*ee,oe=he>>>13,he&=8191,he+=W*te,he+=Y*$,he+=B*m,he+=z*F,he+=M*U,oe+=he>>>13,he&=8191,oe=(oe<<2)+oe|0,oe=oe+pe|0,pe=oe&8191,oe=oe>>>13,A+=oe,_=pe,E=A,x=re,I=q,k=H,W=V,Y=w,B=j,z=ie,M=he,f+=16,h-=16}this._h[0]=_,this._h[1]=E,this._h[2]=x,this._h[3]=I,this._h[4]=k,this._h[5]=W,this._h[6]=Y,this._h[7]=B,this._h[8]=z,this._h[9]=M},c.prototype.finish=function(l,f){f===void 0&&(f=0);var h=new Uint16Array(10),g,_,E,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(g=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=g,g=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=g*5,g=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=g,g=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=g,h[0]=this._h[0]+5,g=h[0]>>>13,h[0]&=8191,x=1;x<10;x++)h[x]=this._h[x]+g,g=h[x]>>>13,h[x]&=8191;for(h[9]-=8192,_=(g^1)-1,x=0;x<10;x++)h[x]&=_;for(_=~_,x=0;x<10;x++)this._h[x]=this._h[x]&_|h[x];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,E=this._h[0]+this._pad[0],this._h[0]=E&65535,x=1;x<8;x++)E=(this._h[x]+this._pad[x]|0)+(E>>>16)|0,this._h[x]=E&65535;return l[f+0]=this._h[0]>>>0,l[f+1]=this._h[0]>>>8,l[f+2]=this._h[1]>>>0,l[f+3]=this._h[1]>>>8,l[f+4]=this._h[2]>>>0,l[f+5]=this._h[2]>>>8,l[f+6]=this._h[3]>>>0,l[f+7]=this._h[3]>>>8,l[f+8]=this._h[4]>>>0,l[f+9]=this._h[4]>>>8,l[f+10]=this._h[5]>>>0,l[f+11]=this._h[5]>>>8,l[f+12]=this._h[6]>>>0,l[f+13]=this._h[6]>>>8,l[f+14]=this._h[7]>>>0,l[f+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var f=0,h=l.length,g;if(this._leftover){g=16-this._leftover,g>h&&(g=h);for(var _=0;_<g;_++)this._buffer[this._leftover+_]=l[f+_];if(h-=g,f+=g,this._leftover+=g,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(g=h-h%16,this._blocks(l,f,g),f+=g,h-=g),h){for(var _=0;_<h;_++)this._buffer[this._leftover+_]=l[f+_];this._leftover+=h}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();t.Poly1305=n;function i(c,l){var f=new n(c);f.update(l);var h=f.digest();return f.clean(),h}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(x1),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=cl,r=x1,n=pn,i=ct,o=ss;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function f(h){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,h.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,g,_,E){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(h,x.length-h.length);var I=new Uint8Array(32);e.stream(this._key,x,I,4);var k=g.length+this.tagLength,W;if(E){if(E.length!==k)throw new Error("ChaCha20Poly1305: incorrect destination length");W=E}else W=new Uint8Array(k);return e.streamXOR(this._key,x,g,W,4),this._authenticate(W.subarray(W.length-this.tagLength,W.length),I,W.subarray(0,W.length-this.tagLength),_),n.wipe(x),W},f.prototype.open=function(h,g,_,E){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(g.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(h,x.length-h.length);var I=new Uint8Array(32);e.stream(this._key,x,I,4);var k=new Uint8Array(this.tagLength);if(this._authenticate(k,I,g.subarray(0,g.length-this.tagLength),_),!o.equal(k,g.subarray(g.length-this.tagLength,g.length)))return null;var W=g.length-this.tagLength,Y;if(E){if(E.length!==W)throw new Error("ChaCha20Poly1305: incorrect destination length");Y=E}else Y=new Uint8Array(W);return e.streamXOR(this._key,x,g.subarray(0,g.length-this.tagLength),Y,4),n.wipe(x),Y},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,g,_,E){var x=new r.Poly1305(g);E&&(x.update(E),E.length%16>0&&x.update(c.subarray(E.length%16))),x.update(_),_.length%16>0&&x.update(c.subarray(_.length%16));var I=new Uint8Array(8);E&&i.writeUint64LE(E.length,I),x.update(I),i.writeUint64LE(_.length,I),x.update(I);for(var k=x.digest(),W=0;W<k.length;W++)h[W]=k[W];x.clean(),n.wipe(k),n.wipe(I)},f}();t.ChaCha20Poly1305=l}(Hh);var I1={},Ha={},Qh={};Object.defineProperty(Qh,"__esModule",{value:!0});function j6(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}Qh.isSerializableHash=j6,Object.defineProperty(Ha,"__esModule",{value:!0});var ai=Qh,k6=ss,q6=pn,D1=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),ai.isSerializableHash(this._inner)&&ai.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),q6.wipe(n)}return t.prototype.reset=function(){if(!ai.isSerializableHash(this._inner)||!ai.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){ai.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),ai.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!ai.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!ai.isSerializableHash(this._inner)||!ai.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!ai.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Ha.HMAC=D1;function z6(t,e,r){var n=new D1(t,e);n.update(r);var i=n.digest();return n.clean(),i}Ha.hmac=z6,Ha.equal=k6.equal,Object.defineProperty(I1,"__esModule",{value:!0});var C1=Ha,O1=pn,H6=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=C1.hmac(this._hash,n,r);this._hmac=new C1.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),O1.wipe(this._buffer),O1.wipe(this._counter),this._bufpos=0},t}(),K6=I1.HKDF=H6,Lo={},hl={},fl={};Object.defineProperty(fl,"__esModule",{value:!0}),fl.BrowserRandomSource=void 0;const M1=65536;class W6{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=M1)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,M1)));return r}}fl.BrowserRandomSource=W6;function V6(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var dl={},G6={},Y6=Object.freeze({__proto__:null,default:G6}),Q6=il(Y6);Object.defineProperty(dl,"__esModule",{value:!0}),dl.NodeRandomSource=void 0;const J6=pn;class Z6{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof V6<"u"){const e=Q6;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,J6.wipe)(r),n}}dl.NodeRandomSource=Z6,Object.defineProperty(hl,"__esModule",{value:!0}),hl.SystemRandomSource=void 0;const X6=fl,e5=dl;class t5{constructor(){if(this.isAvailable=!1,this.name="",this._source=new X6.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new e5.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}hl.SystemRandomSource=t5,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=hl,r=ct,n=pn;t.defaultRandomSource=new e.SystemRandomSource;function i(h,g=t.defaultRandomSource){return g.randomBytes(h)}t.randomBytes=i;function o(h=t.defaultRandomSource){const g=i(4,h),_=(0,r.readUint32LE)(g);return(0,n.wipe)(g),_}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(h,g=c,_=t.defaultRandomSource){if(g.length<2)throw new Error("randomString charset is too short");if(g.length>256)throw new Error("randomString charset is too long");let E="";const x=g.length,I=256-256%x;for(;h>0;){const k=i(Math.ceil(h*256/I),_);for(let W=0;W<k.length&&h>0;W++){const Y=k[W];Y<I&&(E+=g.charAt(Y%x),h--)}(0,n.wipe)(k)}return E}t.randomString=l;function f(h,g=c,_=t.defaultRandomSource){const E=Math.ceil(h/(Math.log(g.length)/Math.LN2));return l(E,g,_)}t.randomStringForEntropy=f}(Lo);var pl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ct,r=pn;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var g=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[g++],h--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(g=o(this._temp,this._state,f,g,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[g++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,g=this._bufferLength,_=h/536870912|0,E=h<<3,x=h%64<56?64:128;this._buffer[g]=128;for(var I=g+1;I<x-8;I++)this._buffer[I]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(E,this._buffer,x-4),o(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var I=0;I<this.digestLength/4;I++)e.writeUint32BE(this._state[I],f,I*4);return this},l.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(f){r.wipe(f.state),f.buffer&&r.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},l}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(l,f,h,g,_){for(;_>=64;){for(var E=f[0],x=f[1],I=f[2],k=f[3],W=f[4],Y=f[5],B=f[6],z=f[7],M=0;M<16;M++){var U=g+M*4;l[M]=e.readUint32BE(h,U)}for(var M=16;M<64;M++){var F=l[M-2],m=(F>>>17|F<<32-17)^(F>>>19|F<<32-19)^F>>>10;F=l[M-15];var $=(F>>>7|F<<32-7)^(F>>>18|F<<32-18)^F>>>3;l[M]=(m+l[M-7]|0)+($+l[M-16]|0)}for(var M=0;M<64;M++){var m=(((W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7))+(W&Y^~W&B)|0)+(z+(i[M]+l[M]|0)|0)|0,$=((E>>>2|E<<32-2)^(E>>>13|E<<32-13)^(E>>>22|E<<32-22))+(E&x^E&I^x&I)|0;z=B,B=Y,Y=W,W=k+m|0,k=I,I=x,x=E,E=m+$|0}f[0]+=E,f[1]+=x,f[2]+=I,f[3]+=k,f[4]+=W,f[5]+=Y,f[6]+=B,f[7]+=z,g+=64,_-=64}return g}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}t.hash=c})(pl);var Jh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Lo,r=pn;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(M){const U=new Float64Array(16);if(M)for(let F=0;F<M.length;F++)U[F]=M[F];return U}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c(M){let U=1;for(let F=0;F<16;F++){let m=M[F]+U+65535;U=Math.floor(m/65536),M[F]=m-U*65536}M[0]+=U-1+37*(U-1)}function l(M,U,F){const m=~(F-1);for(let $=0;$<16;$++){const te=m&(M[$]^U[$]);M[$]^=te,U[$]^=te}}function f(M,U){const F=n(),m=n();for(let $=0;$<16;$++)m[$]=U[$];c(m),c(m),c(m);for(let $=0;$<2;$++){F[0]=m[0]-65517;for(let ee=1;ee<15;ee++)F[ee]=m[ee]-65535-(F[ee-1]>>16&1),F[ee-1]&=65535;F[15]=m[15]-32767-(F[14]>>16&1);const te=F[15]>>16&1;F[14]&=65535,l(m,F,1-te)}for(let $=0;$<16;$++)M[2*$]=m[$]&255,M[2*$+1]=m[$]>>8}function h(M,U){for(let F=0;F<16;F++)M[F]=U[2*F]+(U[2*F+1]<<8);M[15]&=32767}function g(M,U,F){for(let m=0;m<16;m++)M[m]=U[m]+F[m]}function _(M,U,F){for(let m=0;m<16;m++)M[m]=U[m]-F[m]}function E(M,U,F){let m,$,te=0,ee=0,ne=0,de=0,d=0,p=0,b=0,D=0,O=0,T=0,L=0,C=0,v=0,N=0,oe=0,pe=0,A=0,re=0,q=0,H=0,V=0,w=0,j=0,ie=0,he=0,le=0,Oe=0,Pe=0,Ie=0,Mt=0,ze=0,Ce=F[0],Fe=F[1],Ee=F[2],Ae=F[3],Ge=F[4],be=F[5],xe=F[6],Be=F[7],_e=F[8],Me=F[9],je=F[10],$e=F[11],Te=F[12],lt=F[13],Re=F[14],Ne=F[15];m=U[0],te+=m*Ce,ee+=m*Fe,ne+=m*Ee,de+=m*Ae,d+=m*Ge,p+=m*be,b+=m*xe,D+=m*Be,O+=m*_e,T+=m*Me,L+=m*je,C+=m*$e,v+=m*Te,N+=m*lt,oe+=m*Re,pe+=m*Ne,m=U[1],ee+=m*Ce,ne+=m*Fe,de+=m*Ee,d+=m*Ae,p+=m*Ge,b+=m*be,D+=m*xe,O+=m*Be,T+=m*_e,L+=m*Me,C+=m*je,v+=m*$e,N+=m*Te,oe+=m*lt,pe+=m*Re,A+=m*Ne,m=U[2],ne+=m*Ce,de+=m*Fe,d+=m*Ee,p+=m*Ae,b+=m*Ge,D+=m*be,O+=m*xe,T+=m*Be,L+=m*_e,C+=m*Me,v+=m*je,N+=m*$e,oe+=m*Te,pe+=m*lt,A+=m*Re,re+=m*Ne,m=U[3],de+=m*Ce,d+=m*Fe,p+=m*Ee,b+=m*Ae,D+=m*Ge,O+=m*be,T+=m*xe,L+=m*Be,C+=m*_e,v+=m*Me,N+=m*je,oe+=m*$e,pe+=m*Te,A+=m*lt,re+=m*Re,q+=m*Ne,m=U[4],d+=m*Ce,p+=m*Fe,b+=m*Ee,D+=m*Ae,O+=m*Ge,T+=m*be,L+=m*xe,C+=m*Be,v+=m*_e,N+=m*Me,oe+=m*je,pe+=m*$e,A+=m*Te,re+=m*lt,q+=m*Re,H+=m*Ne,m=U[5],p+=m*Ce,b+=m*Fe,D+=m*Ee,O+=m*Ae,T+=m*Ge,L+=m*be,C+=m*xe,v+=m*Be,N+=m*_e,oe+=m*Me,pe+=m*je,A+=m*$e,re+=m*Te,q+=m*lt,H+=m*Re,V+=m*Ne,m=U[6],b+=m*Ce,D+=m*Fe,O+=m*Ee,T+=m*Ae,L+=m*Ge,C+=m*be,v+=m*xe,N+=m*Be,oe+=m*_e,pe+=m*Me,A+=m*je,re+=m*$e,q+=m*Te,H+=m*lt,V+=m*Re,w+=m*Ne,m=U[7],D+=m*Ce,O+=m*Fe,T+=m*Ee,L+=m*Ae,C+=m*Ge,v+=m*be,N+=m*xe,oe+=m*Be,pe+=m*_e,A+=m*Me,re+=m*je,q+=m*$e,H+=m*Te,V+=m*lt,w+=m*Re,j+=m*Ne,m=U[8],O+=m*Ce,T+=m*Fe,L+=m*Ee,C+=m*Ae,v+=m*Ge,N+=m*be,oe+=m*xe,pe+=m*Be,A+=m*_e,re+=m*Me,q+=m*je,H+=m*$e,V+=m*Te,w+=m*lt,j+=m*Re,ie+=m*Ne,m=U[9],T+=m*Ce,L+=m*Fe,C+=m*Ee,v+=m*Ae,N+=m*Ge,oe+=m*be,pe+=m*xe,A+=m*Be,re+=m*_e,q+=m*Me,H+=m*je,V+=m*$e,w+=m*Te,j+=m*lt,ie+=m*Re,he+=m*Ne,m=U[10],L+=m*Ce,C+=m*Fe,v+=m*Ee,N+=m*Ae,oe+=m*Ge,pe+=m*be,A+=m*xe,re+=m*Be,q+=m*_e,H+=m*Me,V+=m*je,w+=m*$e,j+=m*Te,ie+=m*lt,he+=m*Re,le+=m*Ne,m=U[11],C+=m*Ce,v+=m*Fe,N+=m*Ee,oe+=m*Ae,pe+=m*Ge,A+=m*be,re+=m*xe,q+=m*Be,H+=m*_e,V+=m*Me,w+=m*je,j+=m*$e,ie+=m*Te,he+=m*lt,le+=m*Re,Oe+=m*Ne,m=U[12],v+=m*Ce,N+=m*Fe,oe+=m*Ee,pe+=m*Ae,A+=m*Ge,re+=m*be,q+=m*xe,H+=m*Be,V+=m*_e,w+=m*Me,j+=m*je,ie+=m*$e,he+=m*Te,le+=m*lt,Oe+=m*Re,Pe+=m*Ne,m=U[13],N+=m*Ce,oe+=m*Fe,pe+=m*Ee,A+=m*Ae,re+=m*Ge,q+=m*be,H+=m*xe,V+=m*Be,w+=m*_e,j+=m*Me,ie+=m*je,he+=m*$e,le+=m*Te,Oe+=m*lt,Pe+=m*Re,Ie+=m*Ne,m=U[14],oe+=m*Ce,pe+=m*Fe,A+=m*Ee,re+=m*Ae,q+=m*Ge,H+=m*be,V+=m*xe,w+=m*Be,j+=m*_e,ie+=m*Me,he+=m*je,le+=m*$e,Oe+=m*Te,Pe+=m*lt,Ie+=m*Re,Mt+=m*Ne,m=U[15],pe+=m*Ce,A+=m*Fe,re+=m*Ee,q+=m*Ae,H+=m*Ge,V+=m*be,w+=m*xe,j+=m*Be,ie+=m*_e,he+=m*Me,le+=m*je,Oe+=m*$e,Pe+=m*Te,Ie+=m*lt,Mt+=m*Re,ze+=m*Ne,te+=38*A,ee+=38*re,ne+=38*q,de+=38*H,d+=38*V,p+=38*w,b+=38*j,D+=38*ie,O+=38*he,T+=38*le,L+=38*Oe,C+=38*Pe,v+=38*Ie,N+=38*Mt,oe+=38*ze,$=1,m=te+$+65535,$=Math.floor(m/65536),te=m-$*65536,m=ee+$+65535,$=Math.floor(m/65536),ee=m-$*65536,m=ne+$+65535,$=Math.floor(m/65536),ne=m-$*65536,m=de+$+65535,$=Math.floor(m/65536),de=m-$*65536,m=d+$+65535,$=Math.floor(m/65536),d=m-$*65536,m=p+$+65535,$=Math.floor(m/65536),p=m-$*65536,m=b+$+65535,$=Math.floor(m/65536),b=m-$*65536,m=D+$+65535,$=Math.floor(m/65536),D=m-$*65536,m=O+$+65535,$=Math.floor(m/65536),O=m-$*65536,m=T+$+65535,$=Math.floor(m/65536),T=m-$*65536,m=L+$+65535,$=Math.floor(m/65536),L=m-$*65536,m=C+$+65535,$=Math.floor(m/65536),C=m-$*65536,m=v+$+65535,$=Math.floor(m/65536),v=m-$*65536,m=N+$+65535,$=Math.floor(m/65536),N=m-$*65536,m=oe+$+65535,$=Math.floor(m/65536),oe=m-$*65536,m=pe+$+65535,$=Math.floor(m/65536),pe=m-$*65536,te+=$-1+37*($-1),$=1,m=te+$+65535,$=Math.floor(m/65536),te=m-$*65536,m=ee+$+65535,$=Math.floor(m/65536),ee=m-$*65536,m=ne+$+65535,$=Math.floor(m/65536),ne=m-$*65536,m=de+$+65535,$=Math.floor(m/65536),de=m-$*65536,m=d+$+65535,$=Math.floor(m/65536),d=m-$*65536,m=p+$+65535,$=Math.floor(m/65536),p=m-$*65536,m=b+$+65535,$=Math.floor(m/65536),b=m-$*65536,m=D+$+65535,$=Math.floor(m/65536),D=m-$*65536,m=O+$+65535,$=Math.floor(m/65536),O=m-$*65536,m=T+$+65535,$=Math.floor(m/65536),T=m-$*65536,m=L+$+65535,$=Math.floor(m/65536),L=m-$*65536,m=C+$+65535,$=Math.floor(m/65536),C=m-$*65536,m=v+$+65535,$=Math.floor(m/65536),v=m-$*65536,m=N+$+65535,$=Math.floor(m/65536),N=m-$*65536,m=oe+$+65535,$=Math.floor(m/65536),oe=m-$*65536,m=pe+$+65535,$=Math.floor(m/65536),pe=m-$*65536,te+=$-1+37*($-1),M[0]=te,M[1]=ee,M[2]=ne,M[3]=de,M[4]=d,M[5]=p,M[6]=b,M[7]=D,M[8]=O,M[9]=T,M[10]=L,M[11]=C,M[12]=v,M[13]=N,M[14]=oe,M[15]=pe}function x(M,U){E(M,U,U)}function I(M,U){const F=n();for(let m=0;m<16;m++)F[m]=U[m];for(let m=253;m>=0;m--)x(F,F),m!==2&&m!==4&&E(F,F,U);for(let m=0;m<16;m++)M[m]=F[m]}function k(M,U){const F=new Uint8Array(32),m=new Float64Array(80),$=n(),te=n(),ee=n(),ne=n(),de=n(),d=n();for(let O=0;O<31;O++)F[O]=M[O];F[31]=M[31]&127|64,F[0]&=248,h(m,U);for(let O=0;O<16;O++)te[O]=m[O];$[0]=ne[0]=1;for(let O=254;O>=0;--O){const T=F[O>>>3]>>>(O&7)&1;l($,te,T),l(ee,ne,T),g(de,$,ee),_($,$,ee),g(ee,te,ne),_(te,te,ne),x(ne,de),x(d,$),E($,ee,$),E(ee,te,de),g(de,$,ee),_($,$,ee),x(te,$),_(ee,ne,d),E($,ee,o),g($,$,ne),E(ee,ee,$),E($,ne,d),E(ne,te,m),x(te,de),l($,te,T),l(ee,ne,T)}for(let O=0;O<16;O++)m[O+16]=$[O],m[O+32]=ee[O],m[O+48]=te[O],m[O+64]=ne[O];const p=m.subarray(32),b=m.subarray(16);I(p,p),E(b,b,p);const D=new Uint8Array(32);return f(D,b),D}t.scalarMult=k;function W(M){return k(M,i)}t.scalarMultBase=W;function Y(M){if(M.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const U=new Uint8Array(M);return{publicKey:W(U),secretKey:U}}t.generateKeyPairFromSeed=Y;function B(M){const U=(0,e.randomBytes)(32,M),F=Y(U);return(0,r.wipe)(U),F}t.generateKeyPair=B;function z(M,U,F=!1){if(M.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(U.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const m=k(M,U);if(F){let $=0;for(let te=0;te<m.length;te++)$|=m[te];if($===0)throw new Error("X25519: invalid shared key")}return m}t.sharedKey=z})(Jh);function P1(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function $1(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=P1(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function r5(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,f=t.charAt(0),h=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function _(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var k=0,W=0,Y=0,B=I.length;Y!==B&&I[Y]===0;)Y++,k++;for(var z=(B-Y)*g+1>>>0,M=new Uint8Array(z);Y!==B;){for(var U=I[Y],F=0,m=z-1;(U!==0||F<W)&&m!==-1;m--,F++)U+=256*M[m]>>>0,M[m]=U%l>>>0,U=U/l>>>0;if(U!==0)throw new Error("Non-zero carry");W=F,Y++}for(var $=z-W;$!==z&&M[$]===0;)$++;for(var te=f.repeat(k);$<z;++$)te+=t.charAt(M[$]);return te}function E(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var k=0;if(I[k]!==" "){for(var W=0,Y=0;I[k]===f;)W++,k++;for(var B=(I.length-k)*h+1>>>0,z=new Uint8Array(B);I[k];){var M=r[I.charCodeAt(k)];if(M===255)return;for(var U=0,F=B-1;(M!==0||U<Y)&&F!==-1;F--,U++)M+=l*z[F]>>>0,z[F]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");Y=U,k++}if(I[k]!==" "){for(var m=B-Y;m!==B&&z[m]===0;)m++;for(var $=new Uint8Array(W+(B-m)),te=W;m!==B;)$[te++]=z[m++];return $}}}function x(I){var k=E(I);if(k)return k;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:E,decode:x}}var n5=r5,i5=n5;const T1=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},s5=t=>new TextEncoder().encode(t),o5=t=>new TextDecoder().decode(t);class a5{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class c5{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return N1(this,e)}}class l5{constructor(e){this.decoders=e}or(e){return N1(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const N1=(t,e)=>new l5({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class u5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new a5(e,r,n),this.decoder=new c5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const gl=({name:t,prefix:e,encode:r,decode:n})=>new u5(t,e,r,n),Ka=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=i5(r,e);return gl({prefix:t,name:e,encode:n,decode:o=>T1(i(o))})},h5=(t,e,r,n)=>{const i={};for(let g=0;g<e.length;++g)i[e[g]]=g;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,f=0,h=0;for(let g=0;g<o;++g){const _=i[t[g]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|_,l+=r,l>=8&&(l-=8,c[h++]=255&f>>l)}if(l>=r||255&f<<8-l)throw new SyntaxError("Unexpected end of data");return c},f5=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<t.length;++f)for(l=l<<8|t[f],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Cr=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>gl({prefix:e,name:t,encode(i){return f5(i,n,r)},decode(i){return h5(i,n,r,t)}}),d5=gl({prefix:"\0",name:"identity",encode:t=>o5(t),decode:t=>s5(t)});var p5=Object.freeze({__proto__:null,identity:d5});const g5=Cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var m5=Object.freeze({__proto__:null,base2:g5});const v5=Cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var w5=Object.freeze({__proto__:null,base8:v5});const y5=Ka({prefix:"9",name:"base10",alphabet:"0123456789"});var b5=Object.freeze({__proto__:null,base10:y5});const _5=Cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),E5=Cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var A5=Object.freeze({__proto__:null,base16:_5,base16upper:E5});const x5=Cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),S5=Cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),I5=Cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),D5=Cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),C5=Cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),O5=Cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),M5=Cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),P5=Cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$5=Cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var T5=Object.freeze({__proto__:null,base32:x5,base32upper:S5,base32pad:I5,base32padupper:D5,base32hex:C5,base32hexupper:O5,base32hexpad:M5,base32hexpadupper:P5,base32z:$5});const N5=Ka({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),R5=Ka({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var L5=Object.freeze({__proto__:null,base36:N5,base36upper:R5});const B5=Ka({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),U5=Ka({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var F5=Object.freeze({__proto__:null,base58btc:B5,base58flickr:U5});const j5=Cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),k5=Cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),q5=Cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),z5=Cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var H5=Object.freeze({__proto__:null,base64:j5,base64pad:k5,base64url:q5,base64urlpad:z5});const R1=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),K5=R1.reduce((t,e,r)=>(t[r]=e,t),[]),W5=R1.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function V5(t){return t.reduce((e,r)=>(e+=K5[r],e),"")}function G5(t){const e=[];for(const r of t){const n=W5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Y5=gl({prefix:"\u{1F680}",name:"base256emoji",encode:V5,decode:G5});var Q5=Object.freeze({__proto__:null,base256emoji:Y5}),J5=B1,L1=128,Z5=127,X5=~Z5,e8=Math.pow(2,31);function B1(t,e,r){e=e||[],r=r||0;for(var n=r;t>=e8;)e[r++]=t&255|L1,t/=128;for(;t&X5;)e[r++]=t&255|L1,t>>>=7;return e[r]=t|0,B1.bytes=r-n+1,e}var t8=Zh,r8=128,U1=127;function Zh(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw Zh.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&U1)<<i:(c&U1)*Math.pow(2,i),i+=7}while(c>=r8);return Zh.bytes=o-n,r}var n8=Math.pow(2,7),i8=Math.pow(2,14),s8=Math.pow(2,21),o8=Math.pow(2,28),a8=Math.pow(2,35),c8=Math.pow(2,42),l8=Math.pow(2,49),u8=Math.pow(2,56),h8=Math.pow(2,63),f8=function(t){return t<n8?1:t<i8?2:t<s8?3:t<o8?4:t<a8?5:t<c8?6:t<l8?7:t<u8?8:t<h8?9:10},d8={encode:J5,decode:t8,encodingLength:f8},F1=d8;const j1=(t,e,r=0)=>(F1.encode(t,e,r),e),k1=t=>F1.encodingLength(t),Xh=(t,e)=>{const r=e.byteLength,n=k1(t),i=n+k1(r),o=new Uint8Array(i+r);return j1(t,o,0),j1(r,o,n),o.set(e,i),new p8(t,r,e,o)};class p8{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const q1=({name:t,code:e,encode:r})=>new g8(t,e,r);class g8{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Xh(this.code,r):r.then(n=>Xh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const z1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),m8=q1({name:"sha2-256",code:18,encode:z1("SHA-256")}),v8=q1({name:"sha2-512",code:19,encode:z1("SHA-512")});var w8=Object.freeze({__proto__:null,sha256:m8,sha512:v8});const H1=0,y8="identity",K1=T1;var b8=Object.freeze({__proto__:null,identity:{code:H1,name:y8,encode:K1,digest:t=>Xh(H1,K1(t))}});new TextEncoder,new TextDecoder;const Bo={...p5,...m5,...w5,...b5,...A5,...T5,...L5,...F5,...H5,...Q5};({...w8,...b8});function W1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const V1=W1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ef=W1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=P1(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),G1={utf8:V1,"utf-8":V1,hex:Bo.base16,latin1:ef,ascii:ef,binary:ef,...Bo};function Gn(t,e="utf8"){const r=G1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Yn(t,e="utf8"){const r=G1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const _8={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},E8=":";function ml(t){const[e,r]=t.split(E8);return{namespace:e,reference:r}}function Y1(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Q1(t,e){return t.includes(":")?[t]:e.chains||[]}var A8=Object.defineProperty,J1=Object.getOwnPropertySymbols,x8=Object.prototype.hasOwnProperty,S8=Object.prototype.propertyIsEnumerable,Z1=(t,e,r)=>e in t?A8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,X1=(t,e)=>{for(var r in e||(e={}))x8.call(e,r)&&Z1(t,r,e[r]);if(J1)for(var r of J1(e))S8.call(e,r)&&Z1(t,r,e[r]);return t};const I8="ReactNative",gn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},D8="js";function Wa(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Uo(){return!jh()&&!!kh()&&navigator.product===I8}function Fo(){return!Wa()&&!!kh()&&!!jh()}function Va(){return Uo()?gn.reactNative:Wa()?gn.node:Fo()?gn.browser:gn.unknown}function C8(){var t;try{return Uo()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function O8(t,e){let r=za.parse(t);return r=X1(X1({},r),e),t=za.stringify(r),t}function M8(){return f1()||{name:"",description:"",url:"",icons:[""]}}function P8(){if(Va()===gn.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=m3();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function $8(){var t;const e=Va();return e===gn.browser?[e,((t=h1())==null?void 0:t.host)||"unknown"].join(":"):e}function T8(t,e,r){const n=P8(),i=$8();return[[t,e].join("-"),[D8,r].join("-"),n,i].join("/")}function N8({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c,bundleId:l}){const f=r.split("?"),h=T8(t,e,n),g={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0,origin:l||void 0},_=O8(f[1]||"",g);return f[0]+"?"+_}function ks(t,e){return t.filter(r=>e.includes(r)).length===t.length}function eg(t){return Object.fromEntries(t.entries())}function tg(t){return new Map(Object.entries(t))}function qs(t=ye.FIVE_MINUTES,e){const r=ye.toMiliseconds(t||ye.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function jo(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function rg(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function R8(t){return rg("topic",t)}function L8(t){return rg("id",t)}function ng(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Or(t,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(t))}function os(t){return Date.now()>=ye.toMiliseconds(t)}function wt(t,e){return`${t}${e?`:${e}`:""}`}function vl(t=[],e=[]){return[...new Set([...t,...e])]}async function B8({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${t}&sessionTopic=${e}`,c=Va();c===gn.browser?o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===gn.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}async function U8(t,e){try{return await t.getItem(e)||(Fo()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}var ig=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function F8(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var sg={exports:{}};/**
|
|
14
|
+
***************************************************************************** */var Lh=function(t,e){return Lh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Lh(t,e)};function j3(t,e){Lh(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Bh=function(){return Bh=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Bh.apply(this,arguments)};function k3(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function q3(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function z3(t,e){return function(r,n){e(r,n,t)}}function H3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function K3(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(g){try{h(n.next(g))}catch(_){c(_)}}function f(g){try{h(n.throw(g))}catch(_){c(_)}}function h(g){g.done?o(g.value):i(g.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function W3(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(h){return function(g){return f([h,g])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function V3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function G3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Uh(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 t1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Y3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(t1(arguments[e]));return t}function Q3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function ka(t){return this instanceof ka?(this.v=t,this):new ka(t)}function J3(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(E){n[E]&&(i[E]=function(x){return new Promise(function(I,F){o.push([E,x,I,F])>1||l(E,x)})})}function l(E,x){try{f(n[E](x))}catch(I){_(o[0][3],I)}}function f(E){E.value instanceof ka?Promise.resolve(E.value.v).then(h,g):_(o[0][2],E)}function h(E){l("next",E)}function g(E){l("throw",E)}function _(E,x){E(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function Z3(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:ka(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function X3(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 Uh=="function"?Uh(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function e6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function t6(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function r6(t){return t&&t.__esModule?t:{default:t}}function n6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function i6(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var s6=Object.freeze({__proto__:null,__extends:j3,get __assign(){return Bh},__rest:k3,__decorate:q3,__param:z3,__metadata:H3,__awaiter:K3,__generator:W3,__createBinding:V3,__exportStar:G3,__values:Uh,__read:t1,__spread:Y3,__spreadArrays:Q3,__await:ka,__asyncGenerator:J3,__asyncDelegator:Z3,__asyncValues:X3,__makeTemplateObject:e6,__importStar:t6,__importDefault:r6,__classPrivateFieldGet:n6,__classPrivateFieldSet:i6}),hl=il(s6),Fh={},qa={},r1;function o6(){if(r1)return qa;r1=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return qa.delay=t,qa}var Fs={},jh={},js={},n1;function a6(){return n1||(n1=1,Object.defineProperty(js,"__esModule",{value:!0}),js.ONE_THOUSAND=js.ONE_HUNDRED=void 0,js.ONE_HUNDRED=100,js.ONE_THOUSAND=1e3),js}var kh={},i1;function c6(){return i1||(i1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(kh)),kh}var s1;function o1(){return s1||(s1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=hl;e.__exportStar(a6(),t),e.__exportStar(c6(),t)}(jh)),jh}var a1;function l6(){if(a1)return Fs;a1=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.fromMiliseconds=Fs.toMiliseconds=void 0;const t=o1();function e(n){return n*t.ONE_THOUSAND}Fs.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Fs.fromMiliseconds=r,Fs}var c1;function u6(){return c1||(c1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=hl;e.__exportStar(o6(),t),e.__exportStar(l6(),t)}(Fh)),Fh}var No={},l1;function h6(){if(l1)return No;l1=1,Object.defineProperty(No,"__esModule",{value:!0}),No.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return No.Watch=t,No.default=t,No}var qh={},za={},u1;function f6(){if(u1)return za;u1=1,Object.defineProperty(za,"__esModule",{value:!0}),za.IWatch=void 0;class t{}return za.IWatch=t,za}var h1;function d6(){return h1||(h1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),hl.__exportStar(f6(),t)}(qh)),qh}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=hl;e.__exportStar(u6(),t),e.__exportStar(h6(),t),e.__exportStar(d6(),t),e.__exportStar(o1(),t)})(ye);class ks{}class p6 extends ks{constructor(e){super()}}const f1=ye.FIVE_SECONDS,Ha={pulse:"heartbeat_pulse"};class zh extends p6{constructor(e){super(e),this.events=new Cr.exports.EventEmitter,this.interval=f1,this.interval=e?.interval||f1}static async init(e){const r=new zh(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ye.toMiliseconds(this.interval))}pulse(){this.events.emit(Ha.pulse)}}function g6(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var m6=v6;function v6(t,e,r){var n=r&&r.stringify||g6,i=1;if(typeof t=="object"&&t!==null){var o=e.length+i;if(o===1)return t;var c=new Array(o);c[0]=n(t);for(var l=1;l<o;l++)c[l]=n(e[l]);return c.join(" ")}if(typeof t!="string")return t;var f=e.length;if(f===0)return t;for(var h="",g=1-i,_=-1,E=t&&t.length||0,x=0;x<E;){if(t.charCodeAt(x)===37&&x+1<E){switch(_=_>-1?_:0,t.charCodeAt(x+1)){case 100:case 102:if(g>=f||e[g]==null)break;_<x&&(h+=t.slice(_,x)),h+=Number(e[g]),_=x+2,x++;break;case 105:if(g>=f||e[g]==null)break;_<x&&(h+=t.slice(_,x)),h+=Math.floor(Number(e[g])),_=x+2,x++;break;case 79:case 111:case 106:if(g>=f||e[g]===void 0)break;_<x&&(h+=t.slice(_,x));var I=typeof e[g];if(I==="string"){h+="'"+e[g]+"'",_=x+2,x++;break}if(I==="function"){h+=e[g].name||"<anonymous>",_=x+2,x++;break}h+=n(e[g]),_=x+2,x++;break;case 115:if(g>=f)break;_<x&&(h+=t.slice(_,x)),h+=String(e[g]),_=x+2,x++;break;case 37:_<x&&(h+=t.slice(_,x)),h+="%",_=x+2,x++,g--;break}++g}++x}return _===-1?t:(_<E&&(h+=t.slice(_)),h)}const d1=m6;var ai=ci;const Ka=C6().console||{},w6={mapHttpRequest:dl,mapHttpResponse:dl,wrapRequestSerializer:Kh,wrapResponseSerializer:Kh,wrapErrorSerializer:Kh,req:dl,res:dl,err:A6};function y6(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function ci(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||Ka;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=y6(t.browser.serialize,n);let o=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const c=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const l=t.level||"info",f=Object.create(r);f.log||(f.log=Wa),Object.defineProperty(f,"levelVal",{get:g}),Object.defineProperty(f,"level",{get:_,set:E});const h={transmit:e,serialize:i,asObject:t.browser.asObject,levels:c,timestamp:x6(t)};f.levels=ci.levels,f.level=l,f.setMaxListeners=f.getMaxListeners=f.emit=f.addListener=f.on=f.prependListener=f.once=f.prependOnceListener=f.removeListener=f.removeAllListeners=f.listeners=f.listenerCount=f.eventNames=f.write=f.flush=Wa,f.serializers=n,f._serialize=i,f._stdErrSerialize=o,f.child=x,e&&(f._logEvent=Hh());function g(){return this.level==="silent"?1/0:this.levels.values[this.level]}function _(){return this._level}function E(I){if(I!=="silent"&&!this.levels.values[I])throw Error("unknown level "+I);this._level=I,Ro(h,f,"error","log"),Ro(h,f,"fatal","error"),Ro(h,f,"warn","error"),Ro(h,f,"info","log"),Ro(h,f,"debug","log"),Ro(h,f,"trace","log")}function x(I,F){if(!I)throw new Error("missing bindings for child Pino");F=F||{},i&&I.serializers&&(F.serializers=I.serializers);const W=F.serializers;if(i&&W){var Y=Object.assign({},n,W),B=t.browser.serialize===!0?Object.keys(Y):i;delete I.serializers,fl([I],B,Y,this._stdErrSerialize)}function z(M){this._childLevel=(M._childLevel|0)+1,this.error=Lo(M,I,"error"),this.fatal=Lo(M,I,"fatal"),this.warn=Lo(M,I,"warn"),this.info=Lo(M,I,"info"),this.debug=Lo(M,I,"debug"),this.trace=Lo(M,I,"trace"),Y&&(this.serializers=Y,this._serialize=B),e&&(this._logEvent=Hh([].concat(M._logEvent.bindings,I)))}return z.prototype=this,new z(this)}return f}ci.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},ci.stdSerializers=w6,ci.stdTimeFunctions=Object.assign({},{nullTime:p1,epochTime:g1,unixTime:I6,isoTime:S6});function Ro(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Wa:i[r]?i[r]:Ka[r]||Ka[n]||Wa,b6(t,e,r)}function b6(t,e,r){!t.transmit&&e[r]===Wa||(e[r]=function(n){return function(){const o=t.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ka?Ka:this;for(var f=0;f<c.length;f++)c[f]=arguments[f];if(t.serialize&&!t.asObject&&fl(c,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(l,_6(this,r,c,o)):n.apply(l,c),t.transmit){const h=t.transmit.level||e.level,g=ci.levels.values[h],_=ci.levels.values[r];if(_<g)return;E6(this,{ts:o,methodLevel:r,methodValue:_,transmitLevel:h,transmitValue:ci.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},c)}}}(e[r]))}function _6(t,e,r,n){t._serialize&&fl(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let o=i[0];const c={};n&&(c.time=n),c.level=ci.levels.values[e];let l=(t._childLevel|0)+1;if(l<1&&(l=1),o!==null&&typeof o=="object"){for(;l--&&typeof i[0]=="object";)Object.assign(c,i.shift());o=i.length?d1(i.shift(),i):void 0}else typeof o=="string"&&(o=d1(i.shift(),i));return o!==void 0&&(c.msg=o),c}function fl(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=ci.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i]))for(const o in t[i])e&&e.indexOf(o)>-1&&o in r&&(t[i][o]=r[o](t[i][o]))}function Lo(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return t[r].apply(this,n)}}function E6(t,e,r){const n=e.send,i=e.ts,o=e.methodLevel,c=e.methodValue,l=e.val,f=t._logEvent.bindings;fl(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=i,t._logEvent.messages=r.filter(function(h){return f.indexOf(h)===-1}),t._logEvent.level.label=o,t._logEvent.level.value=c,n(o,t._logEvent,l),t._logEvent=Hh(f)}function Hh(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function A6(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function x6(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?p1:g1}function dl(){return{}}function Kh(t){return t}function Wa(){}function p1(){return!1}function g1(){return Date.now()}function I6(){return Math.round(Date.now()/1e3)}function S6(){return new Date(Date.now()).toISOString()}function C6(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}const D6={level:"info"},Va="custom_context",Wh=1e3*1024;class O6{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class m1{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new O6(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}}class v1{constructor(e,r=Wh){this.level=e??"error",this.levelValue=ai.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new m1(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===ai.levels.values.error?console.error(e):r===ai.levels.values.warn?console.warn(e):r===ai.levels.values.debug?console.debug(e):r===ai.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Li({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new m1(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Li({extraMetadata:e})),new Blob(r,{type:"application/json"})}}class M6{constructor(e,r=Wh){this.baseChunkLogger=new v1(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class P6{constructor(e,r=Wh){this.baseChunkLogger=new v1(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var $6=Object.defineProperty,T6=Object.defineProperties,N6=Object.getOwnPropertyDescriptors,w1=Object.getOwnPropertySymbols,R6=Object.prototype.hasOwnProperty,L6=Object.prototype.propertyIsEnumerable,y1=(t,e,r)=>e in t?$6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pl=(t,e)=>{for(var r in e||(e={}))R6.call(e,r)&&y1(t,r,e[r]);if(w1)for(var r of w1(e))L6.call(e,r)&&y1(t,r,e[r]);return t},gl=(t,e)=>T6(t,N6(e));function ml(t){return gl(pl({},t),{level:t?.level||D6.level})}function B6(t,e=Va){return t[e]||""}function U6(t,e,r=Va){return t[r]=e,t}function en(t,e=Va){let r="";return typeof t.bindings>"u"?r=B6(t,e):r=t.bindings().context||"",r}function F6(t,e,r=Va){const n=en(t,r);return n.trim()?`${n}/${e}`:e}function tn(t,e,r=Va){const n=F6(t,e,r),i=t.child({context:n});return U6(i,n,r)}function j6(t){var e,r;const n=new M6((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:ai(gl(pl({},t.opts),{level:"trace",browser:gl(pl({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function k6(t){var e;const r=new P6((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:ai(gl(pl({},t.opts),{level:"trace"})),chunkLoggerController:r}}function q6(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?j6(t):k6(t)}class z6 extends ks{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class H6 extends ks{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class K6{constructor(e,r){this.logger=e,this.core=r}}class W6 extends ks{constructor(e,r){super(),this.relayer=e,this.logger=r}}class V6 extends ks{constructor(e){super()}}class G6{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class Y6 extends ks{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Q6 extends ks{constructor(e,r){super(),this.core=e,this.logger=r}}class J6{constructor(e,r){this.projectId=e,this.logger=r}}class Z6{constructor(e,r){this.projectId=e,this.logger=r}}class X6{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class e5{constructor(e){this.client=e}}var Vh={},Bo={},vl={},wl={};Object.defineProperty(wl,"__esModule",{value:!0}),wl.BrowserRandomSource=void 0;const b1=65536;class t5{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=b1)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,b1)));return r}}wl.BrowserRandomSource=t5;function r5(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var yl={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});function n5(t){for(var e=0;e<t.length;e++)t[e]=0;return t}pn.wipe=n5;var i5={},s5=Object.freeze({__proto__:null,default:i5}),o5=il(s5);Object.defineProperty(yl,"__esModule",{value:!0}),yl.NodeRandomSource=void 0;const a5=pn;class c5{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof r5<"u"){const e=o5;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,a5.wipe)(r),n}}yl.NodeRandomSource=c5,Object.defineProperty(vl,"__esModule",{value:!0}),vl.SystemRandomSource=void 0;const l5=wl,u5=yl;class h5{constructor(){if(this.isAvailable=!1,this.name="",this._source=new l5.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new u5.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}vl.SystemRandomSource=h5;var ct={},_1={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,f){var h=l>>>16&65535,g=l&65535,_=f>>>16&65535,E=f&65535;return g*E+(h*E+g*_<<16>>>0)|0}t.mul=Math.imul||e;function r(l,f){return l+f|0}t.add=r;function n(l,f){return l-f|0}t.sub=n;function i(l,f){return l<<f|l>>>32-f}t.rotl=i;function o(l,f){return l<<32-f|l>>>f}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(_1),Object.defineProperty(ct,"__esModule",{value:!0});var E1=_1;function f5(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ct.readInt16BE=f5;function d5(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ct.readUint16BE=d5;function p5(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ct.readInt16LE=p5;function g5(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ct.readUint16LE=g5;function A1(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}ct.writeUint16BE=A1,ct.writeInt16BE=A1;function x1(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}ct.writeUint16LE=x1,ct.writeInt16LE=x1;function Gh(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ct.readInt32BE=Gh;function Yh(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ct.readUint32BE=Yh;function Qh(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ct.readInt32LE=Qh;function Jh(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ct.readUint32LE=Jh;function bl(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}ct.writeUint32BE=bl,ct.writeInt32BE=bl;function _l(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}ct.writeUint32LE=_l,ct.writeInt32LE=_l;function m5(t,e){e===void 0&&(e=0);var r=Gh(t,e),n=Gh(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ct.readInt64BE=m5;function v5(t,e){e===void 0&&(e=0);var r=Yh(t,e),n=Yh(t,e+4);return r*4294967296+n}ct.readUint64BE=v5;function w5(t,e){e===void 0&&(e=0);var r=Qh(t,e),n=Qh(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ct.readInt64LE=w5;function y5(t,e){e===void 0&&(e=0);var r=Jh(t,e),n=Jh(t,e+4);return n*4294967296+r}ct.readUint64LE=y5;function I1(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),bl(t/4294967296>>>0,e,r),bl(t>>>0,e,r+4),e}ct.writeUint64BE=I1,ct.writeInt64BE=I1;function S1(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),_l(t>>>0,e,r),_l(t/4294967296>>>0,e,r+4),e}ct.writeUint64LE=S1,ct.writeInt64LE=S1;function b5(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}ct.readUintBE=b5;function _5(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}ct.readUintLE=_5;function E5(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!E1.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}ct.writeUintBE=E5;function A5(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!E1.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}ct.writeUintLE=A5;function x5(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}ct.readFloat32BE=x5;function I5(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}ct.readFloat32LE=I5;function S5(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}ct.readFloat64BE=S5;function C5(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}ct.readFloat64LE=C5;function D5(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}ct.writeFloat32BE=D5;function O5(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}ct.writeFloat32LE=O5;function M5(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}ct.writeFloat64BE=M5;function P5(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}ct.writeFloat64LE=P5,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=vl,r=ct,n=pn;t.defaultRandomSource=new e.SystemRandomSource;function i(h,g=t.defaultRandomSource){return g.randomBytes(h)}t.randomBytes=i;function o(h=t.defaultRandomSource){const g=i(4,h),_=(0,r.readUint32LE)(g);return(0,n.wipe)(g),_}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(h,g=c,_=t.defaultRandomSource){if(g.length<2)throw new Error("randomString charset is too short");if(g.length>256)throw new Error("randomString charset is too long");let E="";const x=g.length,I=256-256%x;for(;h>0;){const F=i(Math.ceil(h*256/I),_);for(let W=0;W<F.length&&h>0;W++){const Y=F[W];Y<I&&(E+=g.charAt(Y%x),h--)}(0,n.wipe)(F)}return E}t.randomString=l;function f(h,g=c,_=t.defaultRandomSource){const E=Math.ceil(h/(Math.log(g.length)/Math.LN2));return l(E,g,_)}t.randomStringForEntropy=f}(Bo);var C1={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ct,r=pn;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var g=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[g++],h--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(g=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,g,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[g++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,g=this._bufferLength,_=h/536870912|0,E=h<<3,x=h%128<112?128:256;this._buffer[g]=128;for(var I=g+1;I<x-8;I++)this._buffer[I]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(E,this._buffer,x-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var I=0;I<this.digestLength/8;I++)e.writeUint32BE(this._stateHi[I],f,I*8),e.writeUint32BE(this._stateLo[I],f,I*8+4);return this},l.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(f){return this._stateHi.set(f.stateHi),this._stateLo.set(f.stateLo),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(f){r.wipe(f.stateHi),r.wipe(f.stateLo),f.buffer&&r.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},l}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(l,f,h,g,_,E,x){for(var I=h[0],F=h[1],W=h[2],Y=h[3],B=h[4],z=h[5],M=h[6],U=h[7],j=g[0],m=g[1],$=g[2],te=g[3],ee=g[4],ne=g[5],de=g[6],d=g[7],p,b,C,O,T,L,D,v;x>=128;){for(var N=0;N<16;N++){var oe=8*N+E;l[N]=e.readUint32BE(_,oe),f[N]=e.readUint32BE(_,oe+4)}for(var N=0;N<80;N++){var pe=I,A=F,re=W,q=Y,H=B,V=z,w=M,k=U,ie=j,he=m,le=$,Oe=te,Pe=ee,Se=ne,Mt=de,ze=d;if(p=U,b=d,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=(B>>>14|ee<<32-14)^(B>>>18|ee<<32-18)^(ee>>>41-32|B<<32-(41-32)),b=(ee>>>14|B<<32-14)^(ee>>>18|B<<32-18)^(B>>>41-32|ee<<32-(41-32)),T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=B&z^~B&M,b=ee&ne^~ee&de,T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=i[N*2],b=i[N*2+1],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=l[N%16],b=f[N%16],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,C=D&65535|v<<16,O=T&65535|L<<16,p=C,b=O,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=(I>>>28|j<<32-28)^(j>>>34-32|I<<32-(34-32))^(j>>>39-32|I<<32-(39-32)),b=(j>>>28|I<<32-28)^(I>>>34-32|j<<32-(34-32))^(I>>>39-32|j<<32-(39-32)),T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=I&F^I&W^F&W,b=j&m^j&$^m&$,T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,k=D&65535|v<<16,ze=T&65535|L<<16,p=q,b=Oe,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=C,b=O,T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,q=D&65535|v<<16,Oe=T&65535|L<<16,F=pe,W=A,Y=re,B=q,z=H,M=V,U=w,I=k,m=ie,$=he,te=le,ee=Oe,ne=Pe,de=Se,d=Mt,j=ze,N%16===15)for(var oe=0;oe<16;oe++)p=l[oe],b=f[oe],T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=l[(oe+9)%16],b=f[(oe+9)%16],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,C=l[(oe+1)%16],O=f[(oe+1)%16],p=(C>>>1|O<<32-1)^(C>>>8|O<<32-8)^C>>>7,b=(O>>>1|C<<32-1)^(O>>>8|C<<32-8)^(O>>>7|C<<32-7),T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,C=l[(oe+14)%16],O=f[(oe+14)%16],p=(C>>>19|O<<32-19)^(O>>>61-32|C<<32-(61-32))^C>>>6,b=(O>>>19|C<<32-19)^(C>>>61-32|O<<32-(61-32))^(O>>>6|C<<32-6),T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,l[oe]=D&65535|v<<16,f[oe]=T&65535|L<<16}p=I,b=j,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[0],b=g[0],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[0]=I=D&65535|v<<16,g[0]=j=T&65535|L<<16,p=F,b=m,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[1],b=g[1],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[1]=F=D&65535|v<<16,g[1]=m=T&65535|L<<16,p=W,b=$,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[2],b=g[2],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[2]=W=D&65535|v<<16,g[2]=$=T&65535|L<<16,p=Y,b=te,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[3],b=g[3],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[3]=Y=D&65535|v<<16,g[3]=te=T&65535|L<<16,p=B,b=ee,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[4],b=g[4],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[4]=B=D&65535|v<<16,g[4]=ee=T&65535|L<<16,p=z,b=ne,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[5],b=g[5],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[5]=z=D&65535|v<<16,g[5]=ne=T&65535|L<<16,p=M,b=de,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[6],b=g[6],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[6]=M=D&65535|v<<16,g[6]=de=T&65535|L<<16,p=U,b=d,T=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[7],b=g[7],T+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=T>>>16,D+=L>>>16,v+=D>>>16,h[7]=U=D&65535|v<<16,g[7]=d=T&65535|L<<16,E+=128,x-=128}return E}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}t.hash=c})(C1),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Bo,r=C1,n=pn;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(q){const H=new Float64Array(16);if(q)for(let V=0;V<q.length;V++)H[V]=q[V];return H}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),f=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),E=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(q,H){for(let V=0;V<16;V++)q[V]=H[V]|0}function I(q){let H=1;for(let V=0;V<16;V++){let w=q[V]+H+65535;H=Math.floor(w/65536),q[V]=w-H*65536}q[0]+=H-1+37*(H-1)}function F(q,H,V){const w=~(V-1);for(let k=0;k<16;k++){const ie=w&(q[k]^H[k]);q[k]^=ie,H[k]^=ie}}function W(q,H){const V=i(),w=i();for(let k=0;k<16;k++)w[k]=H[k];I(w),I(w),I(w);for(let k=0;k<2;k++){V[0]=w[0]-65517;for(let he=1;he<15;he++)V[he]=w[he]-65535-(V[he-1]>>16&1),V[he-1]&=65535;V[15]=w[15]-32767-(V[14]>>16&1);const ie=V[15]>>16&1;V[14]&=65535,F(w,V,1-ie)}for(let k=0;k<16;k++)q[2*k]=w[k]&255,q[2*k+1]=w[k]>>8}function Y(q,H){let V=0;for(let w=0;w<32;w++)V|=q[w]^H[w];return(1&V-1>>>8)-1}function B(q,H){const V=new Uint8Array(32),w=new Uint8Array(32);return W(V,q),W(w,H),Y(V,w)}function z(q){const H=new Uint8Array(32);return W(H,q),H[0]&1}function M(q,H){for(let V=0;V<16;V++)q[V]=H[2*V]+(H[2*V+1]<<8);q[15]&=32767}function U(q,H,V){for(let w=0;w<16;w++)q[w]=H[w]+V[w]}function j(q,H,V){for(let w=0;w<16;w++)q[w]=H[w]-V[w]}function m(q,H,V){let w,k,ie=0,he=0,le=0,Oe=0,Pe=0,Se=0,Mt=0,ze=0,De=0,Fe=0,Ee=0,Ae=0,Ge=0,be=0,xe=0,Be=0,_e=0,Me=0,je=0,$e=0,Te=0,lt=0,Re=0,Ne=0,nr=0,dt=0,Et=0,ir=0,It=0,Ot=0,Vr=0,Ye=V[0],He=V[1],Rt=V[2],Qe=V[3],Ve=V[4],Pt=V[5],Xe=V[6],et=V[7],Lt=V[8],tt=V[9],Je=V[10],Ft=V[11],Ze=V[12],ke=V[13],Ht=V[14],rt=V[15];w=H[0],ie+=w*Ye,he+=w*He,le+=w*Rt,Oe+=w*Qe,Pe+=w*Ve,Se+=w*Pt,Mt+=w*Xe,ze+=w*et,De+=w*Lt,Fe+=w*tt,Ee+=w*Je,Ae+=w*Ft,Ge+=w*Ze,be+=w*ke,xe+=w*Ht,Be+=w*rt,w=H[1],he+=w*Ye,le+=w*He,Oe+=w*Rt,Pe+=w*Qe,Se+=w*Ve,Mt+=w*Pt,ze+=w*Xe,De+=w*et,Fe+=w*Lt,Ee+=w*tt,Ae+=w*Je,Ge+=w*Ft,be+=w*Ze,xe+=w*ke,Be+=w*Ht,_e+=w*rt,w=H[2],le+=w*Ye,Oe+=w*He,Pe+=w*Rt,Se+=w*Qe,Mt+=w*Ve,ze+=w*Pt,De+=w*Xe,Fe+=w*et,Ee+=w*Lt,Ae+=w*tt,Ge+=w*Je,be+=w*Ft,xe+=w*Ze,Be+=w*ke,_e+=w*Ht,Me+=w*rt,w=H[3],Oe+=w*Ye,Pe+=w*He,Se+=w*Rt,Mt+=w*Qe,ze+=w*Ve,De+=w*Pt,Fe+=w*Xe,Ee+=w*et,Ae+=w*Lt,Ge+=w*tt,be+=w*Je,xe+=w*Ft,Be+=w*Ze,_e+=w*ke,Me+=w*Ht,je+=w*rt,w=H[4],Pe+=w*Ye,Se+=w*He,Mt+=w*Rt,ze+=w*Qe,De+=w*Ve,Fe+=w*Pt,Ee+=w*Xe,Ae+=w*et,Ge+=w*Lt,be+=w*tt,xe+=w*Je,Be+=w*Ft,_e+=w*Ze,Me+=w*ke,je+=w*Ht,$e+=w*rt,w=H[5],Se+=w*Ye,Mt+=w*He,ze+=w*Rt,De+=w*Qe,Fe+=w*Ve,Ee+=w*Pt,Ae+=w*Xe,Ge+=w*et,be+=w*Lt,xe+=w*tt,Be+=w*Je,_e+=w*Ft,Me+=w*Ze,je+=w*ke,$e+=w*Ht,Te+=w*rt,w=H[6],Mt+=w*Ye,ze+=w*He,De+=w*Rt,Fe+=w*Qe,Ee+=w*Ve,Ae+=w*Pt,Ge+=w*Xe,be+=w*et,xe+=w*Lt,Be+=w*tt,_e+=w*Je,Me+=w*Ft,je+=w*Ze,$e+=w*ke,Te+=w*Ht,lt+=w*rt,w=H[7],ze+=w*Ye,De+=w*He,Fe+=w*Rt,Ee+=w*Qe,Ae+=w*Ve,Ge+=w*Pt,be+=w*Xe,xe+=w*et,Be+=w*Lt,_e+=w*tt,Me+=w*Je,je+=w*Ft,$e+=w*Ze,Te+=w*ke,lt+=w*Ht,Re+=w*rt,w=H[8],De+=w*Ye,Fe+=w*He,Ee+=w*Rt,Ae+=w*Qe,Ge+=w*Ve,be+=w*Pt,xe+=w*Xe,Be+=w*et,_e+=w*Lt,Me+=w*tt,je+=w*Je,$e+=w*Ft,Te+=w*Ze,lt+=w*ke,Re+=w*Ht,Ne+=w*rt,w=H[9],Fe+=w*Ye,Ee+=w*He,Ae+=w*Rt,Ge+=w*Qe,be+=w*Ve,xe+=w*Pt,Be+=w*Xe,_e+=w*et,Me+=w*Lt,je+=w*tt,$e+=w*Je,Te+=w*Ft,lt+=w*Ze,Re+=w*ke,Ne+=w*Ht,nr+=w*rt,w=H[10],Ee+=w*Ye,Ae+=w*He,Ge+=w*Rt,be+=w*Qe,xe+=w*Ve,Be+=w*Pt,_e+=w*Xe,Me+=w*et,je+=w*Lt,$e+=w*tt,Te+=w*Je,lt+=w*Ft,Re+=w*Ze,Ne+=w*ke,nr+=w*Ht,dt+=w*rt,w=H[11],Ae+=w*Ye,Ge+=w*He,be+=w*Rt,xe+=w*Qe,Be+=w*Ve,_e+=w*Pt,Me+=w*Xe,je+=w*et,$e+=w*Lt,Te+=w*tt,lt+=w*Je,Re+=w*Ft,Ne+=w*Ze,nr+=w*ke,dt+=w*Ht,Et+=w*rt,w=H[12],Ge+=w*Ye,be+=w*He,xe+=w*Rt,Be+=w*Qe,_e+=w*Ve,Me+=w*Pt,je+=w*Xe,$e+=w*et,Te+=w*Lt,lt+=w*tt,Re+=w*Je,Ne+=w*Ft,nr+=w*Ze,dt+=w*ke,Et+=w*Ht,ir+=w*rt,w=H[13],be+=w*Ye,xe+=w*He,Be+=w*Rt,_e+=w*Qe,Me+=w*Ve,je+=w*Pt,$e+=w*Xe,Te+=w*et,lt+=w*Lt,Re+=w*tt,Ne+=w*Je,nr+=w*Ft,dt+=w*Ze,Et+=w*ke,ir+=w*Ht,It+=w*rt,w=H[14],xe+=w*Ye,Be+=w*He,_e+=w*Rt,Me+=w*Qe,je+=w*Ve,$e+=w*Pt,Te+=w*Xe,lt+=w*et,Re+=w*Lt,Ne+=w*tt,nr+=w*Je,dt+=w*Ft,Et+=w*Ze,ir+=w*ke,It+=w*Ht,Ot+=w*rt,w=H[15],Be+=w*Ye,_e+=w*He,Me+=w*Rt,je+=w*Qe,$e+=w*Ve,Te+=w*Pt,lt+=w*Xe,Re+=w*et,Ne+=w*Lt,nr+=w*tt,dt+=w*Je,Et+=w*Ft,ir+=w*Ze,It+=w*ke,Ot+=w*Ht,Vr+=w*rt,ie+=38*_e,he+=38*Me,le+=38*je,Oe+=38*$e,Pe+=38*Te,Se+=38*lt,Mt+=38*Re,ze+=38*Ne,De+=38*nr,Fe+=38*dt,Ee+=38*Et,Ae+=38*ir,Ge+=38*It,be+=38*Ot,xe+=38*Vr,k=1,w=ie+k+65535,k=Math.floor(w/65536),ie=w-k*65536,w=he+k+65535,k=Math.floor(w/65536),he=w-k*65536,w=le+k+65535,k=Math.floor(w/65536),le=w-k*65536,w=Oe+k+65535,k=Math.floor(w/65536),Oe=w-k*65536,w=Pe+k+65535,k=Math.floor(w/65536),Pe=w-k*65536,w=Se+k+65535,k=Math.floor(w/65536),Se=w-k*65536,w=Mt+k+65535,k=Math.floor(w/65536),Mt=w-k*65536,w=ze+k+65535,k=Math.floor(w/65536),ze=w-k*65536,w=De+k+65535,k=Math.floor(w/65536),De=w-k*65536,w=Fe+k+65535,k=Math.floor(w/65536),Fe=w-k*65536,w=Ee+k+65535,k=Math.floor(w/65536),Ee=w-k*65536,w=Ae+k+65535,k=Math.floor(w/65536),Ae=w-k*65536,w=Ge+k+65535,k=Math.floor(w/65536),Ge=w-k*65536,w=be+k+65535,k=Math.floor(w/65536),be=w-k*65536,w=xe+k+65535,k=Math.floor(w/65536),xe=w-k*65536,w=Be+k+65535,k=Math.floor(w/65536),Be=w-k*65536,ie+=k-1+37*(k-1),k=1,w=ie+k+65535,k=Math.floor(w/65536),ie=w-k*65536,w=he+k+65535,k=Math.floor(w/65536),he=w-k*65536,w=le+k+65535,k=Math.floor(w/65536),le=w-k*65536,w=Oe+k+65535,k=Math.floor(w/65536),Oe=w-k*65536,w=Pe+k+65535,k=Math.floor(w/65536),Pe=w-k*65536,w=Se+k+65535,k=Math.floor(w/65536),Se=w-k*65536,w=Mt+k+65535,k=Math.floor(w/65536),Mt=w-k*65536,w=ze+k+65535,k=Math.floor(w/65536),ze=w-k*65536,w=De+k+65535,k=Math.floor(w/65536),De=w-k*65536,w=Fe+k+65535,k=Math.floor(w/65536),Fe=w-k*65536,w=Ee+k+65535,k=Math.floor(w/65536),Ee=w-k*65536,w=Ae+k+65535,k=Math.floor(w/65536),Ae=w-k*65536,w=Ge+k+65535,k=Math.floor(w/65536),Ge=w-k*65536,w=be+k+65535,k=Math.floor(w/65536),be=w-k*65536,w=xe+k+65535,k=Math.floor(w/65536),xe=w-k*65536,w=Be+k+65535,k=Math.floor(w/65536),Be=w-k*65536,ie+=k-1+37*(k-1),q[0]=ie,q[1]=he,q[2]=le,q[3]=Oe,q[4]=Pe,q[5]=Se,q[6]=Mt,q[7]=ze,q[8]=De,q[9]=Fe,q[10]=Ee,q[11]=Ae,q[12]=Ge,q[13]=be,q[14]=xe,q[15]=Be}function $(q,H){m(q,H,H)}function te(q,H){const V=i();let w;for(w=0;w<16;w++)V[w]=H[w];for(w=253;w>=0;w--)$(V,V),w!==2&&w!==4&&m(V,V,H);for(w=0;w<16;w++)q[w]=V[w]}function ee(q,H){const V=i();let w;for(w=0;w<16;w++)V[w]=H[w];for(w=250;w>=0;w--)$(V,V),w!==1&&m(V,V,H);for(w=0;w<16;w++)q[w]=V[w]}function ne(q,H){const V=i(),w=i(),k=i(),ie=i(),he=i(),le=i(),Oe=i(),Pe=i(),Se=i();j(V,q[1],q[0]),j(Se,H[1],H[0]),m(V,V,Se),U(w,q[0],q[1]),U(Se,H[0],H[1]),m(w,w,Se),m(k,q[3],H[3]),m(k,k,h),m(ie,q[2],H[2]),U(ie,ie,ie),j(he,w,V),j(le,ie,k),U(Oe,ie,k),U(Pe,w,V),m(q[0],he,le),m(q[1],Pe,Oe),m(q[2],Oe,le),m(q[3],he,Pe)}function de(q,H,V){for(let w=0;w<4;w++)F(q[w],H[w],V)}function d(q,H){const V=i(),w=i(),k=i();te(k,H[2]),m(V,H[0],k),m(w,H[1],k),W(q,w),q[31]^=z(V)<<7}function p(q,H,V){x(q[0],c),x(q[1],l),x(q[2],l),x(q[3],c);for(let w=255;w>=0;--w){const k=V[w/8|0]>>(w&7)&1;de(q,H,k),ne(H,q),ne(q,q),de(q,H,k)}}function b(q,H){const V=[i(),i(),i(),i()];x(V[0],g),x(V[1],_),x(V[2],l),m(V[3],g,_),p(q,V,H)}function C(q){if(q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const H=(0,r.hash)(q);H[0]&=248,H[31]&=127,H[31]|=64;const V=new Uint8Array(32),w=[i(),i(),i(),i()];b(w,H),d(V,w);const k=new Uint8Array(64);return k.set(q),k.set(V,32),{publicKey:V,secretKey:k}}t.generateKeyPairFromSeed=C;function O(q){const H=(0,e.randomBytes)(32,q),V=C(H);return(0,n.wipe)(H),V}t.generateKeyPair=O;function T(q){if(q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(q.subarray(32))}t.extractPublicKeyFromSecretKey=T;const L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function D(q,H){let V,w,k,ie;for(w=63;w>=32;--w){for(V=0,k=w-32,ie=w-12;k<ie;++k)H[k]+=V-16*H[w]*L[k-(w-32)],V=Math.floor((H[k]+128)/256),H[k]-=V*256;H[k]+=V,H[w]=0}for(V=0,k=0;k<32;k++)H[k]+=V-(H[31]>>4)*L[k],V=H[k]>>8,H[k]&=255;for(k=0;k<32;k++)H[k]-=V*L[k];for(w=0;w<32;w++)H[w+1]+=H[w]>>8,q[w]=H[w]&255}function v(q){const H=new Float64Array(64);for(let V=0;V<64;V++)H[V]=q[V];for(let V=0;V<64;V++)q[V]=0;D(q,H)}function N(q,H){const V=new Float64Array(64),w=[i(),i(),i(),i()],k=(0,r.hash)(q.subarray(0,32));k[0]&=248,k[31]&=127,k[31]|=64;const ie=new Uint8Array(64);ie.set(k.subarray(32),32);const he=new r.SHA512;he.update(ie.subarray(32)),he.update(H);const le=he.digest();he.clean(),v(le),b(w,le),d(ie,w),he.reset(),he.update(ie.subarray(0,32)),he.update(q.subarray(32)),he.update(H);const Oe=he.digest();v(Oe);for(let Pe=0;Pe<32;Pe++)V[Pe]=le[Pe];for(let Pe=0;Pe<32;Pe++)for(let Se=0;Se<32;Se++)V[Pe+Se]+=Oe[Pe]*k[Se];return D(ie.subarray(32),V),ie}t.sign=N;function oe(q,H){const V=i(),w=i(),k=i(),ie=i(),he=i(),le=i(),Oe=i();return x(q[2],l),M(q[1],H),$(k,q[1]),m(ie,k,f),j(k,k,q[2]),U(ie,q[2],ie),$(he,ie),$(le,he),m(Oe,le,he),m(V,Oe,k),m(V,V,ie),ee(V,V),m(V,V,k),m(V,V,ie),m(V,V,ie),m(q[0],V,ie),$(w,q[0]),m(w,w,ie),B(w,k)&&m(q[0],q[0],E),$(w,q[0]),m(w,w,ie),B(w,k)?-1:(z(q[0])===H[31]>>7&&j(q[0],c,q[0]),m(q[3],q[0],q[1]),0)}function pe(q,H,V){const w=new Uint8Array(32),k=[i(),i(),i(),i()],ie=[i(),i(),i(),i()];if(V.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(oe(ie,q))return!1;const he=new r.SHA512;he.update(V.subarray(0,32)),he.update(q),he.update(H);const le=he.digest();return v(le),p(k,ie,le),b(ie,V.subarray(32)),ne(k,ie),d(w,k),!Y(V,w)}t.verify=pe;function A(q){let H=[i(),i(),i(),i()];if(oe(H,q))throw new Error("Ed25519: invalid public key");let V=i(),w=i(),k=H[1];U(V,l,k),j(w,l,k),te(w,w),m(V,V,w);let ie=new Uint8Array(32);return W(ie,V),ie}t.convertPublicKeyToX25519=A;function re(q){const H=(0,r.hash)(q.subarray(0,32));H[0]&=248,H[31]&=127,H[31]|=64;const V=new Uint8Array(H.subarray(0,32));return(0,n.wipe)(H),V}t.convertSecretKeyToX25519=re}(Vh);const $5="EdDSA",T5="JWT",D1=".",O1="base64url",N5="utf8",R5="utf8",L5=":",B5="did",U5="key",M1="base58btc",F5="z",j5="K36",k5=32;function Zh(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function P1(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Zh(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function q5(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=P1(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return Zh(r)}function z5(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,f=t.charAt(0),h=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function _(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var F=0,W=0,Y=0,B=I.length;Y!==B&&I[Y]===0;)Y++,F++;for(var z=(B-Y)*g+1>>>0,M=new Uint8Array(z);Y!==B;){for(var U=I[Y],j=0,m=z-1;(U!==0||j<W)&&m!==-1;m--,j++)U+=256*M[m]>>>0,M[m]=U%l>>>0,U=U/l>>>0;if(U!==0)throw new Error("Non-zero carry");W=j,Y++}for(var $=z-W;$!==z&&M[$]===0;)$++;for(var te=f.repeat(F);$<z;++$)te+=t.charAt(M[$]);return te}function E(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var F=0;if(I[F]!==" "){for(var W=0,Y=0;I[F]===f;)W++,F++;for(var B=(I.length-F)*h+1>>>0,z=new Uint8Array(B);I[F];){var M=r[I.charCodeAt(F)];if(M===255)return;for(var U=0,j=B-1;(M!==0||U<Y)&&j!==-1;j--,U++)M+=l*z[j]>>>0,z[j]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");Y=U,F++}if(I[F]!==" "){for(var m=B-Y;m!==B&&z[m]===0;)m++;for(var $=new Uint8Array(W+(B-m)),te=W;m!==B;)$[te++]=z[m++];return $}}}function x(I){var F=E(I);if(F)return F;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:E,decode:x}}var H5=z5,K5=H5;const $1=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},W5=t=>new TextEncoder().encode(t),V5=t=>new TextDecoder().decode(t);class G5{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Y5{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return T1(this,e)}}class Q5{constructor(e){this.decoders=e}or(e){return T1(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const T1=(t,e)=>new Q5({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class J5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new G5(e,r,n),this.decoder=new Y5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const El=({name:t,prefix:e,encode:r,decode:n})=>new J5(t,e,r,n),Ga=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=K5(r,e);return El({prefix:t,name:e,encode:n,decode:o=>$1(i(o))})},Z5=(t,e,r,n)=>{const i={};for(let g=0;g<e.length;++g)i[e[g]]=g;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,f=0,h=0;for(let g=0;g<o;++g){const _=i[t[g]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|_,l+=r,l>=8&&(l-=8,c[h++]=255&f>>l)}if(l>=r||255&f<<8-l)throw new SyntaxError("Unexpected end of data");return c},X5=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<t.length;++f)for(l=l<<8|t[f],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Dr=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>El({prefix:e,name:t,encode(i){return X5(i,n,r)},decode(i){return Z5(i,n,r,t)}}),e8=El({prefix:"\0",name:"identity",encode:t=>V5(t),decode:t=>W5(t)});var t8=Object.freeze({__proto__:null,identity:e8});const r8=Dr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var n8=Object.freeze({__proto__:null,base2:r8});const i8=Dr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var s8=Object.freeze({__proto__:null,base8:i8});const o8=Ga({prefix:"9",name:"base10",alphabet:"0123456789"});var a8=Object.freeze({__proto__:null,base10:o8});const c8=Dr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),l8=Dr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var u8=Object.freeze({__proto__:null,base16:c8,base16upper:l8});const h8=Dr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),f8=Dr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),d8=Dr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),p8=Dr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),g8=Dr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),m8=Dr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),v8=Dr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),w8=Dr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),y8=Dr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var b8=Object.freeze({__proto__:null,base32:h8,base32upper:f8,base32pad:d8,base32padupper:p8,base32hex:g8,base32hexupper:m8,base32hexpad:v8,base32hexpadupper:w8,base32z:y8});const _8=Ga({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),E8=Ga({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var A8=Object.freeze({__proto__:null,base36:_8,base36upper:E8});const x8=Ga({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),I8=Ga({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var S8=Object.freeze({__proto__:null,base58btc:x8,base58flickr:I8});const C8=Dr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),D8=Dr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),O8=Dr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),M8=Dr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var P8=Object.freeze({__proto__:null,base64:C8,base64pad:D8,base64url:O8,base64urlpad:M8});const N1=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),$8=N1.reduce((t,e,r)=>(t[r]=e,t),[]),T8=N1.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function N8(t){return t.reduce((e,r)=>(e+=$8[r],e),"")}function R8(t){const e=[];for(const r of t){const n=T8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const L8=El({prefix:"\u{1F680}",name:"base256emoji",encode:N8,decode:R8});var B8=Object.freeze({__proto__:null,base256emoji:L8}),U8=L1,R1=128,F8=127,j8=~F8,k8=Math.pow(2,31);function L1(t,e,r){e=e||[],r=r||0;for(var n=r;t>=k8;)e[r++]=t&255|R1,t/=128;for(;t&j8;)e[r++]=t&255|R1,t>>>=7;return e[r]=t|0,L1.bytes=r-n+1,e}var q8=Xh,z8=128,B1=127;function Xh(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw Xh.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&B1)<<i:(c&B1)*Math.pow(2,i),i+=7}while(c>=z8);return Xh.bytes=o-n,r}var H8=Math.pow(2,7),K8=Math.pow(2,14),W8=Math.pow(2,21),V8=Math.pow(2,28),G8=Math.pow(2,35),Y8=Math.pow(2,42),Q8=Math.pow(2,49),J8=Math.pow(2,56),Z8=Math.pow(2,63),X8=function(t){return t<H8?1:t<K8?2:t<W8?3:t<V8?4:t<G8?5:t<Y8?6:t<Q8?7:t<J8?8:t<Z8?9:10},e_={encode:U8,decode:q8,encodingLength:X8},U1=e_;const F1=(t,e,r=0)=>(U1.encode(t,e,r),e),j1=t=>U1.encodingLength(t),ef=(t,e)=>{const r=e.byteLength,n=j1(t),i=n+j1(r),o=new Uint8Array(i+r);return F1(t,o,0),F1(r,o,n),o.set(e,i),new t_(t,r,e,o)};class t_{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const k1=({name:t,code:e,encode:r})=>new r_(t,e,r);class r_{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?ef(this.code,r):r.then(n=>ef(this.code,n))}else throw Error("Unknown type, must be binary type")}}const q1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),n_=k1({name:"sha2-256",code:18,encode:q1("SHA-256")}),i_=k1({name:"sha2-512",code:19,encode:q1("SHA-512")});var s_=Object.freeze({__proto__:null,sha256:n_,sha512:i_});const z1=0,o_="identity",H1=$1;var a_=Object.freeze({__proto__:null,identity:{code:z1,name:o_,encode:H1,digest:t=>ef(z1,H1(t))}});new TextEncoder,new TextDecoder;const Uo={...t8,...n8,...s8,...a8,...u8,...b8,...A8,...S8,...P8,...B8};({...s_,...a_});function K1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const W1=K1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),tf=K1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=P1(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),V1={utf8:W1,"utf-8":W1,hex:Uo.base16,latin1:tf,ascii:tf,binary:tf,...Uo};function rf(t,e="utf8"){const r=V1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function nf(t,e="utf8"){const r=V1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Zh(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Al(t){return rf(nf(Li(t),N5),O1)}function G1(t){const e=nf(j5,M1),r=F5+rf(q5([e,t]),M1);return[B5,U5,r].join(L5)}function c_(t){return rf(t,O1)}function l_(t){return nf([Al(t.header),Al(t.payload)].join(D1),R5)}function u_(t){return[Al(t.header),Al(t.payload),c_(t.signature)].join(D1)}function Y1(t=Bo.randomBytes(k5)){return Vh.generateKeyPairFromSeed(t)}async function h_(t,e,r,n,i=ye.fromMiliseconds(Date.now())){const o={alg:$5,typ:T5},c=G1(n.publicKey),l=i+r,f={iss:c,sub:t,aud:e,iat:i,exp:l},h=l_({header:o,payload:f}),g=Vh.sign(n.secretKey,h);return u_({header:o,payload:f,signature:g})}var Q1=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},f_=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),d_=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),p_=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),g_=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),m_=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),v_=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,w_=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,J1=3,y_=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",v_]],Z1=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function b_(t){return t?X1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new m_:typeof navigator<"u"?X1(navigator.userAgent):A_()}function __(t){return t!==""&&y_.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function X1(t){var e=__(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new g_;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<J1&&(i=Q1(Q1([],i,!0),x_(J1-i.length),!0)):i=[];var o=i.join("."),c=E_(t),l=w_.exec(t);return l&&l[1]?new p_(r,o,c,l[1]):new f_(r,o,c)}function E_(t){for(var e=0,r=Z1.length;e<r;e++){var n=Z1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function A_(){var t=typeof process<"u"&&process.version;return t?new d_(process.version.slice(1)):null}function x_(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.getLocalStorage=Qt.getLocalStorageOrThrow=Qt.getCrypto=Qt.getCryptoOrThrow=eg=Qt.getLocation=Qt.getLocationOrThrow=of=Qt.getNavigator=Qt.getNavigatorOrThrow=sf=Qt.getDocument=Qt.getDocumentOrThrow=Qt.getFromWindowOrThrow=Qt.getFromWindow=void 0;function qs(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Qt.getFromWindow=qs;function Fo(t){const e=qs(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Qt.getFromWindowOrThrow=Fo;function I_(){return Fo("document")}Qt.getDocumentOrThrow=I_;function S_(){return qs("document")}var sf=Qt.getDocument=S_;function C_(){return Fo("navigator")}Qt.getNavigatorOrThrow=C_;function D_(){return qs("navigator")}var of=Qt.getNavigator=D_;function O_(){return Fo("location")}Qt.getLocationOrThrow=O_;function M_(){return qs("location")}var eg=Qt.getLocation=M_;function P_(){return Fo("crypto")}Qt.getCryptoOrThrow=P_;function $_(){return qs("crypto")}Qt.getCrypto=$_;function T_(){return Fo("localStorage")}Qt.getLocalStorageOrThrow=T_;function N_(){return qs("localStorage")}Qt.getLocalStorage=N_;var af={};Object.defineProperty(af,"__esModule",{value:!0});var tg=af.getWindowMetadata=void 0;const rg=Qt;function R_(){let t,e;try{t=rg.getDocumentOrThrow(),e=rg.getLocationOrThrow()}catch{return null}function r(){const _=t.getElementsByTagName("link"),E=[];for(let x=0;x<_.length;x++){const I=_[x],F=I.getAttribute("rel");if(F&&F.toLowerCase().indexOf("icon")>-1){const W=I.getAttribute("href");if(W)if(W.toLowerCase().indexOf("https:")===-1&&W.toLowerCase().indexOf("http:")===-1&&W.indexOf("//")!==0){let Y=e.protocol+"//"+e.host;if(W.indexOf("/")===0)Y+=W;else{const B=e.pathname.split("/");B.pop();const z=B.join("/");Y+=z+"/"+W}E.push(Y)}else if(W.indexOf("//")===0){const Y=e.protocol+W;E.push(Y)}else E.push(W)}}return E}function n(..._){const E=t.getElementsByTagName("meta");for(let x=0;x<E.length;x++){const I=E[x],F=["itemprop","property","name"].map(W=>I.getAttribute(W)).filter(W=>W?_.includes(W):!1);if(F.length&&F){const W=I.getAttribute("content");if(W)return W}}return""}function i(){let _=n("name","og:site_name","og:title","twitter:title");return _||(_=t.title),_}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),f=e.origin,h=r();return{description:l,url:f,icons:h,name:c}}tg=af.getWindowMetadata=R_;var Ya={},L_=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),ng="%[a-f0-9]{2}",ig=new RegExp("("+ng+")|([^%]+?)","gi"),sg=new RegExp("("+ng+")+","gi");function cf(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],cf(r),cf(n))}function B_(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(ig)||[],r=1;r<e.length;r++)t=cf(e,r).join(""),e=t.match(ig)||[];return t}}function U_(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=sg.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=B_(r[0]);n!==r[0]&&(e[r[0]]=n)}r=sg.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var F_=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return U_(t)}},j_=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},k_=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=L_,r=F_,n=j_,i=k_,o=B=>B==null,c=Symbol("encodeFragmentIdentifier");function l(B){switch(B.arrayFormat){case"index":return z=>(M,U)=>{const j=M.length;return U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,[g(z,B),"[",j,"]"].join("")]:[...M,[g(z,B),"[",g(j,B),"]=",g(U,B)].join("")]};case"bracket":return z=>(M,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,[g(z,B),"[]"].join("")]:[...M,[g(z,B),"[]=",g(U,B)].join("")];case"colon-list-separator":return z=>(M,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,[g(z,B),":list="].join("")]:[...M,[g(z,B),":list=",g(U,B)].join("")];case"comma":case"separator":case"bracket-separator":{const z=B.arrayFormat==="bracket-separator"?"[]=":"=";return M=>(U,j)=>j===void 0||B.skipNull&&j===null||B.skipEmptyString&&j===""?U:(j=j===null?"":j,U.length===0?[[g(M,B),z,g(j,B)].join("")]:[[U,g(j,B)].join(B.arrayFormatSeparator)])}default:return z=>(M,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?M:U===null?[...M,g(z,B)]:[...M,[g(z,B),"=",g(U,B)].join("")]}}function f(B){let z;switch(B.arrayFormat){case"index":return(M,U,j)=>{if(z=/\[(\d*)\]$/.exec(M),M=M.replace(/\[\d*\]$/,""),!z){j[M]=U;return}j[M]===void 0&&(j[M]={}),j[M][z[1]]=U};case"bracket":return(M,U,j)=>{if(z=/(\[\])$/.exec(M),M=M.replace(/\[\]$/,""),!z){j[M]=U;return}if(j[M]===void 0){j[M]=[U];return}j[M]=[].concat(j[M],U)};case"colon-list-separator":return(M,U,j)=>{if(z=/(:list)$/.exec(M),M=M.replace(/:list$/,""),!z){j[M]=U;return}if(j[M]===void 0){j[M]=[U];return}j[M]=[].concat(j[M],U)};case"comma":case"separator":return(M,U,j)=>{const m=typeof U=="string"&&U.includes(B.arrayFormatSeparator),$=typeof U=="string"&&!m&&_(U,B).includes(B.arrayFormatSeparator);U=$?_(U,B):U;const te=m||$?U.split(B.arrayFormatSeparator).map(ee=>_(ee,B)):U===null?U:_(U,B);j[M]=te};case"bracket-separator":return(M,U,j)=>{const m=/(\[\])$/.test(M);if(M=M.replace(/\[\]$/,""),!m){j[M]=U&&_(U,B);return}const $=U===null?[]:U.split(B.arrayFormatSeparator).map(te=>_(te,B));if(j[M]===void 0){j[M]=$;return}j[M]=[].concat(j[M],$)};default:return(M,U,j)=>{if(j[M]===void 0){j[M]=U;return}j[M]=[].concat(j[M],U)}}}function h(B){if(typeof B!="string"||B.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(B,z){return z.encode?z.strict?e(B):encodeURIComponent(B):B}function _(B,z){return z.decode?r(B):B}function E(B){return Array.isArray(B)?B.sort():typeof B=="object"?E(Object.keys(B)).sort((z,M)=>Number(z)-Number(M)).map(z=>B[z]):B}function x(B){const z=B.indexOf("#");return z!==-1&&(B=B.slice(0,z)),B}function I(B){let z="";const M=B.indexOf("#");return M!==-1&&(z=B.slice(M)),z}function F(B){B=x(B);const z=B.indexOf("?");return z===-1?"":B.slice(z+1)}function W(B,z){return z.parseNumbers&&!Number.isNaN(Number(B))&&typeof B=="string"&&B.trim()!==""?B=Number(B):z.parseBooleans&&B!==null&&(B.toLowerCase()==="true"||B.toLowerCase()==="false")&&(B=B.toLowerCase()==="true"),B}function Y(B,z){z=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},z),h(z.arrayFormatSeparator);const M=f(z),U=Object.create(null);if(typeof B!="string"||(B=B.trim().replace(/^[?#&]/,""),!B))return U;for(const j of B.split("&")){if(j==="")continue;let[m,$]=n(z.decode?j.replace(/\+/g," "):j,"=");$=$===void 0?null:["comma","separator","bracket-separator"].includes(z.arrayFormat)?$:_($,z),M(_(m,z),$,U)}for(const j of Object.keys(U)){const m=U[j];if(typeof m=="object"&&m!==null)for(const $ of Object.keys(m))m[$]=W(m[$],z);else U[j]=W(m,z)}return z.sort===!1?U:(z.sort===!0?Object.keys(U).sort():Object.keys(U).sort(z.sort)).reduce((j,m)=>{const $=U[m];return $&&typeof $=="object"&&!Array.isArray($)?j[m]=E($):j[m]=$,j},Object.create(null))}t.extract=F,t.parse=Y,t.stringify=(B,z)=>{if(!B)return"";z=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},z),h(z.arrayFormatSeparator);const M=$=>z.skipNull&&o(B[$])||z.skipEmptyString&&B[$]==="",U=l(z),j={};for(const $ of Object.keys(B))M($)||(j[$]=B[$]);const m=Object.keys(j);return z.sort!==!1&&m.sort(z.sort),m.map($=>{const te=B[$];return te===void 0?"":te===null?g($,z):Array.isArray(te)?te.length===0&&z.arrayFormat==="bracket-separator"?g($,z)+"[]":te.reduce(U($),[]).join("&"):g($,z)+"="+g(te,z)}).filter($=>$.length>0).join("&")},t.parseUrl=(B,z)=>{z=Object.assign({decode:!0},z);const[M,U]=n(B,"#");return Object.assign({url:M.split("?")[0]||"",query:Y(F(B),z)},z&&z.parseFragmentIdentifier&&U?{fragmentIdentifier:_(U,z)}:{})},t.stringifyUrl=(B,z)=>{z=Object.assign({encode:!0,strict:!0,[c]:!0},z);const M=x(B.url).split("?")[0]||"",U=t.extract(B.url),j=t.parse(U,{sort:!1}),m=Object.assign(j,B.query);let $=t.stringify(m,z);$&&($=`?${$}`);let te=I(B.url);return B.fragmentIdentifier&&(te=`#${z[c]?g(B.fragmentIdentifier,z):B.fragmentIdentifier}`),`${M}${$}${te}`},t.pick=(B,z,M)=>{M=Object.assign({parseFragmentIdentifier:!0,[c]:!1},M);const{url:U,query:j,fragmentIdentifier:m}=t.parseUrl(B,M);return t.stringifyUrl({url:U,query:i(j,z),fragmentIdentifier:m},M)},t.exclude=(B,z,M)=>{const U=Array.isArray(z)?j=>!z.includes(j):(j,m)=>!z(j,m);return t.pick(B,U,M)}})(Ya);var lf={},xl={};Object.defineProperty(xl,"__esModule",{value:!0});var Rr=ct,uf=pn,q_=20;function z_(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],f=r[7]<<24|r[6]<<16|r[5]<<8|r[4],h=r[11]<<24|r[10]<<16|r[9]<<8|r[8],g=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=r[19]<<24|r[18]<<16|r[17]<<8|r[16],E=r[23]<<24|r[22]<<16|r[21]<<8|r[20],x=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],F=e[3]<<24|e[2]<<16|e[1]<<8|e[0],W=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Y=e[11]<<24|e[10]<<16|e[9]<<8|e[8],B=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,M=i,U=o,j=c,m=l,$=f,te=h,ee=g,ne=_,de=E,d=x,p=I,b=F,C=W,O=Y,T=B,L=0;L<q_;L+=2)z=z+m|0,b^=z,b=b>>>32-16|b<<16,ne=ne+b|0,m^=ne,m=m>>>32-12|m<<12,M=M+$|0,C^=M,C=C>>>32-16|C<<16,de=de+C|0,$^=de,$=$>>>32-12|$<<12,U=U+te|0,O^=U,O=O>>>32-16|O<<16,d=d+O|0,te^=d,te=te>>>32-12|te<<12,j=j+ee|0,T^=j,T=T>>>32-16|T<<16,p=p+T|0,ee^=p,ee=ee>>>32-12|ee<<12,U=U+te|0,O^=U,O=O>>>32-8|O<<8,d=d+O|0,te^=d,te=te>>>32-7|te<<7,j=j+ee|0,T^=j,T=T>>>32-8|T<<8,p=p+T|0,ee^=p,ee=ee>>>32-7|ee<<7,M=M+$|0,C^=M,C=C>>>32-8|C<<8,de=de+C|0,$^=de,$=$>>>32-7|$<<7,z=z+m|0,b^=z,b=b>>>32-8|b<<8,ne=ne+b|0,m^=ne,m=m>>>32-7|m<<7,z=z+$|0,T^=z,T=T>>>32-16|T<<16,d=d+T|0,$^=d,$=$>>>32-12|$<<12,M=M+te|0,b^=M,b=b>>>32-16|b<<16,p=p+b|0,te^=p,te=te>>>32-12|te<<12,U=U+ee|0,C^=U,C=C>>>32-16|C<<16,ne=ne+C|0,ee^=ne,ee=ee>>>32-12|ee<<12,j=j+m|0,O^=j,O=O>>>32-16|O<<16,de=de+O|0,m^=de,m=m>>>32-12|m<<12,U=U+ee|0,C^=U,C=C>>>32-8|C<<8,ne=ne+C|0,ee^=ne,ee=ee>>>32-7|ee<<7,j=j+m|0,O^=j,O=O>>>32-8|O<<8,de=de+O|0,m^=de,m=m>>>32-7|m<<7,M=M+te|0,b^=M,b=b>>>32-8|b<<8,p=p+b|0,te^=p,te=te>>>32-7|te<<7,z=z+$|0,T^=z,T=T>>>32-8|T<<8,d=d+T|0,$^=d,$=$>>>32-7|$<<7;Rr.writeUint32LE(z+n|0,t,0),Rr.writeUint32LE(M+i|0,t,4),Rr.writeUint32LE(U+o|0,t,8),Rr.writeUint32LE(j+c|0,t,12),Rr.writeUint32LE(m+l|0,t,16),Rr.writeUint32LE($+f|0,t,20),Rr.writeUint32LE(te+h|0,t,24),Rr.writeUint32LE(ee+g|0,t,28),Rr.writeUint32LE(ne+_|0,t,32),Rr.writeUint32LE(de+E|0,t,36),Rr.writeUint32LE(d+x|0,t,40),Rr.writeUint32LE(p+I|0,t,44),Rr.writeUint32LE(b+F|0,t,48),Rr.writeUint32LE(C+W|0,t,52),Rr.writeUint32LE(O+Y|0,t,56),Rr.writeUint32LE(T+B|0,t,60)}function og(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),f=0;f<r.length;f+=64){z_(l,o,t);for(var h=f;h<f+64&&h<r.length;h++)n[h]=r[h]^l[h-f];K_(o,0,c)}return uf.wipe(l),i===0&&uf.wipe(o),n}xl.streamXOR=og;function H_(t,e,r,n){return n===void 0&&(n=0),uf.wipe(r),og(t,e,r,r,n)}xl.stream=H_;function K_(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var ag={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});function W_(t,e,r){return~(t-1)&e|t-1&r}ss.select=W_;function V_(t,e){return(t|0)-(e|0)-1>>>31&1}ss.lessOrEqual=V_;function cg(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}ss.compare=cg;function G_(t,e){return t.length===0||e.length===0?!1:cg(t,e)!==0}ss.equal=G_,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ss,r=pn;t.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var f=l[0]|l[1]<<8;this._r[0]=f&8191;var h=l[2]|l[3]<<8;this._r[1]=(f>>>13|h<<3)&8191;var g=l[4]|l[5]<<8;this._r[2]=(h>>>10|g<<6)&7939;var _=l[6]|l[7]<<8;this._r[3]=(g>>>7|_<<9)&8191;var E=l[8]|l[9]<<8;this._r[4]=(_>>>4|E<<12)&255,this._r[5]=E>>>1&8190;var x=l[10]|l[11]<<8;this._r[6]=(E>>>14|x<<2)&8191;var I=l[12]|l[13]<<8;this._r[7]=(x>>>11|I<<5)&8065;var F=l[14]|l[15]<<8;this._r[8]=(I>>>8|F<<8)&8191,this._r[9]=F>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,f,h){for(var g=this._fin?0:2048,_=this._h[0],E=this._h[1],x=this._h[2],I=this._h[3],F=this._h[4],W=this._h[5],Y=this._h[6],B=this._h[7],z=this._h[8],M=this._h[9],U=this._r[0],j=this._r[1],m=this._r[2],$=this._r[3],te=this._r[4],ee=this._r[5],ne=this._r[6],de=this._r[7],d=this._r[8],p=this._r[9];h>=16;){var b=l[f+0]|l[f+1]<<8;_+=b&8191;var C=l[f+2]|l[f+3]<<8;E+=(b>>>13|C<<3)&8191;var O=l[f+4]|l[f+5]<<8;x+=(C>>>10|O<<6)&8191;var T=l[f+6]|l[f+7]<<8;I+=(O>>>7|T<<9)&8191;var L=l[f+8]|l[f+9]<<8;F+=(T>>>4|L<<12)&8191,W+=L>>>1&8191;var D=l[f+10]|l[f+11]<<8;Y+=(L>>>14|D<<2)&8191;var v=l[f+12]|l[f+13]<<8;B+=(D>>>11|v<<5)&8191;var N=l[f+14]|l[f+15]<<8;z+=(v>>>8|N<<8)&8191,M+=N>>>5|g;var oe=0,pe=oe;pe+=_*U,pe+=E*(5*p),pe+=x*(5*d),pe+=I*(5*de),pe+=F*(5*ne),oe=pe>>>13,pe&=8191,pe+=W*(5*ee),pe+=Y*(5*te),pe+=B*(5*$),pe+=z*(5*m),pe+=M*(5*j),oe+=pe>>>13,pe&=8191;var A=oe;A+=_*j,A+=E*U,A+=x*(5*p),A+=I*(5*d),A+=F*(5*de),oe=A>>>13,A&=8191,A+=W*(5*ne),A+=Y*(5*ee),A+=B*(5*te),A+=z*(5*$),A+=M*(5*m),oe+=A>>>13,A&=8191;var re=oe;re+=_*m,re+=E*j,re+=x*U,re+=I*(5*p),re+=F*(5*d),oe=re>>>13,re&=8191,re+=W*(5*de),re+=Y*(5*ne),re+=B*(5*ee),re+=z*(5*te),re+=M*(5*$),oe+=re>>>13,re&=8191;var q=oe;q+=_*$,q+=E*m,q+=x*j,q+=I*U,q+=F*(5*p),oe=q>>>13,q&=8191,q+=W*(5*d),q+=Y*(5*de),q+=B*(5*ne),q+=z*(5*ee),q+=M*(5*te),oe+=q>>>13,q&=8191;var H=oe;H+=_*te,H+=E*$,H+=x*m,H+=I*j,H+=F*U,oe=H>>>13,H&=8191,H+=W*(5*p),H+=Y*(5*d),H+=B*(5*de),H+=z*(5*ne),H+=M*(5*ee),oe+=H>>>13,H&=8191;var V=oe;V+=_*ee,V+=E*te,V+=x*$,V+=I*m,V+=F*j,oe=V>>>13,V&=8191,V+=W*U,V+=Y*(5*p),V+=B*(5*d),V+=z*(5*de),V+=M*(5*ne),oe+=V>>>13,V&=8191;var w=oe;w+=_*ne,w+=E*ee,w+=x*te,w+=I*$,w+=F*m,oe=w>>>13,w&=8191,w+=W*j,w+=Y*U,w+=B*(5*p),w+=z*(5*d),w+=M*(5*de),oe+=w>>>13,w&=8191;var k=oe;k+=_*de,k+=E*ne,k+=x*ee,k+=I*te,k+=F*$,oe=k>>>13,k&=8191,k+=W*m,k+=Y*j,k+=B*U,k+=z*(5*p),k+=M*(5*d),oe+=k>>>13,k&=8191;var ie=oe;ie+=_*d,ie+=E*de,ie+=x*ne,ie+=I*ee,ie+=F*te,oe=ie>>>13,ie&=8191,ie+=W*$,ie+=Y*m,ie+=B*j,ie+=z*U,ie+=M*(5*p),oe+=ie>>>13,ie&=8191;var he=oe;he+=_*p,he+=E*d,he+=x*de,he+=I*ne,he+=F*ee,oe=he>>>13,he&=8191,he+=W*te,he+=Y*$,he+=B*m,he+=z*j,he+=M*U,oe+=he>>>13,he&=8191,oe=(oe<<2)+oe|0,oe=oe+pe|0,pe=oe&8191,oe=oe>>>13,A+=oe,_=pe,E=A,x=re,I=q,F=H,W=V,Y=w,B=k,z=ie,M=he,f+=16,h-=16}this._h[0]=_,this._h[1]=E,this._h[2]=x,this._h[3]=I,this._h[4]=F,this._h[5]=W,this._h[6]=Y,this._h[7]=B,this._h[8]=z,this._h[9]=M},c.prototype.finish=function(l,f){f===void 0&&(f=0);var h=new Uint16Array(10),g,_,E,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(g=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=g,g=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=g*5,g=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=g,g=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=g,h[0]=this._h[0]+5,g=h[0]>>>13,h[0]&=8191,x=1;x<10;x++)h[x]=this._h[x]+g,g=h[x]>>>13,h[x]&=8191;for(h[9]-=8192,_=(g^1)-1,x=0;x<10;x++)h[x]&=_;for(_=~_,x=0;x<10;x++)this._h[x]=this._h[x]&_|h[x];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,E=this._h[0]+this._pad[0],this._h[0]=E&65535,x=1;x<8;x++)E=(this._h[x]+this._pad[x]|0)+(E>>>16)|0,this._h[x]=E&65535;return l[f+0]=this._h[0]>>>0,l[f+1]=this._h[0]>>>8,l[f+2]=this._h[1]>>>0,l[f+3]=this._h[1]>>>8,l[f+4]=this._h[2]>>>0,l[f+5]=this._h[2]>>>8,l[f+6]=this._h[3]>>>0,l[f+7]=this._h[3]>>>8,l[f+8]=this._h[4]>>>0,l[f+9]=this._h[4]>>>8,l[f+10]=this._h[5]>>>0,l[f+11]=this._h[5]>>>8,l[f+12]=this._h[6]>>>0,l[f+13]=this._h[6]>>>8,l[f+14]=this._h[7]>>>0,l[f+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var f=0,h=l.length,g;if(this._leftover){g=16-this._leftover,g>h&&(g=h);for(var _=0;_<g;_++)this._buffer[this._leftover+_]=l[f+_];if(h-=g,f+=g,this._leftover+=g,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(g=h-h%16,this._blocks(l,f,g),f+=g,h-=g),h){for(var _=0;_<h;_++)this._buffer[this._leftover+_]=l[f+_];this._leftover+=h}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();t.Poly1305=n;function i(c,l){var f=new n(c);f.update(l);var h=f.digest();return f.clean(),h}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(ag),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=xl,r=ag,n=pn,i=ct,o=ss;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function f(h){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,h.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,g,_,E){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(h,x.length-h.length);var I=new Uint8Array(32);e.stream(this._key,x,I,4);var F=g.length+this.tagLength,W;if(E){if(E.length!==F)throw new Error("ChaCha20Poly1305: incorrect destination length");W=E}else W=new Uint8Array(F);return e.streamXOR(this._key,x,g,W,4),this._authenticate(W.subarray(W.length-this.tagLength,W.length),I,W.subarray(0,W.length-this.tagLength),_),n.wipe(x),W},f.prototype.open=function(h,g,_,E){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(g.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(h,x.length-h.length);var I=new Uint8Array(32);e.stream(this._key,x,I,4);var F=new Uint8Array(this.tagLength);if(this._authenticate(F,I,g.subarray(0,g.length-this.tagLength),_),!o.equal(F,g.subarray(g.length-this.tagLength,g.length)))return null;var W=g.length-this.tagLength,Y;if(E){if(E.length!==W)throw new Error("ChaCha20Poly1305: incorrect destination length");Y=E}else Y=new Uint8Array(W);return e.streamXOR(this._key,x,g.subarray(0,g.length-this.tagLength),Y,4),n.wipe(x),Y},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,g,_,E){var x=new r.Poly1305(g);E&&(x.update(E),E.length%16>0&&x.update(c.subarray(E.length%16))),x.update(_),_.length%16>0&&x.update(c.subarray(_.length%16));var I=new Uint8Array(8);E&&i.writeUint64LE(E.length,I),x.update(I),i.writeUint64LE(_.length,I),x.update(I);for(var F=x.digest(),W=0;W<F.length;W++)h[W]=F[W];x.clean(),n.wipe(F),n.wipe(I)},f}();t.ChaCha20Poly1305=l}(lf);var lg={},Qa={},hf={};Object.defineProperty(hf,"__esModule",{value:!0});function Y_(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}hf.isSerializableHash=Y_,Object.defineProperty(Qa,"__esModule",{value:!0});var li=hf,Q_=ss,J_=pn,ug=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),li.isSerializableHash(this._inner)&&li.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),J_.wipe(n)}return t.prototype.reset=function(){if(!li.isSerializableHash(this._inner)||!li.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){li.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),li.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!li.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!li.isSerializableHash(this._inner)||!li.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!li.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Qa.HMAC=ug;function Z_(t,e,r){var n=new ug(t,e);n.update(r);var i=n.digest();return n.clean(),i}Qa.hmac=Z_,Qa.equal=Q_.equal,Object.defineProperty(lg,"__esModule",{value:!0});var hg=Qa,fg=pn,X_=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=hg.hmac(this._hash,n,r);this._hmac=new hg.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),fg.wipe(this._buffer),fg.wipe(this._counter),this._bufpos=0},t}(),e4=lg.HKDF=X_,Il={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ct,r=pn;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var g=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[g++],h--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(g=o(this._temp,this._state,f,g,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[g++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,g=this._bufferLength,_=h/536870912|0,E=h<<3,x=h%64<56?64:128;this._buffer[g]=128;for(var I=g+1;I<x-8;I++)this._buffer[I]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(E,this._buffer,x-4),o(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var I=0;I<this.digestLength/4;I++)e.writeUint32BE(this._state[I],f,I*4);return this},l.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(f){r.wipe(f.state),f.buffer&&r.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},l}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(l,f,h,g,_){for(;_>=64;){for(var E=f[0],x=f[1],I=f[2],F=f[3],W=f[4],Y=f[5],B=f[6],z=f[7],M=0;M<16;M++){var U=g+M*4;l[M]=e.readUint32BE(h,U)}for(var M=16;M<64;M++){var j=l[M-2],m=(j>>>17|j<<32-17)^(j>>>19|j<<32-19)^j>>>10;j=l[M-15];var $=(j>>>7|j<<32-7)^(j>>>18|j<<32-18)^j>>>3;l[M]=(m+l[M-7]|0)+($+l[M-16]|0)}for(var M=0;M<64;M++){var m=(((W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7))+(W&Y^~W&B)|0)+(z+(i[M]+l[M]|0)|0)|0,$=((E>>>2|E<<32-2)^(E>>>13|E<<32-13)^(E>>>22|E<<32-22))+(E&x^E&I^x&I)|0;z=B,B=Y,Y=W,W=F+m|0,F=I,I=x,x=E,E=m+$|0}f[0]+=E,f[1]+=x,f[2]+=I,f[3]+=F,f[4]+=W,f[5]+=Y,f[6]+=B,f[7]+=z,g+=64,_-=64}return g}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}t.hash=c})(Il);var ff={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Bo,r=pn;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(M){const U=new Float64Array(16);if(M)for(let j=0;j<M.length;j++)U[j]=M[j];return U}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c(M){let U=1;for(let j=0;j<16;j++){let m=M[j]+U+65535;U=Math.floor(m/65536),M[j]=m-U*65536}M[0]+=U-1+37*(U-1)}function l(M,U,j){const m=~(j-1);for(let $=0;$<16;$++){const te=m&(M[$]^U[$]);M[$]^=te,U[$]^=te}}function f(M,U){const j=n(),m=n();for(let $=0;$<16;$++)m[$]=U[$];c(m),c(m),c(m);for(let $=0;$<2;$++){j[0]=m[0]-65517;for(let ee=1;ee<15;ee++)j[ee]=m[ee]-65535-(j[ee-1]>>16&1),j[ee-1]&=65535;j[15]=m[15]-32767-(j[14]>>16&1);const te=j[15]>>16&1;j[14]&=65535,l(m,j,1-te)}for(let $=0;$<16;$++)M[2*$]=m[$]&255,M[2*$+1]=m[$]>>8}function h(M,U){for(let j=0;j<16;j++)M[j]=U[2*j]+(U[2*j+1]<<8);M[15]&=32767}function g(M,U,j){for(let m=0;m<16;m++)M[m]=U[m]+j[m]}function _(M,U,j){for(let m=0;m<16;m++)M[m]=U[m]-j[m]}function E(M,U,j){let m,$,te=0,ee=0,ne=0,de=0,d=0,p=0,b=0,C=0,O=0,T=0,L=0,D=0,v=0,N=0,oe=0,pe=0,A=0,re=0,q=0,H=0,V=0,w=0,k=0,ie=0,he=0,le=0,Oe=0,Pe=0,Se=0,Mt=0,ze=0,De=j[0],Fe=j[1],Ee=j[2],Ae=j[3],Ge=j[4],be=j[5],xe=j[6],Be=j[7],_e=j[8],Me=j[9],je=j[10],$e=j[11],Te=j[12],lt=j[13],Re=j[14],Ne=j[15];m=U[0],te+=m*De,ee+=m*Fe,ne+=m*Ee,de+=m*Ae,d+=m*Ge,p+=m*be,b+=m*xe,C+=m*Be,O+=m*_e,T+=m*Me,L+=m*je,D+=m*$e,v+=m*Te,N+=m*lt,oe+=m*Re,pe+=m*Ne,m=U[1],ee+=m*De,ne+=m*Fe,de+=m*Ee,d+=m*Ae,p+=m*Ge,b+=m*be,C+=m*xe,O+=m*Be,T+=m*_e,L+=m*Me,D+=m*je,v+=m*$e,N+=m*Te,oe+=m*lt,pe+=m*Re,A+=m*Ne,m=U[2],ne+=m*De,de+=m*Fe,d+=m*Ee,p+=m*Ae,b+=m*Ge,C+=m*be,O+=m*xe,T+=m*Be,L+=m*_e,D+=m*Me,v+=m*je,N+=m*$e,oe+=m*Te,pe+=m*lt,A+=m*Re,re+=m*Ne,m=U[3],de+=m*De,d+=m*Fe,p+=m*Ee,b+=m*Ae,C+=m*Ge,O+=m*be,T+=m*xe,L+=m*Be,D+=m*_e,v+=m*Me,N+=m*je,oe+=m*$e,pe+=m*Te,A+=m*lt,re+=m*Re,q+=m*Ne,m=U[4],d+=m*De,p+=m*Fe,b+=m*Ee,C+=m*Ae,O+=m*Ge,T+=m*be,L+=m*xe,D+=m*Be,v+=m*_e,N+=m*Me,oe+=m*je,pe+=m*$e,A+=m*Te,re+=m*lt,q+=m*Re,H+=m*Ne,m=U[5],p+=m*De,b+=m*Fe,C+=m*Ee,O+=m*Ae,T+=m*Ge,L+=m*be,D+=m*xe,v+=m*Be,N+=m*_e,oe+=m*Me,pe+=m*je,A+=m*$e,re+=m*Te,q+=m*lt,H+=m*Re,V+=m*Ne,m=U[6],b+=m*De,C+=m*Fe,O+=m*Ee,T+=m*Ae,L+=m*Ge,D+=m*be,v+=m*xe,N+=m*Be,oe+=m*_e,pe+=m*Me,A+=m*je,re+=m*$e,q+=m*Te,H+=m*lt,V+=m*Re,w+=m*Ne,m=U[7],C+=m*De,O+=m*Fe,T+=m*Ee,L+=m*Ae,D+=m*Ge,v+=m*be,N+=m*xe,oe+=m*Be,pe+=m*_e,A+=m*Me,re+=m*je,q+=m*$e,H+=m*Te,V+=m*lt,w+=m*Re,k+=m*Ne,m=U[8],O+=m*De,T+=m*Fe,L+=m*Ee,D+=m*Ae,v+=m*Ge,N+=m*be,oe+=m*xe,pe+=m*Be,A+=m*_e,re+=m*Me,q+=m*je,H+=m*$e,V+=m*Te,w+=m*lt,k+=m*Re,ie+=m*Ne,m=U[9],T+=m*De,L+=m*Fe,D+=m*Ee,v+=m*Ae,N+=m*Ge,oe+=m*be,pe+=m*xe,A+=m*Be,re+=m*_e,q+=m*Me,H+=m*je,V+=m*$e,w+=m*Te,k+=m*lt,ie+=m*Re,he+=m*Ne,m=U[10],L+=m*De,D+=m*Fe,v+=m*Ee,N+=m*Ae,oe+=m*Ge,pe+=m*be,A+=m*xe,re+=m*Be,q+=m*_e,H+=m*Me,V+=m*je,w+=m*$e,k+=m*Te,ie+=m*lt,he+=m*Re,le+=m*Ne,m=U[11],D+=m*De,v+=m*Fe,N+=m*Ee,oe+=m*Ae,pe+=m*Ge,A+=m*be,re+=m*xe,q+=m*Be,H+=m*_e,V+=m*Me,w+=m*je,k+=m*$e,ie+=m*Te,he+=m*lt,le+=m*Re,Oe+=m*Ne,m=U[12],v+=m*De,N+=m*Fe,oe+=m*Ee,pe+=m*Ae,A+=m*Ge,re+=m*be,q+=m*xe,H+=m*Be,V+=m*_e,w+=m*Me,k+=m*je,ie+=m*$e,he+=m*Te,le+=m*lt,Oe+=m*Re,Pe+=m*Ne,m=U[13],N+=m*De,oe+=m*Fe,pe+=m*Ee,A+=m*Ae,re+=m*Ge,q+=m*be,H+=m*xe,V+=m*Be,w+=m*_e,k+=m*Me,ie+=m*je,he+=m*$e,le+=m*Te,Oe+=m*lt,Pe+=m*Re,Se+=m*Ne,m=U[14],oe+=m*De,pe+=m*Fe,A+=m*Ee,re+=m*Ae,q+=m*Ge,H+=m*be,V+=m*xe,w+=m*Be,k+=m*_e,ie+=m*Me,he+=m*je,le+=m*$e,Oe+=m*Te,Pe+=m*lt,Se+=m*Re,Mt+=m*Ne,m=U[15],pe+=m*De,A+=m*Fe,re+=m*Ee,q+=m*Ae,H+=m*Ge,V+=m*be,w+=m*xe,k+=m*Be,ie+=m*_e,he+=m*Me,le+=m*je,Oe+=m*$e,Pe+=m*Te,Se+=m*lt,Mt+=m*Re,ze+=m*Ne,te+=38*A,ee+=38*re,ne+=38*q,de+=38*H,d+=38*V,p+=38*w,b+=38*k,C+=38*ie,O+=38*he,T+=38*le,L+=38*Oe,D+=38*Pe,v+=38*Se,N+=38*Mt,oe+=38*ze,$=1,m=te+$+65535,$=Math.floor(m/65536),te=m-$*65536,m=ee+$+65535,$=Math.floor(m/65536),ee=m-$*65536,m=ne+$+65535,$=Math.floor(m/65536),ne=m-$*65536,m=de+$+65535,$=Math.floor(m/65536),de=m-$*65536,m=d+$+65535,$=Math.floor(m/65536),d=m-$*65536,m=p+$+65535,$=Math.floor(m/65536),p=m-$*65536,m=b+$+65535,$=Math.floor(m/65536),b=m-$*65536,m=C+$+65535,$=Math.floor(m/65536),C=m-$*65536,m=O+$+65535,$=Math.floor(m/65536),O=m-$*65536,m=T+$+65535,$=Math.floor(m/65536),T=m-$*65536,m=L+$+65535,$=Math.floor(m/65536),L=m-$*65536,m=D+$+65535,$=Math.floor(m/65536),D=m-$*65536,m=v+$+65535,$=Math.floor(m/65536),v=m-$*65536,m=N+$+65535,$=Math.floor(m/65536),N=m-$*65536,m=oe+$+65535,$=Math.floor(m/65536),oe=m-$*65536,m=pe+$+65535,$=Math.floor(m/65536),pe=m-$*65536,te+=$-1+37*($-1),$=1,m=te+$+65535,$=Math.floor(m/65536),te=m-$*65536,m=ee+$+65535,$=Math.floor(m/65536),ee=m-$*65536,m=ne+$+65535,$=Math.floor(m/65536),ne=m-$*65536,m=de+$+65535,$=Math.floor(m/65536),de=m-$*65536,m=d+$+65535,$=Math.floor(m/65536),d=m-$*65536,m=p+$+65535,$=Math.floor(m/65536),p=m-$*65536,m=b+$+65535,$=Math.floor(m/65536),b=m-$*65536,m=C+$+65535,$=Math.floor(m/65536),C=m-$*65536,m=O+$+65535,$=Math.floor(m/65536),O=m-$*65536,m=T+$+65535,$=Math.floor(m/65536),T=m-$*65536,m=L+$+65535,$=Math.floor(m/65536),L=m-$*65536,m=D+$+65535,$=Math.floor(m/65536),D=m-$*65536,m=v+$+65535,$=Math.floor(m/65536),v=m-$*65536,m=N+$+65535,$=Math.floor(m/65536),N=m-$*65536,m=oe+$+65535,$=Math.floor(m/65536),oe=m-$*65536,m=pe+$+65535,$=Math.floor(m/65536),pe=m-$*65536,te+=$-1+37*($-1),M[0]=te,M[1]=ee,M[2]=ne,M[3]=de,M[4]=d,M[5]=p,M[6]=b,M[7]=C,M[8]=O,M[9]=T,M[10]=L,M[11]=D,M[12]=v,M[13]=N,M[14]=oe,M[15]=pe}function x(M,U){E(M,U,U)}function I(M,U){const j=n();for(let m=0;m<16;m++)j[m]=U[m];for(let m=253;m>=0;m--)x(j,j),m!==2&&m!==4&&E(j,j,U);for(let m=0;m<16;m++)M[m]=j[m]}function F(M,U){const j=new Uint8Array(32),m=new Float64Array(80),$=n(),te=n(),ee=n(),ne=n(),de=n(),d=n();for(let O=0;O<31;O++)j[O]=M[O];j[31]=M[31]&127|64,j[0]&=248,h(m,U);for(let O=0;O<16;O++)te[O]=m[O];$[0]=ne[0]=1;for(let O=254;O>=0;--O){const T=j[O>>>3]>>>(O&7)&1;l($,te,T),l(ee,ne,T),g(de,$,ee),_($,$,ee),g(ee,te,ne),_(te,te,ne),x(ne,de),x(d,$),E($,ee,$),E(ee,te,de),g(de,$,ee),_($,$,ee),x(te,$),_(ee,ne,d),E($,ee,o),g($,$,ne),E(ee,ee,$),E($,ne,d),E(ne,te,m),x(te,de),l($,te,T),l(ee,ne,T)}for(let O=0;O<16;O++)m[O+16]=$[O],m[O+32]=ee[O],m[O+48]=te[O],m[O+64]=ne[O];const p=m.subarray(32),b=m.subarray(16);I(p,p),E(b,b,p);const C=new Uint8Array(32);return f(C,b),C}t.scalarMult=F;function W(M){return F(M,i)}t.scalarMultBase=W;function Y(M){if(M.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const U=new Uint8Array(M);return{publicKey:W(U),secretKey:U}}t.generateKeyPairFromSeed=Y;function B(M){const U=(0,e.randomBytes)(32,M),j=Y(U);return(0,r.wipe)(U),j}t.generateKeyPair=B;function z(M,U,j=!1){if(M.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(U.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const m=F(M,U);if(j){let $=0;for(let te=0;te<m.length;te++)$|=m[te];if($===0)throw new Error("X25519: invalid shared key")}return m}t.sharedKey=z})(ff);function dg(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function pg(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=dg(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function gg(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const mg=gg("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),df=gg("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=dg(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),vg={utf8:mg,"utf-8":mg,hex:Uo.base16,latin1:df,ascii:df,binary:df,...Uo};function Gn(t,e="utf8"){const r=vg[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Yn(t,e="utf8"){const r=vg[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const t4={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},r4=":";function Sl(t){const[e,r]=t.split(r4);return{namespace:e,reference:r}}function wg(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function yg(t,e){return t.includes(":")?[t]:e.chains||[]}var n4=Object.defineProperty,bg=Object.getOwnPropertySymbols,i4=Object.prototype.hasOwnProperty,s4=Object.prototype.propertyIsEnumerable,_g=(t,e,r)=>e in t?n4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Eg=(t,e)=>{for(var r in e||(e={}))i4.call(e,r)&&_g(t,r,e[r]);if(bg)for(var r of bg(e))s4.call(e,r)&&_g(t,r,e[r]);return t};const o4="ReactNative",gn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},a4="js";function Ja(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function jo(){return!sf()&&!!of()&&navigator.product===o4}function ko(){return!Ja()&&!!of()&&!!sf()}function Za(){return jo()?gn.reactNative:Ja()?gn.node:ko()?gn.browser:gn.unknown}function c4(){var t;try{return jo()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function l4(t,e){let r=Ya.parse(t);return r=Eg(Eg({},r),e),t=Ya.stringify(r),t}function u4(){return tg()||{name:"",description:"",url:"",icons:[""]}}function h4(){if(Za()===gn.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=b_();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function f4(){var t;const e=Za();return e===gn.browser?[e,((t=eg())==null?void 0:t.host)||"unknown"].join(":"):e}function d4(t,e,r){const n=h4(),i=f4();return[[t,e].join("-"),[a4,r].join("-"),n,i].join("/")}function p4({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c,bundleId:l}){const f=r.split("?"),h=d4(t,e,n),g={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0,origin:l||void 0},_=l4(f[1]||"",g);return f[0]+"?"+_}function zs(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Ag(t){return Object.fromEntries(t.entries())}function xg(t){return new Map(Object.entries(t))}function Hs(t=ye.FIVE_MINUTES,e){const r=ye.toMiliseconds(t||ye.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function qo(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function Ig(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function g4(t){return Ig("topic",t)}function m4(t){return Ig("id",t)}function Sg(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Or(t,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(t))}function os(t){return Date.now()>=ye.toMiliseconds(t)}function wt(t,e){return`${t}${e?`:${e}`:""}`}function Cl(t=[],e=[]){return[...new Set([...t,...e])]}async function v4({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${t}&sessionTopic=${e}`,c=Za();c===gn.browser?o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===gn.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}async function w4(t,e){try{return await t.getItem(e)||(ko()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}var Cg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function y4(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Dg={exports:{}};/**
|
|
15
15
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
16
16
|
*
|
|
17
17
|
* @version 0.8.0
|
|
18
18
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
19
19
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",c=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?i=ig:o&&(i=self);var l=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,f=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",h="0123456789abcdef".split(""),g=[31,7936,2031616,520093696],_=[4,1024,262144,67108864],E=[1,256,65536,16777216],x=[6,1536,393216,100663296],I=[0,8,16,24],k=[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],W=[224,256,384,512],Y=[128,256],B=["hex","buffer","arrayBuffer","array","digest"],z={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(A){return Object.prototype.toString.call(A)==="[object Array]"}),f&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(A){return typeof A=="object"&&A.buffer&&A.buffer.constructor===ArrayBuffer});for(var M=function(A,re,q){return function(H){return new N(A,re,A).update(H)[q]()}},U=function(A,re,q){return function(H,V){return new N(A,re,V).update(H)[q]()}},F=function(A,re,q){return function(H,V,w,j){return p["cshake"+A].update(H,V,w,j)[q]()}},m=function(A,re,q){return function(H,V,w,j){return p["kmac"+A].update(H,V,w,j)[q]()}},$=function(A,re,q,H){for(var V=0;V<B.length;++V){var w=B[V];A[w]=re(q,H,w)}return A},te=function(A,re){var q=M(A,re,"hex");return q.create=function(){return new N(A,re,A)},q.update=function(H){return q.create().update(H)},$(q,M,A,re)},ee=function(A,re){var q=U(A,re,"hex");return q.create=function(H){return new N(A,re,H)},q.update=function(H,V){return q.create(V).update(H)},$(q,U,A,re)},ne=function(A,re){var q=z[A],H=F(A,re,"hex");return H.create=function(V,w,j){return!w&&!j?p["shake"+A].create(V):new N(A,re,V).bytepad([w,j],q)},H.update=function(V,w,j,ie){return H.create(w,j,ie).update(V)},$(H,F,A,re)},de=function(A,re){var q=z[A],H=m(A,re,"hex");return H.create=function(V,w,j){return new oe(A,re,w).bytepad(["KMAC",j],q).bytepad([V],q)},H.update=function(V,w,j,ie){return H.create(V,j,ie).update(w)},$(H,m,A,re)},d=[{name:"keccak",padding:E,bits:W,createMethod:te},{name:"sha3",padding:x,bits:W,createMethod:te},{name:"shake",padding:g,bits:Y,createMethod:ee},{name:"cshake",padding:_,bits:Y,createMethod:ne},{name:"kmac",padding:_,bits:Y,createMethod:de}],p={},b=[],D=0;D<d.length;++D)for(var O=d[D],T=O.bits,L=0;L<T.length;++L){var C=O.name+"_"+T[L];if(b.push(C),p[C]=O.createMethod(T[L],O.padding),O.name!=="sha3"){var v=O.name+T[L];b.push(v),p[v]=p[C]}}function N(A,re,q){this.blocks=[],this.s=[],this.padding=re,this.outputBits=q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(A<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=q>>5,this.extraBytes=(q&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}N.prototype.update=function(A){if(this.finalized)throw new Error(r);var re,q=typeof A;if(q!=="string"){if(q==="object"){if(A===null)throw new Error(e);if(f&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!f||!ArrayBuffer.isView(A)))throw new Error(e)}else throw new Error(e);re=!0}for(var H=this.blocks,V=this.byteCount,w=A.length,j=this.blockCount,ie=0,he=this.s,le,Oe;ie<w;){if(this.reset)for(this.reset=!1,H[0]=this.block,le=1;le<j+1;++le)H[le]=0;if(re)for(le=this.start;ie<w&&le<V;++ie)H[le>>2]|=A[ie]<<I[le++&3];else for(le=this.start;ie<w&&le<V;++ie)Oe=A.charCodeAt(ie),Oe<128?H[le>>2]|=Oe<<I[le++&3]:Oe<2048?(H[le>>2]|=(192|Oe>>6)<<I[le++&3],H[le>>2]|=(128|Oe&63)<<I[le++&3]):Oe<55296||Oe>=57344?(H[le>>2]|=(224|Oe>>12)<<I[le++&3],H[le>>2]|=(128|Oe>>6&63)<<I[le++&3],H[le>>2]|=(128|Oe&63)<<I[le++&3]):(Oe=65536+((Oe&1023)<<10|A.charCodeAt(++ie)&1023),H[le>>2]|=(240|Oe>>18)<<I[le++&3],H[le>>2]|=(128|Oe>>12&63)<<I[le++&3],H[le>>2]|=(128|Oe>>6&63)<<I[le++&3],H[le>>2]|=(128|Oe&63)<<I[le++&3]);if(this.lastByteIndex=le,le>=V){for(this.start=le-V,this.block=H[j],le=0;le<j;++le)he[le]^=H[le];pe(he),this.reset=!0}else this.start=le}return this},N.prototype.encode=function(A,re){var q=A&255,H=1,V=[q];for(A=A>>8,q=A&255;q>0;)V.unshift(q),A=A>>8,q=A&255,++H;return re?V.push(H):V.unshift(H),this.update(V),V.length},N.prototype.encodeString=function(A){var re,q=typeof A;if(q!=="string"){if(q==="object"){if(A===null)throw new Error(e);if(f&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!f||!ArrayBuffer.isView(A)))throw new Error(e)}else throw new Error(e);re=!0}var H=0,V=A.length;if(re)H=V;else for(var w=0;w<A.length;++w){var j=A.charCodeAt(w);j<128?H+=1:j<2048?H+=2:j<55296||j>=57344?H+=3:(j=65536+((j&1023)<<10|A.charCodeAt(++w)&1023),H+=4)}return H+=this.encode(H*8),this.update(A),H},N.prototype.bytepad=function(A,re){for(var q=this.encode(re),H=0;H<A.length;++H)q+=this.encodeString(A[H]);var V=re-q%re,w=[];return w.length=V,this.update(w),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var A=this.blocks,re=this.lastByteIndex,q=this.blockCount,H=this.s;if(A[re>>2]|=this.padding[re&3],this.lastByteIndex===this.byteCount)for(A[0]=A[q],re=1;re<q+1;++re)A[re]=0;for(A[q-1]|=2147483648,re=0;re<q;++re)H[re]^=A[re];pe(H)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var A=this.blockCount,re=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,j="",ie;w<q;){for(V=0;V<A&&w<q;++V,++w)ie=re[V],j+=h[ie>>4&15]+h[ie&15]+h[ie>>12&15]+h[ie>>8&15]+h[ie>>20&15]+h[ie>>16&15]+h[ie>>28&15]+h[ie>>24&15];w%A===0&&(pe(re),V=0)}return H&&(ie=re[V],j+=h[ie>>4&15]+h[ie&15],H>1&&(j+=h[ie>>12&15]+h[ie>>8&15]),H>2&&(j+=h[ie>>20&15]+h[ie>>16&15])),j},N.prototype.arrayBuffer=function(){this.finalize();var A=this.blockCount,re=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,j=this.outputBits>>3,ie;H?ie=new ArrayBuffer(q+1<<2):ie=new ArrayBuffer(j);for(var he=new Uint32Array(ie);w<q;){for(V=0;V<A&&w<q;++V,++w)he[w]=re[V];w%A===0&&pe(re)}return H&&(he[V]=re[V],ie=ie.slice(0,j)),ie},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var A=this.blockCount,re=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,j=[],ie,he;w<q;){for(V=0;V<A&&w<q;++V,++w)ie=w<<2,he=re[V],j[ie]=he&255,j[ie+1]=he>>8&255,j[ie+2]=he>>16&255,j[ie+3]=he>>24&255;w%A===0&&pe(re)}return H&&(ie=w<<2,he=re[V],j[ie]=he&255,H>1&&(j[ie+1]=he>>8&255),H>2&&(j[ie+2]=he>>16&255)),j};function oe(A,re,q){N.call(this,A,re,q)}oe.prototype=new N,oe.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var pe=function(A){var re,q,H,V,w,j,ie,he,le,Oe,Pe,Ie,Mt,ze,Ce,Fe,Ee,Ae,Ge,be,xe,Be,_e,Me,je,$e,Te,lt,Re,Ne,nr,dt,Et,ir,St,Ot,Vr,Ye,He,Rt,Qe,Ve,Pt,Xe,et,Lt,tt,Je,Ft,Ze,ke,Ht,rt,jt,ti,kt,vt,Nn,Rn,Ln,Bn,Un,xr;for(H=0;H<48;H+=2)V=A[0]^A[10]^A[20]^A[30]^A[40],w=A[1]^A[11]^A[21]^A[31]^A[41],j=A[2]^A[12]^A[22]^A[32]^A[42],ie=A[3]^A[13]^A[23]^A[33]^A[43],he=A[4]^A[14]^A[24]^A[34]^A[44],le=A[5]^A[15]^A[25]^A[35]^A[45],Oe=A[6]^A[16]^A[26]^A[36]^A[46],Pe=A[7]^A[17]^A[27]^A[37]^A[47],Ie=A[8]^A[18]^A[28]^A[38]^A[48],Mt=A[9]^A[19]^A[29]^A[39]^A[49],re=Ie^(j<<1|ie>>>31),q=Mt^(ie<<1|j>>>31),A[0]^=re,A[1]^=q,A[10]^=re,A[11]^=q,A[20]^=re,A[21]^=q,A[30]^=re,A[31]^=q,A[40]^=re,A[41]^=q,re=V^(he<<1|le>>>31),q=w^(le<<1|he>>>31),A[2]^=re,A[3]^=q,A[12]^=re,A[13]^=q,A[22]^=re,A[23]^=q,A[32]^=re,A[33]^=q,A[42]^=re,A[43]^=q,re=j^(Oe<<1|Pe>>>31),q=ie^(Pe<<1|Oe>>>31),A[4]^=re,A[5]^=q,A[14]^=re,A[15]^=q,A[24]^=re,A[25]^=q,A[34]^=re,A[35]^=q,A[44]^=re,A[45]^=q,re=he^(Ie<<1|Mt>>>31),q=le^(Mt<<1|Ie>>>31),A[6]^=re,A[7]^=q,A[16]^=re,A[17]^=q,A[26]^=re,A[27]^=q,A[36]^=re,A[37]^=q,A[46]^=re,A[47]^=q,re=Oe^(V<<1|w>>>31),q=Pe^(w<<1|V>>>31),A[8]^=re,A[9]^=q,A[18]^=re,A[19]^=q,A[28]^=re,A[29]^=q,A[38]^=re,A[39]^=q,A[48]^=re,A[49]^=q,ze=A[0],Ce=A[1],Lt=A[11]<<4|A[10]>>>28,tt=A[10]<<4|A[11]>>>28,lt=A[20]<<3|A[21]>>>29,Re=A[21]<<3|A[20]>>>29,Ln=A[31]<<9|A[30]>>>23,Bn=A[30]<<9|A[31]>>>23,Ve=A[40]<<18|A[41]>>>14,Pt=A[41]<<18|A[40]>>>14,ir=A[2]<<1|A[3]>>>31,St=A[3]<<1|A[2]>>>31,Fe=A[13]<<12|A[12]>>>20,Ee=A[12]<<12|A[13]>>>20,Je=A[22]<<10|A[23]>>>22,Ft=A[23]<<10|A[22]>>>22,Ne=A[33]<<13|A[32]>>>19,nr=A[32]<<13|A[33]>>>19,Un=A[42]<<2|A[43]>>>30,xr=A[43]<<2|A[42]>>>30,jt=A[5]<<30|A[4]>>>2,ti=A[4]<<30|A[5]>>>2,Ot=A[14]<<6|A[15]>>>26,Vr=A[15]<<6|A[14]>>>26,Ae=A[25]<<11|A[24]>>>21,Ge=A[24]<<11|A[25]>>>21,Ze=A[34]<<15|A[35]>>>17,ke=A[35]<<15|A[34]>>>17,dt=A[45]<<29|A[44]>>>3,Et=A[44]<<29|A[45]>>>3,Me=A[6]<<28|A[7]>>>4,je=A[7]<<28|A[6]>>>4,kt=A[17]<<23|A[16]>>>9,vt=A[16]<<23|A[17]>>>9,Ye=A[26]<<25|A[27]>>>7,He=A[27]<<25|A[26]>>>7,be=A[36]<<21|A[37]>>>11,xe=A[37]<<21|A[36]>>>11,Ht=A[47]<<24|A[46]>>>8,rt=A[46]<<24|A[47]>>>8,Xe=A[8]<<27|A[9]>>>5,et=A[9]<<27|A[8]>>>5,$e=A[18]<<20|A[19]>>>12,Te=A[19]<<20|A[18]>>>12,Nn=A[29]<<7|A[28]>>>25,Rn=A[28]<<7|A[29]>>>25,Rt=A[38]<<8|A[39]>>>24,Qe=A[39]<<8|A[38]>>>24,Be=A[48]<<14|A[49]>>>18,_e=A[49]<<14|A[48]>>>18,A[0]=ze^~Fe&Ae,A[1]=Ce^~Ee&Ge,A[10]=Me^~$e<,A[11]=je^~Te&Re,A[20]=ir^~Ot&Ye,A[21]=St^~Vr&He,A[30]=Xe^~Lt&Je,A[31]=et^~tt&Ft,A[40]=jt^~kt&Nn,A[41]=ti^~vt&Rn,A[2]=Fe^~Ae&be,A[3]=Ee^~Ge&xe,A[12]=$e^~lt&Ne,A[13]=Te^~Re&nr,A[22]=Ot^~Ye&Rt,A[23]=Vr^~He&Qe,A[32]=Lt^~Je&Ze,A[33]=tt^~Ft&ke,A[42]=kt^~Nn&Ln,A[43]=vt^~Rn&Bn,A[4]=Ae^~be&Be,A[5]=Ge^~xe&_e,A[14]=lt^~Ne&dt,A[15]=Re^~nr&Et,A[24]=Ye^~Rt&Ve,A[25]=He^~Qe&Pt,A[34]=Je^~Ze&Ht,A[35]=Ft^~ke&rt,A[44]=Nn^~Ln&Un,A[45]=Rn^~Bn&xr,A[6]=be^~Be&ze,A[7]=xe^~_e&Ce,A[16]=Ne^~dt&Me,A[17]=nr^~Et&je,A[26]=Rt^~Ve&ir,A[27]=Qe^~Pt&St,A[36]=Ze^~Ht&Xe,A[37]=ke^~rt&et,A[46]=Ln^~Un&jt,A[47]=Bn^~xr&ti,A[8]=Be^~ze&Fe,A[9]=_e^~Ce&Ee,A[18]=dt^~Me&$e,A[19]=Et^~je&Te,A[28]=Ve^~ir&Ot,A[29]=Pt^~St&Vr,A[38]=Ht^~Xe&Lt,A[39]=rt^~et&tt,A[48]=Un^~jt&kt,A[49]=xr^~ti&vt,A[0]^=k[H],A[1]^=k[H+1]};if(l)t.exports=p;else for(D=0;D<b.length;++D)i[b[D]]=p[b[D]]})()})(sg);var j8=sg.exports;const k8="logger/5.7.0";let og=!1,ag=!1;const wl={debug:1,default:2,info:2,warning:3,error:4,off:5};let cg=wl.default,tf=null;function q8(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const lg=q8();var rf;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(rf||(rf={}));var Qn;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Qn||(Qn={}));const ug="0123456789abcdef";class ut{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();wl[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(cg>wl[n])&&console.log.apply(console,r)}debug(...e){this._log(ut.levels.DEBUG,e)}info(...e){this._log(ut.levels.INFO,e)}warn(...e){this._log(ut.levels.WARNING,e)}makeError(e,r,n){if(ag)return this.makeError("censored error",r,{});r||(r=ut.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(f=>{const h=n[f];try{if(h instanceof Uint8Array){let g="";for(let _=0;_<h.length;_++)g+=ug[h[_]>>4],g+=ug[h[_]&15];i.push(f+"=Uint8Array(0x"+g+")")}else i.push(f+"="+JSON.stringify(h))}catch{i.push(f+"="+JSON.stringify(n[f].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const o=e;let c="";switch(r){case Qn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const f=e;switch(f){case"overflow":case"underflow":case"division-by-zero":c+="-"+f;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Qn.CALL_EXCEPTION:case Qn.INSUFFICIENT_FUNDS:case Qn.MISSING_NEW:case Qn.NONCE_EXPIRED:case Qn.REPLACEMENT_UNDERPRICED:case Qn.TRANSACTION_REPLACED:case Qn.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const l=new Error(e);return l.reason=o,l.code=r,Object.keys(n).forEach(function(f){l[f]=n[f]}),l}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,ut.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){lg&&this.throwError("platform missing String.prototype.normalize",ut.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:lg})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ut.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ut.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,ut.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,ut.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ut.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ut.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ut.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return tf||(tf=new ut(k8)),tf}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ut.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),og){if(!e)return;this.globalLogger().throwError("error censorship permanent",ut.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ag=!!e,og=!!r}static setLogLevel(e){const r=wl[e.toLowerCase()];if(r==null){ut.globalLogger().warn("invalid log level - "+e);return}cg=r}static from(e){return new ut(e)}}ut.errors=Qn,ut.levels=rf;const z8="bytes/5.7.0",lr=new ut(z8);function hg(t){return!!t.toHexString}function ko(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return ko(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function H8(t){return mn(t)&&!(t.length%2)||qo(t)}function fg(t){return typeof t=="number"&&t==t&&t%1===0}function qo(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!fg(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!fg(r)||r<0||r>=256)return!1}return!0}function or(t,e){if(e||(e={}),typeof t=="number"){lr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),ko(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),hg(t)&&(t=t.toHexString()),mn(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":lr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return ko(new Uint8Array(n))}return qo(t)?ko(new Uint8Array(t)):lr.throwArgumentError("invalid arrayify value","value",t)}function K8(t){const e=t.map(i=>or(i)),r=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(r);return e.reduce((i,o)=>(n.set(o,i),i+o.length),0),ko(n)}function W8(t,e){t=or(t),t.length>e&&lr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),ko(r)}function mn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const nf="0123456789abcdef";function kr(t,e){if(e||(e={}),typeof t=="number"){lr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=nf[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),hg(t))return t.toHexString();if(mn(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":lr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(qo(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=nf[(i&240)>>4]+nf[i&15]}return r}return lr.throwArgumentError("invalid hexlify value","value",t)}function V8(t){if(typeof t!="string")t=kr(t);else if(!mn(t)||t.length%2)return null;return(t.length-2)/2}function dg(t,e,r){return typeof t!="string"?t=kr(t):(!mn(t)||t.length%2)&&lr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ci(t,e){for(typeof t!="string"?t=kr(t):mn(t)||lr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&lr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function pg(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(H8(t)){let r=or(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=kr(r.slice(0,32)),e.s=kr(r.slice(32,64))):r.length===65?(e.r=kr(r.slice(0,32)),e.s=kr(r.slice(32,64)),e.v=r[64]):lr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:lr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=kr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=W8(or(e._vs),32);e._vs=kr(i);const o=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&lr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const c=kr(i);e.s==null?e.s=c:e.s!==c&&lr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?lr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&lr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!mn(e.r)?lr.throwArgumentError("signature missing or invalid r","signature",t):e.r=ci(e.r,32),e.s==null||!mn(e.s)?lr.throwArgumentError("signature missing or invalid s","signature",t):e.s=ci(e.s,32);const r=or(e.s);r[0]>=128&&lr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=kr(r);e._vs&&(mn(e._vs)||lr.throwArgumentError("signature invalid _vs","signature",t),e._vs=ci(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&lr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function sf(t){return"0x"+j8.keccak_256(or(t))}var gg={exports:{}},G8={},Y8=Object.freeze({__proto__:null,default:G8}),Q8=F8(Y8);(function(t){(function(e,r){function n(d,p){if(!d)throw new Error(p||"Assertion failed")}function i(d,p){d.super_=p;var b=function(){};b.prototype=p.prototype,d.prototype=new b,d.prototype.constructor=d}function o(d,p,b){if(o.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((p==="le"||p==="be")&&(b=p,p=10),this._init(d||0,p||10,b||"be"))}typeof e=="object"?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=Q8.Buffer}catch{}o.isBN=function(d){return d instanceof o?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===o.wordSize&&Array.isArray(d.words)},o.max=function(d,p){return d.cmp(p)>0?d:p},o.min=function(d,p){return d.cmp(p)<0?d:p},o.prototype._init=function(d,p,b){if(typeof d=="number")return this._initNumber(d,p,b);if(typeof d=="object")return this._initArray(d,p,b);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),d=d.toString().replace(/\s+/g,"");var D=0;d[0]==="-"&&(D++,this.negative=1),D<d.length&&(p===16?this._parseHex(d,D,b):(this._parseBase(d,p,D),b==="le"&&this._initArray(this.toArray(),p,b)))},o.prototype._initNumber=function(d,p,b){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(n(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),p,b)},o.prototype._initArray=function(d,p,b){if(n(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var D=0;D<this.length;D++)this.words[D]=0;var O,T,L=0;if(b==="be")for(D=d.length-1,O=0;D>=0;D-=3)T=d[D]|d[D-1]<<8|d[D-2]<<16,this.words[O]|=T<<L&67108863,this.words[O+1]=T>>>26-L&67108863,L+=24,L>=26&&(L-=26,O++);else if(b==="le")for(D=0,O=0;D<d.length;D+=3)T=d[D]|d[D+1]<<8|d[D+2]<<16,this.words[O]|=T<<L&67108863,this.words[O+1]=T>>>26-L&67108863,L+=24,L>=26&&(L-=26,O++);return this._strip()};function l(d,p){var b=d.charCodeAt(p);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;n(!1,"Invalid character in "+d)}function f(d,p,b){var D=l(d,b);return b-1>=p&&(D|=l(d,b-1)<<4),D}o.prototype._parseHex=function(d,p,b){this.length=Math.ceil((d.length-p)/6),this.words=new Array(this.length);for(var D=0;D<this.length;D++)this.words[D]=0;var O=0,T=0,L;if(b==="be")for(D=d.length-1;D>=p;D-=2)L=f(d,p,D)<<O,this.words[T]|=L&67108863,O>=18?(O-=18,T+=1,this.words[T]|=L>>>26):O+=8;else{var C=d.length-p;for(D=C%2===0?p+1:p;D<d.length;D+=2)L=f(d,p,D)<<O,this.words[T]|=L&67108863,O>=18?(O-=18,T+=1,this.words[T]|=L>>>26):O+=8}this._strip()};function h(d,p,b,D){for(var O=0,T=0,L=Math.min(d.length,b),C=p;C<L;C++){var v=d.charCodeAt(C)-48;O*=D,v>=49?T=v-49+10:v>=17?T=v-17+10:T=v,n(v>=0&&T<D,"Invalid character"),O+=T}return O}o.prototype._parseBase=function(d,p,b){this.words=[0],this.length=1;for(var D=0,O=1;O<=67108863;O*=p)D++;D--,O=O/p|0;for(var T=d.length-b,L=T%D,C=Math.min(T,T-L)+b,v=0,N=b;N<C;N+=D)v=h(d,N,N+D,p),this.imuln(O),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(L!==0){var oe=1;for(v=h(d,N,d.length,p),N=0;N<L;N++)oe*=p;this.imuln(oe),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},o.prototype.copy=function(d){d.words=new Array(this.length);for(var p=0;p<this.length;p++)d.words[p]=this.words[p];d.length=this.length,d.negative=this.negative,d.red=this.red};function g(d,p){d.words=p.words,d.length=p.length,d.negative=p.negative,d.red=p.red}if(o.prototype._move=function(d){g(d,this)},o.prototype.clone=function(){var d=new o(null);return this.copy(d),d},o.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{o.prototype.inspect=_}else o.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[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],I=[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];o.prototype.toString=function(d,p){d=d||10,p=p|0||1;var b;if(d===16||d==="hex"){b="";for(var D=0,O=0,T=0;T<this.length;T++){var L=this.words[T],C=((L<<D|O)&16777215).toString(16);O=L>>>24-D&16777215,D+=2,D>=26&&(D-=26,T--),O!==0||T!==this.length-1?b=E[6-C.length]+C+b:b=C+b}for(O!==0&&(b=O.toString(16)+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(d===(d|0)&&d>=2&&d<=36){var v=x[d],N=I[d];b="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var pe=oe.modrn(N).toString(d);oe=oe.idivn(N),oe.isZero()?b=pe+b:b=E[v-pe.length]+pe+b}for(this.isZero()&&(b="0"+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(d,p){return this.toArrayLike(c,d,p)}),o.prototype.toArray=function(d,p){return this.toArrayLike(Array,d,p)};var k=function(d,p){return d.allocUnsafe?d.allocUnsafe(p):new d(p)};o.prototype.toArrayLike=function(d,p,b){this._strip();var D=this.byteLength(),O=b||Math.max(1,D);n(D<=O,"byte array longer than desired length"),n(O>0,"Requested array length <= 0");var T=k(d,O),L=p==="le"?"LE":"BE";return this["_toArrayLike"+L](T,D),T},o.prototype._toArrayLikeLE=function(d,p){for(var b=0,D=0,O=0,T=0;O<this.length;O++){var L=this.words[O]<<T|D;d[b++]=L&255,b<d.length&&(d[b++]=L>>8&255),b<d.length&&(d[b++]=L>>16&255),T===6?(b<d.length&&(d[b++]=L>>24&255),D=0,T=0):(D=L>>>24,T+=2)}if(b<d.length)for(d[b++]=D;b<d.length;)d[b++]=0},o.prototype._toArrayLikeBE=function(d,p){for(var b=d.length-1,D=0,O=0,T=0;O<this.length;O++){var L=this.words[O]<<T|D;d[b--]=L&255,b>=0&&(d[b--]=L>>8&255),b>=0&&(d[b--]=L>>16&255),T===6?(b>=0&&(d[b--]=L>>24&255),D=0,T=0):(D=L>>>24,T+=2)}if(b>=0)for(d[b--]=D;b>=0;)d[b--]=0},Math.clz32?o.prototype._countBits=function(d){return 32-Math.clz32(d)}:o.prototype._countBits=function(d){var p=d,b=0;return p>=4096&&(b+=13,p>>>=13),p>=64&&(b+=7,p>>>=7),p>=8&&(b+=4,p>>>=4),p>=2&&(b+=2,p>>>=2),b+p},o.prototype._zeroBits=function(d){if(d===0)return 26;var p=d,b=0;return p&8191||(b+=13,p>>>=13),p&127||(b+=7,p>>>=7),p&15||(b+=4,p>>>=4),p&3||(b+=2,p>>>=2),p&1||b++,b},o.prototype.bitLength=function(){var d=this.words[this.length-1],p=this._countBits(d);return(this.length-1)*26+p};function W(d){for(var p=new Array(d.bitLength()),b=0;b<p.length;b++){var D=b/26|0,O=b%26;p[b]=d.words[D]>>>O&1}return p}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,p=0;p<this.length;p++){var b=this._zeroBits(this.words[p]);if(d+=b,b!==26)break}return d},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},o.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var p=0;p<d.length;p++)this.words[p]=this.words[p]|d.words[p];return this._strip()},o.prototype.ior=function(d){return n((this.negative|d.negative)===0),this.iuor(d)},o.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},o.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},o.prototype.iuand=function(d){var p;this.length>d.length?p=d:p=this;for(var b=0;b<p.length;b++)this.words[b]=this.words[b]&d.words[b];return this.length=p.length,this._strip()},o.prototype.iand=function(d){return n((this.negative|d.negative)===0),this.iuand(d)},o.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},o.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},o.prototype.iuxor=function(d){var p,b;this.length>d.length?(p=this,b=d):(p=d,b=this);for(var D=0;D<b.length;D++)this.words[D]=p.words[D]^b.words[D];if(this!==p)for(;D<p.length;D++)this.words[D]=p.words[D];return this.length=p.length,this._strip()},o.prototype.ixor=function(d){return n((this.negative|d.negative)===0),this.iuxor(d)},o.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},o.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},o.prototype.inotn=function(d){n(typeof d=="number"&&d>=0);var p=Math.ceil(d/26)|0,b=d%26;this._expand(p),b>0&&p--;for(var D=0;D<p;D++)this.words[D]=~this.words[D]&67108863;return b>0&&(this.words[D]=~this.words[D]&67108863>>26-b),this._strip()},o.prototype.notn=function(d){return this.clone().inotn(d)},o.prototype.setn=function(d,p){n(typeof d=="number"&&d>=0);var b=d/26|0,D=d%26;return this._expand(b+1),p?this.words[b]=this.words[b]|1<<D:this.words[b]=this.words[b]&~(1<<D),this._strip()},o.prototype.iadd=function(d){var p;if(this.negative!==0&&d.negative===0)return this.negative=0,p=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,p=this.isub(d),d.negative=1,p._normSign();var b,D;this.length>d.length?(b=this,D=d):(b=d,D=this);for(var O=0,T=0;T<D.length;T++)p=(b.words[T]|0)+(D.words[T]|0)+O,this.words[T]=p&67108863,O=p>>>26;for(;O!==0&&T<b.length;T++)p=(b.words[T]|0)+O,this.words[T]=p&67108863,O=p>>>26;if(this.length=b.length,O!==0)this.words[this.length]=O,this.length++;else if(b!==this)for(;T<b.length;T++)this.words[T]=b.words[T];return this},o.prototype.add=function(d){var p;return d.negative!==0&&this.negative===0?(d.negative=0,p=this.sub(d),d.negative^=1,p):d.negative===0&&this.negative!==0?(this.negative=0,p=d.sub(this),this.negative=1,p):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},o.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var p=this.iadd(d);return d.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var b=this.cmp(d);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var D,O;b>0?(D=this,O=d):(D=d,O=this);for(var T=0,L=0;L<O.length;L++)p=(D.words[L]|0)-(O.words[L]|0)+T,T=p>>26,this.words[L]=p&67108863;for(;T!==0&&L<D.length;L++)p=(D.words[L]|0)+T,T=p>>26,this.words[L]=p&67108863;if(T===0&&L<D.length&&D!==this)for(;L<D.length;L++)this.words[L]=D.words[L];return this.length=Math.max(this.length,L),D!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(d){return this.clone().isub(d)};function Y(d,p,b){b.negative=p.negative^d.negative;var D=d.length+p.length|0;b.length=D,D=D-1|0;var O=d.words[0]|0,T=p.words[0]|0,L=O*T,C=L&67108863,v=L/67108864|0;b.words[0]=C;for(var N=1;N<D;N++){for(var oe=v>>>26,pe=v&67108863,A=Math.min(N,p.length-1),re=Math.max(0,N-d.length+1);re<=A;re++){var q=N-re|0;O=d.words[q]|0,T=p.words[re]|0,L=O*T+pe,oe+=L/67108864|0,pe=L&67108863}b.words[N]=pe|0,v=oe|0}return v!==0?b.words[N]=v|0:b.length--,b._strip()}var B=function(d,p,b){var D=d.words,O=p.words,T=b.words,L=0,C,v,N,oe=D[0]|0,pe=oe&8191,A=oe>>>13,re=D[1]|0,q=re&8191,H=re>>>13,V=D[2]|0,w=V&8191,j=V>>>13,ie=D[3]|0,he=ie&8191,le=ie>>>13,Oe=D[4]|0,Pe=Oe&8191,Ie=Oe>>>13,Mt=D[5]|0,ze=Mt&8191,Ce=Mt>>>13,Fe=D[6]|0,Ee=Fe&8191,Ae=Fe>>>13,Ge=D[7]|0,be=Ge&8191,xe=Ge>>>13,Be=D[8]|0,_e=Be&8191,Me=Be>>>13,je=D[9]|0,$e=je&8191,Te=je>>>13,lt=O[0]|0,Re=lt&8191,Ne=lt>>>13,nr=O[1]|0,dt=nr&8191,Et=nr>>>13,ir=O[2]|0,St=ir&8191,Ot=ir>>>13,Vr=O[3]|0,Ye=Vr&8191,He=Vr>>>13,Rt=O[4]|0,Qe=Rt&8191,Ve=Rt>>>13,Pt=O[5]|0,Xe=Pt&8191,et=Pt>>>13,Lt=O[6]|0,tt=Lt&8191,Je=Lt>>>13,Ft=O[7]|0,Ze=Ft&8191,ke=Ft>>>13,Ht=O[8]|0,rt=Ht&8191,jt=Ht>>>13,ti=O[9]|0,kt=ti&8191,vt=ti>>>13;b.negative=d.negative^p.negative,b.length=19,C=Math.imul(pe,Re),v=Math.imul(pe,Ne),v=v+Math.imul(A,Re)|0,N=Math.imul(A,Ne);var Nn=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,C=Math.imul(q,Re),v=Math.imul(q,Ne),v=v+Math.imul(H,Re)|0,N=Math.imul(H,Ne),C=C+Math.imul(pe,dt)|0,v=v+Math.imul(pe,Et)|0,v=v+Math.imul(A,dt)|0,N=N+Math.imul(A,Et)|0;var Rn=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,C=Math.imul(w,Re),v=Math.imul(w,Ne),v=v+Math.imul(j,Re)|0,N=Math.imul(j,Ne),C=C+Math.imul(q,dt)|0,v=v+Math.imul(q,Et)|0,v=v+Math.imul(H,dt)|0,N=N+Math.imul(H,Et)|0,C=C+Math.imul(pe,St)|0,v=v+Math.imul(pe,Ot)|0,v=v+Math.imul(A,St)|0,N=N+Math.imul(A,Ot)|0;var Ln=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,C=Math.imul(he,Re),v=Math.imul(he,Ne),v=v+Math.imul(le,Re)|0,N=Math.imul(le,Ne),C=C+Math.imul(w,dt)|0,v=v+Math.imul(w,Et)|0,v=v+Math.imul(j,dt)|0,N=N+Math.imul(j,Et)|0,C=C+Math.imul(q,St)|0,v=v+Math.imul(q,Ot)|0,v=v+Math.imul(H,St)|0,N=N+Math.imul(H,Ot)|0,C=C+Math.imul(pe,Ye)|0,v=v+Math.imul(pe,He)|0,v=v+Math.imul(A,Ye)|0,N=N+Math.imul(A,He)|0;var Bn=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,C=Math.imul(Pe,Re),v=Math.imul(Pe,Ne),v=v+Math.imul(Ie,Re)|0,N=Math.imul(Ie,Ne),C=C+Math.imul(he,dt)|0,v=v+Math.imul(he,Et)|0,v=v+Math.imul(le,dt)|0,N=N+Math.imul(le,Et)|0,C=C+Math.imul(w,St)|0,v=v+Math.imul(w,Ot)|0,v=v+Math.imul(j,St)|0,N=N+Math.imul(j,Ot)|0,C=C+Math.imul(q,Ye)|0,v=v+Math.imul(q,He)|0,v=v+Math.imul(H,Ye)|0,N=N+Math.imul(H,He)|0,C=C+Math.imul(pe,Qe)|0,v=v+Math.imul(pe,Ve)|0,v=v+Math.imul(A,Qe)|0,N=N+Math.imul(A,Ve)|0;var Un=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Un>>>26)|0,Un&=67108863,C=Math.imul(ze,Re),v=Math.imul(ze,Ne),v=v+Math.imul(Ce,Re)|0,N=Math.imul(Ce,Ne),C=C+Math.imul(Pe,dt)|0,v=v+Math.imul(Pe,Et)|0,v=v+Math.imul(Ie,dt)|0,N=N+Math.imul(Ie,Et)|0,C=C+Math.imul(he,St)|0,v=v+Math.imul(he,Ot)|0,v=v+Math.imul(le,St)|0,N=N+Math.imul(le,Ot)|0,C=C+Math.imul(w,Ye)|0,v=v+Math.imul(w,He)|0,v=v+Math.imul(j,Ye)|0,N=N+Math.imul(j,He)|0,C=C+Math.imul(q,Qe)|0,v=v+Math.imul(q,Ve)|0,v=v+Math.imul(H,Qe)|0,N=N+Math.imul(H,Ve)|0,C=C+Math.imul(pe,Xe)|0,v=v+Math.imul(pe,et)|0,v=v+Math.imul(A,Xe)|0,N=N+Math.imul(A,et)|0;var xr=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(xr>>>26)|0,xr&=67108863,C=Math.imul(Ee,Re),v=Math.imul(Ee,Ne),v=v+Math.imul(Ae,Re)|0,N=Math.imul(Ae,Ne),C=C+Math.imul(ze,dt)|0,v=v+Math.imul(ze,Et)|0,v=v+Math.imul(Ce,dt)|0,N=N+Math.imul(Ce,Et)|0,C=C+Math.imul(Pe,St)|0,v=v+Math.imul(Pe,Ot)|0,v=v+Math.imul(Ie,St)|0,N=N+Math.imul(Ie,Ot)|0,C=C+Math.imul(he,Ye)|0,v=v+Math.imul(he,He)|0,v=v+Math.imul(le,Ye)|0,N=N+Math.imul(le,He)|0,C=C+Math.imul(w,Qe)|0,v=v+Math.imul(w,Ve)|0,v=v+Math.imul(j,Qe)|0,N=N+Math.imul(j,Ve)|0,C=C+Math.imul(q,Xe)|0,v=v+Math.imul(q,et)|0,v=v+Math.imul(H,Xe)|0,N=N+Math.imul(H,et)|0,C=C+Math.imul(pe,tt)|0,v=v+Math.imul(pe,Je)|0,v=v+Math.imul(A,tt)|0,N=N+Math.imul(A,Je)|0;var Ci=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,C=Math.imul(be,Re),v=Math.imul(be,Ne),v=v+Math.imul(xe,Re)|0,N=Math.imul(xe,Ne),C=C+Math.imul(Ee,dt)|0,v=v+Math.imul(Ee,Et)|0,v=v+Math.imul(Ae,dt)|0,N=N+Math.imul(Ae,Et)|0,C=C+Math.imul(ze,St)|0,v=v+Math.imul(ze,Ot)|0,v=v+Math.imul(Ce,St)|0,N=N+Math.imul(Ce,Ot)|0,C=C+Math.imul(Pe,Ye)|0,v=v+Math.imul(Pe,He)|0,v=v+Math.imul(Ie,Ye)|0,N=N+Math.imul(Ie,He)|0,C=C+Math.imul(he,Qe)|0,v=v+Math.imul(he,Ve)|0,v=v+Math.imul(le,Qe)|0,N=N+Math.imul(le,Ve)|0,C=C+Math.imul(w,Xe)|0,v=v+Math.imul(w,et)|0,v=v+Math.imul(j,Xe)|0,N=N+Math.imul(j,et)|0,C=C+Math.imul(q,tt)|0,v=v+Math.imul(q,Je)|0,v=v+Math.imul(H,tt)|0,N=N+Math.imul(H,Je)|0,C=C+Math.imul(pe,Ze)|0,v=v+Math.imul(pe,ke)|0,v=v+Math.imul(A,Ze)|0,N=N+Math.imul(A,ke)|0;var fo=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(fo>>>26)|0,fo&=67108863,C=Math.imul(_e,Re),v=Math.imul(_e,Ne),v=v+Math.imul(Me,Re)|0,N=Math.imul(Me,Ne),C=C+Math.imul(be,dt)|0,v=v+Math.imul(be,Et)|0,v=v+Math.imul(xe,dt)|0,N=N+Math.imul(xe,Et)|0,C=C+Math.imul(Ee,St)|0,v=v+Math.imul(Ee,Ot)|0,v=v+Math.imul(Ae,St)|0,N=N+Math.imul(Ae,Ot)|0,C=C+Math.imul(ze,Ye)|0,v=v+Math.imul(ze,He)|0,v=v+Math.imul(Ce,Ye)|0,N=N+Math.imul(Ce,He)|0,C=C+Math.imul(Pe,Qe)|0,v=v+Math.imul(Pe,Ve)|0,v=v+Math.imul(Ie,Qe)|0,N=N+Math.imul(Ie,Ve)|0,C=C+Math.imul(he,Xe)|0,v=v+Math.imul(he,et)|0,v=v+Math.imul(le,Xe)|0,N=N+Math.imul(le,et)|0,C=C+Math.imul(w,tt)|0,v=v+Math.imul(w,Je)|0,v=v+Math.imul(j,tt)|0,N=N+Math.imul(j,Je)|0,C=C+Math.imul(q,Ze)|0,v=v+Math.imul(q,ke)|0,v=v+Math.imul(H,Ze)|0,N=N+Math.imul(H,ke)|0,C=C+Math.imul(pe,rt)|0,v=v+Math.imul(pe,jt)|0,v=v+Math.imul(A,rt)|0,N=N+Math.imul(A,jt)|0;var Oi=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,C=Math.imul($e,Re),v=Math.imul($e,Ne),v=v+Math.imul(Te,Re)|0,N=Math.imul(Te,Ne),C=C+Math.imul(_e,dt)|0,v=v+Math.imul(_e,Et)|0,v=v+Math.imul(Me,dt)|0,N=N+Math.imul(Me,Et)|0,C=C+Math.imul(be,St)|0,v=v+Math.imul(be,Ot)|0,v=v+Math.imul(xe,St)|0,N=N+Math.imul(xe,Ot)|0,C=C+Math.imul(Ee,Ye)|0,v=v+Math.imul(Ee,He)|0,v=v+Math.imul(Ae,Ye)|0,N=N+Math.imul(Ae,He)|0,C=C+Math.imul(ze,Qe)|0,v=v+Math.imul(ze,Ve)|0,v=v+Math.imul(Ce,Qe)|0,N=N+Math.imul(Ce,Ve)|0,C=C+Math.imul(Pe,Xe)|0,v=v+Math.imul(Pe,et)|0,v=v+Math.imul(Ie,Xe)|0,N=N+Math.imul(Ie,et)|0,C=C+Math.imul(he,tt)|0,v=v+Math.imul(he,Je)|0,v=v+Math.imul(le,tt)|0,N=N+Math.imul(le,Je)|0,C=C+Math.imul(w,Ze)|0,v=v+Math.imul(w,ke)|0,v=v+Math.imul(j,Ze)|0,N=N+Math.imul(j,ke)|0,C=C+Math.imul(q,rt)|0,v=v+Math.imul(q,jt)|0,v=v+Math.imul(H,rt)|0,N=N+Math.imul(H,jt)|0,C=C+Math.imul(pe,kt)|0,v=v+Math.imul(pe,vt)|0,v=v+Math.imul(A,kt)|0,N=N+Math.imul(A,vt)|0;var po=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(po>>>26)|0,po&=67108863,C=Math.imul($e,dt),v=Math.imul($e,Et),v=v+Math.imul(Te,dt)|0,N=Math.imul(Te,Et),C=C+Math.imul(_e,St)|0,v=v+Math.imul(_e,Ot)|0,v=v+Math.imul(Me,St)|0,N=N+Math.imul(Me,Ot)|0,C=C+Math.imul(be,Ye)|0,v=v+Math.imul(be,He)|0,v=v+Math.imul(xe,Ye)|0,N=N+Math.imul(xe,He)|0,C=C+Math.imul(Ee,Qe)|0,v=v+Math.imul(Ee,Ve)|0,v=v+Math.imul(Ae,Qe)|0,N=N+Math.imul(Ae,Ve)|0,C=C+Math.imul(ze,Xe)|0,v=v+Math.imul(ze,et)|0,v=v+Math.imul(Ce,Xe)|0,N=N+Math.imul(Ce,et)|0,C=C+Math.imul(Pe,tt)|0,v=v+Math.imul(Pe,Je)|0,v=v+Math.imul(Ie,tt)|0,N=N+Math.imul(Ie,Je)|0,C=C+Math.imul(he,Ze)|0,v=v+Math.imul(he,ke)|0,v=v+Math.imul(le,Ze)|0,N=N+Math.imul(le,ke)|0,C=C+Math.imul(w,rt)|0,v=v+Math.imul(w,jt)|0,v=v+Math.imul(j,rt)|0,N=N+Math.imul(j,jt)|0,C=C+Math.imul(q,kt)|0,v=v+Math.imul(q,vt)|0,v=v+Math.imul(H,kt)|0,N=N+Math.imul(H,vt)|0;var go=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(go>>>26)|0,go&=67108863,C=Math.imul($e,St),v=Math.imul($e,Ot),v=v+Math.imul(Te,St)|0,N=Math.imul(Te,Ot),C=C+Math.imul(_e,Ye)|0,v=v+Math.imul(_e,He)|0,v=v+Math.imul(Me,Ye)|0,N=N+Math.imul(Me,He)|0,C=C+Math.imul(be,Qe)|0,v=v+Math.imul(be,Ve)|0,v=v+Math.imul(xe,Qe)|0,N=N+Math.imul(xe,Ve)|0,C=C+Math.imul(Ee,Xe)|0,v=v+Math.imul(Ee,et)|0,v=v+Math.imul(Ae,Xe)|0,N=N+Math.imul(Ae,et)|0,C=C+Math.imul(ze,tt)|0,v=v+Math.imul(ze,Je)|0,v=v+Math.imul(Ce,tt)|0,N=N+Math.imul(Ce,Je)|0,C=C+Math.imul(Pe,Ze)|0,v=v+Math.imul(Pe,ke)|0,v=v+Math.imul(Ie,Ze)|0,N=N+Math.imul(Ie,ke)|0,C=C+Math.imul(he,rt)|0,v=v+Math.imul(he,jt)|0,v=v+Math.imul(le,rt)|0,N=N+Math.imul(le,jt)|0,C=C+Math.imul(w,kt)|0,v=v+Math.imul(w,vt)|0,v=v+Math.imul(j,kt)|0,N=N+Math.imul(j,vt)|0;var Mi=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,C=Math.imul($e,Ye),v=Math.imul($e,He),v=v+Math.imul(Te,Ye)|0,N=Math.imul(Te,He),C=C+Math.imul(_e,Qe)|0,v=v+Math.imul(_e,Ve)|0,v=v+Math.imul(Me,Qe)|0,N=N+Math.imul(Me,Ve)|0,C=C+Math.imul(be,Xe)|0,v=v+Math.imul(be,et)|0,v=v+Math.imul(xe,Xe)|0,N=N+Math.imul(xe,et)|0,C=C+Math.imul(Ee,tt)|0,v=v+Math.imul(Ee,Je)|0,v=v+Math.imul(Ae,tt)|0,N=N+Math.imul(Ae,Je)|0,C=C+Math.imul(ze,Ze)|0,v=v+Math.imul(ze,ke)|0,v=v+Math.imul(Ce,Ze)|0,N=N+Math.imul(Ce,ke)|0,C=C+Math.imul(Pe,rt)|0,v=v+Math.imul(Pe,jt)|0,v=v+Math.imul(Ie,rt)|0,N=N+Math.imul(Ie,jt)|0,C=C+Math.imul(he,kt)|0,v=v+Math.imul(he,vt)|0,v=v+Math.imul(le,kt)|0,N=N+Math.imul(le,vt)|0;var Is=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Is>>>26)|0,Is&=67108863,C=Math.imul($e,Qe),v=Math.imul($e,Ve),v=v+Math.imul(Te,Qe)|0,N=Math.imul(Te,Ve),C=C+Math.imul(_e,Xe)|0,v=v+Math.imul(_e,et)|0,v=v+Math.imul(Me,Xe)|0,N=N+Math.imul(Me,et)|0,C=C+Math.imul(be,tt)|0,v=v+Math.imul(be,Je)|0,v=v+Math.imul(xe,tt)|0,N=N+Math.imul(xe,Je)|0,C=C+Math.imul(Ee,Ze)|0,v=v+Math.imul(Ee,ke)|0,v=v+Math.imul(Ae,Ze)|0,N=N+Math.imul(Ae,ke)|0,C=C+Math.imul(ze,rt)|0,v=v+Math.imul(ze,jt)|0,v=v+Math.imul(Ce,rt)|0,N=N+Math.imul(Ce,jt)|0,C=C+Math.imul(Pe,kt)|0,v=v+Math.imul(Pe,vt)|0,v=v+Math.imul(Ie,kt)|0,N=N+Math.imul(Ie,vt)|0;var Ds=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,C=Math.imul($e,Xe),v=Math.imul($e,et),v=v+Math.imul(Te,Xe)|0,N=Math.imul(Te,et),C=C+Math.imul(_e,tt)|0,v=v+Math.imul(_e,Je)|0,v=v+Math.imul(Me,tt)|0,N=N+Math.imul(Me,Je)|0,C=C+Math.imul(be,Ze)|0,v=v+Math.imul(be,ke)|0,v=v+Math.imul(xe,Ze)|0,N=N+Math.imul(xe,ke)|0,C=C+Math.imul(Ee,rt)|0,v=v+Math.imul(Ee,jt)|0,v=v+Math.imul(Ae,rt)|0,N=N+Math.imul(Ae,jt)|0,C=C+Math.imul(ze,kt)|0,v=v+Math.imul(ze,vt)|0,v=v+Math.imul(Ce,kt)|0,N=N+Math.imul(Ce,vt)|0;var Gr=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,C=Math.imul($e,tt),v=Math.imul($e,Je),v=v+Math.imul(Te,tt)|0,N=Math.imul(Te,Je),C=C+Math.imul(_e,Ze)|0,v=v+Math.imul(_e,ke)|0,v=v+Math.imul(Me,Ze)|0,N=N+Math.imul(Me,ke)|0,C=C+Math.imul(be,rt)|0,v=v+Math.imul(be,jt)|0,v=v+Math.imul(xe,rt)|0,N=N+Math.imul(xe,jt)|0,C=C+Math.imul(Ee,kt)|0,v=v+Math.imul(Ee,vt)|0,v=v+Math.imul(Ae,kt)|0,N=N+Math.imul(Ae,vt)|0;var mo=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(mo>>>26)|0,mo&=67108863,C=Math.imul($e,Ze),v=Math.imul($e,ke),v=v+Math.imul(Te,Ze)|0,N=Math.imul(Te,ke),C=C+Math.imul(_e,rt)|0,v=v+Math.imul(_e,jt)|0,v=v+Math.imul(Me,rt)|0,N=N+Math.imul(Me,jt)|0,C=C+Math.imul(be,kt)|0,v=v+Math.imul(be,vt)|0,v=v+Math.imul(xe,kt)|0,N=N+Math.imul(xe,vt)|0;var vo=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(vo>>>26)|0,vo&=67108863,C=Math.imul($e,rt),v=Math.imul($e,jt),v=v+Math.imul(Te,rt)|0,N=Math.imul(Te,jt),C=C+Math.imul(_e,kt)|0,v=v+Math.imul(_e,vt)|0,v=v+Math.imul(Me,kt)|0,N=N+Math.imul(Me,vt)|0;var wo=(L+C|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(wo>>>26)|0,wo&=67108863,C=Math.imul($e,kt),v=Math.imul($e,vt),v=v+Math.imul(Te,kt)|0,N=Math.imul(Te,vt);var yo=(L+C|0)+((v&8191)<<13)|0;return L=(N+(v>>>13)|0)+(yo>>>26)|0,yo&=67108863,T[0]=Nn,T[1]=Rn,T[2]=Ln,T[3]=Bn,T[4]=Un,T[5]=xr,T[6]=Ci,T[7]=fo,T[8]=Oi,T[9]=po,T[10]=go,T[11]=Mi,T[12]=Is,T[13]=Ds,T[14]=Gr,T[15]=mo,T[16]=vo,T[17]=wo,T[18]=yo,L!==0&&(T[19]=L,b.length++),b};Math.imul||(B=Y);function z(d,p,b){b.negative=p.negative^d.negative,b.length=d.length+p.length;for(var D=0,O=0,T=0;T<b.length-1;T++){var L=O;O=0;for(var C=D&67108863,v=Math.min(T,p.length-1),N=Math.max(0,T-d.length+1);N<=v;N++){var oe=T-N,pe=d.words[oe]|0,A=p.words[N]|0,re=pe*A,q=re&67108863;L=L+(re/67108864|0)|0,q=q+C|0,C=q&67108863,L=L+(q>>>26)|0,O+=L>>>26,L&=67108863}b.words[T]=C,D=L,L=O}return D!==0?b.words[T]=D:b.length--,b._strip()}function M(d,p,b){return z(d,p,b)}o.prototype.mulTo=function(d,p){var b,D=this.length+d.length;return this.length===10&&d.length===10?b=B(this,d,p):D<63?b=Y(this,d,p):D<1024?b=z(this,d,p):b=M(this,d,p),b},o.prototype.mul=function(d){var p=new o(null);return p.words=new Array(this.length+d.length),this.mulTo(d,p)},o.prototype.mulf=function(d){var p=new o(null);return p.words=new Array(this.length+d.length),M(this,d,p)},o.prototype.imul=function(d){return this.clone().mulTo(d,this)},o.prototype.imuln=function(d){var p=d<0;p&&(d=-d),n(typeof d=="number"),n(d<67108864);for(var b=0,D=0;D<this.length;D++){var O=(this.words[D]|0)*d,T=(O&67108863)+(b&67108863);b>>=26,b+=O/67108864|0,b+=T>>>26,this.words[D]=T&67108863}return b!==0&&(this.words[D]=b,this.length++),p?this.ineg():this},o.prototype.muln=function(d){return this.clone().imuln(d)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(d){var p=W(d);if(p.length===0)return new o(1);for(var b=this,D=0;D<p.length&&p[D]===0;D++,b=b.sqr());if(++D<p.length)for(var O=b.sqr();D<p.length;D++,O=O.sqr())p[D]!==0&&(b=b.mul(O));return b},o.prototype.iushln=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26,D=67108863>>>26-p<<26-p,O;if(p!==0){var T=0;for(O=0;O<this.length;O++){var L=this.words[O]&D,C=(this.words[O]|0)-L<<p;this.words[O]=C|T,T=L>>>26-p}T&&(this.words[O]=T,this.length++)}if(b!==0){for(O=this.length-1;O>=0;O--)this.words[O+b]=this.words[O];for(O=0;O<b;O++)this.words[O]=0;this.length+=b}return this._strip()},o.prototype.ishln=function(d){return n(this.negative===0),this.iushln(d)},o.prototype.iushrn=function(d,p,b){n(typeof d=="number"&&d>=0);var D;p?D=(p-p%26)/26:D=0;var O=d%26,T=Math.min((d-O)/26,this.length),L=67108863^67108863>>>O<<O,C=b;if(D-=T,D=Math.max(0,D),C){for(var v=0;v<T;v++)C.words[v]=this.words[v];C.length=T}if(T!==0)if(this.length>T)for(this.length-=T,v=0;v<this.length;v++)this.words[v]=this.words[v+T];else this.words[0]=0,this.length=1;var N=0;for(v=this.length-1;v>=0&&(N!==0||v>=D);v--){var oe=this.words[v]|0;this.words[v]=N<<26-O|oe>>>O,N=oe&L}return C&&N!==0&&(C.words[C.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(d,p,b){return n(this.negative===0),this.iushrn(d,p,b)},o.prototype.shln=function(d){return this.clone().ishln(d)},o.prototype.ushln=function(d){return this.clone().iushln(d)},o.prototype.shrn=function(d){return this.clone().ishrn(d)},o.prototype.ushrn=function(d){return this.clone().iushrn(d)},o.prototype.testn=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26,D=1<<p;if(this.length<=b)return!1;var O=this.words[b];return!!(O&D)},o.prototype.imaskn=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(p!==0&&b++,this.length=Math.min(b,this.length),p!==0){var D=67108863^67108863>>>p<<p;this.words[this.length-1]&=D}return this._strip()},o.prototype.maskn=function(d){return this.clone().imaskn(d)},o.prototype.iaddn=function(d){return n(typeof d=="number"),n(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},o.prototype._iaddn=function(d){this.words[0]+=d;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},o.prototype.isubn=function(d){if(n(typeof d=="number"),n(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},o.prototype.addn=function(d){return this.clone().iaddn(d)},o.prototype.subn=function(d){return this.clone().isubn(d)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(d,p,b){var D=d.length+b,O;this._expand(D);var T,L=0;for(O=0;O<d.length;O++){T=(this.words[O+b]|0)+L;var C=(d.words[O]|0)*p;T-=C&67108863,L=(T>>26)-(C/67108864|0),this.words[O+b]=T&67108863}for(;O<this.length-b;O++)T=(this.words[O+b]|0)+L,L=T>>26,this.words[O+b]=T&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,O=0;O<this.length;O++)T=-(this.words[O]|0)+L,L=T>>26,this.words[O]=T&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(d,p){var b=this.length-d.length,D=this.clone(),O=d,T=O.words[O.length-1]|0,L=this._countBits(T);b=26-L,b!==0&&(O=O.ushln(b),D.iushln(b),T=O.words[O.length-1]|0);var C=D.length-O.length,v;if(p!=="mod"){v=new o(null),v.length=C+1,v.words=new Array(v.length);for(var N=0;N<v.length;N++)v.words[N]=0}var oe=D.clone()._ishlnsubmul(O,1,C);oe.negative===0&&(D=oe,v&&(v.words[C]=1));for(var pe=C-1;pe>=0;pe--){var A=(D.words[O.length+pe]|0)*67108864+(D.words[O.length+pe-1]|0);for(A=Math.min(A/T|0,67108863),D._ishlnsubmul(O,A,pe);D.negative!==0;)A--,D.negative=0,D._ishlnsubmul(O,1,pe),D.isZero()||(D.negative^=1);v&&(v.words[pe]=A)}return v&&v._strip(),D._strip(),p!=="div"&&b!==0&&D.iushrn(b),{div:v||null,mod:D}},o.prototype.divmod=function(d,p,b){if(n(!d.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var D,O,T;return this.negative!==0&&d.negative===0?(T=this.neg().divmod(d,p),p!=="mod"&&(D=T.div.neg()),p!=="div"&&(O=T.mod.neg(),b&&O.negative!==0&&O.iadd(d)),{div:D,mod:O}):this.negative===0&&d.negative!==0?(T=this.divmod(d.neg(),p),p!=="mod"&&(D=T.div.neg()),{div:D,mod:T.mod}):this.negative&d.negative?(T=this.neg().divmod(d.neg(),p),p!=="div"&&(O=T.mod.neg(),b&&O.negative!==0&&O.isub(d)),{div:T.div,mod:O}):d.length>this.length||this.cmp(d)<0?{div:new o(0),mod:this}:d.length===1?p==="div"?{div:this.divn(d.words[0]),mod:null}:p==="mod"?{div:null,mod:new o(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new o(this.modrn(d.words[0]))}:this._wordDiv(d,p)},o.prototype.div=function(d){return this.divmod(d,"div",!1).div},o.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},o.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},o.prototype.divRound=function(d){var p=this.divmod(d);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(d):p.mod,D=d.ushrn(1),O=d.andln(1),T=b.cmp(D);return T<0||O===1&&T===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},o.prototype.modrn=function(d){var p=d<0;p&&(d=-d),n(d<=67108863);for(var b=(1<<26)%d,D=0,O=this.length-1;O>=0;O--)D=(b*D+(this.words[O]|0))%d;return p?-D:D},o.prototype.modn=function(d){return this.modrn(d)},o.prototype.idivn=function(d){var p=d<0;p&&(d=-d),n(d<=67108863);for(var b=0,D=this.length-1;D>=0;D--){var O=(this.words[D]|0)+b*67108864;this.words[D]=O/d|0,b=O%d}return this._strip(),p?this.ineg():this},o.prototype.divn=function(d){return this.clone().idivn(d)},o.prototype.egcd=function(d){n(d.negative===0),n(!d.isZero());var p=this,b=d.clone();p.negative!==0?p=p.umod(d):p=p.clone();for(var D=new o(1),O=new o(0),T=new o(0),L=new o(1),C=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++C;for(var v=b.clone(),N=p.clone();!p.isZero();){for(var oe=0,pe=1;!(p.words[0]&pe)&&oe<26;++oe,pe<<=1);if(oe>0)for(p.iushrn(oe);oe-- >0;)(D.isOdd()||O.isOdd())&&(D.iadd(v),O.isub(N)),D.iushrn(1),O.iushrn(1);for(var A=0,re=1;!(b.words[0]&re)&&A<26;++A,re<<=1);if(A>0)for(b.iushrn(A);A-- >0;)(T.isOdd()||L.isOdd())&&(T.iadd(v),L.isub(N)),T.iushrn(1),L.iushrn(1);p.cmp(b)>=0?(p.isub(b),D.isub(T),O.isub(L)):(b.isub(p),T.isub(D),L.isub(O))}return{a:T,b:L,gcd:b.iushln(C)}},o.prototype._invmp=function(d){n(d.negative===0),n(!d.isZero());var p=this,b=d.clone();p.negative!==0?p=p.umod(d):p=p.clone();for(var D=new o(1),O=new o(0),T=b.clone();p.cmpn(1)>0&&b.cmpn(1)>0;){for(var L=0,C=1;!(p.words[0]&C)&&L<26;++L,C<<=1);if(L>0)for(p.iushrn(L);L-- >0;)D.isOdd()&&D.iadd(T),D.iushrn(1);for(var v=0,N=1;!(b.words[0]&N)&&v<26;++v,N<<=1);if(v>0)for(b.iushrn(v);v-- >0;)O.isOdd()&&O.iadd(T),O.iushrn(1);p.cmp(b)>=0?(p.isub(b),D.isub(O)):(b.isub(p),O.isub(D))}var oe;return p.cmpn(1)===0?oe=D:oe=O,oe.cmpn(0)<0&&oe.iadd(d),oe},o.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var p=this.clone(),b=d.clone();p.negative=0,b.negative=0;for(var D=0;p.isEven()&&b.isEven();D++)p.iushrn(1),b.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;b.isEven();)b.iushrn(1);var O=p.cmp(b);if(O<0){var T=p;p=b,b=T}else if(O===0||b.cmpn(1)===0)break;p.isub(b)}while(!0);return b.iushln(D)},o.prototype.invm=function(d){return this.egcd(d).a.umod(d)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(d){return this.words[0]&d},o.prototype.bincn=function(d){n(typeof d=="number");var p=d%26,b=(d-p)/26,D=1<<p;if(this.length<=b)return this._expand(b+1),this.words[b]|=D,this;for(var O=D,T=b;O!==0&&T<this.length;T++){var L=this.words[T]|0;L+=O,O=L>>>26,L&=67108863,this.words[T]=L}return O!==0&&(this.words[T]=O,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(d){var p=d<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var b;if(this.length>1)b=1;else{p&&(d=-d),n(d<=67108863,"Number is too big");var D=this.words[0]|0;b=D===d?0:D<d?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var p=this.ucmp(d);return this.negative!==0?-p|0:p},o.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var p=0,b=this.length-1;b>=0;b--){var D=this.words[b]|0,O=d.words[b]|0;if(D!==O){D<O?p=-1:D>O&&(p=1);break}}return p},o.prototype.gtn=function(d){return this.cmpn(d)===1},o.prototype.gt=function(d){return this.cmp(d)===1},o.prototype.gten=function(d){return this.cmpn(d)>=0},o.prototype.gte=function(d){return this.cmp(d)>=0},o.prototype.ltn=function(d){return this.cmpn(d)===-1},o.prototype.lt=function(d){return this.cmp(d)===-1},o.prototype.lten=function(d){return this.cmpn(d)<=0},o.prototype.lte=function(d){return this.cmp(d)<=0},o.prototype.eqn=function(d){return this.cmpn(d)===0},o.prototype.eq=function(d){return this.cmp(d)===0},o.red=function(d){return new ne(d)},o.prototype.toRed=function(d){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(d){return this.red=d,this},o.prototype.forceRed=function(d){return n(!this.red,"Already a number in reduction context"),this._forceRed(d)},o.prototype.redAdd=function(d){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},o.prototype.redIAdd=function(d){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},o.prototype.redSub=function(d){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},o.prototype.redISub=function(d){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},o.prototype.redShl=function(d){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},o.prototype.redMul=function(d){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},o.prototype.redIMul=function(d){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(d){return n(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var U={k256:null,p224:null,p192:null,p25519:null};function F(d,p){this.name=d,this.p=new o(p,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var d=new o(null);return d.words=new Array(Math.ceil(this.n/13)),d},F.prototype.ireduce=function(d){var p=d,b;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),b=p.bitLength();while(b>this.n);var D=b<this.n?-1:p.ucmp(this.p);return D===0?(p.words[0]=0,p.length=1):D>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},F.prototype.split=function(d,p){d.iushrn(this.n,0,p)},F.prototype.imulK=function(d){return d.imul(this.k)};function m(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(m,F),m.prototype.split=function(d,p){for(var b=4194303,D=Math.min(d.length,9),O=0;O<D;O++)p.words[O]=d.words[O];if(p.length=D,d.length<=9){d.words[0]=0,d.length=1;return}var T=d.words[9];for(p.words[p.length++]=T&b,O=10;O<d.length;O++){var L=d.words[O]|0;d.words[O-10]=(L&b)<<4|T>>>22,T=L}T>>>=22,d.words[O-10]=T,T===0&&d.length>10?d.length-=10:d.length-=9},m.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var p=0,b=0;b<d.length;b++){var D=d.words[b]|0;p+=D*977,d.words[b]=p&67108863,p=D*64+(p/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function $(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i($,F);function te(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(te,F);function ee(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ee,F),ee.prototype.imulK=function(d){for(var p=0,b=0;b<d.length;b++){var D=(d.words[b]|0)*19+p,O=D&67108863;D>>>=26,d.words[b]=O,p=D}return p!==0&&(d.words[d.length++]=p),d},o._prime=function(d){if(U[d])return U[d];var p;if(d==="k256")p=new m;else if(d==="p224")p=new $;else if(d==="p192")p=new te;else if(d==="p25519")p=new ee;else throw new Error("Unknown prime "+d);return U[d]=p,p};function ne(d){if(typeof d=="string"){var p=o._prime(d);this.m=p.p,this.prime=p}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}ne.prototype._verify1=function(d){n(d.negative===0,"red works only with positives"),n(d.red,"red works only with red numbers")},ne.prototype._verify2=function(d,p){n((d.negative|p.negative)===0,"red works only with positives"),n(d.red&&d.red===p.red,"red works only with red numbers")},ne.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(g(d,d.umod(this.m)._forceRed(this)),d)},ne.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},ne.prototype.add=function(d,p){this._verify2(d,p);var b=d.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},ne.prototype.iadd=function(d,p){this._verify2(d,p);var b=d.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},ne.prototype.sub=function(d,p){this._verify2(d,p);var b=d.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},ne.prototype.isub=function(d,p){this._verify2(d,p);var b=d.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},ne.prototype.shl=function(d,p){return this._verify1(d),this.imod(d.ushln(p))},ne.prototype.imul=function(d,p){return this._verify2(d,p),this.imod(d.imul(p))},ne.prototype.mul=function(d,p){return this._verify2(d,p),this.imod(d.mul(p))},ne.prototype.isqr=function(d){return this.imul(d,d.clone())},ne.prototype.sqr=function(d){return this.mul(d,d)},ne.prototype.sqrt=function(d){if(d.isZero())return d.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(d,b)}for(var D=this.m.subn(1),O=0;!D.isZero()&&D.andln(1)===0;)O++,D.iushrn(1);n(!D.isZero());var T=new o(1).toRed(this),L=T.redNeg(),C=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new o(2*v*v).toRed(this);this.pow(v,C).cmp(L)!==0;)v.redIAdd(L);for(var N=this.pow(v,D),oe=this.pow(d,D.addn(1).iushrn(1)),pe=this.pow(d,D),A=O;pe.cmp(T)!==0;){for(var re=pe,q=0;re.cmp(T)!==0;q++)re=re.redSqr();n(q<A);var H=this.pow(N,new o(1).iushln(A-q-1));oe=oe.redMul(H),N=H.redSqr(),pe=pe.redMul(N),A=q}return oe},ne.prototype.invm=function(d){var p=d._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},ne.prototype.pow=function(d,p){if(p.isZero())return new o(1).toRed(this);if(p.cmpn(1)===0)return d.clone();var b=4,D=new Array(1<<b);D[0]=new o(1).toRed(this),D[1]=d;for(var O=2;O<D.length;O++)D[O]=this.mul(D[O-1],d);var T=D[0],L=0,C=0,v=p.bitLength()%26;for(v===0&&(v=26),O=p.length-1;O>=0;O--){for(var N=p.words[O],oe=v-1;oe>=0;oe--){var pe=N>>oe&1;if(T!==D[0]&&(T=this.sqr(T)),pe===0&&L===0){C=0;continue}L<<=1,L|=pe,C++,!(C!==b&&(O!==0||oe!==0))&&(T=this.mul(T,D[L]),C=0,L=0)}v=26}return T},ne.prototype.convertTo=function(d){var p=d.umod(this.m);return p===d?p.clone():p},ne.prototype.convertFrom=function(d){var p=d.clone();return p.red=null,p},o.mont=function(d){return new de(d)};function de(d){ne.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(de,ne),de.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},de.prototype.convertFrom=function(d){var p=this.imod(d.mul(this.rinv));return p.red=null,p},de.prototype.imul=function(d,p){if(d.isZero()||p.isZero())return d.words[0]=0,d.length=1,d;var b=d.imul(p),D=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=b.isub(D).iushrn(this.shift),T=O;return O.cmp(this.m)>=0?T=O.isub(this.m):O.cmpn(0)<0&&(T=O.iadd(this.m)),T._forceRed(this)},de.prototype.mul=function(d,p){if(d.isZero()||p.isZero())return new o(0)._forceRed(this);var b=d.mul(p),D=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=b.isub(D).iushrn(this.shift),T=O;return O.cmp(this.m)>=0?T=O.isub(this.m):O.cmpn(0)<0&&(T=O.iadd(this.m)),T._forceRed(this)},de.prototype.invm=function(d){var p=this.imod(d._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,ig)})(gg);var st=gg.exports;const mg="bignumber/5.7.0";var yl=st.BN;const Li=new ut(mg),of={},vg=9007199254740991;function J8(t){return t!=null&&(Jt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||mn(t)||typeof t=="bigint"||qo(t))}let wg=!1;class Jt{constructor(e,r){e!==of&&Li.throwError("cannot call constructor directly; use BigNumber.from",ut.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Xr(bt(this).fromTwos(e))}toTwos(e){return Xr(bt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Jt.from(this._hex.substring(1)):this}add(e){return Xr(bt(this).add(bt(e)))}sub(e){return Xr(bt(this).sub(bt(e)))}div(e){return Jt.from(e).isZero()&&In("division-by-zero","div"),Xr(bt(this).div(bt(e)))}mul(e){return Xr(bt(this).mul(bt(e)))}mod(e){const r=bt(e);return r.isNeg()&&In("division-by-zero","mod"),Xr(bt(this).umod(r))}pow(e){const r=bt(e);return r.isNeg()&&In("negative-power","pow"),Xr(bt(this).pow(r))}and(e){const r=bt(e);return(this.isNegative()||r.isNeg())&&In("unbound-bitwise-result","and"),Xr(bt(this).and(r))}or(e){const r=bt(e);return(this.isNegative()||r.isNeg())&&In("unbound-bitwise-result","or"),Xr(bt(this).or(r))}xor(e){const r=bt(e);return(this.isNegative()||r.isNeg())&&In("unbound-bitwise-result","xor"),Xr(bt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&In("negative-width","mask"),Xr(bt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&In("negative-width","shl"),Xr(bt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&In("negative-width","shr"),Xr(bt(this).shrn(e))}eq(e){return bt(this).eq(bt(e))}lt(e){return bt(this).lt(bt(e))}lte(e){return bt(this).lte(bt(e))}gt(e){return bt(this).gt(bt(e))}gte(e){return bt(this).gte(bt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return bt(this).isZero()}toNumber(){try{return bt(this).toNumber()}catch{In("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Li.throwError("this platform does not support BigInt",ut.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?wg||(wg=!0,Li.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Li.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ut.errors.UNEXPECTED_ARGUMENT,{}):Li.throwError("BigNumber.toString does not accept parameters",ut.errors.UNEXPECTED_ARGUMENT,{})),bt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Jt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Jt(of,Ga(e)):e.match(/^-?[0-9]+$/)?new Jt(of,Ga(new yl(e))):Li.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&In("underflow","BigNumber.from",e),(e>=vg||e<=-vg)&&In("overflow","BigNumber.from",e),Jt.from(String(e));const r=e;if(typeof r=="bigint")return Jt.from(r.toString());if(qo(r))return Jt.from(kr(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Jt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(mn(n)||n[0]==="-"&&mn(n.substring(1))))return Jt.from(n)}return Li.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Ga(t){if(typeof t!="string")return Ga(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Li.throwArgumentError("invalid hex","value",t),t=Ga(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Xr(t){return Jt.from(Ga(t))}function bt(t){const e=Jt.from(t).toHexString();return e[0]==="-"?new yl("-"+e.substring(3),16):new yl(e.substring(2),16)}function In(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Li.throwError(t,ut.errors.NUMERIC_FAULT,n)}function Z8(t){return new yl(t,36).toString(16)}const qr=new ut(mg),Ya={},yg=Jt.from(0),bg=Jt.from(-1);function _g(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),qr.throwError(t,ut.errors.NUMERIC_FAULT,i)}let Qa="0";for(;Qa.length<256;)Qa+=Qa;function af(t){if(typeof t!="number")try{t=Jt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Qa.substring(0,t):qr.throwArgumentError("invalid decimal size","decimals",t)}function cf(t,e){e==null&&(e=0);const r=af(e);t=Jt.from(t);const n=t.lt(yg);n&&(t=t.mul(bg));let i=t.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(r).toString();return r.length===1?t=o:t=o+"."+i,n&&(t="-"+t),t}function Bi(t,e){e==null&&(e=0);const r=af(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&qr.throwArgumentError("invalid decimal value","value",t);const n=t.substring(0,1)==="-";n&&(t=t.substring(1)),t==="."&&qr.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&qr.throwArgumentError("too many decimal points","value",t);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");c[c.length-1]==="0";)c=c.substring(0,c.length-1);for(c.length>r.length-1&&_g("fractional component exceeds decimals","underflow","parseFixed"),c===""&&(c="0");c.length<r.length-1;)c+="0";const l=Jt.from(o),f=Jt.from(c);let h=l.mul(r).add(f);return n&&(h=h.mul(bg)),h}class zo{constructor(e,r,n,i){e!==Ya&&qr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",ut.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=af(i),Object.freeze(this)}static from(e){if(e instanceof zo)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,n=128,i=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||qr.throwArgumentError("invalid fixed format","format",e),r=o[1]!=="u",n=parseInt(o[2]),i=parseInt(o[3])}}else if(e){const o=(c,l,f)=>e[c]==null?f:(typeof e[c]!==l&&qr.throwArgumentError("invalid fixed format ("+c+" not "+l+")","format."+c,e[c]),e[c]);r=o("signed","boolean",r),n=o("width","number",n),i=o("decimals","number",i)}return n%8&&qr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&qr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new zo(Ya,r,n,i)}}class Mr{constructor(e,r,n,i){e!==Ya&&qr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ut.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&qr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Bi(this._value,this.format.decimals),n=Bi(e._value,e.format.decimals);return Mr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Bi(this._value,this.format.decimals),n=Bi(e._value,e.format.decimals);return Mr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Bi(this._value,this.format.decimals),n=Bi(e._value,e.format.decimals);return Mr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Bi(this._value,this.format.decimals),n=Bi(e._value,e.format.decimals);return Mr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Mr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Eg.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Mr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Eg.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&qr.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Mr.from("1"+Qa.substring(0,e),this.format),i=X8.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&qr.throwArgumentError("invalid byte width","width",e);const r=Jt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return ci(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Mr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!J8(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Mr.fromString(cf(e,r),zo.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=zo.from(r),i=Bi(e,n.decimals);!n.signed&&i.lt(yg)&&_g("unsigned value cannot be negative","overflow","value",e);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=ci(o,n.width/8));const c=cf(i,n.decimals);return new Mr(Ya,o,c,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=zo.from(r);if(or(e).length>n.width/8)throw new Error("overflow");let i=Jt.from(e);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),c=cf(i,n.decimals);return new Mr(Ya,o,c,n)}static from(e,r){if(typeof e=="string")return Mr.fromString(e,r);if(qo(e))return Mr.fromBytes(e,r);try{return Mr.fromValue(e,0,r)}catch(n){if(n.code!==ut.errors.INVALID_ARGUMENT)throw n}return qr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Eg=Mr.from(1),X8=Mr.from("0.5"),e4="strings/5.7.0",Ag=new ut(e4);var bl;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(bl||(bl={}));var Ho;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Ho||(Ho={}));function t4(t,e,r,n,i){return Ag.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function xg(t,e,r,n,i){if(t===Ho.BAD_PREFIX||t===Ho.UNEXPECTED_CONTINUE){let o=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)o++;return o}return t===Ho.OVERRUN?r.length-e-1:0}function r4(t,e,r,n,i){return t===Ho.OVERLONG?(n.push(i),0):(n.push(65533),xg(t,e,r))}Object.freeze({error:t4,ignore:xg,replace:r4});function lf(t,e=bl.current){e!=bl.current&&(Ag.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const o=t.charCodeAt(n);if(n>=t.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((i&1023)<<10)+(o&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return or(r)}function n4(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function uf(t,e){e||(e=function(i){return[parseInt(i,16)]});let r=0,n={};return t.split(",").forEach(i=>{let o=i.split(":");r+=parseInt(o[0],16),n[r]=e(o[1])}),n}function Sg(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}Sg("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),uf("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),uf("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),uf("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",n4),Sg("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const Ig="hash/5.7.0";function i4(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return or(e)}function Dg(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(o,c){n.call(o,function(l){c>0&&Array.isArray(l)?i(l,c-1):r.push(l)})};return i(t,e),r}function s4(t){const e={};for(let r=0;r<t.length;r++){const n=t[r];e[n[0]]=n[1]}return e}function o4(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let U=1;U<n;U++)o.push(i+=r());let c=r(),l=e;e+=c;let f=0,h=0;function g(){return f==0&&(h=h<<8|t[e++],f=8),h>>--f&1}const _=31,E=Math.pow(2,_),x=E>>>1,I=x>>1,k=E-1;let W=0;for(let U=0;U<_;U++)W=W<<1|g();let Y=[],B=0,z=E;for(;;){let U=Math.floor(((W-B+1)*i-1)/z),F=0,m=n;for(;m-F>1;){let ee=F+m>>>1;U<o[ee]?m=ee:F=ee}if(F==0)break;Y.push(F);let $=B+Math.floor(z*o[F]/i),te=B+Math.floor(z*o[F+1]/i)-1;for(;!(($^te)&x);)W=W<<1&k|g(),$=$<<1&k,te=te<<1&k|1;for(;$&~te&I;)W=W&x|W<<1&k>>>1|g(),$=$<<1^x,te=(te^x)<<1|x|1;B=$,z=1+te-$}let M=n-4;return Y.map(U=>{switch(U-M){case 3:return M+65792+(t[l++]<<16|t[l++]<<8|t[l++]);case 2:return M+256+(t[l++]<<8|t[l++]);case 1:return M+t[l++];default:return U-1}})}function a4(t){let e=0;return()=>t[e++]}function c4(t){return a4(o4(t))}function l4(t){return t&1?~t>>1:t>>1}function u4(t,e){let r=Array(t);for(let n=0;n<t;n++)r[n]=1+e();return r}function Cg(t,e){let r=Array(t);for(let n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function h4(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=l4(e());return r}function _l(t,e){let r=Cg(t(),t),n=t(),i=Cg(n,t),o=u4(n,t);for(let c=0;c<n;c++)for(let l=0;l<o[c];l++)r.push(i[c]+l);return e?r.map(c=>e[c]):r}function f4(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(p4(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(g4(r,t))}return s4(Dg(e))}function d4(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function Og(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i<e;i++)h4(t,r).forEach((o,c)=>n[c].push(o));return n}function p4(t,e){let r=1+e(),n=e(),i=d4(e),o=Og(i.length,1+t,e);return Dg(o.map((c,l)=>{const f=c[0],h=c.slice(1);return Array(i[l]).fill(void 0).map((g,_)=>{let E=_*n;return[f+_*r,h.map(x=>x+E)]})}))}function g4(t,e){let r=1+e();return Og(r,1+t,e).map(n=>[n[0],n.slice(1)])}function m4(t){let e=_l(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let h=_l(t,e);if(h.length==0)break;n.push({set:new Set(h),node:r()})}n.sort((h,g)=>g.set.size-h.set.size);let i=t(),o=i%3;i=i/3|0;let c=!!(i&1);i>>=1;let l=i==1,f=i==2;return{branches:n,valid:o,fe0f:c,save:l,check:f}}}function v4(){return c4(i4("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const El=v4();new Set(_l(El)),new Set(_l(El)),f4(El),m4(El),new ut(Ig),new Uint8Array(32).fill(0);const w4=`Ethereum Signed Message:
|
|
22
|
-
`;function Mg(t){return typeof t=="string"&&(t=lf(t)),sf(K8([lf(w4),lf(String(t.length)),t]))}const y4="rlp/5.7.0";new ut(y4);const b4="address/5.7.0",Ja=new ut(b4);function Pg(t){mn(t,20)||Ja.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=or(sf(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const _4=9007199254740991;function E4(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const hf={};for(let t=0;t<10;t++)hf[String(t)]=String(t);for(let t=0;t<26;t++)hf[String.fromCharCode(65+t)]=String(10+t);const $g=Math.floor(E4(_4));function A4(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>hf[n]).join("");for(;e.length>=$g;){let n=e.substring(0,$g);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function x4(t){let e=null;if(typeof t!="string"&&Ja.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Pg(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ja.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==A4(t)&&Ja.throwArgumentError("bad icap checksum","address",t),e=Z8(t.substring(4));e.length<40;)e="0"+e;e=Pg("0x"+e)}else Ja.throwArgumentError("invalid address","address",t);return e}const S4="properties/5.7.0";new ut(S4);function Za(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new ut(Ig),new Uint8Array(32).fill(0),Jt.from(-1);const I4=Jt.from(0),D4=Jt.from(1);Jt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ci(D4.toHexString(),32),ci(I4.toHexString(),32);var li={},_t={},Xa=Tg;function Tg(t,e){if(!t)throw new Error(e||"Assertion failed")}Tg.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var ff={exports:{}};typeof Object.create=="function"?ff.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ff.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 C4=Xa,O4=ff.exports;_t.inherits=O4;function M4(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function P4(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):M4(t,i)?(o=65536+((o&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}_t.toArray=P4;function $4(t){for(var e="",r=0;r<t.length;r++)e+=Rg(t[r].toString(16));return e}_t.toHex=$4;function Ng(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}_t.htonl=Ng;function T4(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=Ng(i)),r+=Lg(i.toString(16))}return r}_t.toHex32=T4;function Rg(t){return t.length===1?"0"+t:t}_t.zero2=Rg;function Lg(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}_t.zero8=Lg;function N4(t,e,r,n){var i=r-e;C4(i%4===0);for(var o=new Array(i/4),c=0,l=e;c<o.length;c++,l+=4){var f;n==="big"?f=t[l]<<24|t[l+1]<<16|t[l+2]<<8|t[l+3]:f=t[l+3]<<24|t[l+2]<<16|t[l+1]<<8|t[l],o[c]=f>>>0}return o}_t.join32=N4;function R4(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];e==="big"?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}_t.split32=R4;function L4(t,e){return t>>>e|t<<32-e}_t.rotr32=L4;function B4(t,e){return t<<e|t>>>32-e}_t.rotl32=B4;function U4(t,e){return t+e>>>0}_t.sum32=U4;function F4(t,e,r){return t+e+r>>>0}_t.sum32_3=F4;function j4(t,e,r,n){return t+e+r+n>>>0}_t.sum32_4=j4;function k4(t,e,r,n,i){return t+e+r+n+i>>>0}_t.sum32_5=k4;function q4(t,e,r,n){var i=t[e],o=t[e+1],c=n+o>>>0,l=(c<n?1:0)+r+i;t[e]=l>>>0,t[e+1]=c}_t.sum64=q4;function z4(t,e,r,n){var i=e+n>>>0,o=(i<e?1:0)+t+r;return o>>>0}_t.sum64_hi=z4;function H4(t,e,r,n){var i=e+n;return i>>>0}_t.sum64_lo=H4;function K4(t,e,r,n,i,o,c,l){var f=0,h=e;h=h+n>>>0,f+=h<e?1:0,h=h+o>>>0,f+=h<o?1:0,h=h+l>>>0,f+=h<l?1:0;var g=t+r+i+c+f;return g>>>0}_t.sum64_4_hi=K4;function W4(t,e,r,n,i,o,c,l){var f=e+n+o+l;return f>>>0}_t.sum64_4_lo=W4;function V4(t,e,r,n,i,o,c,l,f,h){var g=0,_=e;_=_+n>>>0,g+=_<e?1:0,_=_+o>>>0,g+=_<o?1:0,_=_+l>>>0,g+=_<l?1:0,_=_+h>>>0,g+=_<h?1:0;var E=t+r+i+c+f+g;return E>>>0}_t.sum64_5_hi=V4;function G4(t,e,r,n,i,o,c,l,f,h){var g=e+n+o+l+h;return g>>>0}_t.sum64_5_lo=G4;function Y4(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}_t.rotr64_hi=Y4;function Q4(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}_t.rotr64_lo=Q4;function J4(t,e,r){return t>>>r}_t.shr64_hi=J4;function Z4(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}_t.shr64_lo=Z4;var Ko={},Bg=_t,X4=Xa;function Al(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ko.BlockHash=Al,Al.prototype.update=function(t,e){if(t=Bg.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=Bg.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},Al.prototype.digest=function(t){return this.update(this._pad()),X4(this.pending===null),this._digest(t)},Al.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=t&255}else for(n[i++]=t&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var Wo={},ui={},e_=_t,hi=e_.rotr32;function t_(t,e,r,n){if(t===0)return Ug(e,r,n);if(t===1||t===3)return jg(e,r,n);if(t===2)return Fg(e,r,n)}ui.ft_1=t_;function Ug(t,e,r){return t&e^~t&r}ui.ch32=Ug;function Fg(t,e,r){return t&e^t&r^e&r}ui.maj32=Fg;function jg(t,e,r){return t^e^r}ui.p32=jg;function r_(t){return hi(t,2)^hi(t,13)^hi(t,22)}ui.s0_256=r_;function n_(t){return hi(t,6)^hi(t,11)^hi(t,25)}ui.s1_256=n_;function i_(t){return hi(t,7)^hi(t,18)^t>>>3}ui.g0_256=i_;function s_(t){return hi(t,17)^hi(t,19)^t>>>10}ui.g1_256=s_;var Vo=_t,o_=Ko,a_=ui,df=Vo.rotl32,ec=Vo.sum32,c_=Vo.sum32_5,l_=a_.ft_1,kg=o_.BlockHash,u_=[1518500249,1859775393,2400959708,3395469782];function fi(){if(!(this instanceof fi))return new fi;kg.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Vo.inherits(fi,kg);var h_=fi;fi.blockSize=512,fi.outSize=160,fi.hmacStrength=80,fi.padLength=64,fi.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=df(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],f=this.h[4];for(n=0;n<r.length;n++){var h=~~(n/20),g=c_(df(i,5),l_(h,o,c,l),f,r[n],u_[h]);f=l,l=c,c=df(o,30),o=i,i=g}this.h[0]=ec(this.h[0],i),this.h[1]=ec(this.h[1],o),this.h[2]=ec(this.h[2],c),this.h[3]=ec(this.h[3],l),this.h[4]=ec(this.h[4],f)},fi.prototype._digest=function(t){return t==="hex"?Vo.toHex32(this.h,"big"):Vo.split32(this.h,"big")};var Go=_t,f_=Ko,Yo=ui,d_=Xa,Jn=Go.sum32,p_=Go.sum32_4,g_=Go.sum32_5,m_=Yo.ch32,v_=Yo.maj32,w_=Yo.s0_256,y_=Yo.s1_256,b_=Yo.g0_256,__=Yo.g1_256,qg=f_.BlockHash,E_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function di(){if(!(this instanceof di))return new di;qg.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E_,this.W=new Array(64)}Go.inherits(di,qg);var zg=di;di.blockSize=512,di.outSize=256,di.hmacStrength=192,di.padLength=64,di.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=p_(__(r[n-2]),r[n-7],b_(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],f=this.h[4],h=this.h[5],g=this.h[6],_=this.h[7];for(d_(this.k.length===r.length),n=0;n<r.length;n++){var E=g_(_,y_(f),m_(f,h,g),this.k[n],r[n]),x=Jn(w_(i),v_(i,o,c));_=g,g=h,h=f,f=Jn(l,E),l=c,c=o,o=i,i=Jn(E,x)}this.h[0]=Jn(this.h[0],i),this.h[1]=Jn(this.h[1],o),this.h[2]=Jn(this.h[2],c),this.h[3]=Jn(this.h[3],l),this.h[4]=Jn(this.h[4],f),this.h[5]=Jn(this.h[5],h),this.h[6]=Jn(this.h[6],g),this.h[7]=Jn(this.h[7],_)},di.prototype._digest=function(t){return t==="hex"?Go.toHex32(this.h,"big"):Go.split32(this.h,"big")};var pf=_t,Hg=zg;function Ui(){if(!(this instanceof Ui))return new Ui;Hg.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}pf.inherits(Ui,Hg);var A_=Ui;Ui.blockSize=512,Ui.outSize=224,Ui.hmacStrength=192,Ui.padLength=64,Ui.prototype._digest=function(t){return t==="hex"?pf.toHex32(this.h.slice(0,7),"big"):pf.split32(this.h.slice(0,7),"big")};var en=_t,x_=Ko,S_=Xa,pi=en.rotr64_hi,gi=en.rotr64_lo,Kg=en.shr64_hi,Wg=en.shr64_lo,as=en.sum64,gf=en.sum64_hi,mf=en.sum64_lo,I_=en.sum64_4_hi,D_=en.sum64_4_lo,C_=en.sum64_5_hi,O_=en.sum64_5_lo,Vg=x_.BlockHash,M_=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Zn(){if(!(this instanceof Zn))return new Zn;Vg.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=M_,this.W=new Array(160)}en.inherits(Zn,Vg);var Gg=Zn;Zn.blockSize=1024,Zn.outSize=512,Zn.hmacStrength=192,Zn.padLength=128,Zn.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=k_(r[n-4],r[n-3]),o=q_(r[n-4],r[n-3]),c=r[n-14],l=r[n-13],f=F_(r[n-30],r[n-29]),h=j_(r[n-30],r[n-29]),g=r[n-32],_=r[n-31];r[n]=I_(i,o,c,l,f,h,g,_),r[n+1]=D_(i,o,c,l,f,h,g,_)}},Zn.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],c=this.h[3],l=this.h[4],f=this.h[5],h=this.h[6],g=this.h[7],_=this.h[8],E=this.h[9],x=this.h[10],I=this.h[11],k=this.h[12],W=this.h[13],Y=this.h[14],B=this.h[15];S_(this.k.length===r.length);for(var z=0;z<r.length;z+=2){var M=Y,U=B,F=B_(_,E),m=U_(_,E),$=P_(_,E,x,I,k),te=$_(_,E,x,I,k,W),ee=this.k[z],ne=this.k[z+1],de=r[z],d=r[z+1],p=C_(M,U,F,m,$,te,ee,ne,de,d),b=O_(M,U,F,m,$,te,ee,ne,de,d);M=R_(n,i),U=L_(n,i),F=T_(n,i,o,c,l),m=N_(n,i,o,c,l,f);var D=gf(M,U,F,m),O=mf(M,U,F,m);Y=k,B=W,k=x,W=I,x=_,I=E,_=gf(h,g,p,b),E=mf(g,g,p,b),h=l,g=f,l=o,f=c,o=n,c=i,n=gf(p,b,D,O),i=mf(p,b,D,O)}as(this.h,0,n,i),as(this.h,2,o,c),as(this.h,4,l,f),as(this.h,6,h,g),as(this.h,8,_,E),as(this.h,10,x,I),as(this.h,12,k,W),as(this.h,14,Y,B)},Zn.prototype._digest=function(t){return t==="hex"?en.toHex32(this.h,"big"):en.split32(this.h,"big")};function P_(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function $_(t,e,r,n,i,o){var c=e&n^~e&o;return c<0&&(c+=4294967296),c}function T_(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function N_(t,e,r,n,i,o){var c=e&n^e&o^n&o;return c<0&&(c+=4294967296),c}function R_(t,e){var r=pi(t,e,28),n=pi(e,t,2),i=pi(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function L_(t,e){var r=gi(t,e,28),n=gi(e,t,2),i=gi(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function B_(t,e){var r=pi(t,e,14),n=pi(t,e,18),i=pi(e,t,9),o=r^n^i;return o<0&&(o+=4294967296),o}function U_(t,e){var r=gi(t,e,14),n=gi(t,e,18),i=gi(e,t,9),o=r^n^i;return o<0&&(o+=4294967296),o}function F_(t,e){var r=pi(t,e,1),n=pi(t,e,8),i=Kg(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function j_(t,e){var r=gi(t,e,1),n=gi(t,e,8),i=Wg(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function k_(t,e){var r=pi(t,e,19),n=pi(e,t,29),i=Kg(t,e,6),o=r^n^i;return o<0&&(o+=4294967296),o}function q_(t,e){var r=gi(t,e,19),n=gi(e,t,29),i=Wg(t,e,6),o=r^n^i;return o<0&&(o+=4294967296),o}var vf=_t,Yg=Gg;function Fi(){if(!(this instanceof Fi))return new Fi;Yg.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}vf.inherits(Fi,Yg);var z_=Fi;Fi.blockSize=1024,Fi.outSize=384,Fi.hmacStrength=192,Fi.padLength=128,Fi.prototype._digest=function(t){return t==="hex"?vf.toHex32(this.h.slice(0,12),"big"):vf.split32(this.h.slice(0,12),"big")},Wo.sha1=h_,Wo.sha224=A_,Wo.sha256=zg,Wo.sha384=z_,Wo.sha512=Gg;var Qg={},zs=_t,H_=Ko,xl=zs.rotl32,Jg=zs.sum32,tc=zs.sum32_3,Zg=zs.sum32_4,Xg=H_.BlockHash;function mi(){if(!(this instanceof mi))return new mi;Xg.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}zs.inherits(mi,Xg),Qg.ripemd160=mi,mi.blockSize=512,mi.outSize=160,mi.hmacStrength=192,mi.padLength=64,mi.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4],l=r,f=n,h=i,g=o,_=c,E=0;E<80;E++){var x=Jg(xl(Zg(r,em(E,n,i,o),t[V_[E]+e],K_(E)),Y_[E]),c);r=c,c=o,o=xl(i,10),i=n,n=x,x=Jg(xl(Zg(l,em(79-E,f,h,g),t[G_[E]+e],W_(E)),Q_[E]),_),l=_,_=g,g=xl(h,10),h=f,f=x}x=tc(this.h[1],i,g),this.h[1]=tc(this.h[2],o,_),this.h[2]=tc(this.h[3],c,l),this.h[3]=tc(this.h[4],r,f),this.h[4]=tc(this.h[0],n,h),this.h[0]=x},mi.prototype._digest=function(t){return t==="hex"?zs.toHex32(this.h,"little"):zs.split32(this.h,"little")};function em(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function K_(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function W_(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var V_=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],G_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Y_=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Q_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],J_=_t,Z_=Xa;function Qo(t,e,r){if(!(this instanceof Qo))return new Qo(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(J_.toArray(e,r))}var X_=Qo;Qo.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),Z_(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=new this.Hash().update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=new this.Hash().update(t)},Qo.prototype.update=function(t,e){return this.inner.update(t,e),this},Qo.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=_t,e.common=Ko,e.sha=Wo,e.ripemd=Qg,e.hmac=X_,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(li);function Jo(t,e,r){return r={path:e,exports:{},require:function(n,i){return eE(n,i??r.path)}},t(r,r.exports),r.exports}function eE(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var wf=tm;function tm(t,e){if(!t)throw new Error(e||"Assertion failed")}tm.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var Xn=Jo(function(t,e){var r=e;function n(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var f=[];if(typeof c!="string"){for(var h=0;h<c.length;h++)f[h]=c[h]|0;return f}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var h=0;h<c.length;h+=2)f.push(parseInt(c[h]+c[h+1],16))}else for(var h=0;h<c.length;h++){var g=c.charCodeAt(h),_=g>>8,E=g&255;_?f.push(_,E):f.push(E)}return f}r.toArray=n;function i(c){return c.length===1?"0"+c:c}r.zero2=i;function o(c){for(var l="",f=0;f<c.length;f++)l+=i(c[f].toString(16));return l}r.toHex=o,r.encode=function(c,l){return l==="hex"?o(c):c}}),vn=Jo(function(t,e){var r=e;r.assert=wf,r.toArray=Xn.toArray,r.zero2=Xn.zero2,r.toHex=Xn.toHex,r.encode=Xn.encode;function n(f,h,g){var _=new Array(Math.max(f.bitLength(),g)+1);_.fill(0);for(var E=1<<h+1,x=f.clone(),I=0;I<_.length;I++){var k,W=x.andln(E-1);x.isOdd()?(W>(E>>1)-1?k=(E>>1)-W:k=W,x.isubn(k)):k=0,_[I]=k,x.iushrn(1)}return _}r.getNAF=n;function i(f,h){var g=[[],[]];f=f.clone(),h=h.clone();for(var _=0,E=0,x;f.cmpn(-_)>0||h.cmpn(-E)>0;){var I=f.andln(3)+_&3,k=h.andln(3)+E&3;I===3&&(I=-1),k===3&&(k=-1);var W;I&1?(x=f.andln(7)+_&7,(x===3||x===5)&&k===2?W=-I:W=I):W=0,g[0].push(W);var Y;k&1?(x=h.andln(7)+E&7,(x===3||x===5)&&I===2?Y=-k:Y=k):Y=0,g[1].push(Y),2*_===W+1&&(_=1-_),2*E===Y+1&&(E=1-E),f.iushrn(1),h.iushrn(1)}return g}r.getJSF=i;function o(f,h,g){var _="_"+h;f.prototype[h]=function(){return this[_]!==void 0?this[_]:this[_]=g.call(this)}}r.cachedProperty=o;function c(f){return typeof f=="string"?r.toArray(f,"hex"):f}r.parseBytes=c;function l(f){return new st(f,"hex","le")}r.intFromLE=l}),Sl=vn.getNAF,tE=vn.getJSF,Il=vn.assert;function cs(t,e){this.type=t,this.p=new st(e.p,16),this.red=e.prime?st.red(e.prime):st.mont(this.p),this.zero=new st(0).toRed(this.red),this.one=new st(1).toRed(this.red),this.two=new st(2).toRed(this.red),this.n=e.n&&new st(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Hs=cs;cs.prototype.point=function(){throw new Error("Not implemented")},cs.prototype.validate=function(){throw new Error("Not implemented")},cs.prototype._fixedNafMul=function(t,e){Il(t.precomputed);var r=t._getDoubles(),n=Sl(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var o=[],c,l;for(c=0;c<n.length;c+=r.step){l=0;for(var f=c+r.step-1;f>=c;f--)l=(l<<1)+n[f];o.push(l)}for(var h=this.jpoint(null,null,null),g=this.jpoint(null,null,null),_=i;_>0;_--){for(c=0;c<o.length;c++)l=o[c],l===_?g=g.mixedAdd(r.points[c]):l===-_&&(g=g.mixedAdd(r.points[c].neg()));h=h.add(g)}return h.toP()},cs.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Sl(e,r,this._bitLength),c=this.jpoint(null,null,null),l=o.length-1;l>=0;l--){for(var f=0;l>=0&&o[l]===0;l--)f++;if(l>=0&&f++,c=c.dblp(f),l<0)break;var h=o[l];Il(h!==0),t.type==="affine"?h>0?c=c.mixedAdd(i[h-1>>1]):c=c.mixedAdd(i[-h-1>>1].neg()):h>0?c=c.add(i[h-1>>1]):c=c.add(i[-h-1>>1].neg())}return t.type==="affine"?c.toP():c},cs.prototype._wnafMulAdd=function(t,e,r,n,i){var o=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0,h,g,_;for(h=0;h<n;h++){_=e[h];var E=_._getNAFPoints(t);o[h]=E.wnd,c[h]=E.points}for(h=n-1;h>=1;h-=2){var x=h-1,I=h;if(o[x]!==1||o[I]!==1){l[x]=Sl(r[x],o[x],this._bitLength),l[I]=Sl(r[I],o[I],this._bitLength),f=Math.max(l[x].length,f),f=Math.max(l[I].length,f);continue}var k=[e[x],null,null,e[I]];e[x].y.cmp(e[I].y)===0?(k[1]=e[x].add(e[I]),k[2]=e[x].toJ().mixedAdd(e[I].neg())):e[x].y.cmp(e[I].y.redNeg())===0?(k[1]=e[x].toJ().mixedAdd(e[I]),k[2]=e[x].add(e[I].neg())):(k[1]=e[x].toJ().mixedAdd(e[I]),k[2]=e[x].toJ().mixedAdd(e[I].neg()));var W=[-3,-1,-5,-7,0,7,5,1,3],Y=tE(r[x],r[I]);for(f=Math.max(Y[0].length,f),l[x]=new Array(f),l[I]=new Array(f),g=0;g<f;g++){var B=Y[0][g]|0,z=Y[1][g]|0;l[x][g]=W[(B+1)*3+(z+1)],l[I][g]=0,c[x]=k}}var M=this.jpoint(null,null,null),U=this._wnafT4;for(h=f;h>=0;h--){for(var F=0;h>=0;){var m=!0;for(g=0;g<n;g++)U[g]=l[g][h]|0,U[g]!==0&&(m=!1);if(!m)break;F++,h--}if(h>=0&&F++,M=M.dblp(F),h<0)break;for(g=0;g<n;g++){var $=U[g];$!==0&&($>0?_=c[g][$-1>>1]:$<0&&(_=c[g][-$-1>>1].neg()),_.type==="affine"?M=M.mixedAdd(_):M=M.add(_))}}for(h=0;h<n;h++)c[h]=null;return i?M:M.toP()};function Dn(t,e){this.curve=t,this.type=e,this.precomputed=null}cs.BasePoint=Dn,Dn.prototype.eq=function(){throw new Error("Not implemented")},Dn.prototype.validate=function(){return this.curve.validate(this)},cs.prototype.decodePoint=function(t,e){t=vn.toArray(t,e);var r=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*r){t[0]===6?Il(t[t.length-1]%2===0):t[0]===7&&Il(t[t.length-1]%2===1);var n=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return n}else if((t[0]===2||t[0]===3)&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),t[0]===3);throw new Error("Unknown point format")},Dn.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Dn.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Dn.prototype.encode=function(t,e){return vn.encode(this._encode(e),t)},Dn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Dn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1},Dn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},Dn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=r===1?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},Dn.prototype._getBeta=function(){return null},Dn.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var yf=Jo(function(t){typeof Object.create=="function"?t.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}}),rE=vn.assert;function Cn(t){Hs.call(this,"short",t),this.a=new st(t.a,16).toRed(this.red),this.b=new st(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}yf(Cn,Hs);var nE=Cn;Cn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,r;if(t.beta)e=new st(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=n[0].cmp(n[1])<0?n[0]:n[1],e=e.toRed(this.red)}if(t.lambda)r=new st(t.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))===0?r=i[0]:(r=i[1],rE(this.g.mul(r).x.cmp(this.g.x.redMul(e))===0))}var o;return t.basis?o=t.basis.map(function(c){return{a:new st(c.a,16),b:new st(c.b,16)}}):o=this._getEndoBasis(r),{beta:e,lambda:r,basis:o}}},Cn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:st.mont(t),r=new st(2).toRed(e).redInvm(),n=r.redNeg(),i=new st(3).toRed(e).redNeg().redSqrt().redMul(r),o=n.redAdd(i).fromRed(),c=n.redSub(i).fromRed();return[o,c]},Cn.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,n=this.n.clone(),i=new st(1),o=new st(0),c=new st(0),l=new st(1),f,h,g,_,E,x,I,k=0,W,Y;r.cmpn(0)!==0;){var B=n.div(r);W=n.sub(B.mul(r)),Y=c.sub(B.mul(i));var z=l.sub(B.mul(o));if(!g&&W.cmp(e)<0)f=I.neg(),h=i,g=W.neg(),_=Y;else if(g&&++k===2)break;I=W,n=r,r=W,c=i,i=Y,l=o,o=z}E=W.neg(),x=Y;var M=g.sqr().add(_.sqr()),U=E.sqr().add(x.sqr());return U.cmp(M)>=0&&(E=f,x=h),g.negative&&(g=g.neg(),_=_.neg()),E.negative&&(E=E.neg(),x=x.neg()),[{a:g,b:_},{a:E,b:x}]},Cn.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),c=i.mul(r.a),l=o.mul(n.a),f=i.mul(r.b),h=o.mul(n.b),g=t.sub(c).sub(l),_=f.add(h).neg();return{k1:g,k2:_}},Cn.prototype.pointFromX=function(t,e){t=new st(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},Cn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0},Cn.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var c=this._endoSplit(e[o]),l=t[o],f=l._getBeta();c.k1.negative&&(c.k1.ineg(),l=l.neg(!0)),c.k2.negative&&(c.k2.ineg(),f=f.neg(!0)),n[o*2]=l,n[o*2+1]=f,i[o*2]=c.k1,i[o*2+1]=c.k2}for(var h=this._wnafMulAdd(1,n,i,o*2,r),g=0;g<o*2;g++)n[g]=null,i[g]=null;return h};function _r(t,e,r,n){Hs.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new st(e,16),this.y=new st(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}yf(_r,Hs.BasePoint),Cn.prototype.point=function(t,e,r){return new _r(this,t,e,r)},Cn.prototype.pointFromJSON=function(t,e){return _r.fromJSON(this,t,e)},_r.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(i){return r.point(i.x.redMul(r.endo.beta),i.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},_r.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},_r.fromJSON=function(t,e,r){typeof e=="string"&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(c){return t.point(c[0],c[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},_r.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},_r.prototype.isInfinity=function(){return this.inf},_r.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},_r.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),c=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,c)},_r.prototype.getX=function(){return this.x.fromRed()},_r.prototype.getY=function(){return this.y.fromRed()},_r.prototype.mul=function(t){return t=new st(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},_r.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},_r.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},_r.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},_r.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(i){return i.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},_r.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function Pr(t,e,r,n){Hs.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new st(0)):(this.x=new st(e,16),this.y=new st(r,16),this.z=new st(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}yf(Pr,Hs.BasePoint),Cn.prototype.jpoint=function(t,e,r){return new Pr(this,t,e,r)},Pr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},Pr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Pr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),c=t.y.redMul(r.redMul(this.z)),l=n.redSub(i),f=o.redSub(c);if(l.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=l.redSqr(),g=h.redMul(l),_=n.redMul(h),E=f.redSqr().redIAdd(g).redISub(_).redISub(_),x=f.redMul(_.redISub(E)).redISub(o.redMul(g)),I=this.z.redMul(t.z).redMul(l);return this.curve.jpoint(E,x,I)},Pr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),c=r.redSub(n),l=i.redSub(o);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),h=f.redMul(c),g=r.redMul(f),_=l.redSqr().redIAdd(h).redISub(g).redISub(g),E=l.redMul(g.redISub(_)).redISub(i.redMul(h)),x=this.z.redMul(c);return this.curve.jpoint(_,E,x)},Pr.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,c=this.y,l=this.z,f=l.redSqr().redSqr(),h=c.redAdd(c);for(e=0;e<t;e++){var g=o.redSqr(),_=h.redSqr(),E=_.redSqr(),x=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),I=o.redMul(_),k=x.redSqr().redISub(I.redAdd(I)),W=I.redISub(k),Y=x.redMul(W);Y=Y.redIAdd(Y).redISub(E);var B=h.redMul(l);e+1<t&&(f=f.redMul(E)),o=k,l=B,h=Y}return this.curve.jpoint(o,h.redMul(i),l)},Pr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Pr.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(o);c=c.redIAdd(c);var l=n.redAdd(n).redIAdd(n),f=l.redSqr().redISub(c).redISub(c),h=o.redIAdd(o);h=h.redIAdd(h),h=h.redIAdd(h),t=f,e=l.redMul(c.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),_=this.y.redSqr(),E=_.redSqr(),x=this.x.redAdd(_).redSqr().redISub(g).redISub(E);x=x.redIAdd(x);var I=g.redAdd(g).redIAdd(g),k=I.redSqr(),W=E.redIAdd(E);W=W.redIAdd(W),W=W.redIAdd(W),t=k.redISub(x).redISub(x),e=I.redMul(x.redISub(t)).redISub(W),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},Pr.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(o);c=c.redIAdd(c);var l=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=l.redSqr().redISub(c).redISub(c);t=f;var h=o.redIAdd(o);h=h.redIAdd(h),h=h.redIAdd(h),e=l.redMul(c.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),_=this.y.redSqr(),E=this.x.redMul(_),x=this.x.redSub(g).redMul(this.x.redAdd(g));x=x.redAdd(x).redIAdd(x);var I=E.redIAdd(E);I=I.redIAdd(I);var k=I.redAdd(I);t=x.redSqr().redISub(k),r=this.y.redAdd(this.z).redSqr().redISub(_).redISub(g);var W=_.redSqr();W=W.redIAdd(W),W=W.redIAdd(W),W=W.redIAdd(W),e=x.redMul(I.redISub(t)).redISub(W)}return this.curve.jpoint(t,e,r)},Pr.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),c=r.redSqr(),l=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),f=e.redAdd(e);f=f.redIAdd(f);var h=f.redMul(c),g=l.redSqr().redISub(h.redAdd(h)),_=h.redISub(g),E=c.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var x=l.redMul(_).redISub(E),I=r.redAdd(r).redMul(n);return this.curve.jpoint(g,x,I)},Pr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),c=this.x.redAdd(e).redSqr().redISub(t).redISub(n);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(o);var l=c.redSqr(),f=n.redIAdd(n);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var h=i.redIAdd(c).redSqr().redISub(o).redISub(l).redISub(f),g=e.redMul(h);g=g.redIAdd(g),g=g.redIAdd(g);var _=this.x.redMul(l).redISub(g);_=_.redIAdd(_),_=_.redIAdd(_);var E=this.y.redMul(h.redMul(f.redISub(h)).redISub(c.redMul(l)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var x=this.z.redAdd(c).redSqr().redISub(r).redISub(l);return this.curve.jpoint(_,E,x)},Pr.prototype.mul=function(t,e){return t=new st(t,e),this.curve._wnafMul(this,t)},Pr.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)===0},Pr.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(r)===0)return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}},Pr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Pr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Dl=Jo(function(t,e){var r=e;r.base=Hs,r.short=nE,r.mont=null,r.edwards=null}),Cl=Jo(function(t,e){var r=e,n=vn.assert;function i(l){l.type==="short"?this.curve=new Dl.short(l):l.type==="edwards"?this.curve=new Dl.edwards(l):this.curve=new Dl.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function o(l,f){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var h=new i(f);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:h}),h}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:li.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:li.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:li.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:li.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:li.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:li.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:li.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:li.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function ls(t){if(!(this instanceof ls))return new ls(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Xn.toArray(t.entropy,t.entropyEnc||"hex"),r=Xn.toArray(t.nonce,t.nonceEnc||"hex"),n=Xn.toArray(t.pers,t.persEnc||"hex");wf(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var rm=ls;ls.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},ls.prototype._hmac=function(){return new li.hmac(this.hash,this.K)},ls.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},ls.prototype.reseed=function(t,e,r,n){typeof e!="string"&&(n=r,r=e,e=null),t=Xn.toArray(t,e),r=Xn.toArray(r,n),wf(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},ls.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(n=r,r=e,e=null),r&&(r=Xn.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this._reseed++,Xn.encode(o,e)};var bf=vn.assert;function Lr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var _f=Lr;Lr.fromPublic=function(t,e,r){return e instanceof Lr?e:new Lr(t,{pub:e,pubEnc:r})},Lr.fromPrivate=function(t,e,r){return e instanceof Lr?e:new Lr(t,{priv:e,privEnc:r})},Lr.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Lr.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Lr.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},Lr.prototype._importPrivate=function(t,e){this.priv=new st(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Lr.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?bf(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&bf(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)},Lr.prototype.derive=function(t){return t.validate()||bf(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Lr.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Lr.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Lr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var iE=vn.assert;function Ol(t,e){if(t instanceof Ol)return t;this._importDER(t,e)||(iE(t.r&&t.s,"Signature without r or s"),this.r=new st(t.r,16),this.s=new st(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Ml=Ol;function sE(){this.place=0}function Ef(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,c=e.place;o<n;o++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}function nm(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Ol.prototype._importDER=function(t,e){t=vn.toArray(t,e);var r=new sE;if(t[r.place++]!==48)return!1;var n=Ef(t,r);if(n===!1||n+r.place!==t.length||t[r.place++]!==2)return!1;var i=Ef(t,r);if(i===!1)return!1;var o=t.slice(r.place,i+r.place);if(r.place+=i,t[r.place++]!==2)return!1;var c=Ef(t,r);if(c===!1||t.length!==c+r.place)return!1;var l=t.slice(r.place,c+r.place);if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new st(o),this.s=new st(l),this.recoveryParam=null,!0};function Af(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Ol.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=nm(e),r=nm(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var n=[2];Af(n,e.length),n=n.concat(e),n.push(2),Af(n,r.length);var i=n.concat(r),o=[48];return Af(o,i.length),o=o.concat(i),vn.encode(o,t)};var oE=function(){throw new Error("unsupported")},im=vn.assert;function On(t){if(!(this instanceof On))return new On(t);typeof t=="string"&&(im(Object.prototype.hasOwnProperty.call(Cl,t),"Unknown curve "+t),t=Cl[t]),t instanceof Cl.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var aE=On;On.prototype.keyPair=function(t){return new _f(this,t)},On.prototype.keyFromPrivate=function(t,e){return _f.fromPrivate(this,t,e)},On.prototype.keyFromPublic=function(t,e){return _f.fromPublic(this,t,e)},On.prototype.genKeyPair=function(t){t||(t={});for(var e=new rm({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||oE(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new st(2));;){var i=new st(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},On.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},On.prototype.sign=function(t,e,r,n){typeof r=="object"&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new st(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),c=t.toArray("be",i),l=new rm({hash:this.hash,entropy:o,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),f=this.n.sub(new st(1)),h=0;;h++){var g=n.k?n.k(h):new st(l.generate(this.n.byteLength()));if(g=this._truncateToN(g,!0),!(g.cmpn(1)<=0||g.cmp(f)>=0)){var _=this.g.mul(g);if(!_.isInfinity()){var E=_.getX(),x=E.umod(this.n);if(x.cmpn(0)!==0){var I=g.invm(this.n).mul(x.mul(e.getPrivate()).iadd(t));if(I=I.umod(this.n),I.cmpn(0)!==0){var k=(_.getY().isOdd()?1:0)|(E.cmp(x)!==0?2:0);return n.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),k^=1),new Ml({r:x,s:I,recoveryParam:k})}}}}}},On.prototype.verify=function(t,e,r,n){t=this._truncateToN(new st(t,16)),r=this.keyFromPublic(r,n),e=new Ml(e,"hex");var i=e.r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c=o.invm(this.n),l=c.mul(t).umod(this.n),f=c.mul(i).umod(this.n),h;return this.curve._maxwellTrick?(h=this.g.jmulAdd(l,r.getPublic(),f),h.isInfinity()?!1:h.eqXToP(i)):(h=this.g.mulAdd(l,r.getPublic(),f),h.isInfinity()?!1:h.getX().umod(this.n).cmp(i)===0)},On.prototype.recoverPubKey=function(t,e,r,n){im((3&r)===r,"The recovery param is more than two bits"),e=new Ml(e,n);var i=this.n,o=new st(t),c=e.r,l=e.s,f=r&1,h=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?c=this.curve.pointFromX(c.add(this.curve.n),f):c=this.curve.pointFromX(c,f);var g=e.r.invm(i),_=i.sub(o).mul(g).umod(i),E=l.mul(g).umod(i);return this.g.mulAdd(_,c,E)},On.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Ml(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var cE=Jo(function(t,e){var r=e;r.version="6.5.4",r.utils=vn,r.rand=function(){throw new Error("unsupported")},r.curve=Dl,r.curves=Cl,r.ec=aE,r.eddsa=null}),lE=cE.ec;const uE="signing-key/5.7.0",xf=new ut(uE);let Sf=null;function vi(){return Sf||(Sf=new lE("secp256k1")),Sf}class hE{constructor(e){Za(this,"curve","secp256k1"),Za(this,"privateKey",kr(e)),V8(this.privateKey)!==32&&xf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=vi().keyFromPrivate(or(this.privateKey));Za(this,"publicKey","0x"+r.getPublic(!1,"hex")),Za(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Za(this,"_isSigningKey",!0)}_addPoint(e){const r=vi().keyFromPublic(or(this.publicKey)),n=vi().keyFromPublic(or(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=vi().keyFromPrivate(or(this.privateKey)),n=or(e);n.length!==32&&xf.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return pg({recoveryParam:i.recoveryParam,r:ci("0x"+i.r.toString(16),32),s:ci("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=vi().keyFromPrivate(or(this.privateKey)),n=vi().keyFromPublic(or(sm(e)));return ci("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function fE(t,e){const r=pg(e),n={r:or(r.r),s:or(r.s)};return"0x"+vi().recoverPubKey(or(t),n,r.recoveryParam).encode("hex",!1)}function sm(t,e){const r=or(t);if(r.length===32){const n=new hE(r);return e?"0x"+vi().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?kr(r):"0x"+vi().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+vi().keyFromPublic(r).getPublic(!0,"hex"):kr(r)}return xf.throwArgumentError("invalid public or private key","key","[REDACTED]")}const dE="transactions/5.7.0";new ut(dE);var om;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(om||(om={}));function pE(t){const e=sm(t);return x4(dg(sf(dg(e,1)),12))}function gE(t,e){return pE(fE(or(t),e))}const mE="https://rpc.walletconnect.com/v1";async function vE(t,e,r,n,i,o){switch(r.t){case"eip191":return wE(t,e,r.s);case"eip1271":return await yE(t,e,r.s,n,i,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function wE(t,e,r){return gE(Mg(e),r).toLowerCase()===t.toLowerCase()}async function yE(t,e,r,n,i,o){try{const c="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",f="0000000000000000000000000000000000000000000000000000000000000041",h=r.substring(2),g=Mg(e).substring(2),_=c+g+l+f+h,E=await fetch(`${o||mE}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:bE(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:_},"latest"]})}),{result:x}=await E.json();return x?x.slice(0,c.length).toLowerCase()===c.toLowerCase():!1}catch(c){return console.error("isValidEip1271Signature: ",c),!1}}function bE(){return Date.now()+Math.floor(Math.random()*1e3)}var _E=Object.defineProperty,EE=Object.defineProperties,AE=Object.getOwnPropertyDescriptors,am=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,SE=Object.prototype.propertyIsEnumerable,cm=(t,e,r)=>e in t?_E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,IE=(t,e)=>{for(var r in e||(e={}))xE.call(e,r)&&cm(t,r,e[r]);if(am)for(var r of am(e))SE.call(e,r)&&cm(t,r,e[r]);return t},DE=(t,e)=>EE(t,AE(e));const CE="did:pkh:",If=t=>t?.split(":"),lm=t=>{const e=t&&If(t);if(e)return t.includes(CE)?e[3]:e[1]},um=t=>{const e=t&&If(t);if(e)return e[2]+":"+e[3]},Pl=t=>{const e=t&&If(t);if(e)return e.pop()};async function hm(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,o=fm(i,i.iss),c=Pl(i.iss);return await vE(c,o,n,lm(i.iss),r)}const fm=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=Pl(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const o=`URI: ${t.aud||t.uri}`,c=`Version: ${t.version}`,l=`Chain ID: ${lm(e)}`,f=`Nonce: ${t.nonce}`,h=`Issued At: ${t.iat}`,g=t.resources?`Resources:${t.resources.map(E=>`
|
|
23
|
-
- ${
|
|
24
|
-
`)};function OE(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function ME(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Ks(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const o=n[i];if(!Array.isArray(o))throw new Error(`Ability limits ${i} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);o.forEach(c=>{if(typeof c!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${c}`)})})})}function PE(t,e,r,n={}){return r?.sort((i,o)=>i.localeCompare(o)),{att:{[t]:$E(e,r,n)}}}function $E(t,e,r={}){e=e?.sort((i,o)=>i.localeCompare(o));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function dm(t){return Ks(t),`urn:recap:${OE(t).replace(/=/g,"")}`}function rc(t){const e=ME(t.replace("urn:recap:",""));return Ks(e),e}function TE(t,e,r){const n=PE(t,e,r);return dm(n)}function NE(t){return t&&t.includes("urn:recap:")}function RE(t,e){const r=rc(t),n=rc(e),i=LE(r,n);return dm(i)}function LE(t,e){Ks(t),Ks(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,o)=>i.localeCompare(o)),n={att:{}};return r.forEach(i=>{var o,c;Object.keys(((o=t.att)==null?void 0:o[i])||{}).concat(Object.keys(((c=e.att)==null?void 0:c[i])||{})).sort((l,f)=>l.localeCompare(f)).forEach(l=>{var f,h;n.att[i]=DE(IE({},n.att[i]),{[l]:((f=t.att[i])==null?void 0:f[l])||((h=e.att[i])==null?void 0:h[l])})})}),n}function BE(t="",e){Ks(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(l=>{const f=Object.keys(e.att[l]).map(_=>({ability:_.split("/")[0],action:_.split("/")[1]}));f.sort((_,E)=>_.action.localeCompare(E.action));const h={};f.forEach(_=>{h[_.ability]||(h[_.ability]=[]),h[_.ability].push(_.action)});const g=Object.keys(h).map(_=>(i++,`(${i}) '${_}': '${h[_].join("', '")}' for '${l}'.`));n.push(g.join(", ").replace(".,","."))});const o=n.join(" "),c=`${r}${o}`;return`${t?t+" ":""}${c}`}function pm(t){var e;const r=rc(t);Ks(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function gm(t){const e=rc(t);Ks(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var o;(o=i?.[0])!=null&&o.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function $l(t){if(!t)return;const e=t?.[t.length-1];return NE(e)?e:void 0}const mm="base10",zr="base16",Df="base64pad",Cf="utf8",vm=0,ji=1,UE=0,wm=1,Of=12,Mf=32;function FE(){const t=Jh.generateKeyPair();return{privateKey:Yn(t.secretKey,zr),publicKey:Yn(t.publicKey,zr)}}function Pf(){const t=Lo.randomBytes(Mf);return Yn(t,zr)}function jE(t,e){const r=Jh.sharedKey(Gn(t,zr),Gn(e,zr),!0),n=new K6(pl.SHA256,r).expand(Mf);return Yn(n,zr)}function Tl(t){const e=pl.hash(Gn(t,zr));return Yn(e,zr)}function Ws(t){const e=pl.hash(Gn(t,Cf));return Yn(e,zr)}function kE(t){return Gn(`${t}`,mm)}function nc(t){return Number(Yn(t,mm))}function qE(t){const e=kE(typeof t.type<"u"?t.type:vm);if(nc(e)===ji&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Gn(t.senderPublicKey,zr):void 0,n=typeof t.iv<"u"?Gn(t.iv,zr):Lo.randomBytes(Of),i=new Hh.ChaCha20Poly1305(Gn(t.symKey,zr)).seal(n,Gn(t.message,Cf));return HE({type:e,sealed:i,iv:n,senderPublicKey:r})}function zE(t){const e=new Hh.ChaCha20Poly1305(Gn(t.symKey,zr)),{sealed:r,iv:n}=Nl(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Yn(i,Cf)}function HE(t){if(nc(t.type)===ji){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Yn($1([t.type,t.senderPublicKey,t.iv,t.sealed]),Df)}return Yn($1([t.type,t.iv,t.sealed]),Df)}function Nl(t){const e=Gn(t,Df),r=e.slice(UE,wm),n=wm;if(nc(r)===ji){const l=n+Mf,f=l+Of,h=e.slice(n,l),g=e.slice(l,f),_=e.slice(f);return{type:r,sealed:_,iv:g,senderPublicKey:h}}const i=n+Of,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function KE(t,e){const r=Nl(t);return ym({type:nc(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Yn(r.senderPublicKey,zr):void 0,receiverPublicKey:e?.receiverPublicKey})}function ym(t){const e=t?.type||vm;if(e===ji){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function bm(t){return t.type===ji&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}const WE="irn";function $f(t){return t?.relay||{protocol:WE}}function ic(t){const e=_8[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var VE=Object.defineProperty,GE=Object.defineProperties,YE=Object.getOwnPropertyDescriptors,_m=Object.getOwnPropertySymbols,QE=Object.prototype.hasOwnProperty,JE=Object.prototype.propertyIsEnumerable,Em=(t,e,r)=>e in t?VE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Am=(t,e)=>{for(var r in e||(e={}))QE.call(e,r)&&Em(t,r,e[r]);if(_m)for(var r of _m(e))JE.call(e,r)&&Em(t,r,e[r]);return t},ZE=(t,e)=>GE(t,YE(e));function XE(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function xm(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",c=za.parse(o),l=typeof c.methods=="string"?c.methods.split(","):void 0;return{protocol:n,topic:eA(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:XE(c),methods:l,expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function eA(t){return t.startsWith("//")?t.substring(2):t}function tA(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function rA(t){return`${t.protocol}:${t.topic}@${t.version}?`+za.stringify(Am(ZE(Am({symKey:t.symKey},tA(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Zo(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function nA(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Zo(r.accounts))}),e}function iA(t,e){const r=[];return Object.values(t).forEach(n=>{Zo(n.accounts).includes(e)&&r.push(...n.methods)}),r}function sA(t,e){const r=[];return Object.values(t).forEach(n=>{Zo(n.accounts).includes(e)&&r.push(...n.events)}),r}function Tf(t){return t.includes(":")}function sc(t){return Tf(t)?t.split(":")[0]:t}function oA(t){const e={};return t?.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function Sm(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=oA(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=vl(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const aA={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},cA={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function me(t,e){const{message:r,code:n}=cA[t];return{message:e?`${r} ${e}`:r,code:n}}function Ut(t,e){const{message:r,code:n}=aA[t];return{message:e?`${r} ${e}`:r,code:n}}function wi(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function oc(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Hr(t){return typeof t>"u"}function ur(t,e){return e&&Hr(t)?!0:typeof t=="string"&&!!t.trim().length}function Nf(t,e){return e&&Hr(t)?!0:typeof t=="number"&&!isNaN(t)}function lA(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return ks(i,n)?(n.forEach(c=>{const{accounts:l,methods:f,events:h}=t.namespaces[c],g=Zo(l),_=r[c];(!ks(Q1(c,_),g)||!ks(_.methods,f)||!ks(_.events,h))&&(o=!1)}),o):!1}function Rl(t){return ur(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function uA(t){if(ur(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Rl(r)}}return!1}function hA(t){if(ur(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function fA(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function dA(t){return t?.topic}function pA(t,e){let r=null;return ur(t?.publicKey,!1)||(r=me("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Im(t){let e=!0;return wi(t)?t.length&&(e=t.every(r=>ur(r,!1))):e=!1,e}function gA(t,e,r){let n=null;return wi(e)&&e.length?e.forEach(i=>{n||Rl(i)||(n=Ut("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Rl(t)||(n=Ut("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function mA(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=gA(i,Q1(i,o),`${e} ${r}`);c&&(n=c)}),n}function vA(t,e){let r=null;return wi(t)?t.forEach(n=>{r||uA(n)||(r=Ut("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Ut("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function wA(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=vA(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function yA(t,e){let r=null;return Im(t?.methods)?Im(t?.events)||(r=Ut("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Ut("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function Dm(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=yA(n,`${e}, namespace`);i&&(r=i)}),r}function bA(t,e,r){let n=null;if(t&&oc(t)){const i=Dm(t,e);i&&(n=i);const o=mA(t,e,r);o&&(n=o)}else n=me("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Rf(t,e){let r=null;if(t&&oc(t)){const n=Dm(t,e);n&&(r=n);const i=wA(t,e);i&&(r=i)}else r=me("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Cm(t){return ur(t.protocol,!0)}function _A(t,e){let r=!1;return e&&!t?r=!0:t&&wi(t)&&t.length&&t.forEach(n=>{r=Cm(n)}),r}function EA(t){return typeof t=="number"}function tn(t){return typeof t<"u"&&typeof t!==null}function AA(t){return!(!t||typeof t!="object"||!t.code||!Nf(t.code,!1)||!t.message||!ur(t.message,!1))}function xA(t){return!(Hr(t)||!ur(t.method,!1))}function SA(t){return!(Hr(t)||Hr(t.result)&&Hr(t.error)||!Nf(t.id,!1)||!ur(t.jsonrpc,!1))}function IA(t){return!(Hr(t)||!ur(t.name,!1))}function Om(t,e){return!(!Rl(e)||!nA(t).includes(e))}function DA(t,e,r){return ur(r,!1)?iA(t,e).includes(r):!1}function CA(t,e,r){return ur(r,!1)?sA(t,e).includes(r):!1}function Mm(t,e,r){let n=null;const i=OA(t),o=MA(e),c=Object.keys(i),l=Object.keys(o),f=Pm(Object.keys(t)),h=Pm(Object.keys(e)),g=f.filter(_=>!h.includes(_));return g.length&&(n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
21
|
+
*/(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",c=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?i=Cg:o&&(i=self);var l=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,f=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",h="0123456789abcdef".split(""),g=[31,7936,2031616,520093696],_=[4,1024,262144,67108864],E=[1,256,65536,16777216],x=[6,1536,393216,100663296],I=[0,8,16,24],F=[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],W=[224,256,384,512],Y=[128,256],B=["hex","buffer","arrayBuffer","array","digest"],z={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(A){return Object.prototype.toString.call(A)==="[object Array]"}),f&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(A){return typeof A=="object"&&A.buffer&&A.buffer.constructor===ArrayBuffer});for(var M=function(A,re,q){return function(H){return new N(A,re,A).update(H)[q]()}},U=function(A,re,q){return function(H,V){return new N(A,re,V).update(H)[q]()}},j=function(A,re,q){return function(H,V,w,k){return p["cshake"+A].update(H,V,w,k)[q]()}},m=function(A,re,q){return function(H,V,w,k){return p["kmac"+A].update(H,V,w,k)[q]()}},$=function(A,re,q,H){for(var V=0;V<B.length;++V){var w=B[V];A[w]=re(q,H,w)}return A},te=function(A,re){var q=M(A,re,"hex");return q.create=function(){return new N(A,re,A)},q.update=function(H){return q.create().update(H)},$(q,M,A,re)},ee=function(A,re){var q=U(A,re,"hex");return q.create=function(H){return new N(A,re,H)},q.update=function(H,V){return q.create(V).update(H)},$(q,U,A,re)},ne=function(A,re){var q=z[A],H=j(A,re,"hex");return H.create=function(V,w,k){return!w&&!k?p["shake"+A].create(V):new N(A,re,V).bytepad([w,k],q)},H.update=function(V,w,k,ie){return H.create(w,k,ie).update(V)},$(H,j,A,re)},de=function(A,re){var q=z[A],H=m(A,re,"hex");return H.create=function(V,w,k){return new oe(A,re,w).bytepad(["KMAC",k],q).bytepad([V],q)},H.update=function(V,w,k,ie){return H.create(V,k,ie).update(w)},$(H,m,A,re)},d=[{name:"keccak",padding:E,bits:W,createMethod:te},{name:"sha3",padding:x,bits:W,createMethod:te},{name:"shake",padding:g,bits:Y,createMethod:ee},{name:"cshake",padding:_,bits:Y,createMethod:ne},{name:"kmac",padding:_,bits:Y,createMethod:de}],p={},b=[],C=0;C<d.length;++C)for(var O=d[C],T=O.bits,L=0;L<T.length;++L){var D=O.name+"_"+T[L];if(b.push(D),p[D]=O.createMethod(T[L],O.padding),O.name!=="sha3"){var v=O.name+T[L];b.push(v),p[v]=p[D]}}function N(A,re,q){this.blocks=[],this.s=[],this.padding=re,this.outputBits=q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(A<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=q>>5,this.extraBytes=(q&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}N.prototype.update=function(A){if(this.finalized)throw new Error(r);var re,q=typeof A;if(q!=="string"){if(q==="object"){if(A===null)throw new Error(e);if(f&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!f||!ArrayBuffer.isView(A)))throw new Error(e)}else throw new Error(e);re=!0}for(var H=this.blocks,V=this.byteCount,w=A.length,k=this.blockCount,ie=0,he=this.s,le,Oe;ie<w;){if(this.reset)for(this.reset=!1,H[0]=this.block,le=1;le<k+1;++le)H[le]=0;if(re)for(le=this.start;ie<w&&le<V;++ie)H[le>>2]|=A[ie]<<I[le++&3];else for(le=this.start;ie<w&&le<V;++ie)Oe=A.charCodeAt(ie),Oe<128?H[le>>2]|=Oe<<I[le++&3]:Oe<2048?(H[le>>2]|=(192|Oe>>6)<<I[le++&3],H[le>>2]|=(128|Oe&63)<<I[le++&3]):Oe<55296||Oe>=57344?(H[le>>2]|=(224|Oe>>12)<<I[le++&3],H[le>>2]|=(128|Oe>>6&63)<<I[le++&3],H[le>>2]|=(128|Oe&63)<<I[le++&3]):(Oe=65536+((Oe&1023)<<10|A.charCodeAt(++ie)&1023),H[le>>2]|=(240|Oe>>18)<<I[le++&3],H[le>>2]|=(128|Oe>>12&63)<<I[le++&3],H[le>>2]|=(128|Oe>>6&63)<<I[le++&3],H[le>>2]|=(128|Oe&63)<<I[le++&3]);if(this.lastByteIndex=le,le>=V){for(this.start=le-V,this.block=H[k],le=0;le<k;++le)he[le]^=H[le];pe(he),this.reset=!0}else this.start=le}return this},N.prototype.encode=function(A,re){var q=A&255,H=1,V=[q];for(A=A>>8,q=A&255;q>0;)V.unshift(q),A=A>>8,q=A&255,++H;return re?V.push(H):V.unshift(H),this.update(V),V.length},N.prototype.encodeString=function(A){var re,q=typeof A;if(q!=="string"){if(q==="object"){if(A===null)throw new Error(e);if(f&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!f||!ArrayBuffer.isView(A)))throw new Error(e)}else throw new Error(e);re=!0}var H=0,V=A.length;if(re)H=V;else for(var w=0;w<A.length;++w){var k=A.charCodeAt(w);k<128?H+=1:k<2048?H+=2:k<55296||k>=57344?H+=3:(k=65536+((k&1023)<<10|A.charCodeAt(++w)&1023),H+=4)}return H+=this.encode(H*8),this.update(A),H},N.prototype.bytepad=function(A,re){for(var q=this.encode(re),H=0;H<A.length;++H)q+=this.encodeString(A[H]);var V=re-q%re,w=[];return w.length=V,this.update(w),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var A=this.blocks,re=this.lastByteIndex,q=this.blockCount,H=this.s;if(A[re>>2]|=this.padding[re&3],this.lastByteIndex===this.byteCount)for(A[0]=A[q],re=1;re<q+1;++re)A[re]=0;for(A[q-1]|=2147483648,re=0;re<q;++re)H[re]^=A[re];pe(H)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var A=this.blockCount,re=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,k="",ie;w<q;){for(V=0;V<A&&w<q;++V,++w)ie=re[V],k+=h[ie>>4&15]+h[ie&15]+h[ie>>12&15]+h[ie>>8&15]+h[ie>>20&15]+h[ie>>16&15]+h[ie>>28&15]+h[ie>>24&15];w%A===0&&(pe(re),V=0)}return H&&(ie=re[V],k+=h[ie>>4&15]+h[ie&15],H>1&&(k+=h[ie>>12&15]+h[ie>>8&15]),H>2&&(k+=h[ie>>20&15]+h[ie>>16&15])),k},N.prototype.arrayBuffer=function(){this.finalize();var A=this.blockCount,re=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,k=this.outputBits>>3,ie;H?ie=new ArrayBuffer(q+1<<2):ie=new ArrayBuffer(k);for(var he=new Uint32Array(ie);w<q;){for(V=0;V<A&&w<q;++V,++w)he[w]=re[V];w%A===0&&pe(re)}return H&&(he[V]=re[V],ie=ie.slice(0,k)),ie},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var A=this.blockCount,re=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,k=[],ie,he;w<q;){for(V=0;V<A&&w<q;++V,++w)ie=w<<2,he=re[V],k[ie]=he&255,k[ie+1]=he>>8&255,k[ie+2]=he>>16&255,k[ie+3]=he>>24&255;w%A===0&&pe(re)}return H&&(ie=w<<2,he=re[V],k[ie]=he&255,H>1&&(k[ie+1]=he>>8&255),H>2&&(k[ie+2]=he>>16&255)),k};function oe(A,re,q){N.call(this,A,re,q)}oe.prototype=new N,oe.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var pe=function(A){var re,q,H,V,w,k,ie,he,le,Oe,Pe,Se,Mt,ze,De,Fe,Ee,Ae,Ge,be,xe,Be,_e,Me,je,$e,Te,lt,Re,Ne,nr,dt,Et,ir,It,Ot,Vr,Ye,He,Rt,Qe,Ve,Pt,Xe,et,Lt,tt,Je,Ft,Ze,ke,Ht,rt,jt,ti,kt,vt,Nn,Rn,Ln,Bn,Un,xr;for(H=0;H<48;H+=2)V=A[0]^A[10]^A[20]^A[30]^A[40],w=A[1]^A[11]^A[21]^A[31]^A[41],k=A[2]^A[12]^A[22]^A[32]^A[42],ie=A[3]^A[13]^A[23]^A[33]^A[43],he=A[4]^A[14]^A[24]^A[34]^A[44],le=A[5]^A[15]^A[25]^A[35]^A[45],Oe=A[6]^A[16]^A[26]^A[36]^A[46],Pe=A[7]^A[17]^A[27]^A[37]^A[47],Se=A[8]^A[18]^A[28]^A[38]^A[48],Mt=A[9]^A[19]^A[29]^A[39]^A[49],re=Se^(k<<1|ie>>>31),q=Mt^(ie<<1|k>>>31),A[0]^=re,A[1]^=q,A[10]^=re,A[11]^=q,A[20]^=re,A[21]^=q,A[30]^=re,A[31]^=q,A[40]^=re,A[41]^=q,re=V^(he<<1|le>>>31),q=w^(le<<1|he>>>31),A[2]^=re,A[3]^=q,A[12]^=re,A[13]^=q,A[22]^=re,A[23]^=q,A[32]^=re,A[33]^=q,A[42]^=re,A[43]^=q,re=k^(Oe<<1|Pe>>>31),q=ie^(Pe<<1|Oe>>>31),A[4]^=re,A[5]^=q,A[14]^=re,A[15]^=q,A[24]^=re,A[25]^=q,A[34]^=re,A[35]^=q,A[44]^=re,A[45]^=q,re=he^(Se<<1|Mt>>>31),q=le^(Mt<<1|Se>>>31),A[6]^=re,A[7]^=q,A[16]^=re,A[17]^=q,A[26]^=re,A[27]^=q,A[36]^=re,A[37]^=q,A[46]^=re,A[47]^=q,re=Oe^(V<<1|w>>>31),q=Pe^(w<<1|V>>>31),A[8]^=re,A[9]^=q,A[18]^=re,A[19]^=q,A[28]^=re,A[29]^=q,A[38]^=re,A[39]^=q,A[48]^=re,A[49]^=q,ze=A[0],De=A[1],Lt=A[11]<<4|A[10]>>>28,tt=A[10]<<4|A[11]>>>28,lt=A[20]<<3|A[21]>>>29,Re=A[21]<<3|A[20]>>>29,Ln=A[31]<<9|A[30]>>>23,Bn=A[30]<<9|A[31]>>>23,Ve=A[40]<<18|A[41]>>>14,Pt=A[41]<<18|A[40]>>>14,ir=A[2]<<1|A[3]>>>31,It=A[3]<<1|A[2]>>>31,Fe=A[13]<<12|A[12]>>>20,Ee=A[12]<<12|A[13]>>>20,Je=A[22]<<10|A[23]>>>22,Ft=A[23]<<10|A[22]>>>22,Ne=A[33]<<13|A[32]>>>19,nr=A[32]<<13|A[33]>>>19,Un=A[42]<<2|A[43]>>>30,xr=A[43]<<2|A[42]>>>30,jt=A[5]<<30|A[4]>>>2,ti=A[4]<<30|A[5]>>>2,Ot=A[14]<<6|A[15]>>>26,Vr=A[15]<<6|A[14]>>>26,Ae=A[25]<<11|A[24]>>>21,Ge=A[24]<<11|A[25]>>>21,Ze=A[34]<<15|A[35]>>>17,ke=A[35]<<15|A[34]>>>17,dt=A[45]<<29|A[44]>>>3,Et=A[44]<<29|A[45]>>>3,Me=A[6]<<28|A[7]>>>4,je=A[7]<<28|A[6]>>>4,kt=A[17]<<23|A[16]>>>9,vt=A[16]<<23|A[17]>>>9,Ye=A[26]<<25|A[27]>>>7,He=A[27]<<25|A[26]>>>7,be=A[36]<<21|A[37]>>>11,xe=A[37]<<21|A[36]>>>11,Ht=A[47]<<24|A[46]>>>8,rt=A[46]<<24|A[47]>>>8,Xe=A[8]<<27|A[9]>>>5,et=A[9]<<27|A[8]>>>5,$e=A[18]<<20|A[19]>>>12,Te=A[19]<<20|A[18]>>>12,Nn=A[29]<<7|A[28]>>>25,Rn=A[28]<<7|A[29]>>>25,Rt=A[38]<<8|A[39]>>>24,Qe=A[39]<<8|A[38]>>>24,Be=A[48]<<14|A[49]>>>18,_e=A[49]<<14|A[48]>>>18,A[0]=ze^~Fe&Ae,A[1]=De^~Ee&Ge,A[10]=Me^~$e<,A[11]=je^~Te&Re,A[20]=ir^~Ot&Ye,A[21]=It^~Vr&He,A[30]=Xe^~Lt&Je,A[31]=et^~tt&Ft,A[40]=jt^~kt&Nn,A[41]=ti^~vt&Rn,A[2]=Fe^~Ae&be,A[3]=Ee^~Ge&xe,A[12]=$e^~lt&Ne,A[13]=Te^~Re&nr,A[22]=Ot^~Ye&Rt,A[23]=Vr^~He&Qe,A[32]=Lt^~Je&Ze,A[33]=tt^~Ft&ke,A[42]=kt^~Nn&Ln,A[43]=vt^~Rn&Bn,A[4]=Ae^~be&Be,A[5]=Ge^~xe&_e,A[14]=lt^~Ne&dt,A[15]=Re^~nr&Et,A[24]=Ye^~Rt&Ve,A[25]=He^~Qe&Pt,A[34]=Je^~Ze&Ht,A[35]=Ft^~ke&rt,A[44]=Nn^~Ln&Un,A[45]=Rn^~Bn&xr,A[6]=be^~Be&ze,A[7]=xe^~_e&De,A[16]=Ne^~dt&Me,A[17]=nr^~Et&je,A[26]=Rt^~Ve&ir,A[27]=Qe^~Pt&It,A[36]=Ze^~Ht&Xe,A[37]=ke^~rt&et,A[46]=Ln^~Un&jt,A[47]=Bn^~xr&ti,A[8]=Be^~ze&Fe,A[9]=_e^~De&Ee,A[18]=dt^~Me&$e,A[19]=Et^~je&Te,A[28]=Ve^~ir&Ot,A[29]=Pt^~It&Vr,A[38]=Ht^~Xe&Lt,A[39]=rt^~et&tt,A[48]=Un^~jt&kt,A[49]=xr^~ti&vt,A[0]^=F[H],A[1]^=F[H+1]};if(l)t.exports=p;else for(C=0;C<b.length;++C)i[b[C]]=p[b[C]]})()})(Dg);var b4=Dg.exports;const _4="logger/5.7.0";let Og=!1,Mg=!1;const Dl={debug:1,default:2,info:2,warning:3,error:4,off:5};let Pg=Dl.default,pf=null;function E4(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const $g=E4();var gf;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(gf||(gf={}));var Qn;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Qn||(Qn={}));const Tg="0123456789abcdef";class ut{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Dl[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Pg>Dl[n])&&console.log.apply(console,r)}debug(...e){this._log(ut.levels.DEBUG,e)}info(...e){this._log(ut.levels.INFO,e)}warn(...e){this._log(ut.levels.WARNING,e)}makeError(e,r,n){if(Mg)return this.makeError("censored error",r,{});r||(r=ut.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(f=>{const h=n[f];try{if(h instanceof Uint8Array){let g="";for(let _=0;_<h.length;_++)g+=Tg[h[_]>>4],g+=Tg[h[_]&15];i.push(f+"=Uint8Array(0x"+g+")")}else i.push(f+"="+JSON.stringify(h))}catch{i.push(f+"="+JSON.stringify(n[f].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const o=e;let c="";switch(r){case Qn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const f=e;switch(f){case"overflow":case"underflow":case"division-by-zero":c+="-"+f;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Qn.CALL_EXCEPTION:case Qn.INSUFFICIENT_FUNDS:case Qn.MISSING_NEW:case Qn.NONCE_EXPIRED:case Qn.REPLACEMENT_UNDERPRICED:case Qn.TRANSACTION_REPLACED:case Qn.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const l=new Error(e);return l.reason=o,l.code=r,Object.keys(n).forEach(function(f){l[f]=n[f]}),l}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,ut.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){$g&&this.throwError("platform missing String.prototype.normalize",ut.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:$g})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ut.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ut.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,ut.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,ut.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ut.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ut.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ut.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return pf||(pf=new ut(_4)),pf}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ut.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Og){if(!e)return;this.globalLogger().throwError("error censorship permanent",ut.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Mg=!!e,Og=!!r}static setLogLevel(e){const r=Dl[e.toLowerCase()];if(r==null){ut.globalLogger().warn("invalid log level - "+e);return}Pg=r}static from(e){return new ut(e)}}ut.errors=Qn,ut.levels=gf;const A4="bytes/5.7.0",lr=new ut(A4);function Ng(t){return!!t.toHexString}function zo(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return zo(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function x4(t){return mn(t)&&!(t.length%2)||Ho(t)}function Rg(t){return typeof t=="number"&&t==t&&t%1===0}function Ho(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Rg(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!Rg(r)||r<0||r>=256)return!1}return!0}function or(t,e){if(e||(e={}),typeof t=="number"){lr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),zo(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Ng(t)&&(t=t.toHexString()),mn(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":lr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return zo(new Uint8Array(n))}return Ho(t)?zo(new Uint8Array(t)):lr.throwArgumentError("invalid arrayify value","value",t)}function I4(t){const e=t.map(i=>or(i)),r=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(r);return e.reduce((i,o)=>(n.set(o,i),i+o.length),0),zo(n)}function S4(t,e){t=or(t),t.length>e&&lr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),zo(r)}function mn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const mf="0123456789abcdef";function kr(t,e){if(e||(e={}),typeof t=="number"){lr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=mf[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Ng(t))return t.toHexString();if(mn(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":lr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Ho(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=mf[(i&240)>>4]+mf[i&15]}return r}return lr.throwArgumentError("invalid hexlify value","value",t)}function C4(t){if(typeof t!="string")t=kr(t);else if(!mn(t)||t.length%2)return null;return(t.length-2)/2}function Lg(t,e,r){return typeof t!="string"?t=kr(t):(!mn(t)||t.length%2)&&lr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ui(t,e){for(typeof t!="string"?t=kr(t):mn(t)||lr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&lr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Bg(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(x4(t)){let r=or(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=kr(r.slice(0,32)),e.s=kr(r.slice(32,64))):r.length===65?(e.r=kr(r.slice(0,32)),e.s=kr(r.slice(32,64)),e.v=r[64]):lr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:lr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=kr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=S4(or(e._vs),32);e._vs=kr(i);const o=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&lr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const c=kr(i);e.s==null?e.s=c:e.s!==c&&lr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?lr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&lr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!mn(e.r)?lr.throwArgumentError("signature missing or invalid r","signature",t):e.r=ui(e.r,32),e.s==null||!mn(e.s)?lr.throwArgumentError("signature missing or invalid s","signature",t):e.s=ui(e.s,32);const r=or(e.s);r[0]>=128&&lr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=kr(r);e._vs&&(mn(e._vs)||lr.throwArgumentError("signature invalid _vs","signature",t),e._vs=ui(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&lr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function vf(t){return"0x"+b4.keccak_256(or(t))}var Ug={exports:{}},D4={},O4=Object.freeze({__proto__:null,default:D4}),M4=y4(O4);(function(t){(function(e,r){function n(d,p){if(!d)throw new Error(p||"Assertion failed")}function i(d,p){d.super_=p;var b=function(){};b.prototype=p.prototype,d.prototype=new b,d.prototype.constructor=d}function o(d,p,b){if(o.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((p==="le"||p==="be")&&(b=p,p=10),this._init(d||0,p||10,b||"be"))}typeof e=="object"?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=M4.Buffer}catch{}o.isBN=function(d){return d instanceof o?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===o.wordSize&&Array.isArray(d.words)},o.max=function(d,p){return d.cmp(p)>0?d:p},o.min=function(d,p){return d.cmp(p)<0?d:p},o.prototype._init=function(d,p,b){if(typeof d=="number")return this._initNumber(d,p,b);if(typeof d=="object")return this._initArray(d,p,b);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),d=d.toString().replace(/\s+/g,"");var C=0;d[0]==="-"&&(C++,this.negative=1),C<d.length&&(p===16?this._parseHex(d,C,b):(this._parseBase(d,p,C),b==="le"&&this._initArray(this.toArray(),p,b)))},o.prototype._initNumber=function(d,p,b){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(n(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),p,b)},o.prototype._initArray=function(d,p,b){if(n(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var C=0;C<this.length;C++)this.words[C]=0;var O,T,L=0;if(b==="be")for(C=d.length-1,O=0;C>=0;C-=3)T=d[C]|d[C-1]<<8|d[C-2]<<16,this.words[O]|=T<<L&67108863,this.words[O+1]=T>>>26-L&67108863,L+=24,L>=26&&(L-=26,O++);else if(b==="le")for(C=0,O=0;C<d.length;C+=3)T=d[C]|d[C+1]<<8|d[C+2]<<16,this.words[O]|=T<<L&67108863,this.words[O+1]=T>>>26-L&67108863,L+=24,L>=26&&(L-=26,O++);return this._strip()};function l(d,p){var b=d.charCodeAt(p);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;n(!1,"Invalid character in "+d)}function f(d,p,b){var C=l(d,b);return b-1>=p&&(C|=l(d,b-1)<<4),C}o.prototype._parseHex=function(d,p,b){this.length=Math.ceil((d.length-p)/6),this.words=new Array(this.length);for(var C=0;C<this.length;C++)this.words[C]=0;var O=0,T=0,L;if(b==="be")for(C=d.length-1;C>=p;C-=2)L=f(d,p,C)<<O,this.words[T]|=L&67108863,O>=18?(O-=18,T+=1,this.words[T]|=L>>>26):O+=8;else{var D=d.length-p;for(C=D%2===0?p+1:p;C<d.length;C+=2)L=f(d,p,C)<<O,this.words[T]|=L&67108863,O>=18?(O-=18,T+=1,this.words[T]|=L>>>26):O+=8}this._strip()};function h(d,p,b,C){for(var O=0,T=0,L=Math.min(d.length,b),D=p;D<L;D++){var v=d.charCodeAt(D)-48;O*=C,v>=49?T=v-49+10:v>=17?T=v-17+10:T=v,n(v>=0&&T<C,"Invalid character"),O+=T}return O}o.prototype._parseBase=function(d,p,b){this.words=[0],this.length=1;for(var C=0,O=1;O<=67108863;O*=p)C++;C--,O=O/p|0;for(var T=d.length-b,L=T%C,D=Math.min(T,T-L)+b,v=0,N=b;N<D;N+=C)v=h(d,N,N+C,p),this.imuln(O),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(L!==0){var oe=1;for(v=h(d,N,d.length,p),N=0;N<L;N++)oe*=p;this.imuln(oe),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},o.prototype.copy=function(d){d.words=new Array(this.length);for(var p=0;p<this.length;p++)d.words[p]=this.words[p];d.length=this.length,d.negative=this.negative,d.red=this.red};function g(d,p){d.words=p.words,d.length=p.length,d.negative=p.negative,d.red=p.red}if(o.prototype._move=function(d){g(d,this)},o.prototype.clone=function(){var d=new o(null);return this.copy(d),d},o.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{o.prototype.inspect=_}else o.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[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],I=[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];o.prototype.toString=function(d,p){d=d||10,p=p|0||1;var b;if(d===16||d==="hex"){b="";for(var C=0,O=0,T=0;T<this.length;T++){var L=this.words[T],D=((L<<C|O)&16777215).toString(16);O=L>>>24-C&16777215,C+=2,C>=26&&(C-=26,T--),O!==0||T!==this.length-1?b=E[6-D.length]+D+b:b=D+b}for(O!==0&&(b=O.toString(16)+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(d===(d|0)&&d>=2&&d<=36){var v=x[d],N=I[d];b="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var pe=oe.modrn(N).toString(d);oe=oe.idivn(N),oe.isZero()?b=pe+b:b=E[v-pe.length]+pe+b}for(this.isZero()&&(b="0"+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(d,p){return this.toArrayLike(c,d,p)}),o.prototype.toArray=function(d,p){return this.toArrayLike(Array,d,p)};var F=function(d,p){return d.allocUnsafe?d.allocUnsafe(p):new d(p)};o.prototype.toArrayLike=function(d,p,b){this._strip();var C=this.byteLength(),O=b||Math.max(1,C);n(C<=O,"byte array longer than desired length"),n(O>0,"Requested array length <= 0");var T=F(d,O),L=p==="le"?"LE":"BE";return this["_toArrayLike"+L](T,C),T},o.prototype._toArrayLikeLE=function(d,p){for(var b=0,C=0,O=0,T=0;O<this.length;O++){var L=this.words[O]<<T|C;d[b++]=L&255,b<d.length&&(d[b++]=L>>8&255),b<d.length&&(d[b++]=L>>16&255),T===6?(b<d.length&&(d[b++]=L>>24&255),C=0,T=0):(C=L>>>24,T+=2)}if(b<d.length)for(d[b++]=C;b<d.length;)d[b++]=0},o.prototype._toArrayLikeBE=function(d,p){for(var b=d.length-1,C=0,O=0,T=0;O<this.length;O++){var L=this.words[O]<<T|C;d[b--]=L&255,b>=0&&(d[b--]=L>>8&255),b>=0&&(d[b--]=L>>16&255),T===6?(b>=0&&(d[b--]=L>>24&255),C=0,T=0):(C=L>>>24,T+=2)}if(b>=0)for(d[b--]=C;b>=0;)d[b--]=0},Math.clz32?o.prototype._countBits=function(d){return 32-Math.clz32(d)}:o.prototype._countBits=function(d){var p=d,b=0;return p>=4096&&(b+=13,p>>>=13),p>=64&&(b+=7,p>>>=7),p>=8&&(b+=4,p>>>=4),p>=2&&(b+=2,p>>>=2),b+p},o.prototype._zeroBits=function(d){if(d===0)return 26;var p=d,b=0;return p&8191||(b+=13,p>>>=13),p&127||(b+=7,p>>>=7),p&15||(b+=4,p>>>=4),p&3||(b+=2,p>>>=2),p&1||b++,b},o.prototype.bitLength=function(){var d=this.words[this.length-1],p=this._countBits(d);return(this.length-1)*26+p};function W(d){for(var p=new Array(d.bitLength()),b=0;b<p.length;b++){var C=b/26|0,O=b%26;p[b]=d.words[C]>>>O&1}return p}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,p=0;p<this.length;p++){var b=this._zeroBits(this.words[p]);if(d+=b,b!==26)break}return d},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},o.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var p=0;p<d.length;p++)this.words[p]=this.words[p]|d.words[p];return this._strip()},o.prototype.ior=function(d){return n((this.negative|d.negative)===0),this.iuor(d)},o.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},o.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},o.prototype.iuand=function(d){var p;this.length>d.length?p=d:p=this;for(var b=0;b<p.length;b++)this.words[b]=this.words[b]&d.words[b];return this.length=p.length,this._strip()},o.prototype.iand=function(d){return n((this.negative|d.negative)===0),this.iuand(d)},o.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},o.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},o.prototype.iuxor=function(d){var p,b;this.length>d.length?(p=this,b=d):(p=d,b=this);for(var C=0;C<b.length;C++)this.words[C]=p.words[C]^b.words[C];if(this!==p)for(;C<p.length;C++)this.words[C]=p.words[C];return this.length=p.length,this._strip()},o.prototype.ixor=function(d){return n((this.negative|d.negative)===0),this.iuxor(d)},o.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},o.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},o.prototype.inotn=function(d){n(typeof d=="number"&&d>=0);var p=Math.ceil(d/26)|0,b=d%26;this._expand(p),b>0&&p--;for(var C=0;C<p;C++)this.words[C]=~this.words[C]&67108863;return b>0&&(this.words[C]=~this.words[C]&67108863>>26-b),this._strip()},o.prototype.notn=function(d){return this.clone().inotn(d)},o.prototype.setn=function(d,p){n(typeof d=="number"&&d>=0);var b=d/26|0,C=d%26;return this._expand(b+1),p?this.words[b]=this.words[b]|1<<C:this.words[b]=this.words[b]&~(1<<C),this._strip()},o.prototype.iadd=function(d){var p;if(this.negative!==0&&d.negative===0)return this.negative=0,p=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,p=this.isub(d),d.negative=1,p._normSign();var b,C;this.length>d.length?(b=this,C=d):(b=d,C=this);for(var O=0,T=0;T<C.length;T++)p=(b.words[T]|0)+(C.words[T]|0)+O,this.words[T]=p&67108863,O=p>>>26;for(;O!==0&&T<b.length;T++)p=(b.words[T]|0)+O,this.words[T]=p&67108863,O=p>>>26;if(this.length=b.length,O!==0)this.words[this.length]=O,this.length++;else if(b!==this)for(;T<b.length;T++)this.words[T]=b.words[T];return this},o.prototype.add=function(d){var p;return d.negative!==0&&this.negative===0?(d.negative=0,p=this.sub(d),d.negative^=1,p):d.negative===0&&this.negative!==0?(this.negative=0,p=d.sub(this),this.negative=1,p):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},o.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var p=this.iadd(d);return d.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var b=this.cmp(d);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,O;b>0?(C=this,O=d):(C=d,O=this);for(var T=0,L=0;L<O.length;L++)p=(C.words[L]|0)-(O.words[L]|0)+T,T=p>>26,this.words[L]=p&67108863;for(;T!==0&&L<C.length;L++)p=(C.words[L]|0)+T,T=p>>26,this.words[L]=p&67108863;if(T===0&&L<C.length&&C!==this)for(;L<C.length;L++)this.words[L]=C.words[L];return this.length=Math.max(this.length,L),C!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(d){return this.clone().isub(d)};function Y(d,p,b){b.negative=p.negative^d.negative;var C=d.length+p.length|0;b.length=C,C=C-1|0;var O=d.words[0]|0,T=p.words[0]|0,L=O*T,D=L&67108863,v=L/67108864|0;b.words[0]=D;for(var N=1;N<C;N++){for(var oe=v>>>26,pe=v&67108863,A=Math.min(N,p.length-1),re=Math.max(0,N-d.length+1);re<=A;re++){var q=N-re|0;O=d.words[q]|0,T=p.words[re]|0,L=O*T+pe,oe+=L/67108864|0,pe=L&67108863}b.words[N]=pe|0,v=oe|0}return v!==0?b.words[N]=v|0:b.length--,b._strip()}var B=function(d,p,b){var C=d.words,O=p.words,T=b.words,L=0,D,v,N,oe=C[0]|0,pe=oe&8191,A=oe>>>13,re=C[1]|0,q=re&8191,H=re>>>13,V=C[2]|0,w=V&8191,k=V>>>13,ie=C[3]|0,he=ie&8191,le=ie>>>13,Oe=C[4]|0,Pe=Oe&8191,Se=Oe>>>13,Mt=C[5]|0,ze=Mt&8191,De=Mt>>>13,Fe=C[6]|0,Ee=Fe&8191,Ae=Fe>>>13,Ge=C[7]|0,be=Ge&8191,xe=Ge>>>13,Be=C[8]|0,_e=Be&8191,Me=Be>>>13,je=C[9]|0,$e=je&8191,Te=je>>>13,lt=O[0]|0,Re=lt&8191,Ne=lt>>>13,nr=O[1]|0,dt=nr&8191,Et=nr>>>13,ir=O[2]|0,It=ir&8191,Ot=ir>>>13,Vr=O[3]|0,Ye=Vr&8191,He=Vr>>>13,Rt=O[4]|0,Qe=Rt&8191,Ve=Rt>>>13,Pt=O[5]|0,Xe=Pt&8191,et=Pt>>>13,Lt=O[6]|0,tt=Lt&8191,Je=Lt>>>13,Ft=O[7]|0,Ze=Ft&8191,ke=Ft>>>13,Ht=O[8]|0,rt=Ht&8191,jt=Ht>>>13,ti=O[9]|0,kt=ti&8191,vt=ti>>>13;b.negative=d.negative^p.negative,b.length=19,D=Math.imul(pe,Re),v=Math.imul(pe,Ne),v=v+Math.imul(A,Re)|0,N=Math.imul(A,Ne);var Nn=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,D=Math.imul(q,Re),v=Math.imul(q,Ne),v=v+Math.imul(H,Re)|0,N=Math.imul(H,Ne),D=D+Math.imul(pe,dt)|0,v=v+Math.imul(pe,Et)|0,v=v+Math.imul(A,dt)|0,N=N+Math.imul(A,Et)|0;var Rn=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,D=Math.imul(w,Re),v=Math.imul(w,Ne),v=v+Math.imul(k,Re)|0,N=Math.imul(k,Ne),D=D+Math.imul(q,dt)|0,v=v+Math.imul(q,Et)|0,v=v+Math.imul(H,dt)|0,N=N+Math.imul(H,Et)|0,D=D+Math.imul(pe,It)|0,v=v+Math.imul(pe,Ot)|0,v=v+Math.imul(A,It)|0,N=N+Math.imul(A,Ot)|0;var Ln=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,D=Math.imul(he,Re),v=Math.imul(he,Ne),v=v+Math.imul(le,Re)|0,N=Math.imul(le,Ne),D=D+Math.imul(w,dt)|0,v=v+Math.imul(w,Et)|0,v=v+Math.imul(k,dt)|0,N=N+Math.imul(k,Et)|0,D=D+Math.imul(q,It)|0,v=v+Math.imul(q,Ot)|0,v=v+Math.imul(H,It)|0,N=N+Math.imul(H,Ot)|0,D=D+Math.imul(pe,Ye)|0,v=v+Math.imul(pe,He)|0,v=v+Math.imul(A,Ye)|0,N=N+Math.imul(A,He)|0;var Bn=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,D=Math.imul(Pe,Re),v=Math.imul(Pe,Ne),v=v+Math.imul(Se,Re)|0,N=Math.imul(Se,Ne),D=D+Math.imul(he,dt)|0,v=v+Math.imul(he,Et)|0,v=v+Math.imul(le,dt)|0,N=N+Math.imul(le,Et)|0,D=D+Math.imul(w,It)|0,v=v+Math.imul(w,Ot)|0,v=v+Math.imul(k,It)|0,N=N+Math.imul(k,Ot)|0,D=D+Math.imul(q,Ye)|0,v=v+Math.imul(q,He)|0,v=v+Math.imul(H,Ye)|0,N=N+Math.imul(H,He)|0,D=D+Math.imul(pe,Qe)|0,v=v+Math.imul(pe,Ve)|0,v=v+Math.imul(A,Qe)|0,N=N+Math.imul(A,Ve)|0;var Un=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Un>>>26)|0,Un&=67108863,D=Math.imul(ze,Re),v=Math.imul(ze,Ne),v=v+Math.imul(De,Re)|0,N=Math.imul(De,Ne),D=D+Math.imul(Pe,dt)|0,v=v+Math.imul(Pe,Et)|0,v=v+Math.imul(Se,dt)|0,N=N+Math.imul(Se,Et)|0,D=D+Math.imul(he,It)|0,v=v+Math.imul(he,Ot)|0,v=v+Math.imul(le,It)|0,N=N+Math.imul(le,Ot)|0,D=D+Math.imul(w,Ye)|0,v=v+Math.imul(w,He)|0,v=v+Math.imul(k,Ye)|0,N=N+Math.imul(k,He)|0,D=D+Math.imul(q,Qe)|0,v=v+Math.imul(q,Ve)|0,v=v+Math.imul(H,Qe)|0,N=N+Math.imul(H,Ve)|0,D=D+Math.imul(pe,Xe)|0,v=v+Math.imul(pe,et)|0,v=v+Math.imul(A,Xe)|0,N=N+Math.imul(A,et)|0;var xr=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(xr>>>26)|0,xr&=67108863,D=Math.imul(Ee,Re),v=Math.imul(Ee,Ne),v=v+Math.imul(Ae,Re)|0,N=Math.imul(Ae,Ne),D=D+Math.imul(ze,dt)|0,v=v+Math.imul(ze,Et)|0,v=v+Math.imul(De,dt)|0,N=N+Math.imul(De,Et)|0,D=D+Math.imul(Pe,It)|0,v=v+Math.imul(Pe,Ot)|0,v=v+Math.imul(Se,It)|0,N=N+Math.imul(Se,Ot)|0,D=D+Math.imul(he,Ye)|0,v=v+Math.imul(he,He)|0,v=v+Math.imul(le,Ye)|0,N=N+Math.imul(le,He)|0,D=D+Math.imul(w,Qe)|0,v=v+Math.imul(w,Ve)|0,v=v+Math.imul(k,Qe)|0,N=N+Math.imul(k,Ve)|0,D=D+Math.imul(q,Xe)|0,v=v+Math.imul(q,et)|0,v=v+Math.imul(H,Xe)|0,N=N+Math.imul(H,et)|0,D=D+Math.imul(pe,tt)|0,v=v+Math.imul(pe,Je)|0,v=v+Math.imul(A,tt)|0,N=N+Math.imul(A,Je)|0;var Di=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Di>>>26)|0,Di&=67108863,D=Math.imul(be,Re),v=Math.imul(be,Ne),v=v+Math.imul(xe,Re)|0,N=Math.imul(xe,Ne),D=D+Math.imul(Ee,dt)|0,v=v+Math.imul(Ee,Et)|0,v=v+Math.imul(Ae,dt)|0,N=N+Math.imul(Ae,Et)|0,D=D+Math.imul(ze,It)|0,v=v+Math.imul(ze,Ot)|0,v=v+Math.imul(De,It)|0,N=N+Math.imul(De,Ot)|0,D=D+Math.imul(Pe,Ye)|0,v=v+Math.imul(Pe,He)|0,v=v+Math.imul(Se,Ye)|0,N=N+Math.imul(Se,He)|0,D=D+Math.imul(he,Qe)|0,v=v+Math.imul(he,Ve)|0,v=v+Math.imul(le,Qe)|0,N=N+Math.imul(le,Ve)|0,D=D+Math.imul(w,Xe)|0,v=v+Math.imul(w,et)|0,v=v+Math.imul(k,Xe)|0,N=N+Math.imul(k,et)|0,D=D+Math.imul(q,tt)|0,v=v+Math.imul(q,Je)|0,v=v+Math.imul(H,tt)|0,N=N+Math.imul(H,Je)|0,D=D+Math.imul(pe,Ze)|0,v=v+Math.imul(pe,ke)|0,v=v+Math.imul(A,Ze)|0,N=N+Math.imul(A,ke)|0;var fo=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(fo>>>26)|0,fo&=67108863,D=Math.imul(_e,Re),v=Math.imul(_e,Ne),v=v+Math.imul(Me,Re)|0,N=Math.imul(Me,Ne),D=D+Math.imul(be,dt)|0,v=v+Math.imul(be,Et)|0,v=v+Math.imul(xe,dt)|0,N=N+Math.imul(xe,Et)|0,D=D+Math.imul(Ee,It)|0,v=v+Math.imul(Ee,Ot)|0,v=v+Math.imul(Ae,It)|0,N=N+Math.imul(Ae,Ot)|0,D=D+Math.imul(ze,Ye)|0,v=v+Math.imul(ze,He)|0,v=v+Math.imul(De,Ye)|0,N=N+Math.imul(De,He)|0,D=D+Math.imul(Pe,Qe)|0,v=v+Math.imul(Pe,Ve)|0,v=v+Math.imul(Se,Qe)|0,N=N+Math.imul(Se,Ve)|0,D=D+Math.imul(he,Xe)|0,v=v+Math.imul(he,et)|0,v=v+Math.imul(le,Xe)|0,N=N+Math.imul(le,et)|0,D=D+Math.imul(w,tt)|0,v=v+Math.imul(w,Je)|0,v=v+Math.imul(k,tt)|0,N=N+Math.imul(k,Je)|0,D=D+Math.imul(q,Ze)|0,v=v+Math.imul(q,ke)|0,v=v+Math.imul(H,Ze)|0,N=N+Math.imul(H,ke)|0,D=D+Math.imul(pe,rt)|0,v=v+Math.imul(pe,jt)|0,v=v+Math.imul(A,rt)|0,N=N+Math.imul(A,jt)|0;var Oi=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,D=Math.imul($e,Re),v=Math.imul($e,Ne),v=v+Math.imul(Te,Re)|0,N=Math.imul(Te,Ne),D=D+Math.imul(_e,dt)|0,v=v+Math.imul(_e,Et)|0,v=v+Math.imul(Me,dt)|0,N=N+Math.imul(Me,Et)|0,D=D+Math.imul(be,It)|0,v=v+Math.imul(be,Ot)|0,v=v+Math.imul(xe,It)|0,N=N+Math.imul(xe,Ot)|0,D=D+Math.imul(Ee,Ye)|0,v=v+Math.imul(Ee,He)|0,v=v+Math.imul(Ae,Ye)|0,N=N+Math.imul(Ae,He)|0,D=D+Math.imul(ze,Qe)|0,v=v+Math.imul(ze,Ve)|0,v=v+Math.imul(De,Qe)|0,N=N+Math.imul(De,Ve)|0,D=D+Math.imul(Pe,Xe)|0,v=v+Math.imul(Pe,et)|0,v=v+Math.imul(Se,Xe)|0,N=N+Math.imul(Se,et)|0,D=D+Math.imul(he,tt)|0,v=v+Math.imul(he,Je)|0,v=v+Math.imul(le,tt)|0,N=N+Math.imul(le,Je)|0,D=D+Math.imul(w,Ze)|0,v=v+Math.imul(w,ke)|0,v=v+Math.imul(k,Ze)|0,N=N+Math.imul(k,ke)|0,D=D+Math.imul(q,rt)|0,v=v+Math.imul(q,jt)|0,v=v+Math.imul(H,rt)|0,N=N+Math.imul(H,jt)|0,D=D+Math.imul(pe,kt)|0,v=v+Math.imul(pe,vt)|0,v=v+Math.imul(A,kt)|0,N=N+Math.imul(A,vt)|0;var po=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(po>>>26)|0,po&=67108863,D=Math.imul($e,dt),v=Math.imul($e,Et),v=v+Math.imul(Te,dt)|0,N=Math.imul(Te,Et),D=D+Math.imul(_e,It)|0,v=v+Math.imul(_e,Ot)|0,v=v+Math.imul(Me,It)|0,N=N+Math.imul(Me,Ot)|0,D=D+Math.imul(be,Ye)|0,v=v+Math.imul(be,He)|0,v=v+Math.imul(xe,Ye)|0,N=N+Math.imul(xe,He)|0,D=D+Math.imul(Ee,Qe)|0,v=v+Math.imul(Ee,Ve)|0,v=v+Math.imul(Ae,Qe)|0,N=N+Math.imul(Ae,Ve)|0,D=D+Math.imul(ze,Xe)|0,v=v+Math.imul(ze,et)|0,v=v+Math.imul(De,Xe)|0,N=N+Math.imul(De,et)|0,D=D+Math.imul(Pe,tt)|0,v=v+Math.imul(Pe,Je)|0,v=v+Math.imul(Se,tt)|0,N=N+Math.imul(Se,Je)|0,D=D+Math.imul(he,Ze)|0,v=v+Math.imul(he,ke)|0,v=v+Math.imul(le,Ze)|0,N=N+Math.imul(le,ke)|0,D=D+Math.imul(w,rt)|0,v=v+Math.imul(w,jt)|0,v=v+Math.imul(k,rt)|0,N=N+Math.imul(k,jt)|0,D=D+Math.imul(q,kt)|0,v=v+Math.imul(q,vt)|0,v=v+Math.imul(H,kt)|0,N=N+Math.imul(H,vt)|0;var go=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(go>>>26)|0,go&=67108863,D=Math.imul($e,It),v=Math.imul($e,Ot),v=v+Math.imul(Te,It)|0,N=Math.imul(Te,Ot),D=D+Math.imul(_e,Ye)|0,v=v+Math.imul(_e,He)|0,v=v+Math.imul(Me,Ye)|0,N=N+Math.imul(Me,He)|0,D=D+Math.imul(be,Qe)|0,v=v+Math.imul(be,Ve)|0,v=v+Math.imul(xe,Qe)|0,N=N+Math.imul(xe,Ve)|0,D=D+Math.imul(Ee,Xe)|0,v=v+Math.imul(Ee,et)|0,v=v+Math.imul(Ae,Xe)|0,N=N+Math.imul(Ae,et)|0,D=D+Math.imul(ze,tt)|0,v=v+Math.imul(ze,Je)|0,v=v+Math.imul(De,tt)|0,N=N+Math.imul(De,Je)|0,D=D+Math.imul(Pe,Ze)|0,v=v+Math.imul(Pe,ke)|0,v=v+Math.imul(Se,Ze)|0,N=N+Math.imul(Se,ke)|0,D=D+Math.imul(he,rt)|0,v=v+Math.imul(he,jt)|0,v=v+Math.imul(le,rt)|0,N=N+Math.imul(le,jt)|0,D=D+Math.imul(w,kt)|0,v=v+Math.imul(w,vt)|0,v=v+Math.imul(k,kt)|0,N=N+Math.imul(k,vt)|0;var Mi=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,D=Math.imul($e,Ye),v=Math.imul($e,He),v=v+Math.imul(Te,Ye)|0,N=Math.imul(Te,He),D=D+Math.imul(_e,Qe)|0,v=v+Math.imul(_e,Ve)|0,v=v+Math.imul(Me,Qe)|0,N=N+Math.imul(Me,Ve)|0,D=D+Math.imul(be,Xe)|0,v=v+Math.imul(be,et)|0,v=v+Math.imul(xe,Xe)|0,N=N+Math.imul(xe,et)|0,D=D+Math.imul(Ee,tt)|0,v=v+Math.imul(Ee,Je)|0,v=v+Math.imul(Ae,tt)|0,N=N+Math.imul(Ae,Je)|0,D=D+Math.imul(ze,Ze)|0,v=v+Math.imul(ze,ke)|0,v=v+Math.imul(De,Ze)|0,N=N+Math.imul(De,ke)|0,D=D+Math.imul(Pe,rt)|0,v=v+Math.imul(Pe,jt)|0,v=v+Math.imul(Se,rt)|0,N=N+Math.imul(Se,jt)|0,D=D+Math.imul(he,kt)|0,v=v+Math.imul(he,vt)|0,v=v+Math.imul(le,kt)|0,N=N+Math.imul(le,vt)|0;var Ss=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,D=Math.imul($e,Qe),v=Math.imul($e,Ve),v=v+Math.imul(Te,Qe)|0,N=Math.imul(Te,Ve),D=D+Math.imul(_e,Xe)|0,v=v+Math.imul(_e,et)|0,v=v+Math.imul(Me,Xe)|0,N=N+Math.imul(Me,et)|0,D=D+Math.imul(be,tt)|0,v=v+Math.imul(be,Je)|0,v=v+Math.imul(xe,tt)|0,N=N+Math.imul(xe,Je)|0,D=D+Math.imul(Ee,Ze)|0,v=v+Math.imul(Ee,ke)|0,v=v+Math.imul(Ae,Ze)|0,N=N+Math.imul(Ae,ke)|0,D=D+Math.imul(ze,rt)|0,v=v+Math.imul(ze,jt)|0,v=v+Math.imul(De,rt)|0,N=N+Math.imul(De,jt)|0,D=D+Math.imul(Pe,kt)|0,v=v+Math.imul(Pe,vt)|0,v=v+Math.imul(Se,kt)|0,N=N+Math.imul(Se,vt)|0;var Cs=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,D=Math.imul($e,Xe),v=Math.imul($e,et),v=v+Math.imul(Te,Xe)|0,N=Math.imul(Te,et),D=D+Math.imul(_e,tt)|0,v=v+Math.imul(_e,Je)|0,v=v+Math.imul(Me,tt)|0,N=N+Math.imul(Me,Je)|0,D=D+Math.imul(be,Ze)|0,v=v+Math.imul(be,ke)|0,v=v+Math.imul(xe,Ze)|0,N=N+Math.imul(xe,ke)|0,D=D+Math.imul(Ee,rt)|0,v=v+Math.imul(Ee,jt)|0,v=v+Math.imul(Ae,rt)|0,N=N+Math.imul(Ae,jt)|0,D=D+Math.imul(ze,kt)|0,v=v+Math.imul(ze,vt)|0,v=v+Math.imul(De,kt)|0,N=N+Math.imul(De,vt)|0;var Gr=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,D=Math.imul($e,tt),v=Math.imul($e,Je),v=v+Math.imul(Te,tt)|0,N=Math.imul(Te,Je),D=D+Math.imul(_e,Ze)|0,v=v+Math.imul(_e,ke)|0,v=v+Math.imul(Me,Ze)|0,N=N+Math.imul(Me,ke)|0,D=D+Math.imul(be,rt)|0,v=v+Math.imul(be,jt)|0,v=v+Math.imul(xe,rt)|0,N=N+Math.imul(xe,jt)|0,D=D+Math.imul(Ee,kt)|0,v=v+Math.imul(Ee,vt)|0,v=v+Math.imul(Ae,kt)|0,N=N+Math.imul(Ae,vt)|0;var mo=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(mo>>>26)|0,mo&=67108863,D=Math.imul($e,Ze),v=Math.imul($e,ke),v=v+Math.imul(Te,Ze)|0,N=Math.imul(Te,ke),D=D+Math.imul(_e,rt)|0,v=v+Math.imul(_e,jt)|0,v=v+Math.imul(Me,rt)|0,N=N+Math.imul(Me,jt)|0,D=D+Math.imul(be,kt)|0,v=v+Math.imul(be,vt)|0,v=v+Math.imul(xe,kt)|0,N=N+Math.imul(xe,vt)|0;var vo=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(vo>>>26)|0,vo&=67108863,D=Math.imul($e,rt),v=Math.imul($e,jt),v=v+Math.imul(Te,rt)|0,N=Math.imul(Te,jt),D=D+Math.imul(_e,kt)|0,v=v+Math.imul(_e,vt)|0,v=v+Math.imul(Me,kt)|0,N=N+Math.imul(Me,vt)|0;var wo=(L+D|0)+((v&8191)<<13)|0;L=(N+(v>>>13)|0)+(wo>>>26)|0,wo&=67108863,D=Math.imul($e,kt),v=Math.imul($e,vt),v=v+Math.imul(Te,kt)|0,N=Math.imul(Te,vt);var yo=(L+D|0)+((v&8191)<<13)|0;return L=(N+(v>>>13)|0)+(yo>>>26)|0,yo&=67108863,T[0]=Nn,T[1]=Rn,T[2]=Ln,T[3]=Bn,T[4]=Un,T[5]=xr,T[6]=Di,T[7]=fo,T[8]=Oi,T[9]=po,T[10]=go,T[11]=Mi,T[12]=Ss,T[13]=Cs,T[14]=Gr,T[15]=mo,T[16]=vo,T[17]=wo,T[18]=yo,L!==0&&(T[19]=L,b.length++),b};Math.imul||(B=Y);function z(d,p,b){b.negative=p.negative^d.negative,b.length=d.length+p.length;for(var C=0,O=0,T=0;T<b.length-1;T++){var L=O;O=0;for(var D=C&67108863,v=Math.min(T,p.length-1),N=Math.max(0,T-d.length+1);N<=v;N++){var oe=T-N,pe=d.words[oe]|0,A=p.words[N]|0,re=pe*A,q=re&67108863;L=L+(re/67108864|0)|0,q=q+D|0,D=q&67108863,L=L+(q>>>26)|0,O+=L>>>26,L&=67108863}b.words[T]=D,C=L,L=O}return C!==0?b.words[T]=C:b.length--,b._strip()}function M(d,p,b){return z(d,p,b)}o.prototype.mulTo=function(d,p){var b,C=this.length+d.length;return this.length===10&&d.length===10?b=B(this,d,p):C<63?b=Y(this,d,p):C<1024?b=z(this,d,p):b=M(this,d,p),b},o.prototype.mul=function(d){var p=new o(null);return p.words=new Array(this.length+d.length),this.mulTo(d,p)},o.prototype.mulf=function(d){var p=new o(null);return p.words=new Array(this.length+d.length),M(this,d,p)},o.prototype.imul=function(d){return this.clone().mulTo(d,this)},o.prototype.imuln=function(d){var p=d<0;p&&(d=-d),n(typeof d=="number"),n(d<67108864);for(var b=0,C=0;C<this.length;C++){var O=(this.words[C]|0)*d,T=(O&67108863)+(b&67108863);b>>=26,b+=O/67108864|0,b+=T>>>26,this.words[C]=T&67108863}return b!==0&&(this.words[C]=b,this.length++),p?this.ineg():this},o.prototype.muln=function(d){return this.clone().imuln(d)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(d){var p=W(d);if(p.length===0)return new o(1);for(var b=this,C=0;C<p.length&&p[C]===0;C++,b=b.sqr());if(++C<p.length)for(var O=b.sqr();C<p.length;C++,O=O.sqr())p[C]!==0&&(b=b.mul(O));return b},o.prototype.iushln=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26,C=67108863>>>26-p<<26-p,O;if(p!==0){var T=0;for(O=0;O<this.length;O++){var L=this.words[O]&C,D=(this.words[O]|0)-L<<p;this.words[O]=D|T,T=L>>>26-p}T&&(this.words[O]=T,this.length++)}if(b!==0){for(O=this.length-1;O>=0;O--)this.words[O+b]=this.words[O];for(O=0;O<b;O++)this.words[O]=0;this.length+=b}return this._strip()},o.prototype.ishln=function(d){return n(this.negative===0),this.iushln(d)},o.prototype.iushrn=function(d,p,b){n(typeof d=="number"&&d>=0);var C;p?C=(p-p%26)/26:C=0;var O=d%26,T=Math.min((d-O)/26,this.length),L=67108863^67108863>>>O<<O,D=b;if(C-=T,C=Math.max(0,C),D){for(var v=0;v<T;v++)D.words[v]=this.words[v];D.length=T}if(T!==0)if(this.length>T)for(this.length-=T,v=0;v<this.length;v++)this.words[v]=this.words[v+T];else this.words[0]=0,this.length=1;var N=0;for(v=this.length-1;v>=0&&(N!==0||v>=C);v--){var oe=this.words[v]|0;this.words[v]=N<<26-O|oe>>>O,N=oe&L}return D&&N!==0&&(D.words[D.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(d,p,b){return n(this.negative===0),this.iushrn(d,p,b)},o.prototype.shln=function(d){return this.clone().ishln(d)},o.prototype.ushln=function(d){return this.clone().iushln(d)},o.prototype.shrn=function(d){return this.clone().ishrn(d)},o.prototype.ushrn=function(d){return this.clone().iushrn(d)},o.prototype.testn=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26,C=1<<p;if(this.length<=b)return!1;var O=this.words[b];return!!(O&C)},o.prototype.imaskn=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(p!==0&&b++,this.length=Math.min(b,this.length),p!==0){var C=67108863^67108863>>>p<<p;this.words[this.length-1]&=C}return this._strip()},o.prototype.maskn=function(d){return this.clone().imaskn(d)},o.prototype.iaddn=function(d){return n(typeof d=="number"),n(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},o.prototype._iaddn=function(d){this.words[0]+=d;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},o.prototype.isubn=function(d){if(n(typeof d=="number"),n(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},o.prototype.addn=function(d){return this.clone().iaddn(d)},o.prototype.subn=function(d){return this.clone().isubn(d)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(d,p,b){var C=d.length+b,O;this._expand(C);var T,L=0;for(O=0;O<d.length;O++){T=(this.words[O+b]|0)+L;var D=(d.words[O]|0)*p;T-=D&67108863,L=(T>>26)-(D/67108864|0),this.words[O+b]=T&67108863}for(;O<this.length-b;O++)T=(this.words[O+b]|0)+L,L=T>>26,this.words[O+b]=T&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,O=0;O<this.length;O++)T=-(this.words[O]|0)+L,L=T>>26,this.words[O]=T&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(d,p){var b=this.length-d.length,C=this.clone(),O=d,T=O.words[O.length-1]|0,L=this._countBits(T);b=26-L,b!==0&&(O=O.ushln(b),C.iushln(b),T=O.words[O.length-1]|0);var D=C.length-O.length,v;if(p!=="mod"){v=new o(null),v.length=D+1,v.words=new Array(v.length);for(var N=0;N<v.length;N++)v.words[N]=0}var oe=C.clone()._ishlnsubmul(O,1,D);oe.negative===0&&(C=oe,v&&(v.words[D]=1));for(var pe=D-1;pe>=0;pe--){var A=(C.words[O.length+pe]|0)*67108864+(C.words[O.length+pe-1]|0);for(A=Math.min(A/T|0,67108863),C._ishlnsubmul(O,A,pe);C.negative!==0;)A--,C.negative=0,C._ishlnsubmul(O,1,pe),C.isZero()||(C.negative^=1);v&&(v.words[pe]=A)}return v&&v._strip(),C._strip(),p!=="div"&&b!==0&&C.iushrn(b),{div:v||null,mod:C}},o.prototype.divmod=function(d,p,b){if(n(!d.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var C,O,T;return this.negative!==0&&d.negative===0?(T=this.neg().divmod(d,p),p!=="mod"&&(C=T.div.neg()),p!=="div"&&(O=T.mod.neg(),b&&O.negative!==0&&O.iadd(d)),{div:C,mod:O}):this.negative===0&&d.negative!==0?(T=this.divmod(d.neg(),p),p!=="mod"&&(C=T.div.neg()),{div:C,mod:T.mod}):this.negative&d.negative?(T=this.neg().divmod(d.neg(),p),p!=="div"&&(O=T.mod.neg(),b&&O.negative!==0&&O.isub(d)),{div:T.div,mod:O}):d.length>this.length||this.cmp(d)<0?{div:new o(0),mod:this}:d.length===1?p==="div"?{div:this.divn(d.words[0]),mod:null}:p==="mod"?{div:null,mod:new o(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new o(this.modrn(d.words[0]))}:this._wordDiv(d,p)},o.prototype.div=function(d){return this.divmod(d,"div",!1).div},o.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},o.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},o.prototype.divRound=function(d){var p=this.divmod(d);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(d):p.mod,C=d.ushrn(1),O=d.andln(1),T=b.cmp(C);return T<0||O===1&&T===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},o.prototype.modrn=function(d){var p=d<0;p&&(d=-d),n(d<=67108863);for(var b=(1<<26)%d,C=0,O=this.length-1;O>=0;O--)C=(b*C+(this.words[O]|0))%d;return p?-C:C},o.prototype.modn=function(d){return this.modrn(d)},o.prototype.idivn=function(d){var p=d<0;p&&(d=-d),n(d<=67108863);for(var b=0,C=this.length-1;C>=0;C--){var O=(this.words[C]|0)+b*67108864;this.words[C]=O/d|0,b=O%d}return this._strip(),p?this.ineg():this},o.prototype.divn=function(d){return this.clone().idivn(d)},o.prototype.egcd=function(d){n(d.negative===0),n(!d.isZero());var p=this,b=d.clone();p.negative!==0?p=p.umod(d):p=p.clone();for(var C=new o(1),O=new o(0),T=new o(0),L=new o(1),D=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++D;for(var v=b.clone(),N=p.clone();!p.isZero();){for(var oe=0,pe=1;!(p.words[0]&pe)&&oe<26;++oe,pe<<=1);if(oe>0)for(p.iushrn(oe);oe-- >0;)(C.isOdd()||O.isOdd())&&(C.iadd(v),O.isub(N)),C.iushrn(1),O.iushrn(1);for(var A=0,re=1;!(b.words[0]&re)&&A<26;++A,re<<=1);if(A>0)for(b.iushrn(A);A-- >0;)(T.isOdd()||L.isOdd())&&(T.iadd(v),L.isub(N)),T.iushrn(1),L.iushrn(1);p.cmp(b)>=0?(p.isub(b),C.isub(T),O.isub(L)):(b.isub(p),T.isub(C),L.isub(O))}return{a:T,b:L,gcd:b.iushln(D)}},o.prototype._invmp=function(d){n(d.negative===0),n(!d.isZero());var p=this,b=d.clone();p.negative!==0?p=p.umod(d):p=p.clone();for(var C=new o(1),O=new o(0),T=b.clone();p.cmpn(1)>0&&b.cmpn(1)>0;){for(var L=0,D=1;!(p.words[0]&D)&&L<26;++L,D<<=1);if(L>0)for(p.iushrn(L);L-- >0;)C.isOdd()&&C.iadd(T),C.iushrn(1);for(var v=0,N=1;!(b.words[0]&N)&&v<26;++v,N<<=1);if(v>0)for(b.iushrn(v);v-- >0;)O.isOdd()&&O.iadd(T),O.iushrn(1);p.cmp(b)>=0?(p.isub(b),C.isub(O)):(b.isub(p),O.isub(C))}var oe;return p.cmpn(1)===0?oe=C:oe=O,oe.cmpn(0)<0&&oe.iadd(d),oe},o.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var p=this.clone(),b=d.clone();p.negative=0,b.negative=0;for(var C=0;p.isEven()&&b.isEven();C++)p.iushrn(1),b.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;b.isEven();)b.iushrn(1);var O=p.cmp(b);if(O<0){var T=p;p=b,b=T}else if(O===0||b.cmpn(1)===0)break;p.isub(b)}while(!0);return b.iushln(C)},o.prototype.invm=function(d){return this.egcd(d).a.umod(d)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(d){return this.words[0]&d},o.prototype.bincn=function(d){n(typeof d=="number");var p=d%26,b=(d-p)/26,C=1<<p;if(this.length<=b)return this._expand(b+1),this.words[b]|=C,this;for(var O=C,T=b;O!==0&&T<this.length;T++){var L=this.words[T]|0;L+=O,O=L>>>26,L&=67108863,this.words[T]=L}return O!==0&&(this.words[T]=O,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(d){var p=d<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var b;if(this.length>1)b=1;else{p&&(d=-d),n(d<=67108863,"Number is too big");var C=this.words[0]|0;b=C===d?0:C<d?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var p=this.ucmp(d);return this.negative!==0?-p|0:p},o.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var p=0,b=this.length-1;b>=0;b--){var C=this.words[b]|0,O=d.words[b]|0;if(C!==O){C<O?p=-1:C>O&&(p=1);break}}return p},o.prototype.gtn=function(d){return this.cmpn(d)===1},o.prototype.gt=function(d){return this.cmp(d)===1},o.prototype.gten=function(d){return this.cmpn(d)>=0},o.prototype.gte=function(d){return this.cmp(d)>=0},o.prototype.ltn=function(d){return this.cmpn(d)===-1},o.prototype.lt=function(d){return this.cmp(d)===-1},o.prototype.lten=function(d){return this.cmpn(d)<=0},o.prototype.lte=function(d){return this.cmp(d)<=0},o.prototype.eqn=function(d){return this.cmpn(d)===0},o.prototype.eq=function(d){return this.cmp(d)===0},o.red=function(d){return new ne(d)},o.prototype.toRed=function(d){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(d){return this.red=d,this},o.prototype.forceRed=function(d){return n(!this.red,"Already a number in reduction context"),this._forceRed(d)},o.prototype.redAdd=function(d){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},o.prototype.redIAdd=function(d){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},o.prototype.redSub=function(d){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},o.prototype.redISub=function(d){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},o.prototype.redShl=function(d){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},o.prototype.redMul=function(d){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},o.prototype.redIMul=function(d){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(d){return n(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var U={k256:null,p224:null,p192:null,p25519:null};function j(d,p){this.name=d,this.p=new o(p,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}j.prototype._tmp=function(){var d=new o(null);return d.words=new Array(Math.ceil(this.n/13)),d},j.prototype.ireduce=function(d){var p=d,b;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),b=p.bitLength();while(b>this.n);var C=b<this.n?-1:p.ucmp(this.p);return C===0?(p.words[0]=0,p.length=1):C>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},j.prototype.split=function(d,p){d.iushrn(this.n,0,p)},j.prototype.imulK=function(d){return d.imul(this.k)};function m(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(m,j),m.prototype.split=function(d,p){for(var b=4194303,C=Math.min(d.length,9),O=0;O<C;O++)p.words[O]=d.words[O];if(p.length=C,d.length<=9){d.words[0]=0,d.length=1;return}var T=d.words[9];for(p.words[p.length++]=T&b,O=10;O<d.length;O++){var L=d.words[O]|0;d.words[O-10]=(L&b)<<4|T>>>22,T=L}T>>>=22,d.words[O-10]=T,T===0&&d.length>10?d.length-=10:d.length-=9},m.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var p=0,b=0;b<d.length;b++){var C=d.words[b]|0;p+=C*977,d.words[b]=p&67108863,p=C*64+(p/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function $(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i($,j);function te(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(te,j);function ee(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ee,j),ee.prototype.imulK=function(d){for(var p=0,b=0;b<d.length;b++){var C=(d.words[b]|0)*19+p,O=C&67108863;C>>>=26,d.words[b]=O,p=C}return p!==0&&(d.words[d.length++]=p),d},o._prime=function(d){if(U[d])return U[d];var p;if(d==="k256")p=new m;else if(d==="p224")p=new $;else if(d==="p192")p=new te;else if(d==="p25519")p=new ee;else throw new Error("Unknown prime "+d);return U[d]=p,p};function ne(d){if(typeof d=="string"){var p=o._prime(d);this.m=p.p,this.prime=p}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}ne.prototype._verify1=function(d){n(d.negative===0,"red works only with positives"),n(d.red,"red works only with red numbers")},ne.prototype._verify2=function(d,p){n((d.negative|p.negative)===0,"red works only with positives"),n(d.red&&d.red===p.red,"red works only with red numbers")},ne.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(g(d,d.umod(this.m)._forceRed(this)),d)},ne.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},ne.prototype.add=function(d,p){this._verify2(d,p);var b=d.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},ne.prototype.iadd=function(d,p){this._verify2(d,p);var b=d.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},ne.prototype.sub=function(d,p){this._verify2(d,p);var b=d.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},ne.prototype.isub=function(d,p){this._verify2(d,p);var b=d.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},ne.prototype.shl=function(d,p){return this._verify1(d),this.imod(d.ushln(p))},ne.prototype.imul=function(d,p){return this._verify2(d,p),this.imod(d.imul(p))},ne.prototype.mul=function(d,p){return this._verify2(d,p),this.imod(d.mul(p))},ne.prototype.isqr=function(d){return this.imul(d,d.clone())},ne.prototype.sqr=function(d){return this.mul(d,d)},ne.prototype.sqrt=function(d){if(d.isZero())return d.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(d,b)}for(var C=this.m.subn(1),O=0;!C.isZero()&&C.andln(1)===0;)O++,C.iushrn(1);n(!C.isZero());var T=new o(1).toRed(this),L=T.redNeg(),D=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new o(2*v*v).toRed(this);this.pow(v,D).cmp(L)!==0;)v.redIAdd(L);for(var N=this.pow(v,C),oe=this.pow(d,C.addn(1).iushrn(1)),pe=this.pow(d,C),A=O;pe.cmp(T)!==0;){for(var re=pe,q=0;re.cmp(T)!==0;q++)re=re.redSqr();n(q<A);var H=this.pow(N,new o(1).iushln(A-q-1));oe=oe.redMul(H),N=H.redSqr(),pe=pe.redMul(N),A=q}return oe},ne.prototype.invm=function(d){var p=d._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},ne.prototype.pow=function(d,p){if(p.isZero())return new o(1).toRed(this);if(p.cmpn(1)===0)return d.clone();var b=4,C=new Array(1<<b);C[0]=new o(1).toRed(this),C[1]=d;for(var O=2;O<C.length;O++)C[O]=this.mul(C[O-1],d);var T=C[0],L=0,D=0,v=p.bitLength()%26;for(v===0&&(v=26),O=p.length-1;O>=0;O--){for(var N=p.words[O],oe=v-1;oe>=0;oe--){var pe=N>>oe&1;if(T!==C[0]&&(T=this.sqr(T)),pe===0&&L===0){D=0;continue}L<<=1,L|=pe,D++,!(D!==b&&(O!==0||oe!==0))&&(T=this.mul(T,C[L]),D=0,L=0)}v=26}return T},ne.prototype.convertTo=function(d){var p=d.umod(this.m);return p===d?p.clone():p},ne.prototype.convertFrom=function(d){var p=d.clone();return p.red=null,p},o.mont=function(d){return new de(d)};function de(d){ne.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(de,ne),de.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},de.prototype.convertFrom=function(d){var p=this.imod(d.mul(this.rinv));return p.red=null,p},de.prototype.imul=function(d,p){if(d.isZero()||p.isZero())return d.words[0]=0,d.length=1,d;var b=d.imul(p),C=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=b.isub(C).iushrn(this.shift),T=O;return O.cmp(this.m)>=0?T=O.isub(this.m):O.cmpn(0)<0&&(T=O.iadd(this.m)),T._forceRed(this)},de.prototype.mul=function(d,p){if(d.isZero()||p.isZero())return new o(0)._forceRed(this);var b=d.mul(p),C=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=b.isub(C).iushrn(this.shift),T=O;return O.cmp(this.m)>=0?T=O.isub(this.m):O.cmpn(0)<0&&(T=O.iadd(this.m)),T._forceRed(this)},de.prototype.invm=function(d){var p=this.imod(d._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,Cg)})(Ug);var st=Ug.exports;const Fg="bignumber/5.7.0";var Ol=st.BN;const Bi=new ut(Fg),wf={},jg=9007199254740991;function P4(t){return t!=null&&(Jt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||mn(t)||typeof t=="bigint"||Ho(t))}let kg=!1;class Jt{constructor(e,r){e!==wf&&Bi.throwError("cannot call constructor directly; use BigNumber.from",ut.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return rn(bt(this).fromTwos(e))}toTwos(e){return rn(bt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Jt.from(this._hex.substring(1)):this}add(e){return rn(bt(this).add(bt(e)))}sub(e){return rn(bt(this).sub(bt(e)))}div(e){return Jt.from(e).isZero()&&Sn("division-by-zero","div"),rn(bt(this).div(bt(e)))}mul(e){return rn(bt(this).mul(bt(e)))}mod(e){const r=bt(e);return r.isNeg()&&Sn("division-by-zero","mod"),rn(bt(this).umod(r))}pow(e){const r=bt(e);return r.isNeg()&&Sn("negative-power","pow"),rn(bt(this).pow(r))}and(e){const r=bt(e);return(this.isNegative()||r.isNeg())&&Sn("unbound-bitwise-result","and"),rn(bt(this).and(r))}or(e){const r=bt(e);return(this.isNegative()||r.isNeg())&&Sn("unbound-bitwise-result","or"),rn(bt(this).or(r))}xor(e){const r=bt(e);return(this.isNegative()||r.isNeg())&&Sn("unbound-bitwise-result","xor"),rn(bt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Sn("negative-width","mask"),rn(bt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Sn("negative-width","shl"),rn(bt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Sn("negative-width","shr"),rn(bt(this).shrn(e))}eq(e){return bt(this).eq(bt(e))}lt(e){return bt(this).lt(bt(e))}lte(e){return bt(this).lte(bt(e))}gt(e){return bt(this).gt(bt(e))}gte(e){return bt(this).gte(bt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return bt(this).isZero()}toNumber(){try{return bt(this).toNumber()}catch{Sn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Bi.throwError("this platform does not support BigInt",ut.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kg||(kg=!0,Bi.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Bi.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ut.errors.UNEXPECTED_ARGUMENT,{}):Bi.throwError("BigNumber.toString does not accept parameters",ut.errors.UNEXPECTED_ARGUMENT,{})),bt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Jt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Jt(wf,Xa(e)):e.match(/^-?[0-9]+$/)?new Jt(wf,Xa(new Ol(e))):Bi.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Sn("underflow","BigNumber.from",e),(e>=jg||e<=-jg)&&Sn("overflow","BigNumber.from",e),Jt.from(String(e));const r=e;if(typeof r=="bigint")return Jt.from(r.toString());if(Ho(r))return Jt.from(kr(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Jt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(mn(n)||n[0]==="-"&&mn(n.substring(1))))return Jt.from(n)}return Bi.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Xa(t){if(typeof t!="string")return Xa(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Bi.throwArgumentError("invalid hex","value",t),t=Xa(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function rn(t){return Jt.from(Xa(t))}function bt(t){const e=Jt.from(t).toHexString();return e[0]==="-"?new Ol("-"+e.substring(3),16):new Ol(e.substring(2),16)}function Sn(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Bi.throwError(t,ut.errors.NUMERIC_FAULT,n)}function $4(t){return new Ol(t,36).toString(16)}const qr=new ut(Fg),ec={},qg=Jt.from(0),zg=Jt.from(-1);function Hg(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),qr.throwError(t,ut.errors.NUMERIC_FAULT,i)}let tc="0";for(;tc.length<256;)tc+=tc;function yf(t){if(typeof t!="number")try{t=Jt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+tc.substring(0,t):qr.throwArgumentError("invalid decimal size","decimals",t)}function bf(t,e){e==null&&(e=0);const r=yf(e);t=Jt.from(t);const n=t.lt(qg);n&&(t=t.mul(zg));let i=t.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(r).toString();return r.length===1?t=o:t=o+"."+i,n&&(t="-"+t),t}function Ui(t,e){e==null&&(e=0);const r=yf(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&qr.throwArgumentError("invalid decimal value","value",t);const n=t.substring(0,1)==="-";n&&(t=t.substring(1)),t==="."&&qr.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&qr.throwArgumentError("too many decimal points","value",t);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");c[c.length-1]==="0";)c=c.substring(0,c.length-1);for(c.length>r.length-1&&Hg("fractional component exceeds decimals","underflow","parseFixed"),c===""&&(c="0");c.length<r.length-1;)c+="0";const l=Jt.from(o),f=Jt.from(c);let h=l.mul(r).add(f);return n&&(h=h.mul(zg)),h}class Ko{constructor(e,r,n,i){e!==ec&&qr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",ut.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=yf(i),Object.freeze(this)}static from(e){if(e instanceof Ko)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,n=128,i=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||qr.throwArgumentError("invalid fixed format","format",e),r=o[1]!=="u",n=parseInt(o[2]),i=parseInt(o[3])}}else if(e){const o=(c,l,f)=>e[c]==null?f:(typeof e[c]!==l&&qr.throwArgumentError("invalid fixed format ("+c+" not "+l+")","format."+c,e[c]),e[c]);r=o("signed","boolean",r),n=o("width","number",n),i=o("decimals","number",i)}return n%8&&qr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&qr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Ko(ec,r,n,i)}}class Mr{constructor(e,r,n,i){e!==ec&&qr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ut.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&qr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Ui(this._value,this.format.decimals),n=Ui(e._value,e.format.decimals);return Mr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Ui(this._value,this.format.decimals),n=Ui(e._value,e.format.decimals);return Mr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Ui(this._value,this.format.decimals),n=Ui(e._value,e.format.decimals);return Mr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Ui(this._value,this.format.decimals),n=Ui(e._value,e.format.decimals);return Mr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Mr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Kg.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Mr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Kg.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&qr.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Mr.from("1"+tc.substring(0,e),this.format),i=T4.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&qr.throwArgumentError("invalid byte width","width",e);const r=Jt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return ui(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Mr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!P4(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Mr.fromString(bf(e,r),Ko.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=Ko.from(r),i=Ui(e,n.decimals);!n.signed&&i.lt(qg)&&Hg("unsigned value cannot be negative","overflow","value",e);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=ui(o,n.width/8));const c=bf(i,n.decimals);return new Mr(ec,o,c,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=Ko.from(r);if(or(e).length>n.width/8)throw new Error("overflow");let i=Jt.from(e);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),c=bf(i,n.decimals);return new Mr(ec,o,c,n)}static from(e,r){if(typeof e=="string")return Mr.fromString(e,r);if(Ho(e))return Mr.fromBytes(e,r);try{return Mr.fromValue(e,0,r)}catch(n){if(n.code!==ut.errors.INVALID_ARGUMENT)throw n}return qr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Kg=Mr.from(1),T4=Mr.from("0.5"),N4="strings/5.7.0",Wg=new ut(N4);var Ml;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Ml||(Ml={}));var Wo;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Wo||(Wo={}));function R4(t,e,r,n,i){return Wg.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function Vg(t,e,r,n,i){if(t===Wo.BAD_PREFIX||t===Wo.UNEXPECTED_CONTINUE){let o=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)o++;return o}return t===Wo.OVERRUN?r.length-e-1:0}function L4(t,e,r,n,i){return t===Wo.OVERLONG?(n.push(i),0):(n.push(65533),Vg(t,e,r))}Object.freeze({error:R4,ignore:Vg,replace:L4});function _f(t,e=Ml.current){e!=Ml.current&&(Wg.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const o=t.charCodeAt(n);if(n>=t.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((i&1023)<<10)+(o&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return or(r)}function B4(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function Ef(t,e){e||(e=function(i){return[parseInt(i,16)]});let r=0,n={};return t.split(",").forEach(i=>{let o=i.split(":");r+=parseInt(o[0],16),n[r]=e(o[1])}),n}function Gg(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}Gg("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),Ef("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Ef("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Ef("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",B4),Gg("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const Yg="hash/5.7.0";function U4(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return or(e)}function Qg(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(o,c){n.call(o,function(l){c>0&&Array.isArray(l)?i(l,c-1):r.push(l)})};return i(t,e),r}function F4(t){const e={};for(let r=0;r<t.length;r++){const n=t[r];e[n[0]]=n[1]}return e}function j4(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let U=1;U<n;U++)o.push(i+=r());let c=r(),l=e;e+=c;let f=0,h=0;function g(){return f==0&&(h=h<<8|t[e++],f=8),h>>--f&1}const _=31,E=Math.pow(2,_),x=E>>>1,I=x>>1,F=E-1;let W=0;for(let U=0;U<_;U++)W=W<<1|g();let Y=[],B=0,z=E;for(;;){let U=Math.floor(((W-B+1)*i-1)/z),j=0,m=n;for(;m-j>1;){let ee=j+m>>>1;U<o[ee]?m=ee:j=ee}if(j==0)break;Y.push(j);let $=B+Math.floor(z*o[j]/i),te=B+Math.floor(z*o[j+1]/i)-1;for(;!(($^te)&x);)W=W<<1&F|g(),$=$<<1&F,te=te<<1&F|1;for(;$&~te&I;)W=W&x|W<<1&F>>>1|g(),$=$<<1^x,te=(te^x)<<1|x|1;B=$,z=1+te-$}let M=n-4;return Y.map(U=>{switch(U-M){case 3:return M+65792+(t[l++]<<16|t[l++]<<8|t[l++]);case 2:return M+256+(t[l++]<<8|t[l++]);case 1:return M+t[l++];default:return U-1}})}function k4(t){let e=0;return()=>t[e++]}function q4(t){return k4(j4(t))}function z4(t){return t&1?~t>>1:t>>1}function H4(t,e){let r=Array(t);for(let n=0;n<t;n++)r[n]=1+e();return r}function Jg(t,e){let r=Array(t);for(let n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function K4(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=z4(e());return r}function Pl(t,e){let r=Jg(t(),t),n=t(),i=Jg(n,t),o=H4(n,t);for(let c=0;c<n;c++)for(let l=0;l<o[c];l++)r.push(i[c]+l);return e?r.map(c=>e[c]):r}function W4(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(G4(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(Y4(r,t))}return F4(Qg(e))}function V4(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function Zg(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i<e;i++)K4(t,r).forEach((o,c)=>n[c].push(o));return n}function G4(t,e){let r=1+e(),n=e(),i=V4(e),o=Zg(i.length,1+t,e);return Qg(o.map((c,l)=>{const f=c[0],h=c.slice(1);return Array(i[l]).fill(void 0).map((g,_)=>{let E=_*n;return[f+_*r,h.map(x=>x+E)]})}))}function Y4(t,e){let r=1+e();return Zg(r,1+t,e).map(n=>[n[0],n.slice(1)])}function Q4(t){let e=Pl(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let h=Pl(t,e);if(h.length==0)break;n.push({set:new Set(h),node:r()})}n.sort((h,g)=>g.set.size-h.set.size);let i=t(),o=i%3;i=i/3|0;let c=!!(i&1);i>>=1;let l=i==1,f=i==2;return{branches:n,valid:o,fe0f:c,save:l,check:f}}}function J4(){return q4(U4("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const $l=J4();new Set(Pl($l)),new Set(Pl($l)),W4($l),Q4($l),new ut(Yg),new Uint8Array(32).fill(0);const Z4=`Ethereum Signed Message:
|
|
22
|
+
`;function Xg(t){return typeof t=="string"&&(t=_f(t)),vf(I4([_f(Z4),_f(String(t.length)),t]))}const X4="rlp/5.7.0";new ut(X4);const eE="address/5.7.0",rc=new ut(eE);function em(t){mn(t,20)||rc.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=or(vf(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const tE=9007199254740991;function rE(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Af={};for(let t=0;t<10;t++)Af[String(t)]=String(t);for(let t=0;t<26;t++)Af[String.fromCharCode(65+t)]=String(10+t);const tm=Math.floor(rE(tE));function nE(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Af[n]).join("");for(;e.length>=tm;){let n=e.substring(0,tm);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function iE(t){let e=null;if(typeof t!="string"&&rc.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=em(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&rc.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==nE(t)&&rc.throwArgumentError("bad icap checksum","address",t),e=$4(t.substring(4));e.length<40;)e="0"+e;e=em("0x"+e)}else rc.throwArgumentError("invalid address","address",t);return e}const sE="properties/5.7.0";new ut(sE);function nc(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new ut(Yg),new Uint8Array(32).fill(0),Jt.from(-1);const oE=Jt.from(0),aE=Jt.from(1);Jt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ui(aE.toHexString(),32),ui(oE.toHexString(),32);var hi={},_t={},ic=rm;function rm(t,e){if(!t)throw new Error(e||"Assertion failed")}rm.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var xf={exports:{}};typeof Object.create=="function"?xf.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:xf.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 cE=ic,lE=xf.exports;_t.inherits=lE;function uE(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function hE(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):uE(t,i)?(o=65536+((o&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}_t.toArray=hE;function fE(t){for(var e="",r=0;r<t.length;r++)e+=im(t[r].toString(16));return e}_t.toHex=fE;function nm(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}_t.htonl=nm;function dE(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=nm(i)),r+=sm(i.toString(16))}return r}_t.toHex32=dE;function im(t){return t.length===1?"0"+t:t}_t.zero2=im;function sm(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}_t.zero8=sm;function pE(t,e,r,n){var i=r-e;cE(i%4===0);for(var o=new Array(i/4),c=0,l=e;c<o.length;c++,l+=4){var f;n==="big"?f=t[l]<<24|t[l+1]<<16|t[l+2]<<8|t[l+3]:f=t[l+3]<<24|t[l+2]<<16|t[l+1]<<8|t[l],o[c]=f>>>0}return o}_t.join32=pE;function gE(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];e==="big"?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}_t.split32=gE;function mE(t,e){return t>>>e|t<<32-e}_t.rotr32=mE;function vE(t,e){return t<<e|t>>>32-e}_t.rotl32=vE;function wE(t,e){return t+e>>>0}_t.sum32=wE;function yE(t,e,r){return t+e+r>>>0}_t.sum32_3=yE;function bE(t,e,r,n){return t+e+r+n>>>0}_t.sum32_4=bE;function _E(t,e,r,n,i){return t+e+r+n+i>>>0}_t.sum32_5=_E;function EE(t,e,r,n){var i=t[e],o=t[e+1],c=n+o>>>0,l=(c<n?1:0)+r+i;t[e]=l>>>0,t[e+1]=c}_t.sum64=EE;function AE(t,e,r,n){var i=e+n>>>0,o=(i<e?1:0)+t+r;return o>>>0}_t.sum64_hi=AE;function xE(t,e,r,n){var i=e+n;return i>>>0}_t.sum64_lo=xE;function IE(t,e,r,n,i,o,c,l){var f=0,h=e;h=h+n>>>0,f+=h<e?1:0,h=h+o>>>0,f+=h<o?1:0,h=h+l>>>0,f+=h<l?1:0;var g=t+r+i+c+f;return g>>>0}_t.sum64_4_hi=IE;function SE(t,e,r,n,i,o,c,l){var f=e+n+o+l;return f>>>0}_t.sum64_4_lo=SE;function CE(t,e,r,n,i,o,c,l,f,h){var g=0,_=e;_=_+n>>>0,g+=_<e?1:0,_=_+o>>>0,g+=_<o?1:0,_=_+l>>>0,g+=_<l?1:0,_=_+h>>>0,g+=_<h?1:0;var E=t+r+i+c+f+g;return E>>>0}_t.sum64_5_hi=CE;function DE(t,e,r,n,i,o,c,l,f,h){var g=e+n+o+l+h;return g>>>0}_t.sum64_5_lo=DE;function OE(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}_t.rotr64_hi=OE;function ME(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}_t.rotr64_lo=ME;function PE(t,e,r){return t>>>r}_t.shr64_hi=PE;function $E(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}_t.shr64_lo=$E;var Vo={},om=_t,TE=ic;function Tl(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Vo.BlockHash=Tl,Tl.prototype.update=function(t,e){if(t=om.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=om.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},Tl.prototype.digest=function(t){return this.update(this._pad()),TE(this.pending===null),this._digest(t)},Tl.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=t&255}else for(n[i++]=t&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var Go={},fi={},NE=_t,di=NE.rotr32;function RE(t,e,r,n){if(t===0)return am(e,r,n);if(t===1||t===3)return lm(e,r,n);if(t===2)return cm(e,r,n)}fi.ft_1=RE;function am(t,e,r){return t&e^~t&r}fi.ch32=am;function cm(t,e,r){return t&e^t&r^e&r}fi.maj32=cm;function lm(t,e,r){return t^e^r}fi.p32=lm;function LE(t){return di(t,2)^di(t,13)^di(t,22)}fi.s0_256=LE;function BE(t){return di(t,6)^di(t,11)^di(t,25)}fi.s1_256=BE;function UE(t){return di(t,7)^di(t,18)^t>>>3}fi.g0_256=UE;function FE(t){return di(t,17)^di(t,19)^t>>>10}fi.g1_256=FE;var Yo=_t,jE=Vo,kE=fi,If=Yo.rotl32,sc=Yo.sum32,qE=Yo.sum32_5,zE=kE.ft_1,um=jE.BlockHash,HE=[1518500249,1859775393,2400959708,3395469782];function pi(){if(!(this instanceof pi))return new pi;um.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Yo.inherits(pi,um);var KE=pi;pi.blockSize=512,pi.outSize=160,pi.hmacStrength=80,pi.padLength=64,pi.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=If(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],f=this.h[4];for(n=0;n<r.length;n++){var h=~~(n/20),g=qE(If(i,5),zE(h,o,c,l),f,r[n],HE[h]);f=l,l=c,c=If(o,30),o=i,i=g}this.h[0]=sc(this.h[0],i),this.h[1]=sc(this.h[1],o),this.h[2]=sc(this.h[2],c),this.h[3]=sc(this.h[3],l),this.h[4]=sc(this.h[4],f)},pi.prototype._digest=function(t){return t==="hex"?Yo.toHex32(this.h,"big"):Yo.split32(this.h,"big")};var Qo=_t,WE=Vo,Jo=fi,VE=ic,Jn=Qo.sum32,GE=Qo.sum32_4,YE=Qo.sum32_5,QE=Jo.ch32,JE=Jo.maj32,ZE=Jo.s0_256,XE=Jo.s1_256,eA=Jo.g0_256,tA=Jo.g1_256,hm=WE.BlockHash,rA=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function gi(){if(!(this instanceof gi))return new gi;hm.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=rA,this.W=new Array(64)}Qo.inherits(gi,hm);var fm=gi;gi.blockSize=512,gi.outSize=256,gi.hmacStrength=192,gi.padLength=64,gi.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=GE(tA(r[n-2]),r[n-7],eA(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],f=this.h[4],h=this.h[5],g=this.h[6],_=this.h[7];for(VE(this.k.length===r.length),n=0;n<r.length;n++){var E=YE(_,XE(f),QE(f,h,g),this.k[n],r[n]),x=Jn(ZE(i),JE(i,o,c));_=g,g=h,h=f,f=Jn(l,E),l=c,c=o,o=i,i=Jn(E,x)}this.h[0]=Jn(this.h[0],i),this.h[1]=Jn(this.h[1],o),this.h[2]=Jn(this.h[2],c),this.h[3]=Jn(this.h[3],l),this.h[4]=Jn(this.h[4],f),this.h[5]=Jn(this.h[5],h),this.h[6]=Jn(this.h[6],g),this.h[7]=Jn(this.h[7],_)},gi.prototype._digest=function(t){return t==="hex"?Qo.toHex32(this.h,"big"):Qo.split32(this.h,"big")};var Sf=_t,dm=fm;function Fi(){if(!(this instanceof Fi))return new Fi;dm.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Sf.inherits(Fi,dm);var nA=Fi;Fi.blockSize=512,Fi.outSize=224,Fi.hmacStrength=192,Fi.padLength=64,Fi.prototype._digest=function(t){return t==="hex"?Sf.toHex32(this.h.slice(0,7),"big"):Sf.split32(this.h.slice(0,7),"big")};var nn=_t,iA=Vo,sA=ic,mi=nn.rotr64_hi,vi=nn.rotr64_lo,pm=nn.shr64_hi,gm=nn.shr64_lo,as=nn.sum64,Cf=nn.sum64_hi,Df=nn.sum64_lo,oA=nn.sum64_4_hi,aA=nn.sum64_4_lo,cA=nn.sum64_5_hi,lA=nn.sum64_5_lo,mm=iA.BlockHash,uA=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Zn(){if(!(this instanceof Zn))return new Zn;mm.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=uA,this.W=new Array(160)}nn.inherits(Zn,mm);var vm=Zn;Zn.blockSize=1024,Zn.outSize=512,Zn.hmacStrength=192,Zn.padLength=128,Zn.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=_A(r[n-4],r[n-3]),o=EA(r[n-4],r[n-3]),c=r[n-14],l=r[n-13],f=yA(r[n-30],r[n-29]),h=bA(r[n-30],r[n-29]),g=r[n-32],_=r[n-31];r[n]=oA(i,o,c,l,f,h,g,_),r[n+1]=aA(i,o,c,l,f,h,g,_)}},Zn.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],c=this.h[3],l=this.h[4],f=this.h[5],h=this.h[6],g=this.h[7],_=this.h[8],E=this.h[9],x=this.h[10],I=this.h[11],F=this.h[12],W=this.h[13],Y=this.h[14],B=this.h[15];sA(this.k.length===r.length);for(var z=0;z<r.length;z+=2){var M=Y,U=B,j=vA(_,E),m=wA(_,E),$=hA(_,E,x,I,F),te=fA(_,E,x,I,F,W),ee=this.k[z],ne=this.k[z+1],de=r[z],d=r[z+1],p=cA(M,U,j,m,$,te,ee,ne,de,d),b=lA(M,U,j,m,$,te,ee,ne,de,d);M=gA(n,i),U=mA(n,i),j=dA(n,i,o,c,l),m=pA(n,i,o,c,l,f);var C=Cf(M,U,j,m),O=Df(M,U,j,m);Y=F,B=W,F=x,W=I,x=_,I=E,_=Cf(h,g,p,b),E=Df(g,g,p,b),h=l,g=f,l=o,f=c,o=n,c=i,n=Cf(p,b,C,O),i=Df(p,b,C,O)}as(this.h,0,n,i),as(this.h,2,o,c),as(this.h,4,l,f),as(this.h,6,h,g),as(this.h,8,_,E),as(this.h,10,x,I),as(this.h,12,F,W),as(this.h,14,Y,B)},Zn.prototype._digest=function(t){return t==="hex"?nn.toHex32(this.h,"big"):nn.split32(this.h,"big")};function hA(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function fA(t,e,r,n,i,o){var c=e&n^~e&o;return c<0&&(c+=4294967296),c}function dA(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function pA(t,e,r,n,i,o){var c=e&n^e&o^n&o;return c<0&&(c+=4294967296),c}function gA(t,e){var r=mi(t,e,28),n=mi(e,t,2),i=mi(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function mA(t,e){var r=vi(t,e,28),n=vi(e,t,2),i=vi(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function vA(t,e){var r=mi(t,e,14),n=mi(t,e,18),i=mi(e,t,9),o=r^n^i;return o<0&&(o+=4294967296),o}function wA(t,e){var r=vi(t,e,14),n=vi(t,e,18),i=vi(e,t,9),o=r^n^i;return o<0&&(o+=4294967296),o}function yA(t,e){var r=mi(t,e,1),n=mi(t,e,8),i=pm(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function bA(t,e){var r=vi(t,e,1),n=vi(t,e,8),i=gm(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function _A(t,e){var r=mi(t,e,19),n=mi(e,t,29),i=pm(t,e,6),o=r^n^i;return o<0&&(o+=4294967296),o}function EA(t,e){var r=vi(t,e,19),n=vi(e,t,29),i=gm(t,e,6),o=r^n^i;return o<0&&(o+=4294967296),o}var Of=_t,wm=vm;function ji(){if(!(this instanceof ji))return new ji;wm.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Of.inherits(ji,wm);var AA=ji;ji.blockSize=1024,ji.outSize=384,ji.hmacStrength=192,ji.padLength=128,ji.prototype._digest=function(t){return t==="hex"?Of.toHex32(this.h.slice(0,12),"big"):Of.split32(this.h.slice(0,12),"big")},Go.sha1=KE,Go.sha224=nA,Go.sha256=fm,Go.sha384=AA,Go.sha512=vm;var ym={},Ks=_t,xA=Vo,Nl=Ks.rotl32,bm=Ks.sum32,oc=Ks.sum32_3,_m=Ks.sum32_4,Em=xA.BlockHash;function wi(){if(!(this instanceof wi))return new wi;Em.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ks.inherits(wi,Em),ym.ripemd160=wi,wi.blockSize=512,wi.outSize=160,wi.hmacStrength=192,wi.padLength=64,wi.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4],l=r,f=n,h=i,g=o,_=c,E=0;E<80;E++){var x=bm(Nl(_m(r,Am(E,n,i,o),t[CA[E]+e],IA(E)),OA[E]),c);r=c,c=o,o=Nl(i,10),i=n,n=x,x=bm(Nl(_m(l,Am(79-E,f,h,g),t[DA[E]+e],SA(E)),MA[E]),_),l=_,_=g,g=Nl(h,10),h=f,f=x}x=oc(this.h[1],i,g),this.h[1]=oc(this.h[2],o,_),this.h[2]=oc(this.h[3],c,l),this.h[3]=oc(this.h[4],r,f),this.h[4]=oc(this.h[0],n,h),this.h[0]=x},wi.prototype._digest=function(t){return t==="hex"?Ks.toHex32(this.h,"little"):Ks.split32(this.h,"little")};function Am(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function IA(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function SA(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var CA=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],DA=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],OA=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],MA=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],PA=_t,$A=ic;function Zo(t,e,r){if(!(this instanceof Zo))return new Zo(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(PA.toArray(e,r))}var TA=Zo;Zo.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),$A(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=new this.Hash().update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=new this.Hash().update(t)},Zo.prototype.update=function(t,e){return this.inner.update(t,e),this},Zo.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=_t,e.common=Vo,e.sha=Go,e.ripemd=ym,e.hmac=TA,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(hi);function Xo(t,e,r){return r={path:e,exports:{},require:function(n,i){return NA(n,i??r.path)}},t(r,r.exports),r.exports}function NA(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Mf=xm;function xm(t,e){if(!t)throw new Error(e||"Assertion failed")}xm.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var Xn=Xo(function(t,e){var r=e;function n(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var f=[];if(typeof c!="string"){for(var h=0;h<c.length;h++)f[h]=c[h]|0;return f}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var h=0;h<c.length;h+=2)f.push(parseInt(c[h]+c[h+1],16))}else for(var h=0;h<c.length;h++){var g=c.charCodeAt(h),_=g>>8,E=g&255;_?f.push(_,E):f.push(E)}return f}r.toArray=n;function i(c){return c.length===1?"0"+c:c}r.zero2=i;function o(c){for(var l="",f=0;f<c.length;f++)l+=i(c[f].toString(16));return l}r.toHex=o,r.encode=function(c,l){return l==="hex"?o(c):c}}),vn=Xo(function(t,e){var r=e;r.assert=Mf,r.toArray=Xn.toArray,r.zero2=Xn.zero2,r.toHex=Xn.toHex,r.encode=Xn.encode;function n(f,h,g){var _=new Array(Math.max(f.bitLength(),g)+1);_.fill(0);for(var E=1<<h+1,x=f.clone(),I=0;I<_.length;I++){var F,W=x.andln(E-1);x.isOdd()?(W>(E>>1)-1?F=(E>>1)-W:F=W,x.isubn(F)):F=0,_[I]=F,x.iushrn(1)}return _}r.getNAF=n;function i(f,h){var g=[[],[]];f=f.clone(),h=h.clone();for(var _=0,E=0,x;f.cmpn(-_)>0||h.cmpn(-E)>0;){var I=f.andln(3)+_&3,F=h.andln(3)+E&3;I===3&&(I=-1),F===3&&(F=-1);var W;I&1?(x=f.andln(7)+_&7,(x===3||x===5)&&F===2?W=-I:W=I):W=0,g[0].push(W);var Y;F&1?(x=h.andln(7)+E&7,(x===3||x===5)&&I===2?Y=-F:Y=F):Y=0,g[1].push(Y),2*_===W+1&&(_=1-_),2*E===Y+1&&(E=1-E),f.iushrn(1),h.iushrn(1)}return g}r.getJSF=i;function o(f,h,g){var _="_"+h;f.prototype[h]=function(){return this[_]!==void 0?this[_]:this[_]=g.call(this)}}r.cachedProperty=o;function c(f){return typeof f=="string"?r.toArray(f,"hex"):f}r.parseBytes=c;function l(f){return new st(f,"hex","le")}r.intFromLE=l}),Rl=vn.getNAF,RA=vn.getJSF,Ll=vn.assert;function cs(t,e){this.type=t,this.p=new st(e.p,16),this.red=e.prime?st.red(e.prime):st.mont(this.p),this.zero=new st(0).toRed(this.red),this.one=new st(1).toRed(this.red),this.two=new st(2).toRed(this.red),this.n=e.n&&new st(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ws=cs;cs.prototype.point=function(){throw new Error("Not implemented")},cs.prototype.validate=function(){throw new Error("Not implemented")},cs.prototype._fixedNafMul=function(t,e){Ll(t.precomputed);var r=t._getDoubles(),n=Rl(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var o=[],c,l;for(c=0;c<n.length;c+=r.step){l=0;for(var f=c+r.step-1;f>=c;f--)l=(l<<1)+n[f];o.push(l)}for(var h=this.jpoint(null,null,null),g=this.jpoint(null,null,null),_=i;_>0;_--){for(c=0;c<o.length;c++)l=o[c],l===_?g=g.mixedAdd(r.points[c]):l===-_&&(g=g.mixedAdd(r.points[c].neg()));h=h.add(g)}return h.toP()},cs.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Rl(e,r,this._bitLength),c=this.jpoint(null,null,null),l=o.length-1;l>=0;l--){for(var f=0;l>=0&&o[l]===0;l--)f++;if(l>=0&&f++,c=c.dblp(f),l<0)break;var h=o[l];Ll(h!==0),t.type==="affine"?h>0?c=c.mixedAdd(i[h-1>>1]):c=c.mixedAdd(i[-h-1>>1].neg()):h>0?c=c.add(i[h-1>>1]):c=c.add(i[-h-1>>1].neg())}return t.type==="affine"?c.toP():c},cs.prototype._wnafMulAdd=function(t,e,r,n,i){var o=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0,h,g,_;for(h=0;h<n;h++){_=e[h];var E=_._getNAFPoints(t);o[h]=E.wnd,c[h]=E.points}for(h=n-1;h>=1;h-=2){var x=h-1,I=h;if(o[x]!==1||o[I]!==1){l[x]=Rl(r[x],o[x],this._bitLength),l[I]=Rl(r[I],o[I],this._bitLength),f=Math.max(l[x].length,f),f=Math.max(l[I].length,f);continue}var F=[e[x],null,null,e[I]];e[x].y.cmp(e[I].y)===0?(F[1]=e[x].add(e[I]),F[2]=e[x].toJ().mixedAdd(e[I].neg())):e[x].y.cmp(e[I].y.redNeg())===0?(F[1]=e[x].toJ().mixedAdd(e[I]),F[2]=e[x].add(e[I].neg())):(F[1]=e[x].toJ().mixedAdd(e[I]),F[2]=e[x].toJ().mixedAdd(e[I].neg()));var W=[-3,-1,-5,-7,0,7,5,1,3],Y=RA(r[x],r[I]);for(f=Math.max(Y[0].length,f),l[x]=new Array(f),l[I]=new Array(f),g=0;g<f;g++){var B=Y[0][g]|0,z=Y[1][g]|0;l[x][g]=W[(B+1)*3+(z+1)],l[I][g]=0,c[x]=F}}var M=this.jpoint(null,null,null),U=this._wnafT4;for(h=f;h>=0;h--){for(var j=0;h>=0;){var m=!0;for(g=0;g<n;g++)U[g]=l[g][h]|0,U[g]!==0&&(m=!1);if(!m)break;j++,h--}if(h>=0&&j++,M=M.dblp(j),h<0)break;for(g=0;g<n;g++){var $=U[g];$!==0&&($>0?_=c[g][$-1>>1]:$<0&&(_=c[g][-$-1>>1].neg()),_.type==="affine"?M=M.mixedAdd(_):M=M.add(_))}}for(h=0;h<n;h++)c[h]=null;return i?M:M.toP()};function Cn(t,e){this.curve=t,this.type=e,this.precomputed=null}cs.BasePoint=Cn,Cn.prototype.eq=function(){throw new Error("Not implemented")},Cn.prototype.validate=function(){return this.curve.validate(this)},cs.prototype.decodePoint=function(t,e){t=vn.toArray(t,e);var r=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*r){t[0]===6?Ll(t[t.length-1]%2===0):t[0]===7&&Ll(t[t.length-1]%2===1);var n=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return n}else if((t[0]===2||t[0]===3)&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),t[0]===3);throw new Error("Unknown point format")},Cn.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Cn.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Cn.prototype.encode=function(t,e){return vn.encode(this._encode(e),t)},Cn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Cn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1},Cn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},Cn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=r===1?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},Cn.prototype._getBeta=function(){return null},Cn.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var Pf=Xo(function(t){typeof Object.create=="function"?t.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}}),LA=vn.assert;function Dn(t){Ws.call(this,"short",t),this.a=new st(t.a,16).toRed(this.red),this.b=new st(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Pf(Dn,Ws);var BA=Dn;Dn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,r;if(t.beta)e=new st(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=n[0].cmp(n[1])<0?n[0]:n[1],e=e.toRed(this.red)}if(t.lambda)r=new st(t.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))===0?r=i[0]:(r=i[1],LA(this.g.mul(r).x.cmp(this.g.x.redMul(e))===0))}var o;return t.basis?o=t.basis.map(function(c){return{a:new st(c.a,16),b:new st(c.b,16)}}):o=this._getEndoBasis(r),{beta:e,lambda:r,basis:o}}},Dn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:st.mont(t),r=new st(2).toRed(e).redInvm(),n=r.redNeg(),i=new st(3).toRed(e).redNeg().redSqrt().redMul(r),o=n.redAdd(i).fromRed(),c=n.redSub(i).fromRed();return[o,c]},Dn.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,n=this.n.clone(),i=new st(1),o=new st(0),c=new st(0),l=new st(1),f,h,g,_,E,x,I,F=0,W,Y;r.cmpn(0)!==0;){var B=n.div(r);W=n.sub(B.mul(r)),Y=c.sub(B.mul(i));var z=l.sub(B.mul(o));if(!g&&W.cmp(e)<0)f=I.neg(),h=i,g=W.neg(),_=Y;else if(g&&++F===2)break;I=W,n=r,r=W,c=i,i=Y,l=o,o=z}E=W.neg(),x=Y;var M=g.sqr().add(_.sqr()),U=E.sqr().add(x.sqr());return U.cmp(M)>=0&&(E=f,x=h),g.negative&&(g=g.neg(),_=_.neg()),E.negative&&(E=E.neg(),x=x.neg()),[{a:g,b:_},{a:E,b:x}]},Dn.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),c=i.mul(r.a),l=o.mul(n.a),f=i.mul(r.b),h=o.mul(n.b),g=t.sub(c).sub(l),_=f.add(h).neg();return{k1:g,k2:_}},Dn.prototype.pointFromX=function(t,e){t=new st(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},Dn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0},Dn.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var c=this._endoSplit(e[o]),l=t[o],f=l._getBeta();c.k1.negative&&(c.k1.ineg(),l=l.neg(!0)),c.k2.negative&&(c.k2.ineg(),f=f.neg(!0)),n[o*2]=l,n[o*2+1]=f,i[o*2]=c.k1,i[o*2+1]=c.k2}for(var h=this._wnafMulAdd(1,n,i,o*2,r),g=0;g<o*2;g++)n[g]=null,i[g]=null;return h};function Er(t,e,r,n){Ws.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new st(e,16),this.y=new st(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Pf(Er,Ws.BasePoint),Dn.prototype.point=function(t,e,r){return new Er(this,t,e,r)},Dn.prototype.pointFromJSON=function(t,e){return Er.fromJSON(this,t,e)},Er.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(i){return r.point(i.x.redMul(r.endo.beta),i.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},Er.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Er.fromJSON=function(t,e,r){typeof e=="string"&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(c){return t.point(c[0],c[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},Er.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Er.prototype.isInfinity=function(){return this.inf},Er.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Er.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),c=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,c)},Er.prototype.getX=function(){return this.x.fromRed()},Er.prototype.getY=function(){return this.y.fromRed()},Er.prototype.mul=function(t){return t=new st(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Er.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Er.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Er.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},Er.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(i){return i.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},Er.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function Pr(t,e,r,n){Ws.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new st(0)):(this.x=new st(e,16),this.y=new st(r,16),this.z=new st(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Pf(Pr,Ws.BasePoint),Dn.prototype.jpoint=function(t,e,r){return new Pr(this,t,e,r)},Pr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},Pr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Pr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),c=t.y.redMul(r.redMul(this.z)),l=n.redSub(i),f=o.redSub(c);if(l.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=l.redSqr(),g=h.redMul(l),_=n.redMul(h),E=f.redSqr().redIAdd(g).redISub(_).redISub(_),x=f.redMul(_.redISub(E)).redISub(o.redMul(g)),I=this.z.redMul(t.z).redMul(l);return this.curve.jpoint(E,x,I)},Pr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),c=r.redSub(n),l=i.redSub(o);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),h=f.redMul(c),g=r.redMul(f),_=l.redSqr().redIAdd(h).redISub(g).redISub(g),E=l.redMul(g.redISub(_)).redISub(i.redMul(h)),x=this.z.redMul(c);return this.curve.jpoint(_,E,x)},Pr.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,c=this.y,l=this.z,f=l.redSqr().redSqr(),h=c.redAdd(c);for(e=0;e<t;e++){var g=o.redSqr(),_=h.redSqr(),E=_.redSqr(),x=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),I=o.redMul(_),F=x.redSqr().redISub(I.redAdd(I)),W=I.redISub(F),Y=x.redMul(W);Y=Y.redIAdd(Y).redISub(E);var B=h.redMul(l);e+1<t&&(f=f.redMul(E)),o=F,l=B,h=Y}return this.curve.jpoint(o,h.redMul(i),l)},Pr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Pr.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(o);c=c.redIAdd(c);var l=n.redAdd(n).redIAdd(n),f=l.redSqr().redISub(c).redISub(c),h=o.redIAdd(o);h=h.redIAdd(h),h=h.redIAdd(h),t=f,e=l.redMul(c.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),_=this.y.redSqr(),E=_.redSqr(),x=this.x.redAdd(_).redSqr().redISub(g).redISub(E);x=x.redIAdd(x);var I=g.redAdd(g).redIAdd(g),F=I.redSqr(),W=E.redIAdd(E);W=W.redIAdd(W),W=W.redIAdd(W),t=F.redISub(x).redISub(x),e=I.redMul(x.redISub(t)).redISub(W),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},Pr.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(o);c=c.redIAdd(c);var l=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=l.redSqr().redISub(c).redISub(c);t=f;var h=o.redIAdd(o);h=h.redIAdd(h),h=h.redIAdd(h),e=l.redMul(c.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),_=this.y.redSqr(),E=this.x.redMul(_),x=this.x.redSub(g).redMul(this.x.redAdd(g));x=x.redAdd(x).redIAdd(x);var I=E.redIAdd(E);I=I.redIAdd(I);var F=I.redAdd(I);t=x.redSqr().redISub(F),r=this.y.redAdd(this.z).redSqr().redISub(_).redISub(g);var W=_.redSqr();W=W.redIAdd(W),W=W.redIAdd(W),W=W.redIAdd(W),e=x.redMul(I.redISub(t)).redISub(W)}return this.curve.jpoint(t,e,r)},Pr.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),c=r.redSqr(),l=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),f=e.redAdd(e);f=f.redIAdd(f);var h=f.redMul(c),g=l.redSqr().redISub(h.redAdd(h)),_=h.redISub(g),E=c.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var x=l.redMul(_).redISub(E),I=r.redAdd(r).redMul(n);return this.curve.jpoint(g,x,I)},Pr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),c=this.x.redAdd(e).redSqr().redISub(t).redISub(n);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(o);var l=c.redSqr(),f=n.redIAdd(n);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var h=i.redIAdd(c).redSqr().redISub(o).redISub(l).redISub(f),g=e.redMul(h);g=g.redIAdd(g),g=g.redIAdd(g);var _=this.x.redMul(l).redISub(g);_=_.redIAdd(_),_=_.redIAdd(_);var E=this.y.redMul(h.redMul(f.redISub(h)).redISub(c.redMul(l)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var x=this.z.redAdd(c).redSqr().redISub(r).redISub(l);return this.curve.jpoint(_,E,x)},Pr.prototype.mul=function(t,e){return t=new st(t,e),this.curve._wnafMul(this,t)},Pr.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)===0},Pr.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(r)===0)return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}},Pr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Pr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Bl=Xo(function(t,e){var r=e;r.base=Ws,r.short=BA,r.mont=null,r.edwards=null}),Ul=Xo(function(t,e){var r=e,n=vn.assert;function i(l){l.type==="short"?this.curve=new Bl.short(l):l.type==="edwards"?this.curve=new Bl.edwards(l):this.curve=new Bl.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function o(l,f){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var h=new i(f);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:h}),h}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hi.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hi.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hi.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hi.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hi.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hi.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hi.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hi.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function ls(t){if(!(this instanceof ls))return new ls(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Xn.toArray(t.entropy,t.entropyEnc||"hex"),r=Xn.toArray(t.nonce,t.nonceEnc||"hex"),n=Xn.toArray(t.pers,t.persEnc||"hex");Mf(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Im=ls;ls.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},ls.prototype._hmac=function(){return new hi.hmac(this.hash,this.K)},ls.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},ls.prototype.reseed=function(t,e,r,n){typeof e!="string"&&(n=r,r=e,e=null),t=Xn.toArray(t,e),r=Xn.toArray(r,n),Mf(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},ls.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(n=r,r=e,e=null),r&&(r=Xn.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this._reseed++,Xn.encode(o,e)};var $f=vn.assert;function Lr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Tf=Lr;Lr.fromPublic=function(t,e,r){return e instanceof Lr?e:new Lr(t,{pub:e,pubEnc:r})},Lr.fromPrivate=function(t,e,r){return e instanceof Lr?e:new Lr(t,{priv:e,privEnc:r})},Lr.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Lr.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Lr.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},Lr.prototype._importPrivate=function(t,e){this.priv=new st(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Lr.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?$f(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&$f(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)},Lr.prototype.derive=function(t){return t.validate()||$f(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Lr.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Lr.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Lr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var UA=vn.assert;function Fl(t,e){if(t instanceof Fl)return t;this._importDER(t,e)||(UA(t.r&&t.s,"Signature without r or s"),this.r=new st(t.r,16),this.s=new st(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var jl=Fl;function FA(){this.place=0}function Nf(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,c=e.place;o<n;o++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}function Sm(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Fl.prototype._importDER=function(t,e){t=vn.toArray(t,e);var r=new FA;if(t[r.place++]!==48)return!1;var n=Nf(t,r);if(n===!1||n+r.place!==t.length||t[r.place++]!==2)return!1;var i=Nf(t,r);if(i===!1)return!1;var o=t.slice(r.place,i+r.place);if(r.place+=i,t[r.place++]!==2)return!1;var c=Nf(t,r);if(c===!1||t.length!==c+r.place)return!1;var l=t.slice(r.place,c+r.place);if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new st(o),this.s=new st(l),this.recoveryParam=null,!0};function Rf(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Fl.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=Sm(e),r=Sm(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var n=[2];Rf(n,e.length),n=n.concat(e),n.push(2),Rf(n,r.length);var i=n.concat(r),o=[48];return Rf(o,i.length),o=o.concat(i),vn.encode(o,t)};var jA=function(){throw new Error("unsupported")},Cm=vn.assert;function On(t){if(!(this instanceof On))return new On(t);typeof t=="string"&&(Cm(Object.prototype.hasOwnProperty.call(Ul,t),"Unknown curve "+t),t=Ul[t]),t instanceof Ul.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var kA=On;On.prototype.keyPair=function(t){return new Tf(this,t)},On.prototype.keyFromPrivate=function(t,e){return Tf.fromPrivate(this,t,e)},On.prototype.keyFromPublic=function(t,e){return Tf.fromPublic(this,t,e)},On.prototype.genKeyPair=function(t){t||(t={});for(var e=new Im({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||jA(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new st(2));;){var i=new st(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},On.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},On.prototype.sign=function(t,e,r,n){typeof r=="object"&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new st(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),c=t.toArray("be",i),l=new Im({hash:this.hash,entropy:o,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),f=this.n.sub(new st(1)),h=0;;h++){var g=n.k?n.k(h):new st(l.generate(this.n.byteLength()));if(g=this._truncateToN(g,!0),!(g.cmpn(1)<=0||g.cmp(f)>=0)){var _=this.g.mul(g);if(!_.isInfinity()){var E=_.getX(),x=E.umod(this.n);if(x.cmpn(0)!==0){var I=g.invm(this.n).mul(x.mul(e.getPrivate()).iadd(t));if(I=I.umod(this.n),I.cmpn(0)!==0){var F=(_.getY().isOdd()?1:0)|(E.cmp(x)!==0?2:0);return n.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),F^=1),new jl({r:x,s:I,recoveryParam:F})}}}}}},On.prototype.verify=function(t,e,r,n){t=this._truncateToN(new st(t,16)),r=this.keyFromPublic(r,n),e=new jl(e,"hex");var i=e.r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c=o.invm(this.n),l=c.mul(t).umod(this.n),f=c.mul(i).umod(this.n),h;return this.curve._maxwellTrick?(h=this.g.jmulAdd(l,r.getPublic(),f),h.isInfinity()?!1:h.eqXToP(i)):(h=this.g.mulAdd(l,r.getPublic(),f),h.isInfinity()?!1:h.getX().umod(this.n).cmp(i)===0)},On.prototype.recoverPubKey=function(t,e,r,n){Cm((3&r)===r,"The recovery param is more than two bits"),e=new jl(e,n);var i=this.n,o=new st(t),c=e.r,l=e.s,f=r&1,h=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?c=this.curve.pointFromX(c.add(this.curve.n),f):c=this.curve.pointFromX(c,f);var g=e.r.invm(i),_=i.sub(o).mul(g).umod(i),E=l.mul(g).umod(i);return this.g.mulAdd(_,c,E)},On.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new jl(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var qA=Xo(function(t,e){var r=e;r.version="6.5.4",r.utils=vn,r.rand=function(){throw new Error("unsupported")},r.curve=Bl,r.curves=Ul,r.ec=kA,r.eddsa=null}),zA=qA.ec;const HA="signing-key/5.7.0",Lf=new ut(HA);let Bf=null;function yi(){return Bf||(Bf=new zA("secp256k1")),Bf}class KA{constructor(e){nc(this,"curve","secp256k1"),nc(this,"privateKey",kr(e)),C4(this.privateKey)!==32&&Lf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=yi().keyFromPrivate(or(this.privateKey));nc(this,"publicKey","0x"+r.getPublic(!1,"hex")),nc(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),nc(this,"_isSigningKey",!0)}_addPoint(e){const r=yi().keyFromPublic(or(this.publicKey)),n=yi().keyFromPublic(or(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=yi().keyFromPrivate(or(this.privateKey)),n=or(e);n.length!==32&&Lf.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Bg({recoveryParam:i.recoveryParam,r:ui("0x"+i.r.toString(16),32),s:ui("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=yi().keyFromPrivate(or(this.privateKey)),n=yi().keyFromPublic(or(Dm(e)));return ui("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function WA(t,e){const r=Bg(e),n={r:or(r.r),s:or(r.s)};return"0x"+yi().recoverPubKey(or(t),n,r.recoveryParam).encode("hex",!1)}function Dm(t,e){const r=or(t);if(r.length===32){const n=new KA(r);return e?"0x"+yi().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?kr(r):"0x"+yi().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+yi().keyFromPublic(r).getPublic(!0,"hex"):kr(r)}return Lf.throwArgumentError("invalid public or private key","key","[REDACTED]")}const VA="transactions/5.7.0";new ut(VA);var Om;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Om||(Om={}));function GA(t){const e=Dm(t);return iE(Lg(vf(Lg(e,1)),12))}function YA(t,e){return GA(WA(or(t),e))}const QA="https://rpc.walletconnect.com/v1";async function JA(t,e,r,n,i,o){switch(r.t){case"eip191":return ZA(t,e,r.s);case"eip1271":return await XA(t,e,r.s,n,i,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function ZA(t,e,r){return YA(Xg(e),r).toLowerCase()===t.toLowerCase()}async function XA(t,e,r,n,i,o){try{const c="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",f="0000000000000000000000000000000000000000000000000000000000000041",h=r.substring(2),g=Xg(e).substring(2),_=c+g+l+f+h,E=await fetch(`${o||QA}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:e7(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:_},"latest"]})}),{result:x}=await E.json();return x?x.slice(0,c.length).toLowerCase()===c.toLowerCase():!1}catch(c){return console.error("isValidEip1271Signature: ",c),!1}}function e7(){return Date.now()+Math.floor(Math.random()*1e3)}var t7=Object.defineProperty,r7=Object.defineProperties,n7=Object.getOwnPropertyDescriptors,Mm=Object.getOwnPropertySymbols,i7=Object.prototype.hasOwnProperty,s7=Object.prototype.propertyIsEnumerable,Pm=(t,e,r)=>e in t?t7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o7=(t,e)=>{for(var r in e||(e={}))i7.call(e,r)&&Pm(t,r,e[r]);if(Mm)for(var r of Mm(e))s7.call(e,r)&&Pm(t,r,e[r]);return t},a7=(t,e)=>r7(t,n7(e));const c7="did:pkh:",Uf=t=>t?.split(":"),$m=t=>{const e=t&&Uf(t);if(e)return t.includes(c7)?e[3]:e[1]},Tm=t=>{const e=t&&Uf(t);if(e)return e[2]+":"+e[3]},kl=t=>{const e=t&&Uf(t);if(e)return e.pop()};async function Nm(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,o=Rm(i,i.iss),c=kl(i.iss);return await JA(c,o,n,$m(i.iss),r)}const Rm=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=kl(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const o=`URI: ${t.aud||t.uri}`,c=`Version: ${t.version}`,l=`Chain ID: ${$m(e)}`,f=`Nonce: ${t.nonce}`,h=`Issued At: ${t.iat}`,g=t.exp?`Expiration Time: ${t.exp}`:void 0,_=t.nbf?`Not Before: ${t.nbf}`:void 0,E=t.requestId?`Request ID: ${t.requestId}`:void 0,x=t.resources?`Resources:${t.resources.map(F=>`
|
|
23
|
+
- ${F}`).join("")}`:void 0,I=ql(t.resources);if(I){const F=ac(I);i=v7(i,F)}return[r,n,"",i,"",o,c,l,f,h,g,_,E,x].filter(F=>F!=null).join(`
|
|
24
|
+
`)};function l7(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function u7(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Vs(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const o=n[i];if(!Array.isArray(o))throw new Error(`Ability limits ${i} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);o.forEach(c=>{if(typeof c!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${c}`)})})})}function h7(t,e,r,n={}){return r?.sort((i,o)=>i.localeCompare(o)),{att:{[t]:f7(e,r,n)}}}function f7(t,e,r={}){e=e?.sort((i,o)=>i.localeCompare(o));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Lm(t){return Vs(t),`urn:recap:${l7(t).replace(/=/g,"")}`}function ac(t){const e=u7(t.replace("urn:recap:",""));return Vs(e),e}function d7(t,e,r){const n=h7(t,e,r);return Lm(n)}function p7(t){return t&&t.includes("urn:recap:")}function g7(t,e){const r=ac(t),n=ac(e),i=m7(r,n);return Lm(i)}function m7(t,e){Vs(t),Vs(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,o)=>i.localeCompare(o)),n={att:{}};return r.forEach(i=>{var o,c;Object.keys(((o=t.att)==null?void 0:o[i])||{}).concat(Object.keys(((c=e.att)==null?void 0:c[i])||{})).sort((l,f)=>l.localeCompare(f)).forEach(l=>{var f,h;n.att[i]=a7(o7({},n.att[i]),{[l]:((f=t.att[i])==null?void 0:f[l])||((h=e.att[i])==null?void 0:h[l])})})}),n}function v7(t="",e){Vs(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(l=>{const f=Object.keys(e.att[l]).map(_=>({ability:_.split("/")[0],action:_.split("/")[1]}));f.sort((_,E)=>_.action.localeCompare(E.action));const h={};f.forEach(_=>{h[_.ability]||(h[_.ability]=[]),h[_.ability].push(_.action)});const g=Object.keys(h).map(_=>(i++,`(${i}) '${_}': '${h[_].join("', '")}' for '${l}'.`));n.push(g.join(", ").replace(".,","."))});const o=n.join(" "),c=`${r}${o}`;return`${t?t+" ":""}${c}`}function Bm(t){var e;const r=ac(t);Vs(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function Um(t){const e=ac(t);Vs(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var o;(o=i?.[0])!=null&&o.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function ql(t){if(!t)return;const e=t?.[t.length-1];return p7(e)?e:void 0}const Fm="base10",zr="base16",Ff="base64pad",jf="utf8",jm=0,ki=1,w7=0,km=1,kf=12,qf=32;function y7(){const t=ff.generateKeyPair();return{privateKey:Yn(t.secretKey,zr),publicKey:Yn(t.publicKey,zr)}}function zf(){const t=Bo.randomBytes(qf);return Yn(t,zr)}function b7(t,e){const r=ff.sharedKey(Gn(t,zr),Gn(e,zr),!0),n=new e4(Il.SHA256,r).expand(qf);return Yn(n,zr)}function zl(t){const e=Il.hash(Gn(t,zr));return Yn(e,zr)}function Gs(t){const e=Il.hash(Gn(t,jf));return Yn(e,zr)}function _7(t){return Gn(`${t}`,Fm)}function cc(t){return Number(Yn(t,Fm))}function E7(t){const e=_7(typeof t.type<"u"?t.type:jm);if(cc(e)===ki&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Gn(t.senderPublicKey,zr):void 0,n=typeof t.iv<"u"?Gn(t.iv,zr):Bo.randomBytes(kf),i=new lf.ChaCha20Poly1305(Gn(t.symKey,zr)).seal(n,Gn(t.message,jf));return x7({type:e,sealed:i,iv:n,senderPublicKey:r})}function A7(t){const e=new lf.ChaCha20Poly1305(Gn(t.symKey,zr)),{sealed:r,iv:n}=Hl(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Yn(i,jf)}function x7(t){if(cc(t.type)===ki){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Yn(pg([t.type,t.senderPublicKey,t.iv,t.sealed]),Ff)}return Yn(pg([t.type,t.iv,t.sealed]),Ff)}function Hl(t){const e=Gn(t,Ff),r=e.slice(w7,km),n=km;if(cc(r)===ki){const l=n+qf,f=l+kf,h=e.slice(n,l),g=e.slice(l,f),_=e.slice(f);return{type:r,sealed:_,iv:g,senderPublicKey:h}}const i=n+kf,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function I7(t,e){const r=Hl(t);return qm({type:cc(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Yn(r.senderPublicKey,zr):void 0,receiverPublicKey:e?.receiverPublicKey})}function qm(t){const e=t?.type||jm;if(e===ki){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function zm(t){return t.type===ki&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}const S7="irn";function Hf(t){return t?.relay||{protocol:S7}}function lc(t){const e=t4[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var C7=Object.defineProperty,D7=Object.defineProperties,O7=Object.getOwnPropertyDescriptors,Hm=Object.getOwnPropertySymbols,M7=Object.prototype.hasOwnProperty,P7=Object.prototype.propertyIsEnumerable,Km=(t,e,r)=>e in t?C7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wm=(t,e)=>{for(var r in e||(e={}))M7.call(e,r)&&Km(t,r,e[r]);if(Hm)for(var r of Hm(e))P7.call(e,r)&&Km(t,r,e[r]);return t},$7=(t,e)=>D7(t,O7(e));function T7(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function Vm(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",c=Ya.parse(o),l=typeof c.methods=="string"?c.methods.split(","):void 0;return{protocol:n,topic:N7(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:T7(c),methods:l,expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function N7(t){return t.startsWith("//")?t.substring(2):t}function R7(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function L7(t){return`${t.protocol}:${t.topic}@${t.version}?`+Ya.stringify(Wm($7(Wm({symKey:t.symKey},R7(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function ea(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function B7(t){const e=[];return Object.values(t).forEach(r=>{e.push(...ea(r.accounts))}),e}function U7(t,e){const r=[];return Object.values(t).forEach(n=>{ea(n.accounts).includes(e)&&r.push(...n.methods)}),r}function F7(t,e){const r=[];return Object.values(t).forEach(n=>{ea(n.accounts).includes(e)&&r.push(...n.events)}),r}function Kf(t){return t.includes(":")}function uc(t){return Kf(t)?t.split(":")[0]:t}function j7(t){const e={};return t?.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function Gm(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=j7(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=Cl(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const k7={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},q7={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function me(t,e){const{message:r,code:n}=q7[t];return{message:e?`${r} ${e}`:r,code:n}}function Ut(t,e){const{message:r,code:n}=k7[t];return{message:e?`${r} ${e}`:r,code:n}}function bi(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function hc(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Hr(t){return typeof t>"u"}function ur(t,e){return e&&Hr(t)?!0:typeof t=="string"&&!!t.trim().length}function Wf(t,e){return e&&Hr(t)?!0:typeof t=="number"&&!isNaN(t)}function z7(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return zs(i,n)?(n.forEach(c=>{const{accounts:l,methods:f,events:h}=t.namespaces[c],g=ea(l),_=r[c];(!zs(yg(c,_),g)||!zs(_.methods,f)||!zs(_.events,h))&&(o=!1)}),o):!1}function Kl(t){return ur(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function H7(t){if(ur(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Kl(r)}}return!1}function K7(t){if(ur(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function W7(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function V7(t){return t?.topic}function G7(t,e){let r=null;return ur(t?.publicKey,!1)||(r=me("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Ym(t){let e=!0;return bi(t)?t.length&&(e=t.every(r=>ur(r,!1))):e=!1,e}function Y7(t,e,r){let n=null;return bi(e)&&e.length?e.forEach(i=>{n||Kl(i)||(n=Ut("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Kl(t)||(n=Ut("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Q7(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=Y7(i,yg(i,o),`${e} ${r}`);c&&(n=c)}),n}function J7(t,e){let r=null;return bi(t)?t.forEach(n=>{r||H7(n)||(r=Ut("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Ut("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Z7(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=J7(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function X7(t,e){let r=null;return Ym(t?.methods)?Ym(t?.events)||(r=Ut("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Ut("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function Qm(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=X7(n,`${e}, namespace`);i&&(r=i)}),r}function ex(t,e,r){let n=null;if(t&&hc(t)){const i=Qm(t,e);i&&(n=i);const o=Q7(t,e,r);o&&(n=o)}else n=me("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Vf(t,e){let r=null;if(t&&hc(t)){const n=Qm(t,e);n&&(r=n);const i=Z7(t,e);i&&(r=i)}else r=me("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Jm(t){return ur(t.protocol,!0)}function tx(t,e){let r=!1;return e&&!t?r=!0:t&&bi(t)&&t.length&&t.forEach(n=>{r=Jm(n)}),r}function rx(t){return typeof t=="number"}function sn(t){return typeof t<"u"&&typeof t!==null}function nx(t){return!(!t||typeof t!="object"||!t.code||!Wf(t.code,!1)||!t.message||!ur(t.message,!1))}function ix(t){return!(Hr(t)||!ur(t.method,!1))}function sx(t){return!(Hr(t)||Hr(t.result)&&Hr(t.error)||!Wf(t.id,!1)||!ur(t.jsonrpc,!1))}function ox(t){return!(Hr(t)||!ur(t.name,!1))}function Zm(t,e){return!(!Kl(e)||!B7(t).includes(e))}function ax(t,e,r){return ur(r,!1)?U7(t,e).includes(r):!1}function cx(t,e,r){return ur(r,!1)?F7(t,e).includes(r):!1}function Xm(t,e,r){let n=null;const i=lx(t),o=ux(e),c=Object.keys(i),l=Object.keys(o),f=ev(Object.keys(t)),h=ev(Object.keys(e)),g=f.filter(_=>!h.includes(_));return g.length&&(n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
25
25
|
Required: ${g.toString()}
|
|
26
|
-
Received: ${Object.keys(e).toString()}`)),
|
|
26
|
+
Received: ${Object.keys(e).toString()}`)),zs(c,l)||(n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
27
27
|
Required: ${c.toString()}
|
|
28
|
-
Approved: ${l.toString()}`)),Object.keys(e).forEach(_=>{if(!_.includes(":")||n)return;const E=
|
|
28
|
+
Approved: ${l.toString()}`)),Object.keys(e).forEach(_=>{if(!_.includes(":")||n)return;const E=ea(e[_].accounts);E.includes(_)||(n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${_}
|
|
29
29
|
Required: ${_}
|
|
30
|
-
Approved: ${E.toString()}`))}),c.forEach(_=>{n||(ks(i[_].methods,o[_].methods)?ks(i[_].events,o[_].events)||(n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${_}`)):n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${_}`))}),n}function OA(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function Pm(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function MA(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Zo(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(o=>o.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function PA(t,e){return Nf(t,!1)&&t<=e.max&&t>=e.min}function $m(){const t=Va();return new Promise(e=>{switch(t){case gn.browser:e($A());break;case gn.reactNative:e(TA());break;case gn.node:e(NA());break;default:e(!0)}})}function $A(){return Fo()&&navigator?.onLine}async function TA(){if(Uo()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function NA(){return!0}function RA(t){switch(Va()){case gn.browser:LA(t);break;case gn.reactNative:BA(t);break}}function LA(t){!Uo()&&Fo()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function BA(t){Uo()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Lf={};class ac{static get(e){return Lf[e]}static set(e,r){Lf[e]=r}static delete(e){delete Lf[e]}}const UA=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,FA=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,jA=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function kA(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){qA(t);return}return e}function qA(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Ll(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!jA.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(UA.test(t)||FA.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,kA)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function zA(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Er(t,...e){try{return zA(t(...e))}catch(r){return Promise.reject(r)}}function HA(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function KA(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function Bl(t){if(HA(t))return String(t);if(KA(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Bl(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Tm(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Bf="base64:";function WA(t){if(typeof t=="string")return t;Tm();const e=Buffer.from(t).toString("base64");return Bf+e}function VA(t){return typeof t!="string"||!t.startsWith(Bf)?t:(Tm(),Buffer.from(t.slice(Bf.length),"base64"))}function rn(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function GA(...t){return rn(t.join(":"))}function Ul(t){return t=rn(t),t?t+":":""}function wF(t){return t}const YA="memory",QA=()=>{const t=new Map;return{name:YA,options:{},hasItem(e){return t.has(e)},getItem(e){return t.get(e)||null},getItemRaw(e){return t.get(e)||null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return Array.from(t.keys())},clear(){t.clear()},dispose(){t.clear()}}};function JA(t={}){const e={mounts:{"":t.driver||QA()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=h=>{for(const g of e.mountpoints)if(h.startsWith(g))return{base:g,relativeKey:h.slice(g.length),driver:e.mounts[g]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,g)=>e.mountpoints.filter(_=>_.startsWith(h)||g&&h.startsWith(_)).map(_=>({relativeBase:h.length>_.length?h.slice(_.length):void 0,mountpoint:_,driver:e.mounts[_]})),i=(h,g)=>{if(e.watching){g=rn(g);for(const _ of e.watchListeners)_(h,g)}},o=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await Nm(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},l=(h,g,_)=>{const E=new Map,x=I=>{let k=E.get(I.base);return k||(k={driver:I.driver,base:I.base,items:[]},E.set(I.base,k)),k};for(const I of h){const k=typeof I=="string",W=rn(k?I:I.key),Y=k?void 0:I.value,B=k||!I.options?g:{...g,...I.options},z=r(W);x(z).items.push({key:W,value:Y,relativeKey:z.relativeKey,options:B})}return Promise.all([...E.values()].map(I=>_(I))).then(I=>I.flat())},f={hasItem(h,g={}){h=rn(h);const{relativeKey:_,driver:E}=r(h);return Er(E.hasItem,_,g)},getItem(h,g={}){h=rn(h);const{relativeKey:_,driver:E}=r(h);return Er(E.getItem,_,g).then(x=>Ll(x))},getItems(h,g){return l(h,g,_=>_.driver.getItems?Er(_.driver.getItems,_.items.map(E=>({key:E.relativeKey,options:E.options})),g).then(E=>E.map(x=>({key:GA(_.base,x.key),value:Ll(x.value)}))):Promise.all(_.items.map(E=>Er(_.driver.getItem,E.relativeKey,E.options).then(x=>({key:E.key,value:Ll(x)})))))},getItemRaw(h,g={}){h=rn(h);const{relativeKey:_,driver:E}=r(h);return E.getItemRaw?Er(E.getItemRaw,_,g):Er(E.getItem,_,g).then(x=>VA(x))},async setItem(h,g,_={}){if(g===void 0)return f.removeItem(h);h=rn(h);const{relativeKey:E,driver:x}=r(h);x.setItem&&(await Er(x.setItem,E,Bl(g),_),x.watch||i("update",h))},async setItems(h,g){await l(h,g,async _=>{_.driver.setItems&&await Er(_.driver.setItems,_.items.map(E=>({key:E.relativeKey,value:Bl(E.value),options:E.options})),g),_.driver.setItem&&await Promise.all(_.items.map(E=>Er(_.driver.setItem,E.relativeKey,Bl(E.value),E.options)))})},async setItemRaw(h,g,_={}){if(g===void 0)return f.removeItem(h,_);h=rn(h);const{relativeKey:E,driver:x}=r(h);if(x.setItemRaw)await Er(x.setItemRaw,E,g,_);else if(x.setItem)await Er(x.setItem,E,WA(g),_);else return;x.watch||i("update",h)},async removeItem(h,g={}){typeof g=="boolean"&&(g={removeMeta:g}),h=rn(h);const{relativeKey:_,driver:E}=r(h);E.removeItem&&(await Er(E.removeItem,_,g),(g.removeMeta||g.removeMata)&&await Er(E.removeItem,_+"$",g),E.watch||i("remove",h))},async getMeta(h,g={}){typeof g=="boolean"&&(g={nativeOnly:g}),h=rn(h);const{relativeKey:_,driver:E}=r(h),x=Object.create(null);if(E.getMeta&&Object.assign(x,await Er(E.getMeta,_,g)),!g.nativeOnly){const I=await Er(E.getItem,_+"$",g).then(k=>Ll(k));I&&typeof I=="object"&&(typeof I.atime=="string"&&(I.atime=new Date(I.atime)),typeof I.mtime=="string"&&(I.mtime=new Date(I.mtime)),Object.assign(x,I))}return x},setMeta(h,g,_={}){return this.setItem(h+"$",g,_)},removeMeta(h,g={}){return this.removeItem(h+"$",g)},async getKeys(h,g={}){h=Ul(h);const _=n(h,!0);let E=[];const x=[];for(const I of _){const W=(await Er(I.driver.getKeys,I.relativeBase,g)).map(Y=>I.mountpoint+rn(Y)).filter(Y=>!E.some(B=>Y.startsWith(B)));x.push(...W),E=[I.mountpoint,...E.filter(Y=>!Y.startsWith(I.mountpoint))]}return h?x.filter(I=>I.startsWith(h)&&!I.endsWith("$")):x.filter(I=>!I.endsWith("$"))},async clear(h,g={}){h=Ul(h),await Promise.all(n(h,!1).map(async _=>{if(_.driver.clear)return Er(_.driver.clear,_.relativeBase,g);if(_.driver.removeItem){const E=await _.driver.getKeys(_.relativeBase||"",g);return Promise.all(E.map(x=>_.driver.removeItem(x,g)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>Rm(h)))},async watch(h){return await o(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(g=>g!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,g){if(h=Ul(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((_,E)=>E.length-_.length)),e.mounts[h]=g,e.watching&&Promise.resolve(Nm(g,i,h)).then(_=>{e.unwatch[h]=_}).catch(console.error),f},async unmount(h,g=!0){h=Ul(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),g&&await Rm(e.mounts[h]),e.mountpoints=e.mountpoints.filter(_=>_!==h),delete e.mounts[h])},getMount(h=""){h=rn(h)+":";const g=r(h);return{driver:g.driver,base:g.base}},getMounts(h="",g={}){return h=rn(h),n(h,g.parents).map(E=>({driver:E.driver,base:E.mountpoint}))}};return f}function Nm(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function Rm(t){typeof t.dispose=="function"&&await Er(t.dispose)}function Vs(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Lm(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Vs(r);return(i,o)=>n.then(c=>o(c.transaction(e,i).objectStore(e)))}let Uf;function cc(){return Uf||(Uf=Lm("keyval-store","keyval")),Uf}function Bm(t,e=cc()){return e("readonly",r=>Vs(r.get(t)))}function ZA(t,e,r=cc()){return r("readwrite",n=>(n.put(e,t),Vs(n.transaction)))}function XA(t,e=cc()){return e("readwrite",r=>(r.delete(t),Vs(r.transaction)))}function e7(t=cc()){return t("readwrite",e=>(e.clear(),Vs(e.transaction)))}function t7(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Vs(t.transaction)}function r7(t=cc()){return t("readonly",e=>{if(e.getAllKeys)return Vs(e.getAllKeys());const r=[];return t7(e,n=>r.push(n.key)).then(()=>r)})}const n7=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),i7=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function lc(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return i7(t)}catch{return t}}function ki(t){return typeof t=="string"?t:n7(t)||""}const s7="idb-keyval";var o7=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Lm(t.dbName,t.storeName)),{name:s7,options:t,async hasItem(i){return!(typeof await Bm(r(i),n)>"u")},async getItem(i){return await Bm(r(i),n)??null},setItem(i,o){return ZA(r(i),o,n)},removeItem(i){return XA(r(i),n)},getKeys(){return r7(n)},clear(){return e7(n)}}};const a7="WALLET_CONNECT_V2_INDEXED_DB",c7="keyvaluestorage";class l7{constructor(){this.indexedDb=JA({driver:o7({dbName:a7,storeName:c7})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,ki(r))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Ff=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fl={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ff<"u"&&Ff.localStorage?Fl.exports=Ff.localStorage:typeof window<"u"&&window.localStorage?Fl.exports=window.localStorage:Fl.exports=new e})();function u7(t){var e;return[t[0],lc((e=t[1])!=null?e:"")]}class h7{constructor(){this.localStorage=Fl.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(u7)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return lc(r)}async setItem(e,r){this.localStorage.setItem(e,ki(r))}async removeItem(e){this.localStorage.removeItem(e)}}const f7="wc_storage_version",Um=1,d7=async(t,e,r)=>{const n=f7,i=await e.getItem(n);if(i&&i>=Um){r(e);return}const o=await t.getKeys();if(!o.length){r(e);return}const c=[];for(;o.length;){const l=o.shift();if(!l)continue;const f=l.toLowerCase();if(f.includes("wc@")||f.includes("walletconnect")||f.includes("wc_")||f.includes("wallet_connect")){const h=await t.getItem(l);await e.setItem(l,h),c.push(l)}}await e.setItem(n,Um),r(e),p7(t,c)},p7=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class g7{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new h7;this.storage=e;try{const r=new l7;d7(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}}class Gs{}class m7 extends Gs{constructor(e){super()}}const Fm=ye.FIVE_SECONDS,uc={pulse:"heartbeat_pulse"};class jf extends m7{constructor(e){super(e),this.events=new Dr.exports.EventEmitter,this.interval=Fm,this.interval=e?.interval||Fm}static async init(e){const r=new jf(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ye.toMiliseconds(this.interval))}pulse(){this.events.emit(uc.pulse)}}function v7(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var w7=y7;function y7(t,e,r){var n=r&&r.stringify||v7,i=1;if(typeof t=="object"&&t!==null){var o=e.length+i;if(o===1)return t;var c=new Array(o);c[0]=n(t);for(var l=1;l<o;l++)c[l]=n(e[l]);return c.join(" ")}if(typeof t!="string")return t;var f=e.length;if(f===0)return t;for(var h="",g=1-i,_=-1,E=t&&t.length||0,x=0;x<E;){if(t.charCodeAt(x)===37&&x+1<E){switch(_=_>-1?_:0,t.charCodeAt(x+1)){case 100:case 102:if(g>=f||e[g]==null)break;_<x&&(h+=t.slice(_,x)),h+=Number(e[g]),_=x+2,x++;break;case 105:if(g>=f||e[g]==null)break;_<x&&(h+=t.slice(_,x)),h+=Math.floor(Number(e[g])),_=x+2,x++;break;case 79:case 111:case 106:if(g>=f||e[g]===void 0)break;_<x&&(h+=t.slice(_,x));var I=typeof e[g];if(I==="string"){h+="'"+e[g]+"'",_=x+2,x++;break}if(I==="function"){h+=e[g].name||"<anonymous>",_=x+2,x++;break}h+=n(e[g]),_=x+2,x++;break;case 115:if(g>=f)break;_<x&&(h+=t.slice(_,x)),h+=String(e[g]),_=x+2,x++;break;case 37:_<x&&(h+=t.slice(_,x)),h+="%",_=x+2,x++,g--;break}++g}++x}return _===-1?t:(_<E&&(h+=t.slice(_)),h)}const jm=w7;var yi=bi;const hc=O7().console||{},b7={mapHttpRequest:kl,mapHttpResponse:kl,wrapRequestSerializer:qf,wrapResponseSerializer:qf,wrapErrorSerializer:qf,req:kl,res:kl,err:S7};function _7(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function bi(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||hc;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=_7(t.browser.serialize,n);let o=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const c=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const l=t.level||"info",f=Object.create(r);f.log||(f.log=fc),Object.defineProperty(f,"levelVal",{get:g}),Object.defineProperty(f,"level",{get:_,set:E});const h={transmit:e,serialize:i,asObject:t.browser.asObject,levels:c,timestamp:I7(t)};f.levels=bi.levels,f.level=l,f.setMaxListeners=f.getMaxListeners=f.emit=f.addListener=f.on=f.prependListener=f.once=f.prependOnceListener=f.removeListener=f.removeAllListeners=f.listeners=f.listenerCount=f.eventNames=f.write=f.flush=fc,f.serializers=n,f._serialize=i,f._stdErrSerialize=o,f.child=x,e&&(f._logEvent=kf());function g(){return this.level==="silent"?1/0:this.levels.values[this.level]}function _(){return this._level}function E(I){if(I!=="silent"&&!this.levels.values[I])throw Error("unknown level "+I);this._level=I,Xo(h,f,"error","log"),Xo(h,f,"fatal","error"),Xo(h,f,"warn","error"),Xo(h,f,"info","log"),Xo(h,f,"debug","log"),Xo(h,f,"trace","log")}function x(I,k){if(!I)throw new Error("missing bindings for child Pino");k=k||{},i&&I.serializers&&(k.serializers=I.serializers);const W=k.serializers;if(i&&W){var Y=Object.assign({},n,W),B=t.browser.serialize===!0?Object.keys(Y):i;delete I.serializers,jl([I],B,Y,this._stdErrSerialize)}function z(M){this._childLevel=(M._childLevel|0)+1,this.error=ea(M,I,"error"),this.fatal=ea(M,I,"fatal"),this.warn=ea(M,I,"warn"),this.info=ea(M,I,"info"),this.debug=ea(M,I,"debug"),this.trace=ea(M,I,"trace"),Y&&(this.serializers=Y,this._serialize=B),e&&(this._logEvent=kf([].concat(M._logEvent.bindings,I)))}return z.prototype=this,new z(this)}return f}bi.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},bi.stdSerializers=b7,bi.stdTimeFunctions=Object.assign({},{nullTime:km,epochTime:qm,unixTime:D7,isoTime:C7});function Xo(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?fc:i[r]?i[r]:hc[r]||hc[n]||fc,E7(t,e,r)}function E7(t,e,r){!t.transmit&&e[r]===fc||(e[r]=function(n){return function(){const o=t.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===hc?hc:this;for(var f=0;f<c.length;f++)c[f]=arguments[f];if(t.serialize&&!t.asObject&&jl(c,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(l,A7(this,r,c,o)):n.apply(l,c),t.transmit){const h=t.transmit.level||e.level,g=bi.levels.values[h],_=bi.levels.values[r];if(_<g)return;x7(this,{ts:o,methodLevel:r,methodValue:_,transmitLevel:h,transmitValue:bi.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},c)}}}(e[r]))}function A7(t,e,r,n){t._serialize&&jl(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let o=i[0];const c={};n&&(c.time=n),c.level=bi.levels.values[e];let l=(t._childLevel|0)+1;if(l<1&&(l=1),o!==null&&typeof o=="object"){for(;l--&&typeof i[0]=="object";)Object.assign(c,i.shift());o=i.length?jm(i.shift(),i):void 0}else typeof o=="string"&&(o=jm(i.shift(),i));return o!==void 0&&(c.msg=o),c}function jl(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=bi.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i]))for(const o in t[i])e&&e.indexOf(o)>-1&&o in r&&(t[i][o]=r[o](t[i][o]))}function ea(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return t[r].apply(this,n)}}function x7(t,e,r){const n=e.send,i=e.ts,o=e.methodLevel,c=e.methodValue,l=e.val,f=t._logEvent.bindings;jl(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=i,t._logEvent.messages=r.filter(function(h){return f.indexOf(h)===-1}),t._logEvent.level.label=o,t._logEvent.level.value=c,n(o,t._logEvent,l),t._logEvent=kf(f)}function kf(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function S7(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function I7(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?km:qm}function kl(){return{}}function qf(t){return t}function fc(){}function km(){return!1}function qm(){return Date.now()}function D7(){return Math.round(Date.now()/1e3)}function C7(){return new Date(Date.now()).toISOString()}function O7(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}const M7={level:"info"},dc="custom_context",zf=1e3*1024;class P7{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class zm{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new P7(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}}class Hm{constructor(e,r=zf){this.level=e??"error",this.levelValue=yi.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new zm(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===yi.levels.values.error?console.error(e):r===yi.levels.values.warn?console.warn(e):r===yi.levels.values.debug?console.debug(e):r===yi.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ki({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new zm(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(ki({extraMetadata:e})),new Blob(r,{type:"application/json"})}}class $7{constructor(e,r=zf){this.baseChunkLogger=new Hm(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class T7{constructor(e,r=zf){this.baseChunkLogger=new Hm(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var N7=Object.defineProperty,R7=Object.defineProperties,L7=Object.getOwnPropertyDescriptors,Km=Object.getOwnPropertySymbols,B7=Object.prototype.hasOwnProperty,U7=Object.prototype.propertyIsEnumerable,Wm=(t,e,r)=>e in t?N7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ql=(t,e)=>{for(var r in e||(e={}))B7.call(e,r)&&Wm(t,r,e[r]);if(Km)for(var r of Km(e))U7.call(e,r)&&Wm(t,r,e[r]);return t},zl=(t,e)=>R7(t,L7(e));function Hl(t){return zl(ql({},t),{level:t?.level||M7.level})}function F7(t,e=dc){return t[e]||""}function j7(t,e,r=dc){return t[r]=e,t}function nn(t,e=dc){let r="";return typeof t.bindings>"u"?r=F7(t,e):r=t.bindings().context||"",r}function k7(t,e,r=dc){const n=nn(t,r);return n.trim()?`${n}/${e}`:e}function sn(t,e,r=dc){const n=k7(t,e,r),i=t.child({context:n});return j7(i,n,r)}function q7(t){var e,r;const n=new $7((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:yi(zl(ql({},t.opts),{level:"trace",browser:zl(ql({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function z7(t){var e;const r=new T7((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:yi(zl(ql({},t.opts),{level:"trace"})),chunkLoggerController:r}}function H7(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?q7(t):z7(t)}class K7 extends Gs{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class W7 extends Gs{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class V7{constructor(e,r){this.logger=e,this.core=r}}class G7 extends Gs{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Y7 extends Gs{constructor(e){super()}}class Q7{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class J7 extends Gs{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Z7 extends Gs{constructor(e,r){super(),this.core=e,this.logger=r}}class X7{constructor(e,r){this.projectId=e,this.logger=r}}class ex{constructor(e,r){this.projectId=e,this.logger=r}}class tx{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class rx{constructor(e){this.client=e}}var Hf={},Vm={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ct,r=pn;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var g=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[g++],h--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(g=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,g,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[g++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,g=this._bufferLength,_=h/536870912|0,E=h<<3,x=h%128<112?128:256;this._buffer[g]=128;for(var I=g+1;I<x-8;I++)this._buffer[I]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(E,this._buffer,x-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var I=0;I<this.digestLength/8;I++)e.writeUint32BE(this._stateHi[I],f,I*8),e.writeUint32BE(this._stateLo[I],f,I*8+4);return this},l.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(f){return this._stateHi.set(f.stateHi),this._stateLo.set(f.stateLo),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(f){r.wipe(f.stateHi),r.wipe(f.stateLo),f.buffer&&r.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},l}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(l,f,h,g,_,E,x){for(var I=h[0],k=h[1],W=h[2],Y=h[3],B=h[4],z=h[5],M=h[6],U=h[7],F=g[0],m=g[1],$=g[2],te=g[3],ee=g[4],ne=g[5],de=g[6],d=g[7],p,b,D,O,T,L,C,v;x>=128;){for(var N=0;N<16;N++){var oe=8*N+E;l[N]=e.readUint32BE(_,oe),f[N]=e.readUint32BE(_,oe+4)}for(var N=0;N<80;N++){var pe=I,A=k,re=W,q=Y,H=B,V=z,w=M,j=U,ie=F,he=m,le=$,Oe=te,Pe=ee,Ie=ne,Mt=de,ze=d;if(p=U,b=d,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=(B>>>14|ee<<32-14)^(B>>>18|ee<<32-18)^(ee>>>41-32|B<<32-(41-32)),b=(ee>>>14|B<<32-14)^(ee>>>18|B<<32-18)^(B>>>41-32|ee<<32-(41-32)),T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,p=B&z^~B&M,b=ee&ne^~ee&de,T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,p=i[N*2],b=i[N*2+1],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,p=l[N%16],b=f[N%16],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,D=C&65535|v<<16,O=T&65535|L<<16,p=D,b=O,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=(I>>>28|F<<32-28)^(F>>>34-32|I<<32-(34-32))^(F>>>39-32|I<<32-(39-32)),b=(F>>>28|I<<32-28)^(I>>>34-32|F<<32-(34-32))^(I>>>39-32|F<<32-(39-32)),T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,p=I&k^I&W^k&W,b=F&m^F&$^m&$,T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,j=C&65535|v<<16,ze=T&65535|L<<16,p=q,b=Oe,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=D,b=O,T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,q=C&65535|v<<16,Oe=T&65535|L<<16,k=pe,W=A,Y=re,B=q,z=H,M=V,U=w,I=j,m=ie,$=he,te=le,ee=Oe,ne=Pe,de=Ie,d=Mt,F=ze,N%16===15)for(var oe=0;oe<16;oe++)p=l[oe],b=f[oe],T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=l[(oe+9)%16],b=f[(oe+9)%16],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,D=l[(oe+1)%16],O=f[(oe+1)%16],p=(D>>>1|O<<32-1)^(D>>>8|O<<32-8)^D>>>7,b=(O>>>1|D<<32-1)^(O>>>8|D<<32-8)^(O>>>7|D<<32-7),T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,D=l[(oe+14)%16],O=f[(oe+14)%16],p=(D>>>19|O<<32-19)^(O>>>61-32|D<<32-(61-32))^D>>>6,b=(O>>>19|D<<32-19)^(D>>>61-32|O<<32-(61-32))^(O>>>6|D<<32-6),T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,l[oe]=C&65535|v<<16,f[oe]=T&65535|L<<16}p=I,b=F,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[0],b=g[0],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[0]=I=C&65535|v<<16,g[0]=F=T&65535|L<<16,p=k,b=m,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[1],b=g[1],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[1]=k=C&65535|v<<16,g[1]=m=T&65535|L<<16,p=W,b=$,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[2],b=g[2],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[2]=W=C&65535|v<<16,g[2]=$=T&65535|L<<16,p=Y,b=te,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[3],b=g[3],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[3]=Y=C&65535|v<<16,g[3]=te=T&65535|L<<16,p=B,b=ee,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[4],b=g[4],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[4]=B=C&65535|v<<16,g[4]=ee=T&65535|L<<16,p=z,b=ne,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[5],b=g[5],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[5]=z=C&65535|v<<16,g[5]=ne=T&65535|L<<16,p=M,b=de,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[6],b=g[6],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[6]=M=C&65535|v<<16,g[6]=de=T&65535|L<<16,p=U,b=d,T=b&65535,L=b>>>16,C=p&65535,v=p>>>16,p=h[7],b=g[7],T+=b&65535,L+=b>>>16,C+=p&65535,v+=p>>>16,L+=T>>>16,C+=L>>>16,v+=C>>>16,h[7]=U=C&65535|v<<16,g[7]=d=T&65535|L<<16,E+=128,x-=128}return E}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}t.hash=c})(Vm),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Lo,r=Vm,n=pn;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(q){const H=new Float64Array(16);if(q)for(let V=0;V<q.length;V++)H[V]=q[V];return H}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),f=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),E=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(q,H){for(let V=0;V<16;V++)q[V]=H[V]|0}function I(q){let H=1;for(let V=0;V<16;V++){let w=q[V]+H+65535;H=Math.floor(w/65536),q[V]=w-H*65536}q[0]+=H-1+37*(H-1)}function k(q,H,V){const w=~(V-1);for(let j=0;j<16;j++){const ie=w&(q[j]^H[j]);q[j]^=ie,H[j]^=ie}}function W(q,H){const V=i(),w=i();for(let j=0;j<16;j++)w[j]=H[j];I(w),I(w),I(w);for(let j=0;j<2;j++){V[0]=w[0]-65517;for(let he=1;he<15;he++)V[he]=w[he]-65535-(V[he-1]>>16&1),V[he-1]&=65535;V[15]=w[15]-32767-(V[14]>>16&1);const ie=V[15]>>16&1;V[14]&=65535,k(w,V,1-ie)}for(let j=0;j<16;j++)q[2*j]=w[j]&255,q[2*j+1]=w[j]>>8}function Y(q,H){let V=0;for(let w=0;w<32;w++)V|=q[w]^H[w];return(1&V-1>>>8)-1}function B(q,H){const V=new Uint8Array(32),w=new Uint8Array(32);return W(V,q),W(w,H),Y(V,w)}function z(q){const H=new Uint8Array(32);return W(H,q),H[0]&1}function M(q,H){for(let V=0;V<16;V++)q[V]=H[2*V]+(H[2*V+1]<<8);q[15]&=32767}function U(q,H,V){for(let w=0;w<16;w++)q[w]=H[w]+V[w]}function F(q,H,V){for(let w=0;w<16;w++)q[w]=H[w]-V[w]}function m(q,H,V){let w,j,ie=0,he=0,le=0,Oe=0,Pe=0,Ie=0,Mt=0,ze=0,Ce=0,Fe=0,Ee=0,Ae=0,Ge=0,be=0,xe=0,Be=0,_e=0,Me=0,je=0,$e=0,Te=0,lt=0,Re=0,Ne=0,nr=0,dt=0,Et=0,ir=0,St=0,Ot=0,Vr=0,Ye=V[0],He=V[1],Rt=V[2],Qe=V[3],Ve=V[4],Pt=V[5],Xe=V[6],et=V[7],Lt=V[8],tt=V[9],Je=V[10],Ft=V[11],Ze=V[12],ke=V[13],Ht=V[14],rt=V[15];w=H[0],ie+=w*Ye,he+=w*He,le+=w*Rt,Oe+=w*Qe,Pe+=w*Ve,Ie+=w*Pt,Mt+=w*Xe,ze+=w*et,Ce+=w*Lt,Fe+=w*tt,Ee+=w*Je,Ae+=w*Ft,Ge+=w*Ze,be+=w*ke,xe+=w*Ht,Be+=w*rt,w=H[1],he+=w*Ye,le+=w*He,Oe+=w*Rt,Pe+=w*Qe,Ie+=w*Ve,Mt+=w*Pt,ze+=w*Xe,Ce+=w*et,Fe+=w*Lt,Ee+=w*tt,Ae+=w*Je,Ge+=w*Ft,be+=w*Ze,xe+=w*ke,Be+=w*Ht,_e+=w*rt,w=H[2],le+=w*Ye,Oe+=w*He,Pe+=w*Rt,Ie+=w*Qe,Mt+=w*Ve,ze+=w*Pt,Ce+=w*Xe,Fe+=w*et,Ee+=w*Lt,Ae+=w*tt,Ge+=w*Je,be+=w*Ft,xe+=w*Ze,Be+=w*ke,_e+=w*Ht,Me+=w*rt,w=H[3],Oe+=w*Ye,Pe+=w*He,Ie+=w*Rt,Mt+=w*Qe,ze+=w*Ve,Ce+=w*Pt,Fe+=w*Xe,Ee+=w*et,Ae+=w*Lt,Ge+=w*tt,be+=w*Je,xe+=w*Ft,Be+=w*Ze,_e+=w*ke,Me+=w*Ht,je+=w*rt,w=H[4],Pe+=w*Ye,Ie+=w*He,Mt+=w*Rt,ze+=w*Qe,Ce+=w*Ve,Fe+=w*Pt,Ee+=w*Xe,Ae+=w*et,Ge+=w*Lt,be+=w*tt,xe+=w*Je,Be+=w*Ft,_e+=w*Ze,Me+=w*ke,je+=w*Ht,$e+=w*rt,w=H[5],Ie+=w*Ye,Mt+=w*He,ze+=w*Rt,Ce+=w*Qe,Fe+=w*Ve,Ee+=w*Pt,Ae+=w*Xe,Ge+=w*et,be+=w*Lt,xe+=w*tt,Be+=w*Je,_e+=w*Ft,Me+=w*Ze,je+=w*ke,$e+=w*Ht,Te+=w*rt,w=H[6],Mt+=w*Ye,ze+=w*He,Ce+=w*Rt,Fe+=w*Qe,Ee+=w*Ve,Ae+=w*Pt,Ge+=w*Xe,be+=w*et,xe+=w*Lt,Be+=w*tt,_e+=w*Je,Me+=w*Ft,je+=w*Ze,$e+=w*ke,Te+=w*Ht,lt+=w*rt,w=H[7],ze+=w*Ye,Ce+=w*He,Fe+=w*Rt,Ee+=w*Qe,Ae+=w*Ve,Ge+=w*Pt,be+=w*Xe,xe+=w*et,Be+=w*Lt,_e+=w*tt,Me+=w*Je,je+=w*Ft,$e+=w*Ze,Te+=w*ke,lt+=w*Ht,Re+=w*rt,w=H[8],Ce+=w*Ye,Fe+=w*He,Ee+=w*Rt,Ae+=w*Qe,Ge+=w*Ve,be+=w*Pt,xe+=w*Xe,Be+=w*et,_e+=w*Lt,Me+=w*tt,je+=w*Je,$e+=w*Ft,Te+=w*Ze,lt+=w*ke,Re+=w*Ht,Ne+=w*rt,w=H[9],Fe+=w*Ye,Ee+=w*He,Ae+=w*Rt,Ge+=w*Qe,be+=w*Ve,xe+=w*Pt,Be+=w*Xe,_e+=w*et,Me+=w*Lt,je+=w*tt,$e+=w*Je,Te+=w*Ft,lt+=w*Ze,Re+=w*ke,Ne+=w*Ht,nr+=w*rt,w=H[10],Ee+=w*Ye,Ae+=w*He,Ge+=w*Rt,be+=w*Qe,xe+=w*Ve,Be+=w*Pt,_e+=w*Xe,Me+=w*et,je+=w*Lt,$e+=w*tt,Te+=w*Je,lt+=w*Ft,Re+=w*Ze,Ne+=w*ke,nr+=w*Ht,dt+=w*rt,w=H[11],Ae+=w*Ye,Ge+=w*He,be+=w*Rt,xe+=w*Qe,Be+=w*Ve,_e+=w*Pt,Me+=w*Xe,je+=w*et,$e+=w*Lt,Te+=w*tt,lt+=w*Je,Re+=w*Ft,Ne+=w*Ze,nr+=w*ke,dt+=w*Ht,Et+=w*rt,w=H[12],Ge+=w*Ye,be+=w*He,xe+=w*Rt,Be+=w*Qe,_e+=w*Ve,Me+=w*Pt,je+=w*Xe,$e+=w*et,Te+=w*Lt,lt+=w*tt,Re+=w*Je,Ne+=w*Ft,nr+=w*Ze,dt+=w*ke,Et+=w*Ht,ir+=w*rt,w=H[13],be+=w*Ye,xe+=w*He,Be+=w*Rt,_e+=w*Qe,Me+=w*Ve,je+=w*Pt,$e+=w*Xe,Te+=w*et,lt+=w*Lt,Re+=w*tt,Ne+=w*Je,nr+=w*Ft,dt+=w*Ze,Et+=w*ke,ir+=w*Ht,St+=w*rt,w=H[14],xe+=w*Ye,Be+=w*He,_e+=w*Rt,Me+=w*Qe,je+=w*Ve,$e+=w*Pt,Te+=w*Xe,lt+=w*et,Re+=w*Lt,Ne+=w*tt,nr+=w*Je,dt+=w*Ft,Et+=w*Ze,ir+=w*ke,St+=w*Ht,Ot+=w*rt,w=H[15],Be+=w*Ye,_e+=w*He,Me+=w*Rt,je+=w*Qe,$e+=w*Ve,Te+=w*Pt,lt+=w*Xe,Re+=w*et,Ne+=w*Lt,nr+=w*tt,dt+=w*Je,Et+=w*Ft,ir+=w*Ze,St+=w*ke,Ot+=w*Ht,Vr+=w*rt,ie+=38*_e,he+=38*Me,le+=38*je,Oe+=38*$e,Pe+=38*Te,Ie+=38*lt,Mt+=38*Re,ze+=38*Ne,Ce+=38*nr,Fe+=38*dt,Ee+=38*Et,Ae+=38*ir,Ge+=38*St,be+=38*Ot,xe+=38*Vr,j=1,w=ie+j+65535,j=Math.floor(w/65536),ie=w-j*65536,w=he+j+65535,j=Math.floor(w/65536),he=w-j*65536,w=le+j+65535,j=Math.floor(w/65536),le=w-j*65536,w=Oe+j+65535,j=Math.floor(w/65536),Oe=w-j*65536,w=Pe+j+65535,j=Math.floor(w/65536),Pe=w-j*65536,w=Ie+j+65535,j=Math.floor(w/65536),Ie=w-j*65536,w=Mt+j+65535,j=Math.floor(w/65536),Mt=w-j*65536,w=ze+j+65535,j=Math.floor(w/65536),ze=w-j*65536,w=Ce+j+65535,j=Math.floor(w/65536),Ce=w-j*65536,w=Fe+j+65535,j=Math.floor(w/65536),Fe=w-j*65536,w=Ee+j+65535,j=Math.floor(w/65536),Ee=w-j*65536,w=Ae+j+65535,j=Math.floor(w/65536),Ae=w-j*65536,w=Ge+j+65535,j=Math.floor(w/65536),Ge=w-j*65536,w=be+j+65535,j=Math.floor(w/65536),be=w-j*65536,w=xe+j+65535,j=Math.floor(w/65536),xe=w-j*65536,w=Be+j+65535,j=Math.floor(w/65536),Be=w-j*65536,ie+=j-1+37*(j-1),j=1,w=ie+j+65535,j=Math.floor(w/65536),ie=w-j*65536,w=he+j+65535,j=Math.floor(w/65536),he=w-j*65536,w=le+j+65535,j=Math.floor(w/65536),le=w-j*65536,w=Oe+j+65535,j=Math.floor(w/65536),Oe=w-j*65536,w=Pe+j+65535,j=Math.floor(w/65536),Pe=w-j*65536,w=Ie+j+65535,j=Math.floor(w/65536),Ie=w-j*65536,w=Mt+j+65535,j=Math.floor(w/65536),Mt=w-j*65536,w=ze+j+65535,j=Math.floor(w/65536),ze=w-j*65536,w=Ce+j+65535,j=Math.floor(w/65536),Ce=w-j*65536,w=Fe+j+65535,j=Math.floor(w/65536),Fe=w-j*65536,w=Ee+j+65535,j=Math.floor(w/65536),Ee=w-j*65536,w=Ae+j+65535,j=Math.floor(w/65536),Ae=w-j*65536,w=Ge+j+65535,j=Math.floor(w/65536),Ge=w-j*65536,w=be+j+65535,j=Math.floor(w/65536),be=w-j*65536,w=xe+j+65535,j=Math.floor(w/65536),xe=w-j*65536,w=Be+j+65535,j=Math.floor(w/65536),Be=w-j*65536,ie+=j-1+37*(j-1),q[0]=ie,q[1]=he,q[2]=le,q[3]=Oe,q[4]=Pe,q[5]=Ie,q[6]=Mt,q[7]=ze,q[8]=Ce,q[9]=Fe,q[10]=Ee,q[11]=Ae,q[12]=Ge,q[13]=be,q[14]=xe,q[15]=Be}function $(q,H){m(q,H,H)}function te(q,H){const V=i();let w;for(w=0;w<16;w++)V[w]=H[w];for(w=253;w>=0;w--)$(V,V),w!==2&&w!==4&&m(V,V,H);for(w=0;w<16;w++)q[w]=V[w]}function ee(q,H){const V=i();let w;for(w=0;w<16;w++)V[w]=H[w];for(w=250;w>=0;w--)$(V,V),w!==1&&m(V,V,H);for(w=0;w<16;w++)q[w]=V[w]}function ne(q,H){const V=i(),w=i(),j=i(),ie=i(),he=i(),le=i(),Oe=i(),Pe=i(),Ie=i();F(V,q[1],q[0]),F(Ie,H[1],H[0]),m(V,V,Ie),U(w,q[0],q[1]),U(Ie,H[0],H[1]),m(w,w,Ie),m(j,q[3],H[3]),m(j,j,h),m(ie,q[2],H[2]),U(ie,ie,ie),F(he,w,V),F(le,ie,j),U(Oe,ie,j),U(Pe,w,V),m(q[0],he,le),m(q[1],Pe,Oe),m(q[2],Oe,le),m(q[3],he,Pe)}function de(q,H,V){for(let w=0;w<4;w++)k(q[w],H[w],V)}function d(q,H){const V=i(),w=i(),j=i();te(j,H[2]),m(V,H[0],j),m(w,H[1],j),W(q,w),q[31]^=z(V)<<7}function p(q,H,V){x(q[0],c),x(q[1],l),x(q[2],l),x(q[3],c);for(let w=255;w>=0;--w){const j=V[w/8|0]>>(w&7)&1;de(q,H,j),ne(H,q),ne(q,q),de(q,H,j)}}function b(q,H){const V=[i(),i(),i(),i()];x(V[0],g),x(V[1],_),x(V[2],l),m(V[3],g,_),p(q,V,H)}function D(q){if(q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const H=(0,r.hash)(q);H[0]&=248,H[31]&=127,H[31]|=64;const V=new Uint8Array(32),w=[i(),i(),i(),i()];b(w,H),d(V,w);const j=new Uint8Array(64);return j.set(q),j.set(V,32),{publicKey:V,secretKey:j}}t.generateKeyPairFromSeed=D;function O(q){const H=(0,e.randomBytes)(32,q),V=D(H);return(0,n.wipe)(H),V}t.generateKeyPair=O;function T(q){if(q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(q.subarray(32))}t.extractPublicKeyFromSecretKey=T;const L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function C(q,H){let V,w,j,ie;for(w=63;w>=32;--w){for(V=0,j=w-32,ie=w-12;j<ie;++j)H[j]+=V-16*H[w]*L[j-(w-32)],V=Math.floor((H[j]+128)/256),H[j]-=V*256;H[j]+=V,H[w]=0}for(V=0,j=0;j<32;j++)H[j]+=V-(H[31]>>4)*L[j],V=H[j]>>8,H[j]&=255;for(j=0;j<32;j++)H[j]-=V*L[j];for(w=0;w<32;w++)H[w+1]+=H[w]>>8,q[w]=H[w]&255}function v(q){const H=new Float64Array(64);for(let V=0;V<64;V++)H[V]=q[V];for(let V=0;V<64;V++)q[V]=0;C(q,H)}function N(q,H){const V=new Float64Array(64),w=[i(),i(),i(),i()],j=(0,r.hash)(q.subarray(0,32));j[0]&=248,j[31]&=127,j[31]|=64;const ie=new Uint8Array(64);ie.set(j.subarray(32),32);const he=new r.SHA512;he.update(ie.subarray(32)),he.update(H);const le=he.digest();he.clean(),v(le),b(w,le),d(ie,w),he.reset(),he.update(ie.subarray(0,32)),he.update(q.subarray(32)),he.update(H);const Oe=he.digest();v(Oe);for(let Pe=0;Pe<32;Pe++)V[Pe]=le[Pe];for(let Pe=0;Pe<32;Pe++)for(let Ie=0;Ie<32;Ie++)V[Pe+Ie]+=Oe[Pe]*j[Ie];return C(ie.subarray(32),V),ie}t.sign=N;function oe(q,H){const V=i(),w=i(),j=i(),ie=i(),he=i(),le=i(),Oe=i();return x(q[2],l),M(q[1],H),$(j,q[1]),m(ie,j,f),F(j,j,q[2]),U(ie,q[2],ie),$(he,ie),$(le,he),m(Oe,le,he),m(V,Oe,j),m(V,V,ie),ee(V,V),m(V,V,j),m(V,V,ie),m(V,V,ie),m(q[0],V,ie),$(w,q[0]),m(w,w,ie),B(w,j)&&m(q[0],q[0],E),$(w,q[0]),m(w,w,ie),B(w,j)?-1:(z(q[0])===H[31]>>7&&F(q[0],c,q[0]),m(q[3],q[0],q[1]),0)}function pe(q,H,V){const w=new Uint8Array(32),j=[i(),i(),i(),i()],ie=[i(),i(),i(),i()];if(V.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(oe(ie,q))return!1;const he=new r.SHA512;he.update(V.subarray(0,32)),he.update(q),he.update(H);const le=he.digest();return v(le),p(j,ie,le),b(ie,V.subarray(32)),ne(j,ie),d(w,j),!Y(V,w)}t.verify=pe;function A(q){let H=[i(),i(),i(),i()];if(oe(H,q))throw new Error("Ed25519: invalid public key");let V=i(),w=i(),j=H[1];U(V,l,j),F(w,l,j),te(w,w),m(V,V,w);let ie=new Uint8Array(32);return W(ie,V),ie}t.convertPublicKeyToX25519=A;function re(q){const H=(0,r.hash)(q.subarray(0,32));H[0]&=248,H[31]&=127,H[31]|=64;const V=new Uint8Array(H.subarray(0,32));return(0,n.wipe)(H),V}t.convertSecretKeyToX25519=re}(Hf);const nx="EdDSA",ix="JWT",Gm=".",Ym="base64url",sx="utf8",ox="utf8",ax=":",cx="did",lx="key",Qm="base58btc",ux="z",hx="K36",fx=32;function Kf(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Jm(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Kf(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function dx(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Jm(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return Kf(r)}function Zm(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Xm=Zm("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Wf=Zm("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Jm(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),ev={utf8:Xm,"utf-8":Xm,hex:Bo.base16,latin1:Wf,ascii:Wf,binary:Wf,...Bo};function Vf(t,e="utf8"){const r=ev[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function Gf(t,e="utf8"){const r=ev[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Kf(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Kl(t){return Vf(Gf(ki(t),sx),Ym)}function tv(t){const e=Gf(hx,Qm),r=ux+Vf(dx([e,t]),Qm);return[cx,lx,r].join(ax)}function px(t){return Vf(t,Ym)}function gx(t){return Gf([Kl(t.header),Kl(t.payload)].join(Gm),ox)}function mx(t){return[Kl(t.header),Kl(t.payload),px(t.signature)].join(Gm)}function rv(t=Lo.randomBytes(fx)){return Hf.generateKeyPairFromSeed(t)}async function vx(t,e,r,n,i=ye.fromMiliseconds(Date.now())){const o={alg:nx,typ:ix},c=tv(n.publicKey),l=i+r,f={iss:c,sub:t,aud:e,iat:i,exp:l},h=gx({header:o,payload:f}),g=Hf.sign(n.secretKey,h);return mx({header:o,payload:f,signature:g})}function wx(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function nv(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const iv=nv("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Yf=nv("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=wx(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),yx={utf8:iv,"utf-8":iv,hex:Bo.base16,latin1:Yf,ascii:Yf,binary:Yf,...Bo};function bx(t,e="utf8"){const r=yx[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const _x="PARSE_ERROR",Ex="INVALID_REQUEST",Ax="METHOD_NOT_FOUND",xx="INVALID_PARAMS",sv="INTERNAL_ERROR",Qf="SERVER_ERROR",Sx=[-32700,-32600,-32601,-32602,-32603],pc={[_x]:{code:-32700,message:"Parse error"},[Ex]:{code:-32600,message:"Invalid Request"},[Ax]:{code:-32601,message:"Method not found"},[xx]:{code:-32602,message:"Invalid params"},[sv]:{code:-32603,message:"Internal error"},[Qf]:{code:-32e3,message:"Server error"}},ov=Qf;function Ix(t){return Sx.includes(t)}function av(t){return Object.keys(pc).includes(t)?pc[t]:pc[ov]}function Dx(t){const e=Object.values(pc).find(r=>r.code===t);return e||pc[ov]}function cv(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var lv={};/*! *****************************************************************************
|
|
30
|
+
Approved: ${E.toString()}`))}),c.forEach(_=>{n||(zs(i[_].methods,o[_].methods)?zs(i[_].events,o[_].events)||(n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${_}`)):n=me("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${_}`))}),n}function lx(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function ev(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function ux(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=ea(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(o=>o.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function hx(t,e){return Wf(t,!1)&&t<=e.max&&t>=e.min}function tv(){const t=Za();return new Promise(e=>{switch(t){case gn.browser:e(fx());break;case gn.reactNative:e(dx());break;case gn.node:e(px());break;default:e(!0)}})}function fx(){return ko()&&navigator?.onLine}async function dx(){if(jo()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function px(){return!0}function gx(t){switch(Za()){case gn.browser:mx(t);break;case gn.reactNative:vx(t);break}}function mx(t){!jo()&&ko()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function vx(t){jo()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Gf={};class fc{static get(e){return Gf[e]}static set(e,r){Gf[e]=r}static delete(e){delete Gf[e]}}function wx(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function rv(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const nv=rv("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Yf=rv("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=wx(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),yx={utf8:nv,"utf-8":nv,hex:Uo.base16,latin1:Yf,ascii:Yf,binary:Yf,...Uo};function bx(t,e="utf8"){const r=yx[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const _x="PARSE_ERROR",Ex="INVALID_REQUEST",Ax="METHOD_NOT_FOUND",xx="INVALID_PARAMS",iv="INTERNAL_ERROR",Qf="SERVER_ERROR",Ix=[-32700,-32600,-32601,-32602,-32603],dc={[_x]:{code:-32700,message:"Parse error"},[Ex]:{code:-32600,message:"Invalid Request"},[Ax]:{code:-32601,message:"Method not found"},[xx]:{code:-32602,message:"Invalid params"},[iv]:{code:-32603,message:"Internal error"},[Qf]:{code:-32e3,message:"Server error"}},sv=Qf;function Sx(t){return Ix.includes(t)}function ov(t){return Object.keys(dc).includes(t)?dc[t]:dc[sv]}function Cx(t){const e=Object.values(dc).find(r=>r.code===t);return e||dc[sv]}function av(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var cv={};/*! *****************************************************************************
|
|
31
31
|
Copyright (c) Microsoft Corporation.
|
|
32
32
|
|
|
33
33
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -40,59 +40,59 @@
|
|
|
40
40
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
41
41
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
42
42
|
PERFORMANCE OF THIS SOFTWARE.
|
|
43
|
-
***************************************************************************** */var Jf=function(t,e){return Jf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Jf(t,e)};function Cx(t,e){Jf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Zf=function(){return Zf=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Zf.apply(this,arguments)};function Ox(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Mx(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Px(t,e){return function(r,n){e(r,n,t)}}function $x(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Tx(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(g){try{h(n.next(g))}catch(_){c(_)}}function f(g){try{h(n.throw(g))}catch(_){c(_)}}function h(g){g.done?o(g.value):i(g.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function Nx(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(h){return function(g){return f([h,g])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Rx(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Lx(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Xf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 uv(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Bx(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(uv(arguments[e]));return t}function Ux(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function gc(t){return this instanceof gc?(this.v=t,this):new gc(t)}function Fx(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(E){n[E]&&(i[E]=function(x){return new Promise(function(I,k){o.push([E,x,I,k])>1||l(E,x)})})}function l(E,x){try{f(n[E](x))}catch(I){_(o[0][3],I)}}function f(E){E.value instanceof gc?Promise.resolve(E.value.v).then(h,g):_(o[0][2],E)}function h(E){l("next",E)}function g(E){l("throw",E)}function _(E,x){E(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function jx(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:gc(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function kx(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 Xf=="function"?Xf(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function qx(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function zx(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Hx(t){return t&&t.__esModule?t:{default:t}}function Kx(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Wx(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Vx=Object.freeze({__proto__:null,__extends:Cx,get __assign(){return Zf},__rest:Ox,__decorate:Mx,__param:Px,__metadata:$x,__awaiter:Tx,__generator:Nx,__createBinding:Rx,__exportStar:Lx,__values:Xf,__read:uv,__spread:Bx,__spreadArrays:Ux,__await:gc,__asyncGenerator:Fx,__asyncDelegator:jx,__asyncValues:kx,__makeTemplateObject:qx,__importStar:zx,__importDefault:Hx,__classPrivateFieldGet:Kx,__classPrivateFieldSet:Wx}),Gx=il(Vx),qi={},hv;function Yx(){if(hv)return qi;hv=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.isBrowserCryptoAvailable=qi.getSubtleCrypto=qi.getBrowerCrypto=void 0;function t(){return jr?.crypto||jr?.msCrypto||{}}qi.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}qi.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return qi.isBrowserCryptoAvailable=r,qi}var zi={},fv;function Qx(){if(fv)return zi;fv=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.isBrowser=zi.isNode=zi.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}zi.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}zi.isNode=e;function r(){return!t()&&!e()}return zi.isBrowser=r,zi}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Gx;e.__exportStar(Yx(),t),e.__exportStar(Qx(),t)})(lv);function us(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ys(t=6){return BigInt(us(t))}function ta(t,e,r){return{id:r||us(),jsonrpc:"2.0",method:t,params:e}}function Wl(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Vl(t,e,r){return{id:t,jsonrpc:"2.0",error:Jx(e,r)}}function Jx(t,e){return typeof t>"u"?av(sv):(typeof t=="string"&&(t=Object.assign(Object.assign({},av(Qf)),{message:t})),typeof e<"u"&&(t.data=e),Ix(t.code)&&(t=Dx(t.code)),t)}class Zx{}class Xx extends Zx{constructor(){super()}}class e9 extends Xx{constructor(e){super()}}const t9="^https?:",r9="^wss?:";function n9(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function dv(t,e){const r=n9(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function pv(t){return dv(t,t9)}function gv(t){return dv(t,r9)}function i9(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function mv(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function e0(t){return mv(t)&&"method"in t}function Gl(t){return mv(t)&&(_i(t)||Mn(t))}function _i(t){return"result"in t}function Mn(t){return"error"in t}class Hi extends e9{constructor(e){super(e),this.events=new Dr.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(ta(e.method,e.params||[],e.id||Ys().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{Mn(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Gl(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const s9=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),o9=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",vv=t=>t.split("?")[0],wv=10,a9=s9();class c9{constructor(e){if(this.url=e,this.events=new Dr.exports.EventEmitter,this.registering=!1,!gv(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ki(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!gv(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),o=lv.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!i9(e)},c=new a9(e,[],o);o9()?c.onerror=l=>{const f=l;n(this.emitError(f.error))}:c.on("error",l=>{n(this.emitError(l))}),c.onopen=()=>{this.onOpen(c),r(c)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?lc(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=Vl(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return cv(e,vv(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>wv&&this.events.setMaxListeners(wv)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${vv(this.url)}`));return this.events.emit("register_error",r),r}}var t0={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",f="[object Array]",h="[object AsyncFunction]",g="[object Boolean]",_="[object Date]",E="[object Error]",x="[object Function]",I="[object GeneratorFunction]",k="[object Map]",W="[object Number]",Y="[object Null]",B="[object Object]",z="[object Promise]",M="[object Proxy]",U="[object RegExp]",F="[object Set]",m="[object String]",$="[object Symbol]",te="[object Undefined]",ee="[object WeakMap]",ne="[object ArrayBuffer]",de="[object DataView]",d="[object Float32Array]",p="[object Float64Array]",b="[object Int8Array]",D="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",L="[object Uint8ClampedArray]",C="[object Uint16Array]",v="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,oe=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,A={};A[d]=A[p]=A[b]=A[D]=A[O]=A[T]=A[L]=A[C]=A[v]=!0,A[l]=A[f]=A[ne]=A[g]=A[de]=A[_]=A[E]=A[x]=A[k]=A[W]=A[B]=A[U]=A[F]=A[m]=A[ee]=!1;var re=typeof jr=="object"&&jr&&jr.Object===Object&&jr,q=typeof self=="object"&&self&&self.Object===Object&&self,H=re||q||Function("return this")(),V=e&&!e.nodeType&&e,w=V&&!0&&t&&!t.nodeType&&t,j=w&&w.exports===V,ie=j&&re.process,he=function(){try{return ie&&ie.binding&&ie.binding("util")}catch{}}(),le=he&&he.isTypedArray;function Oe(K,J){for(var fe=-1,Se=K==null?0:K.length,Vt=0,ot=[];++fe<Se;){var Zt=K[fe];J(Zt,fe,K)&&(ot[Vt++]=Zt)}return ot}function Pe(K,J){for(var fe=-1,Se=J.length,Vt=K.length;++fe<Se;)K[Vt+fe]=J[fe];return K}function Ie(K,J){for(var fe=-1,Se=K==null?0:K.length;++fe<Se;)if(J(K[fe],fe,K))return!0;return!1}function Mt(K,J){for(var fe=-1,Se=Array(K);++fe<K;)Se[fe]=J(fe);return Se}function ze(K){return function(J){return K(J)}}function Ce(K,J){return K.has(J)}function Fe(K,J){return K?.[J]}function Ee(K){var J=-1,fe=Array(K.size);return K.forEach(function(Se,Vt){fe[++J]=[Vt,Se]}),fe}function Ae(K,J){return function(fe){return K(J(fe))}}function Ge(K){var J=-1,fe=Array(K.size);return K.forEach(function(Se){fe[++J]=Se}),fe}var be=Array.prototype,xe=Function.prototype,Be=Object.prototype,_e=H["__core-js_shared__"],Me=xe.toString,je=Be.hasOwnProperty,$e=function(){var K=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return K?"Symbol(src)_1."+K:""}(),Te=Be.toString,lt=RegExp("^"+Me.call(je).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=j?H.Buffer:void 0,Ne=H.Symbol,nr=H.Uint8Array,dt=Be.propertyIsEnumerable,Et=be.splice,ir=Ne?Ne.toStringTag:void 0,St=Object.getOwnPropertySymbols,Ot=Re?Re.isBuffer:void 0,Vr=Ae(Object.keys,Object),Ye=bn(H,"DataView"),He=bn(H,"Map"),Rt=bn(H,"Promise"),Qe=bn(H,"Set"),Ve=bn(H,"WeakMap"),Pt=bn(Object,"create"),Xe=Yi(Ye),et=Yi(He),Lt=Yi(Rt),tt=Yi(Qe),Je=Yi(Ve),Ft=Ne?Ne.prototype:void 0,Ze=Ft?Ft.valueOf:void 0;function ke(K){var J=-1,fe=K==null?0:K.length;for(this.clear();++J<fe;){var Se=K[J];this.set(Se[0],Se[1])}}function Ht(){this.__data__=Pt?Pt(null):{},this.size=0}function rt(K){var J=this.has(K)&&delete this.__data__[K];return this.size-=J?1:0,J}function jt(K){var J=this.__data__;if(Pt){var fe=J[K];return fe===n?void 0:fe}return je.call(J,K)?J[K]:void 0}function ti(K){var J=this.__data__;return Pt?J[K]!==void 0:je.call(J,K)}function kt(K,J){var fe=this.__data__;return this.size+=this.has(K)?0:1,fe[K]=Pt&&J===void 0?n:J,this}ke.prototype.clear=Ht,ke.prototype.delete=rt,ke.prototype.get=jt,ke.prototype.has=ti,ke.prototype.set=kt;function vt(K){var J=-1,fe=K==null?0:K.length;for(this.clear();++J<fe;){var Se=K[J];this.set(Se[0],Se[1])}}function Nn(){this.__data__=[],this.size=0}function Rn(K){var J=this.__data__,fe=bo(J,K);if(fe<0)return!1;var Se=J.length-1;return fe==Se?J.pop():Et.call(J,fe,1),--this.size,!0}function Ln(K){var J=this.__data__,fe=bo(J,K);return fe<0?void 0:J[fe][1]}function Bn(K){return bo(this.__data__,K)>-1}function Un(K,J){var fe=this.__data__,Se=bo(fe,K);return Se<0?(++this.size,fe.push([K,J])):fe[Se][1]=J,this}vt.prototype.clear=Nn,vt.prototype.delete=Rn,vt.prototype.get=Ln,vt.prototype.has=Bn,vt.prototype.set=Un;function xr(K){var J=-1,fe=K==null?0:K.length;for(this.clear();++J<fe;){var Se=K[J];this.set(Se[0],Se[1])}}function Ci(){this.size=0,this.__data__={hash:new ke,map:new(He||vt),string:new ke}}function fo(K){var J=Cs(this,K).delete(K);return this.size-=J?1:0,J}function Oi(K){return Cs(this,K).get(K)}function po(K){return Cs(this,K).has(K)}function go(K,J){var fe=Cs(this,K),Se=fe.size;return fe.set(K,J),this.size+=fe.size==Se?0:1,this}xr.prototype.clear=Ci,xr.prototype.delete=fo,xr.prototype.get=Oi,xr.prototype.has=po,xr.prototype.set=go;function Mi(K){var J=-1,fe=K==null?0:K.length;for(this.__data__=new xr;++J<fe;)this.add(K[J])}function Is(K){return this.__data__.set(K,n),this}function Ds(K){return this.__data__.has(K)}Mi.prototype.add=Mi.prototype.push=Is,Mi.prototype.has=Ds;function Gr(K){var J=this.__data__=new vt(K);this.size=J.size}function mo(){this.__data__=new vt,this.size=0}function vo(K){var J=this.__data__,fe=J.delete(K);return this.size=J.size,fe}function wo(K){return this.__data__.get(K)}function yo(K){return this.__data__.has(K)}function Pu(K,J){var fe=this.__data__;if(fe instanceof vt){var Se=fe.__data__;if(!He||Se.length<r-1)return Se.push([K,J]),this.size=++fe.size,this;fe=this.__data__=new xr(Se)}return fe.set(K,J),this.size=fe.size,this}Gr.prototype.clear=mo,Gr.prototype.delete=vo,Gr.prototype.get=wo,Gr.prototype.has=yo,Gr.prototype.set=Pu;function $u(K,J){var fe=Sa(K),Se=!fe&&Hu(K),Vt=!fe&&!Se&&kc(K),ot=!fe&&!Se&&!Vt&&Vu(K),Zt=fe||Se||Vt||ot,gr=Zt?Mt(K.length,String):[],It=gr.length;for(var Gt in K)(J||je.call(K,Gt))&&!(Zt&&(Gt=="length"||Vt&&(Gt=="offset"||Gt=="parent")||ot&&(Gt=="buffer"||Gt=="byteLength"||Gt=="byteOffset")||Fu(Gt,It)))&&gr.push(Gt);return gr}function bo(K,J){for(var fe=K.length;fe--;)if(zu(K[fe][0],J))return fe;return-1}function Fc(K,J,fe){var Se=J(K);return Sa(K)?Se:Pe(Se,fe(K))}function _o(K){return K==null?K===void 0?te:Y:ir&&ir in Object(K)?Bu(K):Td(K)}function jc(K){return Ao(K)&&_o(K)==l}function Eo(K,J,fe,Se,Vt){return K===J?!0:K==null||J==null||!Ao(K)&&!Ao(J)?K!==K&&J!==J:Tu(K,J,fe,Se,Eo,Vt)}function Tu(K,J,fe,Se,Vt,ot){var Zt=Sa(K),gr=Sa(J),It=Zt?f:Pi(K),Gt=gr?f:Pi(J);It=It==l?B:It,Gt=Gt==l?B:Gt;var fr=It==B,ln=Gt==B,mr=It==Gt;if(mr&&kc(K)){if(!kc(J))return!1;Zt=!0,fr=!1}if(mr&&!fr)return ot||(ot=new Gr),Zt||Vu(K)?Aa(K,J,fe,Se,Vt,ot):$d(K,J,It,fe,Se,Vt,ot);if(!(fe&i)){var Xt=fr&&je.call(K,"__wrapped__"),Yr=ln&&je.call(J,"__wrapped__");if(Xt||Yr){var ri=Xt?K.value():K,Fn=Yr?J.value():J;return ot||(ot=new Gr),Vt(ri,Fn,fe,Se,ot)}}return mr?(ot||(ot=new Gr),Lu(K,J,fe,Se,Vt,ot)):!1}function Pd(K){if(!Wu(K)||ku(K))return!1;var J=Ia(K)?lt:oe;return J.test(Yi(K))}function Nu(K){return Ao(K)&&Ku(K.length)&&!!A[_o(K)]}function Ru(K){if(!qu(K))return Vr(K);var J=[];for(var fe in Object(K))je.call(K,fe)&&fe!="constructor"&&J.push(fe);return J}function Aa(K,J,fe,Se,Vt,ot){var Zt=fe&i,gr=K.length,It=J.length;if(gr!=It&&!(Zt&&It>gr))return!1;var Gt=ot.get(K);if(Gt&&ot.get(J))return Gt==J;var fr=-1,ln=!0,mr=fe&o?new Mi:void 0;for(ot.set(K,J),ot.set(J,K);++fr<gr;){var Xt=K[fr],Yr=J[fr];if(Se)var ri=Zt?Se(Yr,Xt,fr,J,K,ot):Se(Xt,Yr,fr,K,J,ot);if(ri!==void 0){if(ri)continue;ln=!1;break}if(mr){if(!Ie(J,function(Fn,$i){if(!Ce(mr,$i)&&(Xt===Fn||Vt(Xt,Fn,fe,Se,ot)))return mr.push($i)})){ln=!1;break}}else if(!(Xt===Yr||Vt(Xt,Yr,fe,Se,ot))){ln=!1;break}}return ot.delete(K),ot.delete(J),ln}function $d(K,J,fe,Se,Vt,ot,Zt){switch(fe){case de:if(K.byteLength!=J.byteLength||K.byteOffset!=J.byteOffset)return!1;K=K.buffer,J=J.buffer;case ne:return!(K.byteLength!=J.byteLength||!ot(new nr(K),new nr(J)));case g:case _:case W:return zu(+K,+J);case E:return K.name==J.name&&K.message==J.message;case U:case m:return K==J+"";case k:var gr=Ee;case F:var It=Se&i;if(gr||(gr=Ge),K.size!=J.size&&!It)return!1;var Gt=Zt.get(K);if(Gt)return Gt==J;Se|=o,Zt.set(K,J);var fr=Aa(gr(K),gr(J),Se,Vt,ot,Zt);return Zt.delete(K),fr;case $:if(Ze)return Ze.call(K)==Ze.call(J)}return!1}function Lu(K,J,fe,Se,Vt,ot){var Zt=fe&i,gr=xa(K),It=gr.length,Gt=xa(J),fr=Gt.length;if(It!=fr&&!Zt)return!1;for(var ln=It;ln--;){var mr=gr[ln];if(!(Zt?mr in J:je.call(J,mr)))return!1}var Xt=ot.get(K);if(Xt&&ot.get(J))return Xt==J;var Yr=!0;ot.set(K,J),ot.set(J,K);for(var ri=Zt;++ln<It;){mr=gr[ln];var Fn=K[mr],$i=J[mr];if(Se)var qc=Zt?Se($i,Fn,mr,J,K,ot):Se(Fn,$i,mr,K,J,ot);if(!(qc===void 0?Fn===$i||Vt(Fn,$i,fe,Se,ot):qc)){Yr=!1;break}ri||(ri=mr=="constructor")}if(Yr&&!ri){var xo=K.constructor,Sr=J.constructor;xo!=Sr&&"constructor"in K&&"constructor"in J&&!(typeof xo=="function"&&xo instanceof xo&&typeof Sr=="function"&&Sr instanceof Sr)&&(Yr=!1)}return ot.delete(K),ot.delete(J),Yr}function xa(K){return Fc(K,Ld,Uu)}function Cs(K,J){var fe=K.__data__;return ju(J)?fe[typeof J=="string"?"string":"hash"]:fe.map}function bn(K,J){var fe=Fe(K,J);return Pd(fe)?fe:void 0}function Bu(K){var J=je.call(K,ir),fe=K[ir];try{K[ir]=void 0;var Se=!0}catch{}var Vt=Te.call(K);return Se&&(J?K[ir]=fe:delete K[ir]),Vt}var Uu=St?function(K){return K==null?[]:(K=Object(K),Oe(St(K),function(J){return dt.call(K,J)}))}:Wt,Pi=_o;(Ye&&Pi(new Ye(new ArrayBuffer(1)))!=de||He&&Pi(new He)!=k||Rt&&Pi(Rt.resolve())!=z||Qe&&Pi(new Qe)!=F||Ve&&Pi(new Ve)!=ee)&&(Pi=function(K){var J=_o(K),fe=J==B?K.constructor:void 0,Se=fe?Yi(fe):"";if(Se)switch(Se){case Xe:return de;case et:return k;case Lt:return z;case tt:return F;case Je:return ee}return J});function Fu(K,J){return J=J??c,!!J&&(typeof K=="number"||pe.test(K))&&K>-1&&K%1==0&&K<J}function ju(K){var J=typeof K;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?K!=="__proto__":K===null}function ku(K){return!!$e&&$e in K}function qu(K){var J=K&&K.constructor,fe=typeof J=="function"&&J.prototype||Be;return K===fe}function Td(K){return Te.call(K)}function Yi(K){if(K!=null){try{return Me.call(K)}catch{}try{return K+""}catch{}}return""}function zu(K,J){return K===J||K!==K&&J!==J}var Hu=jc(function(){return arguments}())?jc:function(K){return Ao(K)&&je.call(K,"callee")&&!dt.call(K,"callee")},Sa=Array.isArray;function Nd(K){return K!=null&&Ku(K.length)&&!Ia(K)}var kc=Ot||Kt;function Rd(K,J){return Eo(K,J)}function Ia(K){if(!Wu(K))return!1;var J=_o(K);return J==x||J==I||J==h||J==M}function Ku(K){return typeof K=="number"&&K>-1&&K%1==0&&K<=c}function Wu(K){var J=typeof K;return K!=null&&(J=="object"||J=="function")}function Ao(K){return K!=null&&typeof K=="object"}var Vu=le?ze(le):Nu;function Ld(K){return Nd(K)?$u(K):Ru(K)}function Wt(){return[]}function Kt(){return!1}t.exports=Rd})(t0,t0.exports);var l9=t0.exports;function u9(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],c=[],l={},f=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return o},entries:function(){return c},get:function(g){return l[g.toLowerCase()]},has:function(g){return g.toLowerCase()in l}}}};for(var h in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(g,_,E){o.push(_=_.toLowerCase()),c.push([_,E]),l[_]=l[_]?l[_]+","+E:E}),r(f())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var h9=Object.freeze({__proto__:null,default:u9}),yv=il(h9),f9=self.fetch||(self.fetch=yv.default||yv),d9=Object.defineProperty,bv=Object.getOwnPropertySymbols,p9=Object.prototype.hasOwnProperty,g9=Object.prototype.propertyIsEnumerable,_v=(t,e,r)=>e in t?d9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kr=(t,e)=>{for(var r in e||(e={}))p9.call(e,r)&&_v(t,r,e[r]);if(bv)for(var r of bv(e))g9.call(e,r)&&_v(t,r,e[r]);return t};function m9(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,f=t.charAt(0),h=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function _(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var k=0,W=0,Y=0,B=I.length;Y!==B&&I[Y]===0;)Y++,k++;for(var z=(B-Y)*g+1>>>0,M=new Uint8Array(z);Y!==B;){for(var U=I[Y],F=0,m=z-1;(U!==0||F<W)&&m!==-1;m--,F++)U+=256*M[m]>>>0,M[m]=U%l>>>0,U=U/l>>>0;if(U!==0)throw new Error("Non-zero carry");W=F,Y++}for(var $=z-W;$!==z&&M[$]===0;)$++;for(var te=f.repeat(k);$<z;++$)te+=t.charAt(M[$]);return te}function E(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var k=0;if(I[k]!==" "){for(var W=0,Y=0;I[k]===f;)W++,k++;for(var B=(I.length-k)*h+1>>>0,z=new Uint8Array(B);I[k];){var M=r[I.charCodeAt(k)];if(M===255)return;for(var U=0,F=B-1;(M!==0||U<Y)&&F!==-1;F--,U++)M+=l*z[F]>>>0,z[F]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");Y=U,k++}if(I[k]!==" "){for(var m=B-Y;m!==B&&z[m]===0;)m++;for(var $=new Uint8Array(W+(B-m)),te=W;m!==B;)$[te++]=z[m++];return $}}}function x(I){var k=E(I);if(k)return k;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:E,decode:x}}var v9=m9,w9=v9;const Ev=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},y9=t=>new TextEncoder().encode(t),b9=t=>new TextDecoder().decode(t);class _9{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class E9{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Av(this,e)}}class A9{constructor(e){this.decoders=e}or(e){return Av(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Av=(t,e)=>new A9(Kr(Kr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class x9{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new _9(e,r,n),this.decoder=new E9(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Yl=({name:t,prefix:e,encode:r,decode:n})=>new x9(t,e,r,n),mc=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=w9(r,e);return Yl({prefix:t,name:e,encode:n,decode:o=>Ev(i(o))})},S9=(t,e,r,n)=>{const i={};for(let g=0;g<e.length;++g)i[e[g]]=g;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,f=0,h=0;for(let g=0;g<o;++g){const _=i[t[g]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|_,l+=r,l>=8&&(l-=8,c[h++]=255&f>>l)}if(l>=r||255&f<<8-l)throw new SyntaxError("Unexpected end of data");return c},I9=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<t.length;++f)for(l=l<<8|t[f],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},$r=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Yl({prefix:e,name:t,encode(i){return I9(i,n,r)},decode(i){return S9(i,n,r,t)}}),D9=Yl({prefix:"\0",name:"identity",encode:t=>b9(t),decode:t=>y9(t)});var C9=Object.freeze({__proto__:null,identity:D9});const O9=$r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var M9=Object.freeze({__proto__:null,base2:O9});const P9=$r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $9=Object.freeze({__proto__:null,base8:P9});const T9=mc({prefix:"9",name:"base10",alphabet:"0123456789"});var N9=Object.freeze({__proto__:null,base10:T9});const R9=$r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),L9=$r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var B9=Object.freeze({__proto__:null,base16:R9,base16upper:L9});const U9=$r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),F9=$r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),j9=$r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),k9=$r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q9=$r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),z9=$r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),H9=$r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),K9=$r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),W9=$r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var V9=Object.freeze({__proto__:null,base32:U9,base32upper:F9,base32pad:j9,base32padupper:k9,base32hex:q9,base32hexupper:z9,base32hexpad:H9,base32hexpadupper:K9,base32z:W9});const G9=mc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Y9=mc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Q9=Object.freeze({__proto__:null,base36:G9,base36upper:Y9});const J9=mc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Z9=mc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var X9=Object.freeze({__proto__:null,base58btc:J9,base58flickr:Z9});const eS=$r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tS=$r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),rS=$r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nS=$r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iS=Object.freeze({__proto__:null,base64:eS,base64pad:tS,base64url:rS,base64urlpad:nS});const xv=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),sS=xv.reduce((t,e,r)=>(t[r]=e,t),[]),oS=xv.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function aS(t){return t.reduce((e,r)=>(e+=sS[r],e),"")}function cS(t){const e=[];for(const r of t){const n=oS[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const lS=Yl({prefix:"\u{1F680}",name:"base256emoji",encode:aS,decode:cS});var uS=Object.freeze({__proto__:null,base256emoji:lS}),hS=Iv,Sv=128,fS=127,dS=~fS,pS=Math.pow(2,31);function Iv(t,e,r){e=e||[],r=r||0;for(var n=r;t>=pS;)e[r++]=t&255|Sv,t/=128;for(;t&dS;)e[r++]=t&255|Sv,t>>>=7;return e[r]=t|0,Iv.bytes=r-n+1,e}var gS=r0,mS=128,Dv=127;function r0(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw r0.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Dv)<<i:(c&Dv)*Math.pow(2,i),i+=7}while(c>=mS);return r0.bytes=o-n,r}var vS=Math.pow(2,7),wS=Math.pow(2,14),yS=Math.pow(2,21),bS=Math.pow(2,28),_S=Math.pow(2,35),ES=Math.pow(2,42),AS=Math.pow(2,49),xS=Math.pow(2,56),SS=Math.pow(2,63),IS=function(t){return t<vS?1:t<wS?2:t<yS?3:t<bS?4:t<_S?5:t<ES?6:t<AS?7:t<xS?8:t<SS?9:10},DS={encode:hS,decode:gS,encodingLength:IS},Cv=DS;const Ov=(t,e,r=0)=>(Cv.encode(t,e,r),e),Mv=t=>Cv.encodingLength(t),n0=(t,e)=>{const r=e.byteLength,n=Mv(t),i=n+Mv(r),o=new Uint8Array(i+r);return Ov(t,o,0),Ov(r,o,n),o.set(e,i),new CS(t,r,e,o)};class CS{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Pv=({name:t,code:e,encode:r})=>new OS(t,e,r);class OS{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?n0(this.code,r):r.then(n=>n0(this.code,n))}else throw Error("Unknown type, must be binary type")}}const $v=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),MS=Pv({name:"sha2-256",code:18,encode:$v("SHA-256")}),PS=Pv({name:"sha2-512",code:19,encode:$v("SHA-512")});var $S=Object.freeze({__proto__:null,sha256:MS,sha512:PS});const Tv=0,TS="identity",Nv=Ev;var NS=Object.freeze({__proto__:null,identity:{code:Tv,name:TS,encode:Nv,digest:t=>n0(Tv,Nv(t))}});new TextEncoder,new TextDecoder;const Rv=Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr({},C9),M9),$9),N9),B9),V9),Q9),X9),iS),uS);Kr(Kr({},$S),NS);function RS(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Lv(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Bv=Lv("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),i0=Lv("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=RS(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),LS=Kr({utf8:Bv,"utf-8":Bv,hex:Rv.base16,latin1:i0,ascii:i0,binary:i0},Rv);function BS(t,e="utf8"){const r=LS[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const Uv="wc",US=2,s0="core",hs=`${Uv}@2:${s0}:`,FS={name:s0,logger:"error"},jS={database:":memory:"},kS="crypto",Fv="client_ed25519_seed",qS=ye.ONE_DAY,zS="keychain",HS="0.3",KS="messages",WS="0.3",VS=ye.SIX_HOURS,GS="publisher",jv="irn",YS="error",kv="wss://relay.walletconnect.com",qv="wss://relay.walletconnect.org",QS="relayer",on={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},JS="_subscription",Pn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ZS=ye.ONE_SECOND,XS="2.13.2",eI=1e4,tI="0.3",rI="WALLETCONNECT_CLIENT_ID",Ei={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},nI="subscription",iI="0.3",sI=ye.FIVE_SECONDS*1e3,oI="pairing",aI="0.3",vc={wc_pairingDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:0},res:{ttl:ye.ONE_DAY,prompt:!1,tag:0}}},ra={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},ei={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},cI="history",lI="0.3",uI="expirer",$n={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},hI="0.3",o0="verify-api",na="https://verify.walletconnect.com",a0="https://verify.walletconnect.org",fI=[na,a0],dI="echo",pI="https://echo.walletconnect.com";class gI{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=zS,this.version=HS,this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:o}=me("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=sn(r,this.name)}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,eg(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?tg(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class mI{constructor(e,r,n){this.core=e,this.logger=r,this.name=kS,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),o=rv(i);return tv(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=FE();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=rv(o),l=Pf();return await vx(l,i,qS,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),f=jE(l,o);return this.setSymKey(f,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||Tl(i);return await this.keychain.set(c,i),c},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,o,c)=>{this.isInitialized();const l=ym(c),f=ki(o);if(bm(l)){const E=l.senderPublicKey,x=l.receiverPublicKey;i=await this.generateSharedKey(E,x)}const h=this.getSymKey(i),{type:g,senderPublicKey:_}=l;return qE({type:g,symKey:h,message:f,senderPublicKey:_})},this.decode=async(i,o,c)=>{this.isInitialized();const l=KE(o,c);if(bm(l)){const f=l.receiverPublicKey,h=l.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=zE({symKey:f,encoded:o});return lc(h)}catch(f){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(f)}},this.getPayloadType=i=>{const o=Nl(i);return nc(o.type)},this.getPayloadSenderPublicKey=i=>{const o=Nl(i);return o.senderPublicKey?bx(o.senderPublicKey,zr):void 0},this.core=e,this.logger=sn(r,this.name),this.keychain=n||new gI(this.core,this.logger)}get context(){return nn(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Fv)}catch{e=Pf(),await this.keychain.set(Fv,e)}return BS(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class vI extends V7{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=KS,this.version=WS,this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const o=Ws(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=Ws(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=sn(e,this.name),this.core=r}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,eg(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?tg(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class wI extends G7{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Dr.exports.EventEmitter,this.name=GS,this.queue=new Map,this.publishTimeout=ye.toMiliseconds(ye.ONE_MINUTE),this.failedPublishTimeout=ye.toMiliseconds(ye.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});const l=o?.ttl||VS,f=$f(o),h=o?.prompt||!1,g=o?.tag||0,_=o?.id||Ys().toString(),E={topic:n,message:i,opts:{ttl:l,relay:f,prompt:h,tag:g,id:_}},x=`Failed to publish payload, please try again. id:${_} tag:${g}`,I=Date.now();let k,W=1;try{for(;k===void 0;){if(Date.now()-I>this.publishTimeout)throw new Error(x);this.logger.trace({id:_,attempts:W},`publisher.publish - attempt ${W}`),k=await await jo(this.rpcPublish(n,i,l,f,h,g,_).catch(Y=>this.logger.warn(Y)),this.publishTimeout,x),W++,k||await new Promise(Y=>setTimeout(Y,this.failedPublishTimeout))}this.relayer.events.emit(on.publish,E),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:_,topic:n,message:i,opts:o}})}catch(Y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Y),(c=o?.internal)!=null&&c.throwOnFailedPublish)throw Y;this.queue.set(_,E)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=sn(r,this.name),this.registerEventListeners()}get context(){return nn(this.logger)}rpcPublish(e,r,n,i,o,c,l){var f,h,g,_;const E={method:ic(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Hr((f=E.params)==null?void 0:f.prompt)&&((h=E.params)==null||delete h.prompt),Hr((g=E.params)==null?void 0:g.tag)&&((_=E.params)==null||delete _.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:E}),this.relayer.request(E)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(uc.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(on.connection_stalled);return}this.checkQueue()}),this.relayer.on(on.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class yI{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var bI=Object.defineProperty,_I=Object.defineProperties,EI=Object.getOwnPropertyDescriptors,zv=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,xI=Object.prototype.propertyIsEnumerable,Hv=(t,e,r)=>e in t?bI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wc=(t,e)=>{for(var r in e||(e={}))AI.call(e,r)&&Hv(t,r,e[r]);if(zv)for(var r of zv(e))xI.call(e,r)&&Hv(t,r,e[r]);return t},c0=(t,e)=>_I(t,EI(e));class SI extends J7{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new yI,this.events=new Dr.exports.EventEmitter,this.name=nI,this.version=iI,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=hs,this.subscribeTimeout=ye.toMiliseconds(ye.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=$f(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return typeof l=="string"&&(this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((o,c)=>{const l=new ye.Watch;l.start(i);const f=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(f),l.stop(i),o(!0)),l.elapsed(i)>=sI&&(clearInterval(f),l.stop(i),c(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=sn(r,this.name),this.clientId=""}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=$f(n);await this.rpcUnsubscribe(e,r,i);const o=Ut("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:ic(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await jo(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)?Ws(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(on.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:ic(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await jo(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(on.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:ic(r.protocol).batchFetchMessages,params:{topics:e.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await jo(this.relayer.request(n).catch(o=>this.logger.warn(o)),this.subscribeTimeout)}catch{this.relayer.events.emit(on.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:ic(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,c0(wc({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,wc({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,wc({},r)),this.topicMap.set(r.topic,e),this.events.emit(Ei.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Ei.deleted,c0(wc({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Ei.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(n),await this.batchSubscribe(n)}}this.events.emit(Ei.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);wi(r)&&this.onBatchSubscribe(r.map((n,i)=>c0(wc({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(uc.pulse,async()=>{await this.checkPending()}),this.events.on(Ei.created,async e=>{const r=Ei.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Ei.deleted,async e=>{const r=Ei.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var II=Object.defineProperty,Kv=Object.getOwnPropertySymbols,DI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,Wv=(t,e,r)=>e in t?II(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,OI=(t,e)=>{for(var r in e||(e={}))DI.call(e,r)&&Wv(t,r,e[r]);if(Kv)for(var r of Kv(e))CI.call(e,r)&&Wv(t,r,e[r]);return t};class MI extends Y7{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Dr.exports.EventEmitter,this.name=QS,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=ye.toMiliseconds(ye.THIRTY_SECONDS+ye.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const o=r.id||Ys().toString();await this.toEstablishConnection();try{const c=this.provider.request(r);this.requestsInFlight.set(o,{promise:c,request:r}),this.logger.trace({id:o,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const l=await new Promise(async(f,h)=>{const g=()=>{h(new Error(`relayer.request - publish interrupted, id: ${o}`))};this.provider.on(Pn.disconnect,g);const _=await c;this.provider.off(Pn.disconnect,g),f(_)});return this.logger.trace({id:o,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),l}catch(c){throw this.logger.debug(`Failed to Publish Request: ${o}`),c}finally{this.requestsInFlight.delete(o)}},this.resetPingTimeout=()=>{if(Wa())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.startPingTimeout(),this.events.emit(on.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(on.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Pn.payload,this.onPayloadHandler),this.provider.on(Pn.connect,this.onConnectHandler),this.provider.on(Pn.disconnect,this.onDisconnectHandler),this.provider.on(Pn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?sn(e.logger,this.name):yi(Hl({level:e.logger||YS})),this.messages=new vI(this.logger,e.core),this.subscriber=new SI(this,this.logger),this.publisher=new wI(this,this.logger),this.relayUrl=e?.relayUrl||kv,this.projectId=e.projectId,this.bundleId=C8(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${qv}...`),await this.restartTransport(qv)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},eI)}get context(){return nn(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"",o;const c=l=>{l.topic===e&&(this.subscriber.off(Ei.created,c),o())};return await Promise.all([new Promise(l=>{o=l,this.subscriber.on(Ei.created,c)}),new Promise(async l=>{i=await this.subscriber.subscribe(e,r)||i,l()})]),i}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await jo(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Pn.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Pn.disconnect,i),await jo(this.provider.connect(),ye.toMiliseconds(ye.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{n(o)}),await this.subscriber.start(),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await $m())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}startPingTimeout(){var e,r,n,i,o;if(Wa())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((o=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||o.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(c){this.logger.warn(c)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Hi(new c9(N8({sdkVersion:XS,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),e0(e)){if(!e.method.endsWith(JS))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(OI({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Gl(e)&&this.events.emit(on.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(on.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Wl(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Pn.payload,this.onPayloadHandler),this.provider.off(Pn.connect,this.onConnectHandler),this.provider.off(Pn.disconnect,this.onDisconnectHandler),this.provider.off(Pn.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await $m();RA(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(on.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},ye.toMiliseconds(ZS))}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var PI=Object.defineProperty,Vv=Object.getOwnPropertySymbols,$I=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,Gv=(t,e,r)=>e in t?PI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Yv=(t,e)=>{for(var r in e||(e={}))$I.call(e,r)&&Gv(t,r,e[r]);if(Vv)for(var r of Vv(e))TI.call(e,r)&&Gv(t,r,e[r]);return t};class Qs extends Q7{constructor(e,r,n,i=hs,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=tI,this.cached=[],this.initialized=!1,this.storagePrefix=hs,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Hr(c)?this.map.set(this.getKey(c),c):fA(c)?this.map.set(c.id,c):dA(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(l=>Object.keys(c).every(f=>l9(l[f],c[f]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const f=Yv(Yv({},this.getData(c)),l);this.map.set(c,f),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),this.addToRecentlyDeleted(c),await this.persist())},this.logger=sn(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=me("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class NI{constructor(e,r){this.core=e,this.logger=r,this.name=oI,this.version=aI,this.events=new Dr.exports,this.initialized=!1,this.storagePrefix=hs,this.ignoredPayloadTypes=[ji],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=Pf(),o=await this.core.crypto.setSymKey(i),c=Or(ye.FIVE_MINUTES),l={protocol:jv},f={topic:o,expiry:c,relay:l,active:!1},h=rA({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:i,relay:l,expiryTimestamp:c,methods:n?.methods});return this.core.expirer.set(o,c),await this.pairings.set(o,f),await this.core.relayer.subscribe(o),{topic:o,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c,expiryTimestamp:l,methods:f}=xm(n.uri);let h;if(this.pairings.keys.includes(i)&&(h=this.pairings.get(i),h.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const g=l||Or(ye.FIVE_MINUTES),_={topic:i,relay:c,expiry:g,active:!1,methods:f};return this.core.expirer.set(i,g),await this.pairings.set(i,_),n.activatePairing&&await this.activate({topic:i}),this.events.emit(ra.create,_),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),_},this.activate=async({topic:n})=>{this.isInitialized();const i=Or(ye.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:f}=qs();this.events.once(wt("pairing_ping",o),({error:h})=>{h?f(h):l()}),await c()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Ut("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=ta(i,o),l=await this.core.crypto.encode(n,c),f=vc[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,f),c.id},this.sendResult=async(n,i,o)=>{const c=Wl(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=vc[f.request.method].res;await this.core.relayer.publish(i,l,h),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=Vl(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=vc[f.request.method]?vc[f.request.method].res:vc.unregistered_method.res;await this.core.relayer.publish(i,l,h),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Ut("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>os(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n;switch(o.method){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit(ra.ping,{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{_i(i)?this.events.emit(wt("pairing_ping",o),{}):Mn(i)&&this.events.emit(wt("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(ra.delete,{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Ut("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Ut("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!tn(n)){const{message:c}=me("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!hA(n.uri)){const{message:c}=me("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const o=xm(n.uri);if(!((i=o?.relay)!=null&&i.protocol)){const{message:c}=me("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(o!=null&&o.symKey)){const{message:c}=me("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}if(o!=null&&o.expiryTimestamp&&ye.toMiliseconds(o?.expiryTimestamp)<Date.now()){const{message:c}=me("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}},this.isValidPing=async n=>{if(!tn(n)){const{message:o}=me("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!tn(n)){const{message:o}=me("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ur(n,!1)){const{message:i}=me("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=me("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(os(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=me("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=sn(r,this.name),this.pairings=new Qs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return nn(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(on.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{e0(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Gl(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on($n.expired,async e=>{const{topic:r}=ng(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(ra.expire,{topic:r}))})}}class RI extends W7{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Dr.exports.EventEmitter,this.name=cI,this.version=lI,this.cached=[],this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o,expiry:Or(ye.THIRTY_DAYS)};this.records.set(c.id,c),this.persist(),this.events.emit(ei.created,c)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Mn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(ei.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(ei.deleted,o)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=sn(r,this.name)}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:ta(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ei.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ei.created,e=>{const r=ei.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(ei.updated,e=>{const r=ei.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(ei.deleted,e=>{const r=ei.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(uc.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ye.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(ei.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class LI extends Z7{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Dr.exports.EventEmitter,this.name=uI,this.version=hI,this.cached=[],this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit($n.created,{target:o,expiration:c})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit($n.deleted,{target:i,expiration:o})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=sn(r,this.name)}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return R8(e);if(typeof e=="number")return L8(e);const{message:r}=me("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit($n.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ye.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit($n.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(uc.pulse,()=>this.checkExpirations()),this.events.on($n.created,e=>{const r=$n.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on($n.expired,e=>{const r=$n.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on($n.deleted,e=>{const r=$n.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class BI extends X7{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=o0,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||Uo()||!Fo())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o)}if(!this.initialized){this.removeIframe(),this.verifyUrl=a0;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n?.verifyUrl);let o;try{o=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),o=await this.fetchAttestation(n.attestationId,a0)}return o},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const o=this.startAbortTimer(ye.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?await c.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=o=>{o.data==="verify_ready"&&(this.onInit(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(o=>{const c=document.getElementById(o0);if(c)return this.iframe=c,this.onInit(),o();window.addEventListener("message",i);const l=document.createElement("iframe");l.id=o0,l.src=`${this.verifyUrl}/${this.projectId}`,l.style.display="none",document.body.append(l),this.iframe=l,n=o}),new Promise((o,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},ye.toMiliseconds(ye.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||na;return fI.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${na}`),i=na),i},this.logger=sn(r,this.name),this.verifyUrl=na,this.abortController=new AbortController,this.isDevEnv=Wa()&&process.env.IS_VITEST}get context(){return nn(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ye.toMiliseconds(e))}}class UI extends ex{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=dI,this.registerDeviceToken=async n=>{const{clientId:i,token:o,notificationType:c,enableEncrypted:l=!1}=n,f=`${pI}/${this.projectId}/clients`;await f9(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:o,always_raw:l})})},this.logger=sn(r,this.context)}}var FI=Object.defineProperty,Qv=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,kI=Object.prototype.propertyIsEnumerable,Jv=(t,e,r)=>e in t?FI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zv=(t,e)=>{for(var r in e||(e={}))jI.call(e,r)&&Jv(t,r,e[r]);if(Qv)for(var r of Qv(e))kI.call(e,r)&&Jv(t,r,e[r]);return t};class l0 extends K7{constructor(e){var r;super(e),this.protocol=Uv,this.version=US,this.name=s0,this.events=new Dr.exports.EventEmitter,this.initialized=!1,this.on=(c,l)=>this.events.on(c,l),this.once=(c,l)=>this.events.once(c,l),this.off=(c,l)=>this.events.off(c,l),this.removeListener=(c,l)=>this.events.removeListener(c,l),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||kv,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=Hl({level:typeof e?.logger=="string"&&e.logger?e.logger:FS.logger}),{logger:i,chunkLoggerController:o}=H7({opts:n,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=o,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var c,l;(c=this.logChunkController)!=null&&c.downloadLogsBlobInBrowser&&((l=this.logChunkController)==null||l.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=sn(i,this.name),this.heartbeat=new jf,this.crypto=new mI(this,this.logger,e?.keychain),this.history=new RI(this,this.logger),this.expirer=new LI(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new g7(Zv(Zv({},jS),e?.storageOptions)),this.relayer=new MI({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new NI(this,this.logger),this.verify=new BI(this.projectId||"",this.logger),this.echoClient=new UI(this.projectId||"",this.logger)}static async init(e){const r=new l0(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(rI,n),r}get context(){return nn(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const qI=l0,Xv="wc",ew=2,tw="client",u0=`${Xv}@${ew}:${tw}:`,h0={name:tw,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},rw="WALLETCONNECT_DEEPLINK_CHOICE",zI="proposal",nw="Proposal expired",HI="session",ia=ye.SEVEN_DAYS,KI="engine",Tr={wc_sessionPropose:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ye.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ye.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1119}}},f0={min:ye.FIVE_MINUTES,max:ye.SEVEN_DAYS},Ai={idle:"IDLE",active:"ACTIVE"},WI="request",VI=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"],GI="wc",YI="auth",QI="authKeys",JI="pairingTopics",ZI="requests",Ql=`${GI}@${1.5}:${YI}:`,Jl=`${Ql}:PUB_KEY`;var XI=Object.defineProperty,eD=Object.defineProperties,tD=Object.getOwnPropertyDescriptors,iw=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,nD=Object.prototype.propertyIsEnumerable,sw=(t,e,r)=>e in t?XI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vr=(t,e)=>{for(var r in e||(e={}))rD.call(e,r)&&sw(t,r,e[r]);if(iw)for(var r of iw(e))nD.call(e,r)&&sw(t,r,e[r]);return t},Js=(t,e)=>eD(t,tD(e));class iD extends rx{constructor(e){super(e),this.name=KI,this.events=new Dr.exports,this.initialized=!1,this.requestQueue={state:Ai.idle,queue:[]},this.sessionRequestQueue={state:Ai.idle,queue:[]},this.requestQueueDelay=ye.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Tr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Js(vr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:f}=n;let h=i,g,_=!1;try{h&&(_=this.client.core.pairing.pairings.get(h).active)}catch(M){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),M}if(!h||!_){const{topic:M,uri:U}=await this.client.core.pairing.create();h=M,g=U}if(!h){const{message:M}=me("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(M)}const E=await this.client.core.crypto.generateKeyPair(),x=Tr.wc_sessionPropose.req.ttl||ye.FIVE_MINUTES,I=Or(x),k=vr({requiredNamespaces:o,optionalNamespaces:c,relays:f??[{protocol:jv}],proposer:{publicKey:E,metadata:this.client.metadata},expiryTimestamp:I,pairingTopic:h},l&&{sessionProperties:l}),{reject:W,resolve:Y,done:B}=qs(x,nw);this.events.once(wt("session_connect"),async({error:M,session:U})=>{if(M)W(M);else if(U){U.self.publicKey=E;const F=Js(vr({},U),{pairingTopic:k.pairingTopic,requiredNamespaces:k.requiredNamespaces,optionalNamespaces:k.optionalNamespaces});await this.client.session.set(U.topic,F),await this.setExpiry(U.topic,U.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:U.peer.metadata}),this.cleanupDuplicatePairings(F),Y(F)}});const z=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:k,throwOnFailedPublish:!0});return await this.setProposal(z,vr({id:z},k)),{uri:g,approval:B}},this.pair=async r=>{await this.isInitialized();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{await this.isInitialized();try{await this.isValidApprove(r)}catch(B){throw this.client.logger.error("approve() -> isValidApprove() failed"),B}const{id:n,relayProtocol:i,namespaces:o,sessionProperties:c,sessionConfig:l}=r;let f;try{f=this.client.proposal.get(n)}catch(B){throw this.client.logger.error(`approve() -> proposal.get(${n}) failed`),B}const{pairingTopic:h,proposer:g,requiredNamespaces:_,optionalNamespaces:E}=f,x=await this.client.core.crypto.generateKeyPair(),I=g.publicKey,k=await this.client.core.crypto.generateSharedKey(x,I),W=vr(vr({relay:{protocol:i??"irn"},namespaces:o,controller:{publicKey:x,metadata:this.client.metadata},expiry:Or(ia)},c&&{sessionProperties:c}),l&&{sessionConfig:l});await this.client.core.relayer.subscribe(k);const Y=Js(vr({},W),{topic:k,requiredNamespaces:_,optionalNamespaces:E,pairingTopic:h,acknowledged:!1,self:W.controller,peer:{publicKey:g.publicKey,metadata:g.metadata},controller:x});await this.client.session.set(k,Y);try{await this.sendResult({id:n,topic:h,result:{relay:{protocol:i??"irn"},responderPublicKey:x},throwOnFailedPublish:!0}),await this.sendRequest({topic:k,method:"wc_sessionSettle",params:W,throwOnFailedPublish:!0})}catch(B){throw this.client.logger.error(B),this.client.session.delete(k,Ut("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(k),B}return await this.client.core.pairing.updateMetadata({topic:h,metadata:g.metadata}),await this.client.proposal.delete(n,Ut("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(k,Or(ia)),{topic:k,acknowledged:()=>new Promise(B=>setTimeout(()=>B(this.client.session.get(k)),500))}},this.reject=async r=>{await this.isInitialized();try{await this.isValidReject(r)}catch(c){throw this.client.logger.error("reject() -> isValidReject() failed"),c}const{id:n,reason:i}=r;let o;try{o=this.client.proposal.get(n).pairingTopic}catch(c){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),c}o&&(await this.sendError({id:n,topic:o,error:i,rpcOpts:Tr.wc_sessionPropose.reject}),await this.client.proposal.delete(n,Ut("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized();try{await this.isValidUpdate(r)}catch(_){throw this.client.logger.error("update() -> isValidUpdate() failed"),_}const{topic:n,namespaces:i}=r,{done:o,resolve:c,reject:l}=qs(),f=us(),h=Ys().toString(),g=this.client.session.get(n).namespaces;return this.events.once(wt("session_update",f),({error:_})=>{_?l(_):c()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:f,relayRpcId:h}).catch(_=>{this.client.logger.error(_),this.client.session.update(n,{namespaces:g}),l(_)}),{acknowledged:o}},this.extend=async r=>{await this.isInitialized();try{await this.isValidExtend(r)}catch(f){throw this.client.logger.error("extend() -> isValidExtend() failed"),f}const{topic:n}=r,i=us(),{done:o,resolve:c,reject:l}=qs();return this.events.once(wt("session_extend",i),({error:f})=>{f?l(f):c()}),await this.setExpiry(n,Or(ia)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(f=>{l(f)}),{acknowledged:o}},this.request=async r=>{await this.isInitialized();try{await this.isValidRequest(r)}catch(x){throw this.client.logger.error("request() -> isValidRequest() failed"),x}const{chainId:n,request:i,topic:o,expiry:c=Tr.wc_sessionRequest.req.ttl}=r,l=this.client.session.get(o),f=us(),h=Ys().toString(),{done:g,resolve:_,reject:E}=qs(c,"Request expired. Please try again.");return this.events.once(wt("session_request",f),({error:x,result:I})=>{x?E(x):_(I)}),await Promise.all([new Promise(async x=>{await this.sendRequest({clientRpcId:f,relayRpcId:h,topic:o,method:"wc_sessionRequest",params:{request:Js(vr({},i),{expiryTimestamp:Or(c)}),chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(I=>E(I)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:f}),x()}),new Promise(async x=>{var I;if(!((I=l.sessionConfig)!=null&&I.disableDeepLink)){const k=await U8(this.client.core.storage,rw);B8({id:f,topic:o,wcDeepLink:k})}x()}),g()]).then(x=>x[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;_i(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):Mn(i)&&await this.sendError({id:o,topic:n,error:i.error}),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=us(),o=Ys().toString(),{done:c,resolve:l,reject:f}=qs();this.events.once(wt("session_ping",i),({error:h})=>{h?f(h):l()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:o}),c()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r,c=Ys().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:o},throwOnFailedPublish:!0,relayRpcId:c})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Ut("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=me("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>lA(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async r=>{this.isInitialized(),this.isValidAuthenticate(r);const{chains:n,statement:i="",uri:o,domain:c,nonce:l,type:f,exp:h,nbf:g,methods:_=[],expiry:E}=r,x=[...r.resources||[]],{topic:I,uri:k}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:I,uri:k}});const W=await this.client.core.crypto.generateKeyPair(),Y=Tl(W);if(await Promise.all([this.client.auth.authKeys.set(Jl,{responseTopic:Y,publicKey:W}),this.client.auth.pairingTopics.set(Y,{topic:Y,pairingTopic:I})]),await this.client.core.relayer.subscribe(Y),this.client.logger.info(`sending request to new pairing topic: ${I}`),_.length>0){const{namespace:d}=ml(n[0]);let p=TE(d,"request",_);$l(x)&&(p=RE(p,x.pop())),x.push(p)}const B=E&&E>Tr.wc_sessionAuthenticate.req.ttl?E:Tr.wc_sessionAuthenticate.req.ttl,z={authPayload:{type:f??"caip122",chains:n,statement:i,aud:o,domain:c,version:"1",nonce:l,iat:new Date().toISOString(),exp:h,nbf:g,resources:x},requester:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:Or(B)},M={eip155:{chains:n,methods:[...new Set(["personal_sign",..._])],events:["chainChanged","accountsChanged"]}},U={requiredNamespaces:{},optionalNamespaces:M,relays:[{protocol:"irn"}],pairingTopic:I,proposer:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:Or(Tr.wc_sessionPropose.req.ttl)},{done:F,resolve:m,reject:$}=qs(B,"Request expired"),te=async({error:d,session:p})=>{if(this.events.off(wt("session_request",ne),ee),d)$(d);else if(p){p.self.publicKey=W,await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:p.peer.metadata});const b=this.client.session.get(p.topic);await this.deleteProposal(de),m({session:b})}},ee=async d=>{if(await this.deletePendingAuthRequest(ne,{message:"fulfilled",code:0}),d.error){const C=Ut("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return d.error.code===C.code?void 0:(this.events.off(wt("session_connect"),te),$(d.error.message))}await this.deleteProposal(de),this.events.off(wt("session_connect"),te);const{cacaos:p,responder:b}=d.result,D=[],O=[];for(const C of p){await hm({cacao:C,projectId:this.client.core.projectId})||(this.client.logger.error(C,"Signature verification failed"),$(Ut("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:v}=C,N=$l(v.resources),oe=[um(v.iss)],pe=Pl(v.iss);if(N){const A=pm(N),re=gm(N);D.push(...A),oe.push(...re)}for(const A of oe)O.push(`${A}:${pe}`)}const T=await this.client.core.crypto.generateSharedKey(W,b.publicKey);let L;D.length>0&&(L={topic:T,acknowledged:!0,self:{publicKey:W,metadata:this.client.metadata},peer:b,controller:b.publicKey,expiry:Or(ia),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:I,namespaces:Sm([...new Set(D)],[...new Set(O)])},await this.client.core.relayer.subscribe(T),await this.client.session.set(T,L),L=this.client.session.get(T)),m({auths:p,session:L})},ne=us(),de=us();this.events.once(wt("session_connect"),te),this.events.once(wt("session_request",ne),ee);try{await Promise.all([this.sendRequest({topic:I,method:"wc_sessionAuthenticate",params:z,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:ne}),this.sendRequest({topic:I,method:"wc_sessionPropose",params:U,expiry:Tr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:de})])}catch(d){throw this.events.off(wt("session_connect"),te),this.events.off(wt("session_request",ne),ee),d}return await this.setProposal(de,vr({id:de},U)),await this.setAuthRequest(ne,{request:Js(vr({},z),{verifyContext:{}}),pairingTopic:I}),{uri:k,response:F}},this.approveSessionAuthenticate=async r=>{this.isInitialized();const{id:n,auths:i}=r,o=this.getPendingAuthRequest(n);if(!o)throw new Error(`Could not find pending auth request with id ${n}`);const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=Tl(c),h={type:ji,receiverPublicKey:c,senderPublicKey:l},g=[],_=[];for(const I of i){if(!await hm({cacao:I,projectId:this.client.core.projectId})){const z=Ut("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:z,encodeOpts:h}),new Error(z.message)}const{p:k}=I,W=$l(k.resources),Y=[um(k.iss)],B=Pl(k.iss);if(W){const z=pm(W),M=gm(W);g.push(...z),Y.push(...M)}for(const z of Y)_.push(`${z}:${B}`)}const E=await this.client.core.crypto.generateSharedKey(l,c);let x;return g?.length>0&&(x={topic:E,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:Or(ia),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:"",namespaces:Sm([...new Set(g)],[...new Set(_)])},await this.client.core.relayer.subscribe(E),await this.client.session.set(E,x)),await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),{session:x}},this.rejectSessionAuthenticate=async r=>{await this.isInitialized();const{id:n,reason:i}=r,o=this.getPendingAuthRequest(n);if(!o)throw new Error(`Could not find pending auth request with id ${n}`);const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=Tl(c),h={type:ji,receiverPublicKey:c,senderPublicKey:l};await this.sendError({id:n,topic:f,error:i,encodeOpts:h,rpcOpts:Tr.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,Ut("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return fm(n,i)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:o=!1,emitEvent:c=!0,id:l=0}=r,{self:f}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,Ut("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(f.publicKey)&&await this.client.core.crypto.deleteKeyPair(f.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),o||this.client.core.expirer.del(i),this.client.core.storage.removeItem(rw).catch(h=>this.client.logger.warn(h)),this.getPendingSessionRequests().forEach(h=>{h.topic===i&&this.deletePendingSessionRequest(h.id,Ut("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=Ai.idle),c&&this.client.events.emit("session_delete",{id:l,topic:i})},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Ut("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=Ai.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Or(Tr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:o}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:o,verifyContext:i.verifyContext})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:o,verifyContext:c}=r,l=o.request.expiryTimestamp||Or(Tr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,l),await this.client.pendingRequest.set(n,{id:n,topic:i,params:o,verifyContext:c})},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:f,throwOnFailedPublish:h}=r,g=ta(i,o,f);if(Fo()&&VI.includes(i)){const x=Ws(JSON.stringify(g));this.client.core.verify.register({attestationId:x})}let _;try{_=await this.client.core.crypto.encode(n,g)}catch(x){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),x}const E=Tr[i].req;return c&&(E.ttl=c),l&&(E.id=l),this.client.core.history.set(n,g),h?(E.internal=Js(vr({},E.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,_,E)):this.client.core.relayer.publish(n,_,E).catch(x=>this.client.logger.error(x)),g.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c,encodeOpts:l}=r,f=Wl(n,o);let h;try{h=await this.client.core.crypto.encode(i,f,l)}catch(E){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),E}let g;try{g=await this.client.core.history.get(i,n)}catch(E){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),E}const _=Tr[g.request.method].res;c?(_.internal=Js(vr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,_)):this.client.core.relayer.publish(i,h,_).catch(E=>this.client.logger.error(E)),await this.client.core.history.resolve(f)},this.sendError=async r=>{const{id:n,topic:i,error:o,encodeOpts:c,rpcOpts:l}=r,f=Vl(n,o);let h;try{h=await this.client.core.crypto.encode(i,f,c)}catch(E){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),E}let g;try{g=await this.client.core.history.get(i,n)}catch(E){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),E}const _=l||Tr[g.request.method].res;this.client.core.relayer.publish(i,h,_),await this.client.core.history.resolve(f)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let o=!1;os(i.expiry)&&(o=!0),this.client.core.crypto.keychain.has(i.topic)||(o=!0),o&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{os(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Ai.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Ai.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Ai.idle},this.processRequest=r=>{const{topic:n,payload:i}=r,o=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:o}))switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=me("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,o=this.expectedPairingMethodMap.get(n);return!o||o.includes(i)?!1:!!(o.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(vr({},n.params));const c=i.expiryTimestamp||Or(Tr.wc_sessionPropose.req.ttl),l=vr({id:o,pairingTopic:r,expiryTimestamp:c},i);await this.setProposal(o,l);const f=Ws(JSON.stringify(n)),h=await this.getVerifyContext(f,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:h})}catch(c){await this.sendError({id:o,topic:r,error:c,rpcOpts:Tr.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(_i(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const f=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:f});const h=await this.client.core.crypto.generateSharedKey(l,f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const g=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:g}),await this.client.core.pairing.activate({topic:r})}else if(Mn(n)){await this.client.proposal.delete(i,Ut("USER_DISCONNECTED"));const o=wt("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(wt("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:f,namespaces:h,sessionProperties:g,sessionConfig:_}=n.params,E=vr(vr({topic:r,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},g&&{sessionProperties:g}),_&&{sessionConfig:_});await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0});const x=wt("session_connect");if(this.events.listenerCount(x)===0)throw new Error(`emitting ${x} without any listeners 997`);this.events.emit(wt("session_connect"),{session:E})}catch(c){await this.sendError({id:i,topic:r,error:c}),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;_i(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(wt("session_approve",i),{})):Mn(n)&&(await this.client.session.delete(r,Ut("USER_DISCONNECTED")),this.events.emit(wt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{const c=`${r}_session_update`,l=ac.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`),this.sendError({id:o,topic:r,error:Ut("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(vr({topic:r},i));try{ac.set(c,o),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:o,topic:r,result:!0,throwOnFailedPublish:!0})}catch(f){throw ac.delete(c),f}this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError({id:o,topic:r,error:c}),this.client.logger.error(c)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,o=wt("session_update",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(wt("session_update",i),{}):Mn(n)&&this.events.emit(wt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Or(ia)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,o=wt("session_extend",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(wt("session_extend",i),{}):Mn(n)&&this.events.emit(wt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,o=wt("session_ping",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);setTimeout(()=>{_i(n)?this.events.emit(wt("session_ping",i),{}):Mn(n)&&this.events.emit(wt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(on.publish,async()=>{o(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Ut("USER_DISCONNECTED")})])}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{var i;const{id:o,params:c}=n;try{await this.isValidRequest(vr({topic:r},c));const l=Ws(JSON.stringify(ta("wc_sessionRequest",c,o))),f=this.client.session.get(r),h=await this.getVerifyContext(l,f.peer.metadata),g={id:o,topic:r,params:c,verifyContext:h};await this.setPendingSessionRequest(g),(i=this.client.signConfig)!=null&&i.disableRequestQueue?this.emitSessionRequest(g):(this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue())}catch(l){await this.sendError({id:o,topic:r,error:l}),this.client.logger.error(l)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,o=wt("session_request",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(wt("session_request",i),{result:n.result}):Mn(n)&&this.events.emit(wt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{const c=`${r}_session_event_${o.event.name}`,l=ac.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(vr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),ac.set(c,i)}catch(c){await this.sendError({id:i,topic:r,error:c}),this.client.logger.error(c)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),_i(n)?this.events.emit(wt("session_request",i),{result:n.result}):Mn(n)&&this.events.emit(wt("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async(r,n)=>{try{const{requester:i,authPayload:o,expiryTimestamp:c}=n.params,l=Ws(JSON.stringify(n)),f=await this.getVerifyContext(l,this.client.metadata),h={requester:i,pairingTopic:r,id:n.id,authPayload:o,verifyContext:f,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:h,pairingTopic:r}),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id})}catch(i){this.client.logger.error(i);const o=n.params.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),l={type:ji,receiverPublicKey:o,senderPublicKey:c};await this.sendError({id:n.id,topic:r,error:i,encodeOpts:l,rpcOpts:Tr.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Ai.idle,this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(o=>o.topic===r&&o.request.method==="wc_sessionRequest").forEach(o=>{const c=o.request.id,l=wt("session_request",c);if(this.events.listenerCount(l)===0)throw new Error(`emitting ${l} without any listeners`);this.events.emit(wt("session_request",o.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Ai.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Ai.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,ta("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async r=>{if(!tn(r)){const{message:f}=me("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(f)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Hr(n)||await this.isValidPairingTopic(n),!_A(l,!0)){const{message:f}=me("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(f)}!Hr(i)&&oc(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Hr(o)&&oc(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Hr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=bA(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!tn(r))throw new Error(me("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const l=this.client.proposal.get(n),f=Rf(i,"approve()");if(f)throw new Error(f.message);const h=Mm(l.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ur(o,!0)){const{message:g}=me("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(g)}Hr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!tn(r)){const{message:o}=me("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!AA(i)){const{message:o}=me("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!tn(r)){const{message:h}=me("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(h)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!Cm(n)){const{message:h}=me("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const l=pA(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const f=Rf(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(os(c)){const{message:h}=me("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async r=>{if(!tn(r)){const{message:f}=me("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(f)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=Rf(i,"update()");if(c)throw new Error(c.message);const l=Mm(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!tn(r)){const{message:i}=me("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!tn(r)){const{message:f}=me("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(f)}const{topic:n,request:i,chainId:o,expiry:c}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!Om(l,o)){const{message:f}=me("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(f)}if(!xA(i)){const{message:f}=me("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!DA(l,o,i.method)){const{message:f}=me("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!PA(c,f0)){const{message:f}=me("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${f0.min} and ${f0.max}`);throw new Error(f)}},this.isValidRespond=async r=>{var n;if(!tn(r)){const{message:c}=me("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(c)}const{topic:i,response:o}=r;try{await this.isValidSessionTopic(i)}catch(c){throw(n=r?.response)!=null&&n.id&&this.cleanupAfterResponse(r),c}if(!SA(o)){const{message:c}=me("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(c)}},this.isValidPing=async r=>{if(!tn(r)){const{message:i}=me("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!tn(r)){const{message:l}=me("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!Om(c,o)){const{message:l}=me("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!IA(i)){const{message:l}=me("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!CA(c,o,i.name)){const{message:l}=me("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!tn(r)){const{message:i}=me("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:o,nonce:c}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ur(i,!1))throw new Error("uri is required parameter");if(!ur(o,!1))throw new Error("domain is required parameter");if(!ur(c,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(f=>ml(f).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:l}=ml(n[0]);if(l!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||na,validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o.origin,i.verified.isScam=o.isScam,i.verified.validation=o.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(o){this.client.logger.info(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ur(i,!1)){const{message:o}=me("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const o=this.recentlyDeletedLimit/2;for(const c of this.recentlyDeletedMap.keys()){if(i++>=o)break;this.recentlyDeletedMap.delete(c)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=me("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}}}async isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(on.message,async e=>{const{topic:r,message:n}=e,{publicKey:i}=this.client.auth.authKeys.keys.includes(Jl)?this.client.auth.authKeys.get(Jl):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:i});try{e0(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):Gl(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o})}catch(c){this.client.logger.error(c)}})}registerExpirerEvents(){this.client.core.expirer.on($n.expired,async e=>{const{topic:r,id:n}=ng(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,me("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,me("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(ra.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(ra.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ur(e,!1)){const{message:r}=me("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=me("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(os(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=me("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ur(e,!1)){const{message:r}=me("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=me("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(os(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=me("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=me("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ur(e,!1)){const{message:r}=me("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=me("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!EA(e)){const{message:r}=me("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=me("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(os(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=me("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class sD extends Qs{constructor(e,r){super(e,r,zI,u0),this.core=e,this.logger=r}}class oD extends Qs{constructor(e,r){super(e,r,HI,u0),this.core=e,this.logger=r}}class aD extends Qs{constructor(e,r){super(e,r,WI,u0,n=>n.id),this.core=e,this.logger=r}}class cD extends Qs{constructor(e,r){super(e,r,QI,Ql,()=>Jl),this.core=e,this.logger=r}}class lD extends Qs{constructor(e,r){super(e,r,JI,Ql),this.core=e,this.logger=r}}class uD extends Qs{constructor(e,r){super(e,r,ZI,Ql,n=>n.id),this.core=e,this.logger=r}}class hD{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new cD(this.core,this.logger),this.pairingTopics=new lD(this.core,this.logger),this.requests=new uD(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class d0 extends tx{constructor(e){super(e),this.protocol=Xv,this.version=ew,this.name=h0.name,this.events=new Dr.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async n=>{try{return await this.engine.authenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=e?.name||h0.name,this.metadata=e?.metadata||M8(),this.signConfig=e?.signConfig;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:yi(Hl({level:e?.logger||h0.logger}));this.core=e?.core||new qI(e),this.logger=sn(r,this.name),this.session=new oD(this.core,this.logger),this.proposal=new sD(this.core,this.logger),this.pendingRequest=new aD(this.core,this.logger),this.engine=new iD(this),this.auth=new hD(this.core,this.logger)}static async init(e){const r=new d0(e);return await r.initialize(),r}get context(){return nn(this.logger)}get pairing(){return this.core.pairing.pairings}validateMetadata(e){if(!e.name)throw new Error("name is required value in metadata");if(!e.description)throw new Error("description is required value in metadata");if(!e.url)throw new Error("url is required value in metadata")}async initialize(){this.logger.trace("Initialized");try{await this.validateMetadata(this.metadata),await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var p0={exports:{}};(function(t,e){var r=typeof self<"u"?self:jr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function f(p){return p&&DataView.prototype.isPrototypeOf(p)}if(l.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=ArrayBuffer.isView||function(p){return p&&h.indexOf(Object.prototype.toString.call(p))>-1};function _(p){if(typeof p!="string"&&(p=String(p)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(p))throw new TypeError("Invalid character in header field name");return p.toLowerCase()}function E(p){return typeof p!="string"&&(p=String(p)),p}function x(p){var b={next:function(){var D=p.shift();return{done:D===void 0,value:D}}};return l.iterable&&(b[Symbol.iterator]=function(){return b}),b}function I(p){this.map={},p instanceof I?p.forEach(function(b,D){this.append(D,b)},this):Array.isArray(p)?p.forEach(function(b){this.append(b[0],b[1])},this):p&&Object.getOwnPropertyNames(p).forEach(function(b){this.append(b,p[b])},this)}I.prototype.append=function(p,b){p=_(p),b=E(b);var D=this.map[p];this.map[p]=D?D+", "+b:b},I.prototype.delete=function(p){delete this.map[_(p)]},I.prototype.get=function(p){return p=_(p),this.has(p)?this.map[p]:null},I.prototype.has=function(p){return this.map.hasOwnProperty(_(p))},I.prototype.set=function(p,b){this.map[_(p)]=E(b)},I.prototype.forEach=function(p,b){for(var D in this.map)this.map.hasOwnProperty(D)&&p.call(b,this.map[D],D,this)},I.prototype.keys=function(){var p=[];return this.forEach(function(b,D){p.push(D)}),x(p)},I.prototype.values=function(){var p=[];return this.forEach(function(b){p.push(b)}),x(p)},I.prototype.entries=function(){var p=[];return this.forEach(function(b,D){p.push([D,b])}),x(p)},l.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function k(p){if(p.bodyUsed)return Promise.reject(new TypeError("Already read"));p.bodyUsed=!0}function W(p){return new Promise(function(b,D){p.onload=function(){b(p.result)},p.onerror=function(){D(p.error)}})}function Y(p){var b=new FileReader,D=W(b);return b.readAsArrayBuffer(p),D}function B(p){var b=new FileReader,D=W(b);return b.readAsText(p),D}function z(p){for(var b=new Uint8Array(p),D=new Array(b.length),O=0;O<b.length;O++)D[O]=String.fromCharCode(b[O]);return D.join("")}function M(p){if(p.slice)return p.slice(0);var b=new Uint8Array(p.byteLength);return b.set(new Uint8Array(p)),b.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(p){this._bodyInit=p,p?typeof p=="string"?this._bodyText=p:l.blob&&Blob.prototype.isPrototypeOf(p)?this._bodyBlob=p:l.formData&&FormData.prototype.isPrototypeOf(p)?this._bodyFormData=p:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(p)?this._bodyText=p.toString():l.arrayBuffer&&l.blob&&f(p)?(this._bodyArrayBuffer=M(p.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(p)||g(p))?this._bodyArrayBuffer=M(p):this._bodyText=p=Object.prototype.toString.call(p):this._bodyText="",this.headers.get("content-type")||(typeof p=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(p)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var p=k(this);if(p)return p;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?k(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Y)}),this.text=function(){var p=k(this);if(p)return p;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(z(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(te)}),this.json=function(){return this.text().then(JSON.parse)},this}var F=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(p){var b=p.toUpperCase();return F.indexOf(b)>-1?b:p}function $(p,b){b=b||{};var D=b.body;if(p instanceof $){if(p.bodyUsed)throw new TypeError("Already read");this.url=p.url,this.credentials=p.credentials,b.headers||(this.headers=new I(p.headers)),this.method=p.method,this.mode=p.mode,this.signal=p.signal,!D&&p._bodyInit!=null&&(D=p._bodyInit,p.bodyUsed=!0)}else this.url=String(p);if(this.credentials=b.credentials||this.credentials||"same-origin",(b.headers||!this.headers)&&(this.headers=new I(b.headers)),this.method=m(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.signal=b.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function te(p){var b=new FormData;return p.trim().split("&").forEach(function(D){if(D){var O=D.split("="),T=O.shift().replace(/\+/g," "),L=O.join("=").replace(/\+/g," ");b.append(decodeURIComponent(T),decodeURIComponent(L))}}),b}function ee(p){var b=new I,D=p.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(O){var T=O.split(":"),L=T.shift().trim();if(L){var C=T.join(":").trim();b.append(L,C)}}),b}U.call($.prototype);function ne(p,b){b||(b={}),this.type="default",this.status=b.status===void 0?200:b.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new I(b.headers),this.url=b.url||"",this._initBody(p)}U.call(ne.prototype),ne.prototype.clone=function(){return new ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},ne.error=function(){var p=new ne(null,{status:0,statusText:""});return p.type="error",p};var de=[301,302,303,307,308];ne.redirect=function(p,b){if(de.indexOf(b)===-1)throw new RangeError("Invalid status code");return new ne(null,{status:b,headers:{location:p}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(b,D){this.message=b,this.name=D;var O=Error(b);this.stack=O.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function d(p,b){return new Promise(function(D,O){var T=new $(p,b);if(T.signal&&T.signal.aborted)return O(new c.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function C(){L.abort()}L.onload=function(){var v={status:L.status,statusText:L.statusText,headers:ee(L.getAllResponseHeaders()||"")};v.url="responseURL"in L?L.responseURL:v.headers.get("X-Request-URL");var N="response"in L?L.response:L.responseText;D(new ne(N,v))},L.onerror=function(){O(new TypeError("Network request failed"))},L.ontimeout=function(){O(new TypeError("Network request failed"))},L.onabort=function(){O(new c.DOMException("Aborted","AbortError"))},L.open(T.method,T.url,!0),T.credentials==="include"?L.withCredentials=!0:T.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&l.blob&&(L.responseType="blob"),T.headers.forEach(function(v,N){L.setRequestHeader(N,v)}),T.signal&&(T.signal.addEventListener("abort",C),L.onreadystatechange=function(){L.readyState===4&&T.signal.removeEventListener("abort",C)}),L.send(typeof T._bodyInit>"u"?null:T._bodyInit)})}return d.polyfill=!0,o.fetch||(o.fetch=d,o.Headers=I,o.Request=$,o.Response=ne),c.Headers=I,c.Request=$,c.Response=ne,c.fetch=d,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(p0,p0.exports);var ow=t3(p0.exports),fD=Object.defineProperty,dD=Object.defineProperties,pD=Object.getOwnPropertyDescriptors,aw=Object.getOwnPropertySymbols,gD=Object.prototype.hasOwnProperty,mD=Object.prototype.propertyIsEnumerable,cw=(t,e,r)=>e in t?fD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lw=(t,e)=>{for(var r in e||(e={}))gD.call(e,r)&&cw(t,r,e[r]);if(aw)for(var r of aw(e))mD.call(e,r)&&cw(t,r,e[r]);return t},uw=(t,e)=>dD(t,pD(e));const vD={Accept:"application/json","Content-Type":"application/json"},wD="POST",hw={headers:vD,method:wD},fw=10;class fs{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Dr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!pv(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=ki(e),n=await(await ow(this.url,uw(lw({},hw),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!pv(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=ki({id:1,jsonrpc:"2.0",method:"test",params:[]});await ow(e,uw(lw({},hw),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?lc(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=Vl(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return cv(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>fw&&this.events.setMaxListeners(fw)}}const dw="error",yD="wss://relay.walletconnect.com",bD="wc",_D="universal_provider",pw=`${bD}@2:${_D}:`,ED="https://rpc.walletconnect.com/v1/",Ki={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g0={exports:{}};/**
|
|
43
|
+
***************************************************************************** */var Jf=function(t,e){return Jf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Jf(t,e)};function Dx(t,e){Jf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Zf=function(){return Zf=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Zf.apply(this,arguments)};function Ox(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Mx(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Px(t,e){return function(r,n){e(r,n,t)}}function $x(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Tx(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(g){try{h(n.next(g))}catch(_){c(_)}}function f(g){try{h(n.throw(g))}catch(_){c(_)}}function h(g){g.done?o(g.value):i(g.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function Nx(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(h){return function(g){return f([h,g])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Rx(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Lx(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Xf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 lv(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Bx(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(lv(arguments[e]));return t}function Ux(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function pc(t){return this instanceof pc?(this.v=t,this):new pc(t)}function Fx(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(E){n[E]&&(i[E]=function(x){return new Promise(function(I,F){o.push([E,x,I,F])>1||l(E,x)})})}function l(E,x){try{f(n[E](x))}catch(I){_(o[0][3],I)}}function f(E){E.value instanceof pc?Promise.resolve(E.value.v).then(h,g):_(o[0][2],E)}function h(E){l("next",E)}function g(E){l("throw",E)}function _(E,x){E(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function jx(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:pc(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function kx(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 Xf=="function"?Xf(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function qx(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function zx(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Hx(t){return t&&t.__esModule?t:{default:t}}function Kx(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Wx(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Vx=Object.freeze({__proto__:null,__extends:Dx,get __assign(){return Zf},__rest:Ox,__decorate:Mx,__param:Px,__metadata:$x,__awaiter:Tx,__generator:Nx,__createBinding:Rx,__exportStar:Lx,__values:Xf,__read:lv,__spread:Bx,__spreadArrays:Ux,__await:pc,__asyncGenerator:Fx,__asyncDelegator:jx,__asyncValues:kx,__makeTemplateObject:qx,__importStar:zx,__importDefault:Hx,__classPrivateFieldGet:Kx,__classPrivateFieldSet:Wx}),Gx=il(Vx),qi={},uv;function Yx(){if(uv)return qi;uv=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.isBrowserCryptoAvailable=qi.getSubtleCrypto=qi.getBrowerCrypto=void 0;function t(){return jr?.crypto||jr?.msCrypto||{}}qi.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}qi.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return qi.isBrowserCryptoAvailable=r,qi}var zi={},hv;function Qx(){if(hv)return zi;hv=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.isBrowser=zi.isNode=zi.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}zi.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}zi.isNode=e;function r(){return!t()&&!e()}return zi.isBrowser=r,zi}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Gx;e.__exportStar(Yx(),t),e.__exportStar(Qx(),t)})(cv);function us(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ys(t=6){return BigInt(us(t))}function ta(t,e,r){return{id:r||us(),jsonrpc:"2.0",method:t,params:e}}function Wl(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Vl(t,e,r){return{id:t,jsonrpc:"2.0",error:Jx(e,r)}}function Jx(t,e){return typeof t>"u"?ov(iv):(typeof t=="string"&&(t=Object.assign(Object.assign({},ov(Qf)),{message:t})),typeof e<"u"&&(t.data=e),Sx(t.code)&&(t=Cx(t.code)),t)}class Zx{}class Xx extends Zx{constructor(){super()}}class e9 extends Xx{constructor(e){super()}}const t9="^https?:",r9="^wss?:";function n9(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function fv(t,e){const r=n9(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function dv(t){return fv(t,t9)}function pv(t){return fv(t,r9)}function i9(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function gv(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function e0(t){return gv(t)&&"method"in t}function Gl(t){return gv(t)&&(_i(t)||Mn(t))}function _i(t){return"result"in t}function Mn(t){return"error"in t}class Hi extends e9{constructor(e){super(e),this.events=new Cr.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(ta(e.method,e.params||[],e.id||Ys().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{Mn(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Gl(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const s9=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),o9=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",mv=t=>t.split("?")[0],vv=10,a9=s9();class c9{constructor(e){if(this.url=e,this.events=new Cr.exports.EventEmitter,this.registering=!1,!pv(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Li(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!pv(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),o=cv.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!i9(e)},c=new a9(e,[],o);o9()?c.onerror=l=>{const f=l;n(this.emitError(f.error))}:c.on("error",l=>{n(this.emitError(l))}),c.onopen=()=>{this.onOpen(c),r(c)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ja(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=Vl(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return av(e,mv(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>vv&&this.events.setMaxListeners(vv)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${mv(this.url)}`));return this.events.emit("register_error",r),r}}var t0={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",f="[object Array]",h="[object AsyncFunction]",g="[object Boolean]",_="[object Date]",E="[object Error]",x="[object Function]",I="[object GeneratorFunction]",F="[object Map]",W="[object Number]",Y="[object Null]",B="[object Object]",z="[object Promise]",M="[object Proxy]",U="[object RegExp]",j="[object Set]",m="[object String]",$="[object Symbol]",te="[object Undefined]",ee="[object WeakMap]",ne="[object ArrayBuffer]",de="[object DataView]",d="[object Float32Array]",p="[object Float64Array]",b="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",L="[object Uint8ClampedArray]",D="[object Uint16Array]",v="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,oe=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,A={};A[d]=A[p]=A[b]=A[C]=A[O]=A[T]=A[L]=A[D]=A[v]=!0,A[l]=A[f]=A[ne]=A[g]=A[de]=A[_]=A[E]=A[x]=A[F]=A[W]=A[B]=A[U]=A[j]=A[m]=A[ee]=!1;var re=typeof jr=="object"&&jr&&jr.Object===Object&&jr,q=typeof self=="object"&&self&&self.Object===Object&&self,H=re||q||Function("return this")(),V=e&&!e.nodeType&&e,w=V&&!0&&t&&!t.nodeType&&t,k=w&&w.exports===V,ie=k&&re.process,he=function(){try{return ie&&ie.binding&&ie.binding("util")}catch{}}(),le=he&&he.isTypedArray;function Oe(K,J){for(var fe=-1,Ie=K==null?0:K.length,Vt=0,ot=[];++fe<Ie;){var Zt=K[fe];J(Zt,fe,K)&&(ot[Vt++]=Zt)}return ot}function Pe(K,J){for(var fe=-1,Ie=J.length,Vt=K.length;++fe<Ie;)K[Vt+fe]=J[fe];return K}function Se(K,J){for(var fe=-1,Ie=K==null?0:K.length;++fe<Ie;)if(J(K[fe],fe,K))return!0;return!1}function Mt(K,J){for(var fe=-1,Ie=Array(K);++fe<K;)Ie[fe]=J(fe);return Ie}function ze(K){return function(J){return K(J)}}function De(K,J){return K.has(J)}function Fe(K,J){return K?.[J]}function Ee(K){var J=-1,fe=Array(K.size);return K.forEach(function(Ie,Vt){fe[++J]=[Vt,Ie]}),fe}function Ae(K,J){return function(fe){return K(J(fe))}}function Ge(K){var J=-1,fe=Array(K.size);return K.forEach(function(Ie){fe[++J]=Ie}),fe}var be=Array.prototype,xe=Function.prototype,Be=Object.prototype,_e=H["__core-js_shared__"],Me=xe.toString,je=Be.hasOwnProperty,$e=function(){var K=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return K?"Symbol(src)_1."+K:""}(),Te=Be.toString,lt=RegExp("^"+Me.call(je).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=k?H.Buffer:void 0,Ne=H.Symbol,nr=H.Uint8Array,dt=Be.propertyIsEnumerable,Et=be.splice,ir=Ne?Ne.toStringTag:void 0,It=Object.getOwnPropertySymbols,Ot=Re?Re.isBuffer:void 0,Vr=Ae(Object.keys,Object),Ye=bn(H,"DataView"),He=bn(H,"Map"),Rt=bn(H,"Promise"),Qe=bn(H,"Set"),Ve=bn(H,"WeakMap"),Pt=bn(Object,"create"),Xe=Yi(Ye),et=Yi(He),Lt=Yi(Rt),tt=Yi(Qe),Je=Yi(Ve),Ft=Ne?Ne.prototype:void 0,Ze=Ft?Ft.valueOf:void 0;function ke(K){var J=-1,fe=K==null?0:K.length;for(this.clear();++J<fe;){var Ie=K[J];this.set(Ie[0],Ie[1])}}function Ht(){this.__data__=Pt?Pt(null):{},this.size=0}function rt(K){var J=this.has(K)&&delete this.__data__[K];return this.size-=J?1:0,J}function jt(K){var J=this.__data__;if(Pt){var fe=J[K];return fe===n?void 0:fe}return je.call(J,K)?J[K]:void 0}function ti(K){var J=this.__data__;return Pt?J[K]!==void 0:je.call(J,K)}function kt(K,J){var fe=this.__data__;return this.size+=this.has(K)?0:1,fe[K]=Pt&&J===void 0?n:J,this}ke.prototype.clear=Ht,ke.prototype.delete=rt,ke.prototype.get=jt,ke.prototype.has=ti,ke.prototype.set=kt;function vt(K){var J=-1,fe=K==null?0:K.length;for(this.clear();++J<fe;){var Ie=K[J];this.set(Ie[0],Ie[1])}}function Nn(){this.__data__=[],this.size=0}function Rn(K){var J=this.__data__,fe=bo(J,K);if(fe<0)return!1;var Ie=J.length-1;return fe==Ie?J.pop():Et.call(J,fe,1),--this.size,!0}function Ln(K){var J=this.__data__,fe=bo(J,K);return fe<0?void 0:J[fe][1]}function Bn(K){return bo(this.__data__,K)>-1}function Un(K,J){var fe=this.__data__,Ie=bo(fe,K);return Ie<0?(++this.size,fe.push([K,J])):fe[Ie][1]=J,this}vt.prototype.clear=Nn,vt.prototype.delete=Rn,vt.prototype.get=Ln,vt.prototype.has=Bn,vt.prototype.set=Un;function xr(K){var J=-1,fe=K==null?0:K.length;for(this.clear();++J<fe;){var Ie=K[J];this.set(Ie[0],Ie[1])}}function Di(){this.size=0,this.__data__={hash:new ke,map:new(He||vt),string:new ke}}function fo(K){var J=Ds(this,K).delete(K);return this.size-=J?1:0,J}function Oi(K){return Ds(this,K).get(K)}function po(K){return Ds(this,K).has(K)}function go(K,J){var fe=Ds(this,K),Ie=fe.size;return fe.set(K,J),this.size+=fe.size==Ie?0:1,this}xr.prototype.clear=Di,xr.prototype.delete=fo,xr.prototype.get=Oi,xr.prototype.has=po,xr.prototype.set=go;function Mi(K){var J=-1,fe=K==null?0:K.length;for(this.__data__=new xr;++J<fe;)this.add(K[J])}function Ss(K){return this.__data__.set(K,n),this}function Cs(K){return this.__data__.has(K)}Mi.prototype.add=Mi.prototype.push=Ss,Mi.prototype.has=Cs;function Gr(K){var J=this.__data__=new vt(K);this.size=J.size}function mo(){this.__data__=new vt,this.size=0}function vo(K){var J=this.__data__,fe=J.delete(K);return this.size=J.size,fe}function wo(K){return this.__data__.get(K)}function yo(K){return this.__data__.has(K)}function Pu(K,J){var fe=this.__data__;if(fe instanceof vt){var Ie=fe.__data__;if(!He||Ie.length<r-1)return Ie.push([K,J]),this.size=++fe.size,this;fe=this.__data__=new xr(Ie)}return fe.set(K,J),this.size=fe.size,this}Gr.prototype.clear=mo,Gr.prototype.delete=vo,Gr.prototype.get=wo,Gr.prototype.has=yo,Gr.prototype.set=Pu;function $u(K,J){var fe=xa(K),Ie=!fe&&Hu(K),Vt=!fe&&!Ie&&kc(K),ot=!fe&&!Ie&&!Vt&&Vu(K),Zt=fe||Ie||Vt||ot,gr=Zt?Mt(K.length,String):[],St=gr.length;for(var Gt in K)(J||je.call(K,Gt))&&!(Zt&&(Gt=="length"||Vt&&(Gt=="offset"||Gt=="parent")||ot&&(Gt=="buffer"||Gt=="byteLength"||Gt=="byteOffset")||Fu(Gt,St)))&&gr.push(Gt);return gr}function bo(K,J){for(var fe=K.length;fe--;)if(zu(K[fe][0],J))return fe;return-1}function Fc(K,J,fe){var Ie=J(K);return xa(K)?Ie:Pe(Ie,fe(K))}function _o(K){return K==null?K===void 0?te:Y:ir&&ir in Object(K)?Bu(K):$d(K)}function jc(K){return Ao(K)&&_o(K)==l}function Eo(K,J,fe,Ie,Vt){return K===J?!0:K==null||J==null||!Ao(K)&&!Ao(J)?K!==K&&J!==J:Tu(K,J,fe,Ie,Eo,Vt)}function Tu(K,J,fe,Ie,Vt,ot){var Zt=xa(K),gr=xa(J),St=Zt?f:Pi(K),Gt=gr?f:Pi(J);St=St==l?B:St,Gt=Gt==l?B:Gt;var fr=St==B,ln=Gt==B,mr=St==Gt;if(mr&&kc(K)){if(!kc(J))return!1;Zt=!0,fr=!1}if(mr&&!fr)return ot||(ot=new Gr),Zt||Vu(K)?Ea(K,J,fe,Ie,Vt,ot):Pd(K,J,St,fe,Ie,Vt,ot);if(!(fe&i)){var Xt=fr&&je.call(K,"__wrapped__"),Yr=ln&&je.call(J,"__wrapped__");if(Xt||Yr){var ri=Xt?K.value():K,Fn=Yr?J.value():J;return ot||(ot=new Gr),Vt(ri,Fn,fe,Ie,ot)}}return mr?(ot||(ot=new Gr),Lu(K,J,fe,Ie,Vt,ot)):!1}function Md(K){if(!Wu(K)||ku(K))return!1;var J=Ia(K)?lt:oe;return J.test(Yi(K))}function Nu(K){return Ao(K)&&Ku(K.length)&&!!A[_o(K)]}function Ru(K){if(!qu(K))return Vr(K);var J=[];for(var fe in Object(K))je.call(K,fe)&&fe!="constructor"&&J.push(fe);return J}function Ea(K,J,fe,Ie,Vt,ot){var Zt=fe&i,gr=K.length,St=J.length;if(gr!=St&&!(Zt&&St>gr))return!1;var Gt=ot.get(K);if(Gt&&ot.get(J))return Gt==J;var fr=-1,ln=!0,mr=fe&o?new Mi:void 0;for(ot.set(K,J),ot.set(J,K);++fr<gr;){var Xt=K[fr],Yr=J[fr];if(Ie)var ri=Zt?Ie(Yr,Xt,fr,J,K,ot):Ie(Xt,Yr,fr,K,J,ot);if(ri!==void 0){if(ri)continue;ln=!1;break}if(mr){if(!Se(J,function(Fn,$i){if(!De(mr,$i)&&(Xt===Fn||Vt(Xt,Fn,fe,Ie,ot)))return mr.push($i)})){ln=!1;break}}else if(!(Xt===Yr||Vt(Xt,Yr,fe,Ie,ot))){ln=!1;break}}return ot.delete(K),ot.delete(J),ln}function Pd(K,J,fe,Ie,Vt,ot,Zt){switch(fe){case de:if(K.byteLength!=J.byteLength||K.byteOffset!=J.byteOffset)return!1;K=K.buffer,J=J.buffer;case ne:return!(K.byteLength!=J.byteLength||!ot(new nr(K),new nr(J)));case g:case _:case W:return zu(+K,+J);case E:return K.name==J.name&&K.message==J.message;case U:case m:return K==J+"";case F:var gr=Ee;case j:var St=Ie&i;if(gr||(gr=Ge),K.size!=J.size&&!St)return!1;var Gt=Zt.get(K);if(Gt)return Gt==J;Ie|=o,Zt.set(K,J);var fr=Ea(gr(K),gr(J),Ie,Vt,ot,Zt);return Zt.delete(K),fr;case $:if(Ze)return Ze.call(K)==Ze.call(J)}return!1}function Lu(K,J,fe,Ie,Vt,ot){var Zt=fe&i,gr=Aa(K),St=gr.length,Gt=Aa(J),fr=Gt.length;if(St!=fr&&!Zt)return!1;for(var ln=St;ln--;){var mr=gr[ln];if(!(Zt?mr in J:je.call(J,mr)))return!1}var Xt=ot.get(K);if(Xt&&ot.get(J))return Xt==J;var Yr=!0;ot.set(K,J),ot.set(J,K);for(var ri=Zt;++ln<St;){mr=gr[ln];var Fn=K[mr],$i=J[mr];if(Ie)var qc=Zt?Ie($i,Fn,mr,J,K,ot):Ie(Fn,$i,mr,K,J,ot);if(!(qc===void 0?Fn===$i||Vt(Fn,$i,fe,Ie,ot):qc)){Yr=!1;break}ri||(ri=mr=="constructor")}if(Yr&&!ri){var xo=K.constructor,Ir=J.constructor;xo!=Ir&&"constructor"in K&&"constructor"in J&&!(typeof xo=="function"&&xo instanceof xo&&typeof Ir=="function"&&Ir instanceof Ir)&&(Yr=!1)}return ot.delete(K),ot.delete(J),Yr}function Aa(K){return Fc(K,Rd,Uu)}function Ds(K,J){var fe=K.__data__;return ju(J)?fe[typeof J=="string"?"string":"hash"]:fe.map}function bn(K,J){var fe=Fe(K,J);return Md(fe)?fe:void 0}function Bu(K){var J=je.call(K,ir),fe=K[ir];try{K[ir]=void 0;var Ie=!0}catch{}var Vt=Te.call(K);return Ie&&(J?K[ir]=fe:delete K[ir]),Vt}var Uu=It?function(K){return K==null?[]:(K=Object(K),Oe(It(K),function(J){return dt.call(K,J)}))}:Wt,Pi=_o;(Ye&&Pi(new Ye(new ArrayBuffer(1)))!=de||He&&Pi(new He)!=F||Rt&&Pi(Rt.resolve())!=z||Qe&&Pi(new Qe)!=j||Ve&&Pi(new Ve)!=ee)&&(Pi=function(K){var J=_o(K),fe=J==B?K.constructor:void 0,Ie=fe?Yi(fe):"";if(Ie)switch(Ie){case Xe:return de;case et:return F;case Lt:return z;case tt:return j;case Je:return ee}return J});function Fu(K,J){return J=J??c,!!J&&(typeof K=="number"||pe.test(K))&&K>-1&&K%1==0&&K<J}function ju(K){var J=typeof K;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?K!=="__proto__":K===null}function ku(K){return!!$e&&$e in K}function qu(K){var J=K&&K.constructor,fe=typeof J=="function"&&J.prototype||Be;return K===fe}function $d(K){return Te.call(K)}function Yi(K){if(K!=null){try{return Me.call(K)}catch{}try{return K+""}catch{}}return""}function zu(K,J){return K===J||K!==K&&J!==J}var Hu=jc(function(){return arguments}())?jc:function(K){return Ao(K)&&je.call(K,"callee")&&!dt.call(K,"callee")},xa=Array.isArray;function Td(K){return K!=null&&Ku(K.length)&&!Ia(K)}var kc=Ot||Kt;function Nd(K,J){return Eo(K,J)}function Ia(K){if(!Wu(K))return!1;var J=_o(K);return J==x||J==I||J==h||J==M}function Ku(K){return typeof K=="number"&&K>-1&&K%1==0&&K<=c}function Wu(K){var J=typeof K;return K!=null&&(J=="object"||J=="function")}function Ao(K){return K!=null&&typeof K=="object"}var Vu=le?ze(le):Nu;function Rd(K){return Td(K)?$u(K):Ru(K)}function Wt(){return[]}function Kt(){return!1}t.exports=Nd})(t0,t0.exports);var l9=t0.exports;function u9(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],c=[],l={},f=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return o},entries:function(){return c},get:function(g){return l[g.toLowerCase()]},has:function(g){return g.toLowerCase()in l}}}};for(var h in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(g,_,E){o.push(_=_.toLowerCase()),c.push([_,E]),l[_]=l[_]?l[_]+","+E:E}),r(f())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var h9=Object.freeze({__proto__:null,default:u9}),wv=il(h9),f9=self.fetch||(self.fetch=wv.default||wv),d9=Object.defineProperty,yv=Object.getOwnPropertySymbols,p9=Object.prototype.hasOwnProperty,g9=Object.prototype.propertyIsEnumerable,bv=(t,e,r)=>e in t?d9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kr=(t,e)=>{for(var r in e||(e={}))p9.call(e,r)&&bv(t,r,e[r]);if(yv)for(var r of yv(e))g9.call(e,r)&&bv(t,r,e[r]);return t};function m9(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,f=t.charAt(0),h=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function _(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var F=0,W=0,Y=0,B=I.length;Y!==B&&I[Y]===0;)Y++,F++;for(var z=(B-Y)*g+1>>>0,M=new Uint8Array(z);Y!==B;){for(var U=I[Y],j=0,m=z-1;(U!==0||j<W)&&m!==-1;m--,j++)U+=256*M[m]>>>0,M[m]=U%l>>>0,U=U/l>>>0;if(U!==0)throw new Error("Non-zero carry");W=j,Y++}for(var $=z-W;$!==z&&M[$]===0;)$++;for(var te=f.repeat(F);$<z;++$)te+=t.charAt(M[$]);return te}function E(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var F=0;if(I[F]!==" "){for(var W=0,Y=0;I[F]===f;)W++,F++;for(var B=(I.length-F)*h+1>>>0,z=new Uint8Array(B);I[F];){var M=r[I.charCodeAt(F)];if(M===255)return;for(var U=0,j=B-1;(M!==0||U<Y)&&j!==-1;j--,U++)M+=l*z[j]>>>0,z[j]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");Y=U,F++}if(I[F]!==" "){for(var m=B-Y;m!==B&&z[m]===0;)m++;for(var $=new Uint8Array(W+(B-m)),te=W;m!==B;)$[te++]=z[m++];return $}}}function x(I){var F=E(I);if(F)return F;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:E,decode:x}}var v9=m9,w9=v9;const _v=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},y9=t=>new TextEncoder().encode(t),b9=t=>new TextDecoder().decode(t);class _9{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class E9{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Ev(this,e)}}class A9{constructor(e){this.decoders=e}or(e){return Ev(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ev=(t,e)=>new A9(Kr(Kr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class x9{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new _9(e,r,n),this.decoder=new E9(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Yl=({name:t,prefix:e,encode:r,decode:n})=>new x9(t,e,r,n),gc=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=w9(r,e);return Yl({prefix:t,name:e,encode:n,decode:o=>_v(i(o))})},I9=(t,e,r,n)=>{const i={};for(let g=0;g<e.length;++g)i[e[g]]=g;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,f=0,h=0;for(let g=0;g<o;++g){const _=i[t[g]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|_,l+=r,l>=8&&(l-=8,c[h++]=255&f>>l)}if(l>=r||255&f<<8-l)throw new SyntaxError("Unexpected end of data");return c},S9=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<t.length;++f)for(l=l<<8|t[f],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},$r=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Yl({prefix:e,name:t,encode(i){return S9(i,n,r)},decode(i){return I9(i,n,r,t)}}),C9=Yl({prefix:"\0",name:"identity",encode:t=>b9(t),decode:t=>y9(t)});var D9=Object.freeze({__proto__:null,identity:C9});const O9=$r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var M9=Object.freeze({__proto__:null,base2:O9});const P9=$r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $9=Object.freeze({__proto__:null,base8:P9});const T9=gc({prefix:"9",name:"base10",alphabet:"0123456789"});var N9=Object.freeze({__proto__:null,base10:T9});const R9=$r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),L9=$r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var B9=Object.freeze({__proto__:null,base16:R9,base16upper:L9});const U9=$r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),F9=$r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),j9=$r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),k9=$r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q9=$r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),z9=$r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),H9=$r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),K9=$r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),W9=$r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var V9=Object.freeze({__proto__:null,base32:U9,base32upper:F9,base32pad:j9,base32padupper:k9,base32hex:q9,base32hexupper:z9,base32hexpad:H9,base32hexpadupper:K9,base32z:W9});const G9=gc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Y9=gc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Q9=Object.freeze({__proto__:null,base36:G9,base36upper:Y9});const J9=gc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Z9=gc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var X9=Object.freeze({__proto__:null,base58btc:J9,base58flickr:Z9});const eI=$r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tI=$r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),rI=$r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nI=$r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iI=Object.freeze({__proto__:null,base64:eI,base64pad:tI,base64url:rI,base64urlpad:nI});const Av=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),sI=Av.reduce((t,e,r)=>(t[r]=e,t),[]),oI=Av.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function aI(t){return t.reduce((e,r)=>(e+=sI[r],e),"")}function cI(t){const e=[];for(const r of t){const n=oI[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const lI=Yl({prefix:"\u{1F680}",name:"base256emoji",encode:aI,decode:cI});var uI=Object.freeze({__proto__:null,base256emoji:lI}),hI=Iv,xv=128,fI=127,dI=~fI,pI=Math.pow(2,31);function Iv(t,e,r){e=e||[],r=r||0;for(var n=r;t>=pI;)e[r++]=t&255|xv,t/=128;for(;t&dI;)e[r++]=t&255|xv,t>>>=7;return e[r]=t|0,Iv.bytes=r-n+1,e}var gI=r0,mI=128,Sv=127;function r0(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw r0.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Sv)<<i:(c&Sv)*Math.pow(2,i),i+=7}while(c>=mI);return r0.bytes=o-n,r}var vI=Math.pow(2,7),wI=Math.pow(2,14),yI=Math.pow(2,21),bI=Math.pow(2,28),_I=Math.pow(2,35),EI=Math.pow(2,42),AI=Math.pow(2,49),xI=Math.pow(2,56),II=Math.pow(2,63),SI=function(t){return t<vI?1:t<wI?2:t<yI?3:t<bI?4:t<_I?5:t<EI?6:t<AI?7:t<xI?8:t<II?9:10},CI={encode:hI,decode:gI,encodingLength:SI},Cv=CI;const Dv=(t,e,r=0)=>(Cv.encode(t,e,r),e),Ov=t=>Cv.encodingLength(t),n0=(t,e)=>{const r=e.byteLength,n=Ov(t),i=n+Ov(r),o=new Uint8Array(i+r);return Dv(t,o,0),Dv(r,o,n),o.set(e,i),new DI(t,r,e,o)};class DI{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Mv=({name:t,code:e,encode:r})=>new OI(t,e,r);class OI{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?n0(this.code,r):r.then(n=>n0(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Pv=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),MI=Mv({name:"sha2-256",code:18,encode:Pv("SHA-256")}),PI=Mv({name:"sha2-512",code:19,encode:Pv("SHA-512")});var $I=Object.freeze({__proto__:null,sha256:MI,sha512:PI});const $v=0,TI="identity",Tv=_v;var NI=Object.freeze({__proto__:null,identity:{code:$v,name:TI,encode:Tv,digest:t=>n0($v,Tv(t))}});new TextEncoder,new TextDecoder;const Nv=Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr({},D9),M9),$9),N9),B9),V9),Q9),X9),iI),uI);Kr(Kr({},$I),NI);function RI(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Rv(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Lv=Rv("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),i0=Rv("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=RI(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),LI=Kr({utf8:Lv,"utf-8":Lv,hex:Nv.base16,latin1:i0,ascii:i0,binary:i0},Nv);function BI(t,e="utf8"){const r=LI[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const Bv="wc",UI=2,s0="core",hs=`${Bv}@2:${s0}:`,FI={name:s0,logger:"error"},jI={database:":memory:"},kI="crypto",Uv="client_ed25519_seed",qI=ye.ONE_DAY,zI="keychain",HI="0.3",KI="messages",WI="0.3",VI=ye.SIX_HOURS,GI="publisher",Fv="irn",YI="error",jv="wss://relay.walletconnect.com",kv="wss://relay.walletconnect.org",QI="relayer",on={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},JI="_subscription",Pn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ZI=ye.ONE_SECOND,XI="2.13.3-13604ac8",eS=1e4,tS="0.3",rS="WALLETCONNECT_CLIENT_ID",Ei={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},nS="subscription",iS="0.3",sS=ye.FIVE_SECONDS*1e3,oS="pairing",aS="0.3",mc={wc_pairingDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:0},res:{ttl:ye.ONE_DAY,prompt:!1,tag:0}}},ra={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},ei={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},cS="history",lS="0.3",uS="expirer",$n={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},hS="0.3",o0="verify-api",fS="https://verify.walletconnect.com",qv="https://verify.walletconnect.org",vc=qv,dS=[fS,qv],pS="echo",gS="https://echo.walletconnect.com";class mS{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=zI,this.version=HI,this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:o}=me("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=tn(r,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Ag(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?xg(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class vS{constructor(e,r,n){this.core=e,this.logger=r,this.name=kI,this.randomSessionIdentifier=zf(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),o=Y1(i);return G1(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=y7();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=Y1(o),l=this.randomSessionIdentifier;return await h_(l,i,qI,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),f=b7(l,o);return this.setSymKey(f,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||zl(i);return await this.keychain.set(c,i),c},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,o,c)=>{this.isInitialized();const l=qm(c),f=Li(o);if(zm(l)){const E=l.senderPublicKey,x=l.receiverPublicKey;i=await this.generateSharedKey(E,x)}const h=this.getSymKey(i),{type:g,senderPublicKey:_}=l;return E7({type:g,symKey:h,message:f,senderPublicKey:_})},this.decode=async(i,o,c)=>{this.isInitialized();const l=I7(o,c);if(zm(l)){const f=l.receiverPublicKey,h=l.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=A7({symKey:f,encoded:o});return ja(h)}catch(f){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(f)}},this.getPayloadType=i=>{const o=Hl(i);return cc(o.type)},this.getPayloadSenderPublicKey=i=>{const o=Hl(i);return o.senderPublicKey?bx(o.senderPublicKey,zr):void 0},this.core=e,this.logger=tn(r,this.name),this.keychain=n||new mS(this.core,this.logger)}get context(){return en(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Uv)}catch{e=zf(),await this.keychain.set(Uv,e)}return BI(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class wS extends K6{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=KI,this.version=WI,this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const o=Gs(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=Gs(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=tn(e,this.name),this.core=r}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Ag(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?xg(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class yS extends W6{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Cr.exports.EventEmitter,this.name=GI,this.queue=new Map,this.publishTimeout=ye.toMiliseconds(ye.ONE_MINUTE),this.failedPublishTimeout=ye.toMiliseconds(ye.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});const l=o?.ttl||VI,f=Hf(o),h=o?.prompt||!1,g=o?.tag||0,_=o?.id||Ys().toString(),E={topic:n,message:i,opts:{ttl:l,relay:f,prompt:h,tag:g,id:_}},x=`Failed to publish payload, please try again. id:${_} tag:${g}`,I=Date.now();let F,W=1;try{for(;F===void 0;){if(Date.now()-I>this.publishTimeout)throw new Error(x);this.logger.trace({id:_,attempts:W},`publisher.publish - attempt ${W}`),F=await await qo(this.rpcPublish(n,i,l,f,h,g,_).catch(Y=>this.logger.warn(Y)),this.publishTimeout,x),W++,F||await new Promise(Y=>setTimeout(Y,this.failedPublishTimeout))}this.relayer.events.emit(on.publish,E),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:_,topic:n,message:i,opts:o}})}catch(Y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Y),(c=o?.internal)!=null&&c.throwOnFailedPublish)throw Y;this.queue.set(_,E)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=tn(r,this.name),this.registerEventListeners()}get context(){return en(this.logger)}rpcPublish(e,r,n,i,o,c,l){var f,h,g,_;const E={method:lc(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Hr((f=E.params)==null?void 0:f.prompt)&&((h=E.params)==null||delete h.prompt),Hr((g=E.params)==null?void 0:g.tag)&&((_=E.params)==null||delete _.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:E}),this.relayer.request(E)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ha.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(on.connection_stalled);return}this.checkQueue()}),this.relayer.on(on.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class bS{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var _S=Object.defineProperty,ES=Object.defineProperties,AS=Object.getOwnPropertyDescriptors,zv=Object.getOwnPropertySymbols,xS=Object.prototype.hasOwnProperty,IS=Object.prototype.propertyIsEnumerable,Hv=(t,e,r)=>e in t?_S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wc=(t,e)=>{for(var r in e||(e={}))xS.call(e,r)&&Hv(t,r,e[r]);if(zv)for(var r of zv(e))IS.call(e,r)&&Hv(t,r,e[r]);return t},a0=(t,e)=>ES(t,AS(e));class SS extends Y6{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new bS,this.events=new Cr.exports.EventEmitter,this.name=nS,this.version=iS,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=hs,this.subscribeTimeout=ye.toMiliseconds(ye.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=Hf(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return typeof l=="string"&&(this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((o,c)=>{const l=new ye.Watch;l.start(i);const f=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(f),l.stop(i),o(!0)),l.elapsed(i)>=sS&&(clearInterval(f),l.stop(i),c(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=tn(r,this.name),this.clientId=""}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Hf(n);await this.rpcUnsubscribe(e,r,i);const o=Ut("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:lc(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await qo(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)?Gs(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(on.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:lc(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await qo(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(on.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:lc(r.protocol).batchFetchMessages,params:{topics:e.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await qo(this.relayer.request(n).catch(o=>this.logger.warn(o)),this.subscribeTimeout)}catch{this.relayer.events.emit(on.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:lc(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,a0(wc({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,wc({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,wc({},r)),this.topicMap.set(r.topic,e),this.events.emit(Ei.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Ei.deleted,a0(wc({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Ei.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(n),await this.batchSubscribe(n)}}this.events.emit(Ei.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);bi(r)&&this.onBatchSubscribe(r.map((n,i)=>a0(wc({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(Ha.pulse,async()=>{await this.checkPending()}),this.events.on(Ei.created,async e=>{const r=Ei.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Ei.deleted,async e=>{const r=Ei.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var CS=Object.defineProperty,Kv=Object.getOwnPropertySymbols,DS=Object.prototype.hasOwnProperty,OS=Object.prototype.propertyIsEnumerable,Wv=(t,e,r)=>e in t?CS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,MS=(t,e)=>{for(var r in e||(e={}))DS.call(e,r)&&Wv(t,r,e[r]);if(Kv)for(var r of Kv(e))OS.call(e,r)&&Wv(t,r,e[r]);return t};class PS extends V6{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Cr.exports.EventEmitter,this.name=QI,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=ye.toMiliseconds(ye.THIRTY_SECONDS+ye.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const o=r.id||Ys().toString();await this.toEstablishConnection();try{const c=this.provider.request(r);this.requestsInFlight.set(o,{promise:c,request:r}),this.logger.trace({id:o,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const l=await new Promise(async(f,h)=>{const g=()=>{h(new Error(`relayer.request - publish interrupted, id: ${o}`))};this.provider.on(Pn.disconnect,g);const _=await c;this.provider.off(Pn.disconnect,g),f(_)});return this.logger.trace({id:o,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),l}catch(c){throw this.logger.debug(`Failed to Publish Request: ${o}`),c}finally{this.requestsInFlight.delete(o)}},this.resetPingTimeout=()=>{if(Ja())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.startPingTimeout(),this.events.emit(on.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(on.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Pn.payload,this.onPayloadHandler),this.provider.on(Pn.connect,this.onConnectHandler),this.provider.on(Pn.disconnect,this.onDisconnectHandler),this.provider.on(Pn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?tn(e.logger,this.name):ai(ml({level:e.logger||YI})),this.messages=new wS(this.logger,e.core),this.subscriber=new SS(this,this.logger),this.publisher=new yS(this,this.logger),this.relayUrl=e?.relayUrl||jv,this.projectId=e.projectId,this.bundleId=c4(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${kv}...`),await this.restartTransport(kv)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},eS)}get context(){return en(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"",o;const c=l=>{l.topic===e&&(this.subscriber.off(Ei.created,c),o())};return await Promise.all([new Promise(l=>{o=l,this.subscriber.on(Ei.created,c)}),new Promise(async l=>{i=await this.subscriber.subscribe(e,r)||i,l()})]),i}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await qo(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Pn.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Pn.disconnect,i),await qo(this.provider.connect(),ye.toMiliseconds(ye.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{n(o)}),await this.subscriber.start(),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await tv())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}startPingTimeout(){var e,r,n,i,o;if(Ja())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((o=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||o.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(c){this.logger.warn(c)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Hi(new c9(p4({sdkVersion:XI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),e0(e)){if(!e.method.endsWith(JI))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(MS({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Gl(e)&&this.events.emit(on.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(on.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Wl(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Pn.payload,this.onPayloadHandler),this.provider.off(Pn.connect,this.onConnectHandler),this.provider.off(Pn.disconnect,this.onDisconnectHandler),this.provider.off(Pn.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await tv();gx(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(on.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},ye.toMiliseconds(ZI))}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var $S=Object.defineProperty,Vv=Object.getOwnPropertySymbols,TS=Object.prototype.hasOwnProperty,NS=Object.prototype.propertyIsEnumerable,Gv=(t,e,r)=>e in t?$S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Yv=(t,e)=>{for(var r in e||(e={}))TS.call(e,r)&&Gv(t,r,e[r]);if(Vv)for(var r of Vv(e))NS.call(e,r)&&Gv(t,r,e[r]);return t};class Qs extends G6{constructor(e,r,n,i=hs,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=tS,this.cached=[],this.initialized=!1,this.storagePrefix=hs,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Hr(c)?this.map.set(this.getKey(c),c):W7(c)?this.map.set(c.id,c):V7(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(l=>Object.keys(c).every(f=>l9(l[f],c[f]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const f=Yv(Yv({},this.getData(c)),l);this.map.set(c,f),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),this.addToRecentlyDeleted(c),await this.persist())},this.logger=tn(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=me("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class RS{constructor(e,r){this.core=e,this.logger=r,this.name=oS,this.version=aS,this.events=new Cr.exports,this.initialized=!1,this.storagePrefix=hs,this.ignoredPayloadTypes=[ki],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=zf(),o=await this.core.crypto.setSymKey(i),c=Or(ye.FIVE_MINUTES),l={protocol:Fv},f={topic:o,expiry:c,relay:l,active:!1},h=L7({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:i,relay:l,expiryTimestamp:c,methods:n?.methods});return this.core.expirer.set(o,c),await this.pairings.set(o,f),await this.core.relayer.subscribe(o),{topic:o,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c,expiryTimestamp:l,methods:f}=Vm(n.uri);let h;if(this.pairings.keys.includes(i)&&(h=this.pairings.get(i),h.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const g=l||Or(ye.FIVE_MINUTES),_={topic:i,relay:c,expiry:g,active:!1,methods:f};return this.core.expirer.set(i,g),await this.pairings.set(i,_),n.activatePairing&&await this.activate({topic:i}),this.events.emit(ra.create,_),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),_},this.activate=async({topic:n})=>{this.isInitialized();const i=Or(ye.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:f}=Hs();this.events.once(wt("pairing_ping",o),({error:h})=>{h?f(h):l()}),await c()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Ut("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=ta(i,o),l=await this.core.crypto.encode(n,c),f=mc[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,f),c.id},this.sendResult=async(n,i,o)=>{const c=Wl(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=mc[f.request.method].res;await this.core.relayer.publish(i,l,h),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=Vl(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=mc[f.request.method]?mc[f.request.method].res:mc.unregistered_method.res;await this.core.relayer.publish(i,l,h),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Ut("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>os(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n;switch(o.method){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit(ra.ping,{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{_i(i)?this.events.emit(wt("pairing_ping",o),{}):Mn(i)&&this.events.emit(wt("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(ra.delete,{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Ut("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Ut("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!sn(n)){const{message:c}=me("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!K7(n.uri)){const{message:c}=me("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const o=Vm(n.uri);if(!((i=o?.relay)!=null&&i.protocol)){const{message:c}=me("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(o!=null&&o.symKey)){const{message:c}=me("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}if(o!=null&&o.expiryTimestamp&&ye.toMiliseconds(o?.expiryTimestamp)<Date.now()){const{message:c}=me("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}},this.isValidPing=async n=>{if(!sn(n)){const{message:o}=me("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!sn(n)){const{message:o}=me("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ur(n,!1)){const{message:i}=me("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=me("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(os(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=me("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=tn(r,this.name),this.pairings=new Qs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return en(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(on.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{e0(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Gl(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on($n.expired,async e=>{const{topic:r}=Sg(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(ra.expire,{topic:r}))})}}class LS extends H6{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Cr.exports.EventEmitter,this.name=cS,this.version=lS,this.cached=[],this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o,expiry:Or(ye.THIRTY_DAYS)};this.records.set(c.id,c),this.persist(),this.events.emit(ei.created,c)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Mn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(ei.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(ei.deleted,o)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=tn(r,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:ta(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ei.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ei.created,e=>{const r=ei.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(ei.updated,e=>{const r=ei.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(ei.deleted,e=>{const r=ei.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(Ha.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ye.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(ei.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class BS extends Q6{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Cr.exports.EventEmitter,this.name=uS,this.version=hS,this.cached=[],this.initialized=!1,this.storagePrefix=hs,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit($n.created,{target:o,expiration:c})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit($n.deleted,{target:i,expiration:o})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=tn(r,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return g4(e);if(typeof e=="number")return m4(e);const{message:r}=me("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit($n.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=me("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=me("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ye.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit($n.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Ha.pulse,()=>this.checkExpirations()),this.events.on($n.created,e=>{const r=$n.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on($n.expired,e=>{const r=$n.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on($n.deleted,e=>{const r=$n.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}}}class US extends J6{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=o0,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||jo()||!ko())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o),this.verifyDisabled=!0}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n?.verifyUrl);return this.fetchAttestation(n.attestationId,i)},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const o=this.startAbortTimer(ye.ONE_SECOND*5),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?await c.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=o=>{o.data==="verify_ready"&&(this.onInit(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(o=>{const c=document.getElementById(o0);if(c)return this.iframe=c,this.onInit(),o();window.addEventListener("message",i);const l=document.createElement("iframe");l.id=o0,l.src=`${this.verifyUrl}/${this.projectId}`,l.style.display="none",document.body.append(l),this.iframe=l,n=o}),new Promise((o,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},ye.toMiliseconds(ye.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||vc;return dS.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${vc}`),i=vc),i},this.logger=tn(r,this.name),this.verifyUrl=vc,this.abortController=new AbortController,this.isDevEnv=Ja()&&process.env.IS_VITEST}get context(){return en(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ye.toMiliseconds(e))}}class FS extends Z6{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=pS,this.registerDeviceToken=async n=>{const{clientId:i,token:o,notificationType:c,enableEncrypted:l=!1}=n,f=`${gS}/${this.projectId}/clients`;await f9(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:o,always_raw:l})})},this.logger=tn(r,this.context)}}var jS=Object.defineProperty,Qv=Object.getOwnPropertySymbols,kS=Object.prototype.hasOwnProperty,qS=Object.prototype.propertyIsEnumerable,Jv=(t,e,r)=>e in t?jS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zv=(t,e)=>{for(var r in e||(e={}))kS.call(e,r)&&Jv(t,r,e[r]);if(Qv)for(var r of Qv(e))qS.call(e,r)&&Jv(t,r,e[r]);return t};class c0 extends z6{constructor(e){var r;super(e),this.protocol=Bv,this.version=UI,this.name=s0,this.events=new Cr.exports.EventEmitter,this.initialized=!1,this.on=(c,l)=>this.events.on(c,l),this.once=(c,l)=>this.events.once(c,l),this.off=(c,l)=>this.events.off(c,l),this.removeListener=(c,l)=>this.events.removeListener(c,l),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||jv,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=ml({level:typeof e?.logger=="string"&&e.logger?e.logger:FI.logger}),{logger:i,chunkLoggerController:o}=q6({opts:n,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=o,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var c,l;(c=this.logChunkController)!=null&&c.downloadLogsBlobInBrowser&&((l=this.logChunkController)==null||l.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=tn(i,this.name),this.heartbeat=new zh,this.crypto=new vS(this,this.logger,e?.keychain),this.history=new LS(this,this.logger),this.expirer=new BS(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new F3(Zv(Zv({},jI),e?.storageOptions)),this.relayer=new PS({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new RS(this,this.logger),this.verify=new US(this.projectId||"",this.logger),this.echoClient=new FS(this.projectId||"",this.logger)}static async init(e){const r=new c0(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(rS,n),r}get context(){return en(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const zS=c0,Xv="wc",ew=2,tw="client",l0=`${Xv}@${ew}:${tw}:`,u0={name:tw,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},rw="WALLETCONNECT_DEEPLINK_CHOICE",HS="proposal",nw="Proposal expired",KS="session",na=ye.SEVEN_DAYS,WS="engine",Tr={wc_sessionPropose:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ye.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ye.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1119}}},h0={min:ye.FIVE_MINUTES,max:ye.SEVEN_DAYS},Ai={idle:"IDLE",active:"ACTIVE"},VS="request",GS=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"],YS="wc",QS="auth",JS="authKeys",ZS="pairingTopics",XS="requests",Ql=`${YS}@${1.5}:${QS}:`,Jl=`${Ql}:PUB_KEY`;var eC=Object.defineProperty,tC=Object.defineProperties,rC=Object.getOwnPropertyDescriptors,iw=Object.getOwnPropertySymbols,nC=Object.prototype.hasOwnProperty,iC=Object.prototype.propertyIsEnumerable,sw=(t,e,r)=>e in t?eC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vr=(t,e)=>{for(var r in e||(e={}))nC.call(e,r)&&sw(t,r,e[r]);if(iw)for(var r of iw(e))iC.call(e,r)&&sw(t,r,e[r]);return t},Js=(t,e)=>tC(t,rC(e));class sC extends e5{constructor(e){super(e),this.name=WS,this.events=new Cr.exports,this.initialized=!1,this.requestQueue={state:Ai.idle,queue:[]},this.sessionRequestQueue={state:Ai.idle,queue:[]},this.requestQueueDelay=ye.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Tr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Js(vr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:f}=n;let h=i,g,_=!1;try{h&&(_=this.client.core.pairing.pairings.get(h).active)}catch(M){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),M}if(!h||!_){const{topic:M,uri:U}=await this.client.core.pairing.create();h=M,g=U}if(!h){const{message:M}=me("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(M)}const E=await this.client.core.crypto.generateKeyPair(),x=Tr.wc_sessionPropose.req.ttl||ye.FIVE_MINUTES,I=Or(x),F=vr({requiredNamespaces:o,optionalNamespaces:c,relays:f??[{protocol:Fv}],proposer:{publicKey:E,metadata:this.client.metadata},expiryTimestamp:I,pairingTopic:h},l&&{sessionProperties:l}),{reject:W,resolve:Y,done:B}=Hs(x,nw);this.events.once(wt("session_connect"),async({error:M,session:U})=>{if(M)W(M);else if(U){U.self.publicKey=E;const j=Js(vr({},U),{pairingTopic:F.pairingTopic,requiredNamespaces:F.requiredNamespaces,optionalNamespaces:F.optionalNamespaces});await this.client.session.set(U.topic,j),await this.setExpiry(U.topic,U.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:U.peer.metadata}),this.cleanupDuplicatePairings(j),Y(j)}});const z=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:F,throwOnFailedPublish:!0});return await this.setProposal(z,vr({id:z},F)),{uri:g,approval:B}},this.pair=async r=>{await this.isInitialized();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{await this.isInitialized();try{await this.isValidApprove(r)}catch(B){throw this.client.logger.error("approve() -> isValidApprove() failed"),B}const{id:n,relayProtocol:i,namespaces:o,sessionProperties:c,sessionConfig:l}=r;let f;try{f=this.client.proposal.get(n)}catch(B){throw this.client.logger.error(`approve() -> proposal.get(${n}) failed`),B}const{pairingTopic:h,proposer:g,requiredNamespaces:_,optionalNamespaces:E}=f,x=await this.client.core.crypto.generateKeyPair(),I=g.publicKey,F=await this.client.core.crypto.generateSharedKey(x,I),W=vr(vr({relay:{protocol:i??"irn"},namespaces:o,controller:{publicKey:x,metadata:this.client.metadata},expiry:Or(na)},c&&{sessionProperties:c}),l&&{sessionConfig:l});await this.client.core.relayer.subscribe(F);const Y=Js(vr({},W),{topic:F,requiredNamespaces:_,optionalNamespaces:E,pairingTopic:h,acknowledged:!1,self:W.controller,peer:{publicKey:g.publicKey,metadata:g.metadata},controller:x});await this.client.session.set(F,Y);try{await this.sendResult({id:n,topic:h,result:{relay:{protocol:i??"irn"},responderPublicKey:x},throwOnFailedPublish:!0}),await this.sendRequest({topic:F,method:"wc_sessionSettle",params:W,throwOnFailedPublish:!0})}catch(B){throw this.client.logger.error(B),this.client.session.delete(F,Ut("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(F),B}return await this.client.core.pairing.updateMetadata({topic:h,metadata:g.metadata}),await this.client.proposal.delete(n,Ut("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(F,Or(na)),{topic:F,acknowledged:()=>new Promise(B=>setTimeout(()=>B(this.client.session.get(F)),500))}},this.reject=async r=>{await this.isInitialized();try{await this.isValidReject(r)}catch(c){throw this.client.logger.error("reject() -> isValidReject() failed"),c}const{id:n,reason:i}=r;let o;try{o=this.client.proposal.get(n).pairingTopic}catch(c){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),c}o&&(await this.sendError({id:n,topic:o,error:i,rpcOpts:Tr.wc_sessionPropose.reject}),await this.client.proposal.delete(n,Ut("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized();try{await this.isValidUpdate(r)}catch(_){throw this.client.logger.error("update() -> isValidUpdate() failed"),_}const{topic:n,namespaces:i}=r,{done:o,resolve:c,reject:l}=Hs(),f=us(),h=Ys().toString(),g=this.client.session.get(n).namespaces;return this.events.once(wt("session_update",f),({error:_})=>{_?l(_):c()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:f,relayRpcId:h}).catch(_=>{this.client.logger.error(_),this.client.session.update(n,{namespaces:g}),l(_)}),{acknowledged:o}},this.extend=async r=>{await this.isInitialized();try{await this.isValidExtend(r)}catch(f){throw this.client.logger.error("extend() -> isValidExtend() failed"),f}const{topic:n}=r,i=us(),{done:o,resolve:c,reject:l}=Hs();return this.events.once(wt("session_extend",i),({error:f})=>{f?l(f):c()}),await this.setExpiry(n,Or(na)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(f=>{l(f)}),{acknowledged:o}},this.request=async r=>{await this.isInitialized();try{await this.isValidRequest(r)}catch(x){throw this.client.logger.error("request() -> isValidRequest() failed"),x}const{chainId:n,request:i,topic:o,expiry:c=Tr.wc_sessionRequest.req.ttl}=r,l=this.client.session.get(o),f=us(),h=Ys().toString(),{done:g,resolve:_,reject:E}=Hs(c,"Request expired. Please try again.");return this.events.once(wt("session_request",f),({error:x,result:I})=>{x?E(x):_(I)}),await Promise.all([new Promise(async x=>{await this.sendRequest({clientRpcId:f,relayRpcId:h,topic:o,method:"wc_sessionRequest",params:{request:Js(vr({},i),{expiryTimestamp:Or(c)}),chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(I=>E(I)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:f}),x()}),new Promise(async x=>{var I;if(!((I=l.sessionConfig)!=null&&I.disableDeepLink)){const F=await w4(this.client.core.storage,rw);console.log("handleDeeplinkRedirect",r),v4({id:f,topic:o,wcDeepLink:F})}x()}),g()]).then(x=>x[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;_i(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):Mn(i)&&await this.sendError({id:o,topic:n,error:i.error}),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=us(),o=Ys().toString(),{done:c,resolve:l,reject:f}=Hs();this.events.once(wt("session_ping",i),({error:h})=>{h?f(h):l()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:o}),c()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r,c=Ys().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:o},throwOnFailedPublish:!0,relayRpcId:c})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Ut("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=me("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>z7(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async r=>{this.isInitialized(),this.isValidAuthenticate(r);const{chains:n,statement:i="",uri:o,domain:c,nonce:l,type:f,exp:h,nbf:g,methods:_=[],expiry:E}=r,x=[...r.resources||[]],{topic:I,uri:F}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:I,uri:F}});const W=await this.client.core.crypto.generateKeyPair(),Y=zl(W);if(await Promise.all([this.client.auth.authKeys.set(Jl,{responseTopic:Y,publicKey:W}),this.client.auth.pairingTopics.set(Y,{topic:Y,pairingTopic:I})]),await this.client.core.relayer.subscribe(Y),this.client.logger.info(`sending request to new pairing topic: ${I}`),_.length>0){const{namespace:d}=Sl(n[0]);let p=d7(d,"request",_);ql(x)&&(p=g7(p,x.pop())),x.push(p)}const B=E&&E>Tr.wc_sessionAuthenticate.req.ttl?E:Tr.wc_sessionAuthenticate.req.ttl,z={authPayload:{type:f??"caip122",chains:n,statement:i,aud:o,domain:c,version:"1",nonce:l,iat:new Date().toISOString(),exp:h,nbf:g,resources:x},requester:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:Or(B)},M={eip155:{chains:n,methods:[...new Set(["personal_sign",..._])],events:["chainChanged","accountsChanged"]}},U={requiredNamespaces:{},optionalNamespaces:M,relays:[{protocol:"irn"}],pairingTopic:I,proposer:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:Or(Tr.wc_sessionPropose.req.ttl)},{done:j,resolve:m,reject:$}=Hs(B,"Request expired"),te=async({error:d,session:p})=>{if(this.events.off(wt("session_request",ne),ee),d)$(d);else if(p){p.self.publicKey=W,await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:p.peer.metadata});const b=this.client.session.get(p.topic);await this.deleteProposal(de),m({session:b})}},ee=async d=>{if(await this.deletePendingAuthRequest(ne,{message:"fulfilled",code:0}),d.error){const D=Ut("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return d.error.code===D.code?void 0:(this.events.off(wt("session_connect"),te),$(d.error.message))}await this.deleteProposal(de),this.events.off(wt("session_connect"),te);const{cacaos:p,responder:b}=d.result,C=[],O=[];for(const D of p){await Nm({cacao:D,projectId:this.client.core.projectId})||(this.client.logger.error(D,"Signature verification failed"),$(Ut("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:v}=D,N=ql(v.resources),oe=[Tm(v.iss)],pe=kl(v.iss);if(N){const A=Bm(N),re=Um(N);C.push(...A),oe.push(...re)}for(const A of oe)O.push(`${A}:${pe}`)}const T=await this.client.core.crypto.generateSharedKey(W,b.publicKey);let L;C.length>0&&(L={topic:T,acknowledged:!0,self:{publicKey:W,metadata:this.client.metadata},peer:b,controller:b.publicKey,expiry:Or(na),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:I,namespaces:Gm([...new Set(C)],[...new Set(O)])},await this.client.core.relayer.subscribe(T),await this.client.session.set(T,L),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:b.metadata}),L=this.client.session.get(T)),m({auths:p,session:L})},ne=us(),de=us();this.events.once(wt("session_connect"),te),this.events.once(wt("session_request",ne),ee);try{await Promise.all([this.sendRequest({topic:I,method:"wc_sessionAuthenticate",params:z,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:ne}),this.sendRequest({topic:I,method:"wc_sessionPropose",params:U,expiry:Tr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:de})])}catch(d){throw this.events.off(wt("session_connect"),te),this.events.off(wt("session_request",ne),ee),d}return await this.setProposal(de,vr({id:de},U)),await this.setAuthRequest(ne,{request:Js(vr({},z),{verifyContext:{}}),pairingTopic:I}),{uri:F,response:j}},this.approveSessionAuthenticate=async r=>{this.isInitialized();const{id:n,auths:i}=r,o=this.getPendingAuthRequest(n);if(!o)throw new Error(`Could not find pending auth request with id ${n}`);const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=zl(c),h={type:ki,receiverPublicKey:c,senderPublicKey:l},g=[],_=[];for(const I of i){if(!await Nm({cacao:I,projectId:this.client.core.projectId})){const z=Ut("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:z,encodeOpts:h}),new Error(z.message)}const{p:F}=I,W=ql(F.resources),Y=[Tm(F.iss)],B=kl(F.iss);if(W){const z=Bm(W),M=Um(W);g.push(...z),Y.push(...M)}for(const z of Y)_.push(`${z}:${B}`)}const E=await this.client.core.crypto.generateSharedKey(l,c);let x;return g?.length>0&&(x={topic:E,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:Or(na),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:Gm([...new Set(g)],[...new Set(_)])},await this.client.core.relayer.subscribe(E),await this.client.session.set(E,x),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})),await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),{session:x}},this.rejectSessionAuthenticate=async r=>{await this.isInitialized();const{id:n,reason:i}=r,o=this.getPendingAuthRequest(n);if(!o)throw new Error(`Could not find pending auth request with id ${n}`);const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=zl(c),h={type:ki,receiverPublicKey:c,senderPublicKey:l};await this.sendError({id:n,topic:f,error:i,encodeOpts:h,rpcOpts:Tr.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,Ut("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return Rm(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:o=!1,emitEvent:c=!0,id:l=0}=r,{self:f}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,Ut("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(f.publicKey)&&await this.client.core.crypto.deleteKeyPair(f.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),o||this.client.core.expirer.del(i),this.client.core.storage.removeItem(rw).catch(h=>this.client.logger.warn(h)),this.getPendingSessionRequests().forEach(h=>{h.topic===i&&this.deletePendingSessionRequest(h.id,Ut("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=Ai.idle),c&&this.client.events.emit("session_delete",{id:l,topic:i})},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Ut("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=Ai.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Or(Tr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:o}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:o,verifyContext:i.verifyContext})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:o,verifyContext:c}=r,l=o.request.expiryTimestamp||Or(Tr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,l),await this.client.pendingRequest.set(n,{id:n,topic:i,params:o,verifyContext:c})},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:f,throwOnFailedPublish:h}=r,g=ta(i,o,f);if(ko()&&GS.includes(i)){const x=Gs(JSON.stringify(g));this.client.core.verify.register({attestationId:x})}let _;try{_=await this.client.core.crypto.encode(n,g)}catch(x){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),x}const E=Tr[i].req;return c&&(E.ttl=c),l&&(E.id=l),this.client.core.history.set(n,g),h?(E.internal=Js(vr({},E.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,_,E)):this.client.core.relayer.publish(n,_,E).catch(x=>this.client.logger.error(x)),g.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c,encodeOpts:l}=r,f=Wl(n,o);let h;try{h=await this.client.core.crypto.encode(i,f,l)}catch(E){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),E}let g;try{g=await this.client.core.history.get(i,n)}catch(E){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),E}const _=Tr[g.request.method].res;c?(_.internal=Js(vr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,_)):this.client.core.relayer.publish(i,h,_).catch(E=>this.client.logger.error(E)),await this.client.core.history.resolve(f)},this.sendError=async r=>{const{id:n,topic:i,error:o,encodeOpts:c,rpcOpts:l}=r,f=Vl(n,o);let h;try{h=await this.client.core.crypto.encode(i,f,c)}catch(E){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),E}let g;try{g=await this.client.core.history.get(i,n)}catch(E){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),E}const _=l||Tr[g.request.method].res;this.client.core.relayer.publish(i,h,_),await this.client.core.history.resolve(f)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let o=!1;os(i.expiry)&&(o=!0),this.client.core.crypto.keychain.has(i.topic)||(o=!0),o&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{os(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Ai.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Ai.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Ai.idle},this.processRequest=async r=>{const{topic:n,payload:i}=r,o=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest(n,i);case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=me("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,o=this.expectedPairingMethodMap.get(n);return!o||o.includes(i)?!1:!!(o.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(vr({},n.params));const c=i.expiryTimestamp||Or(Tr.wc_sessionPropose.req.ttl),l=vr({id:o,pairingTopic:r,expiryTimestamp:c},i);await this.setProposal(o,l);const f=Gs(JSON.stringify(n)),h=await this.getVerifyContext(f,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:h})}catch(c){await this.sendError({id:o,topic:r,error:c,rpcOpts:Tr.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(_i(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const f=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:f});const h=await this.client.core.crypto.generateSharedKey(l,f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const g=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:g}),await this.client.core.pairing.activate({topic:r})}else if(Mn(n)){await this.client.proposal.delete(i,Ut("USER_DISCONNECTED"));const o=wt("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(wt("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:f,namespaces:h,sessionProperties:g,sessionConfig:_}=n.params,E=vr(vr({topic:r,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},g&&{sessionProperties:g}),_&&{sessionConfig:_});await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0});const x=wt("session_connect");if(this.events.listenerCount(x)===0)throw new Error(`emitting ${x} without any listeners 997`);this.events.emit(wt("session_connect"),{session:E})}catch(c){await this.sendError({id:i,topic:r,error:c}),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;_i(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(wt("session_approve",i),{})):Mn(n)&&(await this.client.session.delete(r,Ut("USER_DISCONNECTED")),this.events.emit(wt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{const c=`${r}_session_update`,l=fc.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`),this.sendError({id:o,topic:r,error:Ut("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(vr({topic:r},i));try{fc.set(c,o),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:o,topic:r,result:!0,throwOnFailedPublish:!0})}catch(f){throw fc.delete(c),f}this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError({id:o,topic:r,error:c}),this.client.logger.error(c)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,o=wt("session_update",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(wt("session_update",i),{}):Mn(n)&&this.events.emit(wt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Or(na)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,o=wt("session_extend",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(wt("session_extend",i),{}):Mn(n)&&this.events.emit(wt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,o=wt("session_ping",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);setTimeout(()=>{_i(n)?this.events.emit(wt("session_ping",i),{}):Mn(n)&&this.events.emit(wt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(on.publish,async()=>{o(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Ut("USER_DISCONNECTED")})])}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{var i;const{id:o,params:c}=n;try{await this.isValidRequest(vr({topic:r},c));const l=Gs(JSON.stringify(ta("wc_sessionRequest",c,o))),f=this.client.session.get(r),h=await this.getVerifyContext(l,f.peer.metadata),g={id:o,topic:r,params:c,verifyContext:h};await this.setPendingSessionRequest(g),(i=this.client.signConfig)!=null&&i.disableRequestQueue?this.emitSessionRequest(g):(this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue())}catch(l){await this.sendError({id:o,topic:r,error:l}),this.client.logger.error(l)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,o=wt("session_request",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(wt("session_request",i),{result:n.result}):Mn(n)&&this.events.emit(wt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{const c=`${r}_session_event_${o.event.name}`,l=fc.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(vr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),fc.set(c,i)}catch(c){await this.sendError({id:i,topic:r,error:c}),this.client.logger.error(c)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),_i(n)?this.events.emit(wt("session_request",i),{result:n.result}):Mn(n)&&this.events.emit(wt("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async(r,n)=>{try{const{requester:i,authPayload:o,expiryTimestamp:c}=n.params,l=Gs(JSON.stringify(n)),f=await this.getVerifyContext(l,this.client.metadata),h={requester:i,pairingTopic:r,id:n.id,authPayload:o,verifyContext:f,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:h,pairingTopic:r}),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id})}catch(i){this.client.logger.error(i);const o=n.params.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),l={type:ki,receiverPublicKey:o,senderPublicKey:c};await this.sendError({id:n.id,topic:r,error:i,encodeOpts:l,rpcOpts:Tr.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Ai.idle,this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(o=>o.topic===r&&o.request.method==="wc_sessionRequest").forEach(o=>{const c=o.request.id,l=wt("session_request",c);if(this.events.listenerCount(l)===0)throw new Error(`emitting ${l} without any listeners`);this.events.emit(wt("session_request",o.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Ai.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Ai.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,ta("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async r=>{if(!sn(r)){const{message:f}=me("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(f)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Hr(n)||await this.isValidPairingTopic(n),!tx(l,!0)){const{message:f}=me("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(f)}!Hr(i)&&hc(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Hr(o)&&hc(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Hr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=ex(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!sn(r))throw new Error(me("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const l=this.client.proposal.get(n),f=Vf(i,"approve()");if(f)throw new Error(f.message);const h=Xm(l.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ur(o,!0)){const{message:g}=me("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(g)}Hr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!sn(r)){const{message:o}=me("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!nx(i)){const{message:o}=me("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!sn(r)){const{message:h}=me("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(h)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!Jm(n)){const{message:h}=me("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const l=G7(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const f=Vf(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(os(c)){const{message:h}=me("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async r=>{if(!sn(r)){const{message:f}=me("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(f)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=Vf(i,"update()");if(c)throw new Error(c.message);const l=Xm(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!sn(r)){const{message:i}=me("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!sn(r)){const{message:f}=me("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(f)}const{topic:n,request:i,chainId:o,expiry:c}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!Zm(l,o)){const{message:f}=me("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(f)}if(!ix(i)){const{message:f}=me("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!ax(l,o,i.method)){const{message:f}=me("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!hx(c,h0)){const{message:f}=me("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${h0.min} and ${h0.max}`);throw new Error(f)}},this.isValidRespond=async r=>{var n;if(!sn(r)){const{message:c}=me("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(c)}const{topic:i,response:o}=r;try{await this.isValidSessionTopic(i)}catch(c){throw(n=r?.response)!=null&&n.id&&this.cleanupAfterResponse(r),c}if(!sx(o)){const{message:c}=me("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(c)}},this.isValidPing=async r=>{if(!sn(r)){const{message:i}=me("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!sn(r)){const{message:l}=me("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!Zm(c,o)){const{message:l}=me("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!ox(i)){const{message:l}=me("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!cx(c,o,i.name)){const{message:l}=me("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!sn(r)){const{message:i}=me("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:o,nonce:c}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ur(i,!1))throw new Error("uri is required parameter");if(!ur(o,!1))throw new Error("domain is required parameter");if(!ur(c,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(f=>Sl(f).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:l}=Sl(n[0]);if(l!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||vc,validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o.origin,i.verified.isScam=o.isScam,i.verified.validation=o.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(o){this.client.logger.info(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ur(i,!1)){const{message:o}=me("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const o=this.recentlyDeletedLimit/2;for(const c of this.recentlyDeletedMap.keys()){if(i++>=o)break;this.recentlyDeletedMap.delete(c)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=me("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}}}async isInitialized(){if(!this.initialized){const{message:e}=me("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(on.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n}=e,{publicKey:i}=this.client.auth.authKeys.keys.includes(Jl)?this.client.auth.authKeys.get(Jl):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:i});try{e0(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):Gl(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o})}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on($n.expired,async e=>{const{topic:r,id:n}=Sg(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,me("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,me("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(ra.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(ra.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ur(e,!1)){const{message:r}=me("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=me("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(os(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=me("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ur(e,!1)){const{message:r}=me("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=me("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(os(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=me("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=me("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ur(e,!1)){const{message:r}=me("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=me("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!rx(e)){const{message:r}=me("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=me("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(os(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=me("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class oC extends Qs{constructor(e,r){super(e,r,HS,l0),this.core=e,this.logger=r}}class aC extends Qs{constructor(e,r){super(e,r,KS,l0),this.core=e,this.logger=r}}class cC extends Qs{constructor(e,r){super(e,r,VS,l0,n=>n.id),this.core=e,this.logger=r}}class lC extends Qs{constructor(e,r){super(e,r,JS,Ql,()=>Jl),this.core=e,this.logger=r}}class uC extends Qs{constructor(e,r){super(e,r,ZS,Ql),this.core=e,this.logger=r}}class hC extends Qs{constructor(e,r){super(e,r,XS,Ql,n=>n.id),this.core=e,this.logger=r}}class fC{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new lC(this.core,this.logger),this.pairingTopics=new uC(this.core,this.logger),this.requests=new hC(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class f0 extends X6{constructor(e){super(e),this.protocol=Xv,this.version=ew,this.name=u0.name,this.events=new Cr.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async n=>{try{return await this.engine.authenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=e?.name||u0.name,this.metadata=e?.metadata||u4(),this.signConfig=e?.signConfig;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:ai(ml({level:e?.logger||u0.logger}));this.core=e?.core||new zS(e),this.logger=tn(r,this.name),this.session=new aC(this.core,this.logger),this.proposal=new oC(this.core,this.logger),this.pendingRequest=new cC(this.core,this.logger),this.engine=new sC(this),this.auth=new fC(this.core,this.logger)}static async init(e){const r=new f0(e);return await r.initialize(),r}get context(){return en(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var d0={exports:{}};(function(t,e){var r=typeof self<"u"?self:jr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function f(p){return p&&DataView.prototype.isPrototypeOf(p)}if(l.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=ArrayBuffer.isView||function(p){return p&&h.indexOf(Object.prototype.toString.call(p))>-1};function _(p){if(typeof p!="string"&&(p=String(p)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(p))throw new TypeError("Invalid character in header field name");return p.toLowerCase()}function E(p){return typeof p!="string"&&(p=String(p)),p}function x(p){var b={next:function(){var C=p.shift();return{done:C===void 0,value:C}}};return l.iterable&&(b[Symbol.iterator]=function(){return b}),b}function I(p){this.map={},p instanceof I?p.forEach(function(b,C){this.append(C,b)},this):Array.isArray(p)?p.forEach(function(b){this.append(b[0],b[1])},this):p&&Object.getOwnPropertyNames(p).forEach(function(b){this.append(b,p[b])},this)}I.prototype.append=function(p,b){p=_(p),b=E(b);var C=this.map[p];this.map[p]=C?C+", "+b:b},I.prototype.delete=function(p){delete this.map[_(p)]},I.prototype.get=function(p){return p=_(p),this.has(p)?this.map[p]:null},I.prototype.has=function(p){return this.map.hasOwnProperty(_(p))},I.prototype.set=function(p,b){this.map[_(p)]=E(b)},I.prototype.forEach=function(p,b){for(var C in this.map)this.map.hasOwnProperty(C)&&p.call(b,this.map[C],C,this)},I.prototype.keys=function(){var p=[];return this.forEach(function(b,C){p.push(C)}),x(p)},I.prototype.values=function(){var p=[];return this.forEach(function(b){p.push(b)}),x(p)},I.prototype.entries=function(){var p=[];return this.forEach(function(b,C){p.push([C,b])}),x(p)},l.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function F(p){if(p.bodyUsed)return Promise.reject(new TypeError("Already read"));p.bodyUsed=!0}function W(p){return new Promise(function(b,C){p.onload=function(){b(p.result)},p.onerror=function(){C(p.error)}})}function Y(p){var b=new FileReader,C=W(b);return b.readAsArrayBuffer(p),C}function B(p){var b=new FileReader,C=W(b);return b.readAsText(p),C}function z(p){for(var b=new Uint8Array(p),C=new Array(b.length),O=0;O<b.length;O++)C[O]=String.fromCharCode(b[O]);return C.join("")}function M(p){if(p.slice)return p.slice(0);var b=new Uint8Array(p.byteLength);return b.set(new Uint8Array(p)),b.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(p){this._bodyInit=p,p?typeof p=="string"?this._bodyText=p:l.blob&&Blob.prototype.isPrototypeOf(p)?this._bodyBlob=p:l.formData&&FormData.prototype.isPrototypeOf(p)?this._bodyFormData=p:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(p)?this._bodyText=p.toString():l.arrayBuffer&&l.blob&&f(p)?(this._bodyArrayBuffer=M(p.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(p)||g(p))?this._bodyArrayBuffer=M(p):this._bodyText=p=Object.prototype.toString.call(p):this._bodyText="",this.headers.get("content-type")||(typeof p=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(p)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var p=F(this);if(p)return p;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?F(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Y)}),this.text=function(){var p=F(this);if(p)return p;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(z(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(te)}),this.json=function(){return this.text().then(JSON.parse)},this}var j=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(p){var b=p.toUpperCase();return j.indexOf(b)>-1?b:p}function $(p,b){b=b||{};var C=b.body;if(p instanceof $){if(p.bodyUsed)throw new TypeError("Already read");this.url=p.url,this.credentials=p.credentials,b.headers||(this.headers=new I(p.headers)),this.method=p.method,this.mode=p.mode,this.signal=p.signal,!C&&p._bodyInit!=null&&(C=p._bodyInit,p.bodyUsed=!0)}else this.url=String(p);if(this.credentials=b.credentials||this.credentials||"same-origin",(b.headers||!this.headers)&&(this.headers=new I(b.headers)),this.method=m(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.signal=b.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(C)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function te(p){var b=new FormData;return p.trim().split("&").forEach(function(C){if(C){var O=C.split("="),T=O.shift().replace(/\+/g," "),L=O.join("=").replace(/\+/g," ");b.append(decodeURIComponent(T),decodeURIComponent(L))}}),b}function ee(p){var b=new I,C=p.replace(/\r?\n[\t ]+/g," ");return C.split(/\r?\n/).forEach(function(O){var T=O.split(":"),L=T.shift().trim();if(L){var D=T.join(":").trim();b.append(L,D)}}),b}U.call($.prototype);function ne(p,b){b||(b={}),this.type="default",this.status=b.status===void 0?200:b.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new I(b.headers),this.url=b.url||"",this._initBody(p)}U.call(ne.prototype),ne.prototype.clone=function(){return new ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},ne.error=function(){var p=new ne(null,{status:0,statusText:""});return p.type="error",p};var de=[301,302,303,307,308];ne.redirect=function(p,b){if(de.indexOf(b)===-1)throw new RangeError("Invalid status code");return new ne(null,{status:b,headers:{location:p}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(b,C){this.message=b,this.name=C;var O=Error(b);this.stack=O.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function d(p,b){return new Promise(function(C,O){var T=new $(p,b);if(T.signal&&T.signal.aborted)return O(new c.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function D(){L.abort()}L.onload=function(){var v={status:L.status,statusText:L.statusText,headers:ee(L.getAllResponseHeaders()||"")};v.url="responseURL"in L?L.responseURL:v.headers.get("X-Request-URL");var N="response"in L?L.response:L.responseText;C(new ne(N,v))},L.onerror=function(){O(new TypeError("Network request failed"))},L.ontimeout=function(){O(new TypeError("Network request failed"))},L.onabort=function(){O(new c.DOMException("Aborted","AbortError"))},L.open(T.method,T.url,!0),T.credentials==="include"?L.withCredentials=!0:T.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&l.blob&&(L.responseType="blob"),T.headers.forEach(function(v,N){L.setRequestHeader(N,v)}),T.signal&&(T.signal.addEventListener("abort",D),L.onreadystatechange=function(){L.readyState===4&&T.signal.removeEventListener("abort",D)}),L.send(typeof T._bodyInit>"u"?null:T._bodyInit)})}return d.polyfill=!0,o.fetch||(o.fetch=d,o.Headers=I,o.Request=$,o.Response=ne),c.Headers=I,c.Request=$,c.Response=ne,c.fetch=d,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(d0,d0.exports);var ow=t3(d0.exports),dC=Object.defineProperty,pC=Object.defineProperties,gC=Object.getOwnPropertyDescriptors,aw=Object.getOwnPropertySymbols,mC=Object.prototype.hasOwnProperty,vC=Object.prototype.propertyIsEnumerable,cw=(t,e,r)=>e in t?dC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lw=(t,e)=>{for(var r in e||(e={}))mC.call(e,r)&&cw(t,r,e[r]);if(aw)for(var r of aw(e))vC.call(e,r)&&cw(t,r,e[r]);return t},uw=(t,e)=>pC(t,gC(e));const wC={Accept:"application/json","Content-Type":"application/json"},yC="POST",hw={headers:wC,method:yC},fw=10;class fs{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Cr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!dv(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Li(e),n=await(await ow(this.url,uw(lw({},hw),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!dv(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Li({id:1,jsonrpc:"2.0",method:"test",params:[]});await ow(e,uw(lw({},hw),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ja(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=Vl(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return av(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>fw&&this.events.setMaxListeners(fw)}}const dw="error",bC="wss://relay.walletconnect.com",_C="wc",EC="universal_provider",pw=`${_C}@2:${EC}:`,AC="https://rpc.walletconnect.com/v1/",Ki={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},p0={exports:{}};/**
|
|
44
44
|
* @license
|
|
45
45
|
* Lodash <https://lodash.com/>
|
|
46
46
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
47
47
|
* Released under MIT license <https://lodash.com/license>
|
|
48
48
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
49
49
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
50
|
-
*/(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",_=1,E=2,x=4,I=1,k=2,W=1,Y=2,B=4,z=8,M=16,U=32,F=64,m=128,$=256,te=512,ee=30,ne="...",de=800,d=16,p=1,b=2,D=3,O=1/0,T=9007199254740991,L=17976931348623157e292,C=0/0,v=4294967295,N=v-1,oe=v>>>1,pe=[["ary",m],["bind",W],["bindKey",Y],["curry",z],["curryRight",M],["flip",te],["partial",U],["partialRight",F],["rearg",$]],A="[object Arguments]",re="[object Array]",q="[object AsyncFunction]",H="[object Boolean]",V="[object Date]",w="[object DOMException]",j="[object Error]",ie="[object Function]",he="[object GeneratorFunction]",le="[object Map]",Oe="[object Number]",Pe="[object Null]",Ie="[object Object]",Mt="[object Promise]",ze="[object Proxy]",Ce="[object RegExp]",Fe="[object Set]",Ee="[object String]",Ae="[object Symbol]",Ge="[object Undefined]",be="[object WeakMap]",xe="[object WeakSet]",Be="[object ArrayBuffer]",_e="[object DataView]",Me="[object Float32Array]",je="[object Float64Array]",$e="[object Int8Array]",Te="[object Int16Array]",lt="[object Int32Array]",Re="[object Uint8Array]",Ne="[object Uint8ClampedArray]",nr="[object Uint16Array]",dt="[object Uint32Array]",Et=/\b__p \+= '';/g,ir=/\b(__p \+=) '' \+/g,St=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ot=/&(?:amp|lt|gt|quot|#39);/g,Vr=/[&<>"']/g,Ye=RegExp(Ot.source),He=RegExp(Vr.source),Rt=/<%-([\s\S]+?)%>/g,Qe=/<%([\s\S]+?)%>/g,Ve=/<%=([\s\S]+?)%>/g,Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xe=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lt=/[\\^$.*+?()[\]{}|]/g,tt=RegExp(Lt.source),Je=/^\s+/,Ft=/\s/,Ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ke=/\{\n\/\* \[wrapped with (.+)\] \*/,Ht=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jt=/[()=,{}\[\]\/\s]/,ti=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,Nn=/^[-+]0x[0-9a-f]+$/i,Rn=/^0b[01]+$/i,Ln=/^\[object .+?Constructor\]$/,Bn=/^0o[0-7]+$/i,Un=/^(?:0|[1-9]\d*)$/,xr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ci=/($^)/,fo=/['\n\r\u2028\u2029\\]/g,Oi="\\ud800-\\udfff",po="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",Mi="\\u20d0-\\u20ff",Is=po+go+Mi,Ds="\\u2700-\\u27bf",Gr="a-z\\xdf-\\xf6\\xf8-\\xff",mo="\\xac\\xb1\\xd7\\xf7",vo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",wo="\\u2000-\\u206f",yo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pu="A-Z\\xc0-\\xd6\\xd8-\\xde",$u="\\ufe0e\\ufe0f",bo=mo+vo+wo+yo,Fc="['\u2019]",_o="["+Oi+"]",jc="["+bo+"]",Eo="["+Is+"]",Tu="\\d+",Pd="["+Ds+"]",Nu="["+Gr+"]",Ru="[^"+Oi+bo+Tu+Ds+Gr+Pu+"]",Aa="\\ud83c[\\udffb-\\udfff]",$d="(?:"+Eo+"|"+Aa+")",Lu="[^"+Oi+"]",xa="(?:\\ud83c[\\udde6-\\uddff]){2}",Cs="[\\ud800-\\udbff][\\udc00-\\udfff]",bn="["+Pu+"]",Bu="\\u200d",Uu="(?:"+Nu+"|"+Ru+")",Pi="(?:"+bn+"|"+Ru+")",Fu="(?:"+Fc+"(?:d|ll|m|re|s|t|ve))?",ju="(?:"+Fc+"(?:D|LL|M|RE|S|T|VE))?",ku=$d+"?",qu="["+$u+"]?",Td="(?:"+Bu+"(?:"+[Lu,xa,Cs].join("|")+")"+qu+ku+")*",Yi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hu=qu+ku+Td,Sa="(?:"+[Pd,xa,Cs].join("|")+")"+Hu,Nd="(?:"+[Lu+Eo+"?",Eo,xa,Cs,_o].join("|")+")",kc=RegExp(Fc,"g"),Rd=RegExp(Eo,"g"),Ia=RegExp(Aa+"(?="+Aa+")|"+Nd+Hu,"g"),Ku=RegExp([bn+"?"+Nu+"+"+Fu+"(?="+[jc,bn,"$"].join("|")+")",Pi+"+"+ju+"(?="+[jc,bn+Uu,"$"].join("|")+")",bn+"?"+Uu+"+"+Fu,bn+"+"+ju,zu,Yi,Tu,Sa].join("|"),"g"),Wu=RegExp("["+Bu+Oi+Is+$u+"]"),Ao=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ld=-1,Wt={};Wt[Me]=Wt[je]=Wt[$e]=Wt[Te]=Wt[lt]=Wt[Re]=Wt[Ne]=Wt[nr]=Wt[dt]=!0,Wt[A]=Wt[re]=Wt[Be]=Wt[H]=Wt[_e]=Wt[V]=Wt[j]=Wt[ie]=Wt[le]=Wt[Oe]=Wt[Ie]=Wt[Ce]=Wt[Fe]=Wt[Ee]=Wt[be]=!1;var Kt={};Kt[A]=Kt[re]=Kt[Be]=Kt[_e]=Kt[H]=Kt[V]=Kt[Me]=Kt[je]=Kt[$e]=Kt[Te]=Kt[lt]=Kt[le]=Kt[Oe]=Kt[Ie]=Kt[Ce]=Kt[Fe]=Kt[Ee]=Kt[Ae]=Kt[Re]=Kt[Ne]=Kt[nr]=Kt[dt]=!0,Kt[j]=Kt[ie]=Kt[be]=!1;var K={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},fe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,ot=parseInt,Zt=typeof yc=="object"&&yc&&yc.Object===Object&&yc,gr=typeof self=="object"&&self&&self.Object===Object&&self,It=Zt||gr||Function("return this")(),Gt=e&&!e.nodeType&&e,fr=Gt&&!0&&t&&!t.nodeType&&t,ln=fr&&fr.exports===Gt,mr=ln&&Zt.process,Xt=function(){try{var Z=fr&&fr.require&&fr.require("util").types;return Z||mr&&mr.binding&&mr.binding("util")}catch{}}(),Yr=Xt&&Xt.isArrayBuffer,ri=Xt&&Xt.isDate,Fn=Xt&&Xt.isMap,$i=Xt&&Xt.isRegExp,qc=Xt&&Xt.isSet,xo=Xt&&Xt.isTypedArray;function Sr(Z,ae,se){switch(se.length){case 0:return Z.call(ae);case 1:return Z.call(ae,se[0]);case 2:return Z.call(ae,se[0],se[1]);case 3:return Z.call(ae,se[0],se[1],se[2])}return Z.apply(ae,se)}function B$(Z,ae,se,De){for(var it=-1,Tt=Z==null?0:Z.length;++it<Tt;){var yr=Z[it];ae(De,yr,se(yr),Z)}return De}function jn(Z,ae){for(var se=-1,De=Z==null?0:Z.length;++se<De&&ae(Z[se],se,Z)!==!1;);return Z}function U$(Z,ae){for(var se=Z==null?0:Z.length;se--&&ae(Z[se],se,Z)!==!1;);return Z}function ry(Z,ae){for(var se=-1,De=Z==null?0:Z.length;++se<De;)if(!ae(Z[se],se,Z))return!1;return!0}function Os(Z,ae){for(var se=-1,De=Z==null?0:Z.length,it=0,Tt=[];++se<De;){var yr=Z[se];ae(yr,se,Z)&&(Tt[it++]=yr)}return Tt}function Gu(Z,ae){var se=Z==null?0:Z.length;return!!se&&Da(Z,ae,0)>-1}function Bd(Z,ae,se){for(var De=-1,it=Z==null?0:Z.length;++De<it;)if(se(ae,Z[De]))return!0;return!1}function tr(Z,ae){for(var se=-1,De=Z==null?0:Z.length,it=Array(De);++se<De;)it[se]=ae(Z[se],se,Z);return it}function Ms(Z,ae){for(var se=-1,De=ae.length,it=Z.length;++se<De;)Z[it+se]=ae[se];return Z}function Ud(Z,ae,se,De){var it=-1,Tt=Z==null?0:Z.length;for(De&&Tt&&(se=Z[++it]);++it<Tt;)se=ae(se,Z[it],it,Z);return se}function F$(Z,ae,se,De){var it=Z==null?0:Z.length;for(De&&it&&(se=Z[--it]);it--;)se=ae(se,Z[it],it,Z);return se}function Fd(Z,ae){for(var se=-1,De=Z==null?0:Z.length;++se<De;)if(ae(Z[se],se,Z))return!0;return!1}var j$=jd("length");function k$(Z){return Z.split("")}function q$(Z){return Z.match(rt)||[]}function ny(Z,ae,se){var De;return se(Z,function(it,Tt,yr){if(ae(it,Tt,yr))return De=Tt,!1}),De}function Yu(Z,ae,se,De){for(var it=Z.length,Tt=se+(De?1:-1);De?Tt--:++Tt<it;)if(ae(Z[Tt],Tt,Z))return Tt;return-1}function Da(Z,ae,se){return ae===ae?eT(Z,ae,se):Yu(Z,iy,se)}function z$(Z,ae,se,De){for(var it=se-1,Tt=Z.length;++it<Tt;)if(De(Z[it],ae))return it;return-1}function iy(Z){return Z!==Z}function sy(Z,ae){var se=Z==null?0:Z.length;return se?qd(Z,ae)/se:C}function jd(Z){return function(ae){return ae==null?r:ae[Z]}}function kd(Z){return function(ae){return Z==null?r:Z[ae]}}function oy(Z,ae,se,De,it){return it(Z,function(Tt,yr,Yt){se=De?(De=!1,Tt):ae(se,Tt,yr,Yt)}),se}function H$(Z,ae){var se=Z.length;for(Z.sort(ae);se--;)Z[se]=Z[se].value;return Z}function qd(Z,ae){for(var se,De=-1,it=Z.length;++De<it;){var Tt=ae(Z[De]);Tt!==r&&(se=se===r?Tt:se+Tt)}return se}function zd(Z,ae){for(var se=-1,De=Array(Z);++se<Z;)De[se]=ae(se);return De}function K$(Z,ae){return tr(ae,function(se){return[se,Z[se]]})}function ay(Z){return Z&&Z.slice(0,hy(Z)+1).replace(Je,"")}function _n(Z){return function(ae){return Z(ae)}}function Hd(Z,ae){return tr(ae,function(se){return Z[se]})}function zc(Z,ae){return Z.has(ae)}function cy(Z,ae){for(var se=-1,De=Z.length;++se<De&&Da(ae,Z[se],0)>-1;);return se}function ly(Z,ae){for(var se=Z.length;se--&&Da(ae,Z[se],0)>-1;);return se}function W$(Z,ae){for(var se=Z.length,De=0;se--;)Z[se]===ae&&++De;return De}var V$=kd(K),G$=kd(J);function Y$(Z){return"\\"+Se[Z]}function Q$(Z,ae){return Z==null?r:Z[ae]}function Ca(Z){return Wu.test(Z)}function J$(Z){return Ao.test(Z)}function Z$(Z){for(var ae,se=[];!(ae=Z.next()).done;)se.push(ae.value);return se}function Kd(Z){var ae=-1,se=Array(Z.size);return Z.forEach(function(De,it){se[++ae]=[it,De]}),se}function uy(Z,ae){return function(se){return Z(ae(se))}}function Ps(Z,ae){for(var se=-1,De=Z.length,it=0,Tt=[];++se<De;){var yr=Z[se];(yr===ae||yr===g)&&(Z[se]=g,Tt[it++]=se)}return Tt}function Qu(Z){var ae=-1,se=Array(Z.size);return Z.forEach(function(De){se[++ae]=De}),se}function X$(Z){var ae=-1,se=Array(Z.size);return Z.forEach(function(De){se[++ae]=[De,De]}),se}function eT(Z,ae,se){for(var De=se-1,it=Z.length;++De<it;)if(Z[De]===ae)return De;return-1}function tT(Z,ae,se){for(var De=se+1;De--;)if(Z[De]===ae)return De;return De}function Oa(Z){return Ca(Z)?nT(Z):j$(Z)}function ni(Z){return Ca(Z)?iT(Z):k$(Z)}function hy(Z){for(var ae=Z.length;ae--&&Ft.test(Z.charAt(ae)););return ae}var rT=kd(fe);function nT(Z){for(var ae=Ia.lastIndex=0;Ia.test(Z);)++ae;return ae}function iT(Z){return Z.match(Ia)||[]}function sT(Z){return Z.match(Ku)||[]}var oT=function Z(ae){ae=ae==null?It:Ma.defaults(It.Object(),ae,Ma.pick(It,Vu));var se=ae.Array,De=ae.Date,it=ae.Error,Tt=ae.Function,yr=ae.Math,Yt=ae.Object,Wd=ae.RegExp,aT=ae.String,kn=ae.TypeError,Ju=se.prototype,cT=Tt.prototype,Pa=Yt.prototype,Zu=ae["__core-js_shared__"],Xu=cT.toString,qt=Pa.hasOwnProperty,lT=0,fy=function(){var s=/[^.]+$/.exec(Zu&&Zu.keys&&Zu.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),eh=Pa.toString,uT=Xu.call(Yt),hT=It._,fT=Wd("^"+Xu.call(qt).replace(Lt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),th=ln?ae.Buffer:r,$s=ae.Symbol,rh=ae.Uint8Array,dy=th?th.allocUnsafe:r,nh=uy(Yt.getPrototypeOf,Yt),py=Yt.create,gy=Pa.propertyIsEnumerable,ih=Ju.splice,my=$s?$s.isConcatSpreadable:r,Hc=$s?$s.iterator:r,So=$s?$s.toStringTag:r,sh=function(){try{var s=Mo(Yt,"defineProperty");return s({},"",{}),s}catch{}}(),dT=ae.clearTimeout!==It.clearTimeout&&ae.clearTimeout,pT=De&&De.now!==It.Date.now&&De.now,gT=ae.setTimeout!==It.setTimeout&&ae.setTimeout,oh=yr.ceil,ah=yr.floor,Vd=Yt.getOwnPropertySymbols,mT=th?th.isBuffer:r,vy=ae.isFinite,vT=Ju.join,wT=uy(Yt.keys,Yt),br=yr.max,Ur=yr.min,yT=De.now,bT=ae.parseInt,wy=yr.random,_T=Ju.reverse,Gd=Mo(ae,"DataView"),Kc=Mo(ae,"Map"),Yd=Mo(ae,"Promise"),$a=Mo(ae,"Set"),Wc=Mo(ae,"WeakMap"),Vc=Mo(Yt,"create"),ch=Wc&&new Wc,Ta={},ET=Po(Gd),AT=Po(Kc),xT=Po(Yd),ST=Po($a),IT=Po(Wc),lh=$s?$s.prototype:r,Gc=lh?lh.valueOf:r,yy=lh?lh.toString:r;function P(s){if(cr(s)&&!at(s)&&!(s instanceof At)){if(s instanceof qn)return s;if(qt.call(s,"__wrapped__"))return bb(s)}return new qn(s)}var Na=function(){function s(){}return function(a){if(!sr(a))return{};if(py)return py(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function uh(){}function qn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}P.templateSettings={escape:Rt,evaluate:Qe,interpolate:Ve,variable:"",imports:{_:P}},P.prototype=uh.prototype,P.prototype.constructor=P,qn.prototype=Na(uh.prototype),qn.prototype.constructor=qn;function At(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function DT(){var s=new At(this.__wrapped__);return s.__actions__=un(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=un(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=un(this.__views__),s}function CT(){if(this.__filtered__){var s=new At(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function OT(){var s=this.__wrapped__.value(),a=this.__dir__,u=at(s),y=a<0,S=u?s.length:0,R=kN(0,S,this.__views__),G=R.start,Q=R.end,X=Q-G,ce=y?Q:G-1,ue=this.__iteratees__,ge=ue.length,we=0,Le=Ur(X,this.__takeCount__);if(!u||!y&&S==X&&Le==X)return zy(s,this.__actions__);var Ke=[];e:for(;X--&&we<Le;){ce+=a;for(var pt=-1,We=s[ce];++pt<ge;){var yt=ue[pt],Dt=yt.iteratee,xn=yt.type,Zr=Dt(We);if(xn==b)We=Zr;else if(!Zr){if(xn==p)continue e;break e}}Ke[we++]=We}return Ke}At.prototype=Na(uh.prototype),At.prototype.constructor=At;function Io(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function MT(){this.__data__=Vc?Vc(null):{},this.size=0}function PT(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function $T(s){var a=this.__data__;if(Vc){var u=a[s];return u===f?r:u}return qt.call(a,s)?a[s]:r}function TT(s){var a=this.__data__;return Vc?a[s]!==r:qt.call(a,s)}function NT(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Vc&&a===r?f:a,this}Io.prototype.clear=MT,Io.prototype.delete=PT,Io.prototype.get=$T,Io.prototype.has=TT,Io.prototype.set=NT;function Qi(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function RT(){this.__data__=[],this.size=0}function LT(s){var a=this.__data__,u=hh(a,s);if(u<0)return!1;var y=a.length-1;return u==y?a.pop():ih.call(a,u,1),--this.size,!0}function BT(s){var a=this.__data__,u=hh(a,s);return u<0?r:a[u][1]}function UT(s){return hh(this.__data__,s)>-1}function FT(s,a){var u=this.__data__,y=hh(u,s);return y<0?(++this.size,u.push([s,a])):u[y][1]=a,this}Qi.prototype.clear=RT,Qi.prototype.delete=LT,Qi.prototype.get=BT,Qi.prototype.has=UT,Qi.prototype.set=FT;function Ji(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function jT(){this.size=0,this.__data__={hash:new Io,map:new(Kc||Qi),string:new Io}}function kT(s){var a=Ah(this,s).delete(s);return this.size-=a?1:0,a}function qT(s){return Ah(this,s).get(s)}function zT(s){return Ah(this,s).has(s)}function HT(s,a){var u=Ah(this,s),y=u.size;return u.set(s,a),this.size+=u.size==y?0:1,this}Ji.prototype.clear=jT,Ji.prototype.delete=kT,Ji.prototype.get=qT,Ji.prototype.has=zT,Ji.prototype.set=HT;function Do(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new Ji;++a<u;)this.add(s[a])}function KT(s){return this.__data__.set(s,f),this}function WT(s){return this.__data__.has(s)}Do.prototype.add=Do.prototype.push=KT,Do.prototype.has=WT;function ii(s){var a=this.__data__=new Qi(s);this.size=a.size}function VT(){this.__data__=new Qi,this.size=0}function GT(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function YT(s){return this.__data__.get(s)}function QT(s){return this.__data__.has(s)}function JT(s,a){var u=this.__data__;if(u instanceof Qi){var y=u.__data__;if(!Kc||y.length<i-1)return y.push([s,a]),this.size=++u.size,this;u=this.__data__=new Ji(y)}return u.set(s,a),this.size=u.size,this}ii.prototype.clear=VT,ii.prototype.delete=GT,ii.prototype.get=YT,ii.prototype.has=QT,ii.prototype.set=JT;function by(s,a){var u=at(s),y=!u&&$o(s),S=!u&&!y&&Bs(s),R=!u&&!y&&!S&&Ua(s),G=u||y||S||R,Q=G?zd(s.length,aT):[],X=Q.length;for(var ce in s)(a||qt.call(s,ce))&&!(G&&(ce=="length"||S&&(ce=="offset"||ce=="parent")||R&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||ts(ce,X)))&&Q.push(ce);return Q}function _y(s){var a=s.length;return a?s[op(0,a-1)]:r}function ZT(s,a){return xh(un(s),Co(a,0,s.length))}function XT(s){return xh(un(s))}function Qd(s,a,u){(u!==r&&!si(s[a],u)||u===r&&!(a in s))&&Zi(s,a,u)}function Yc(s,a,u){var y=s[a];(!(qt.call(s,a)&&si(y,u))||u===r&&!(a in s))&&Zi(s,a,u)}function hh(s,a){for(var u=s.length;u--;)if(si(s[u][0],a))return u;return-1}function eN(s,a,u,y){return Ts(s,function(S,R,G){a(y,S,u(S),G)}),y}function Ey(s,a){return s&&Ni(a,Ir(a),s)}function tN(s,a){return s&&Ni(a,fn(a),s)}function Zi(s,a,u){a=="__proto__"&&sh?sh(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function Jd(s,a){for(var u=-1,y=a.length,S=se(y),R=s==null;++u<y;)S[u]=R?r:Pp(s,a[u]);return S}function Co(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function zn(s,a,u,y,S,R){var G,Q=a&_,X=a&E,ce=a&x;if(u&&(G=S?u(s,y,S,R):u(s)),G!==r)return G;if(!sr(s))return s;var ue=at(s);if(ue){if(G=zN(s),!Q)return un(s,G)}else{var ge=Fr(s),we=ge==ie||ge==he;if(Bs(s))return Wy(s,Q);if(ge==Ie||ge==A||we&&!S){if(G=X||we?{}:hb(s),!Q)return X?$N(s,tN(G,s)):PN(s,Ey(G,s))}else{if(!Kt[ge])return S?s:{};G=HN(s,ge,Q)}}R||(R=new ii);var Le=R.get(s);if(Le)return Le;R.set(s,G),jb(s)?s.forEach(function(We){G.add(zn(We,a,u,We,s,R))}):Ub(s)&&s.forEach(function(We,yt){G.set(yt,zn(We,a,u,yt,s,R))});var Ke=ce?X?vp:mp:X?fn:Ir,pt=ue?r:Ke(s);return jn(pt||s,function(We,yt){pt&&(yt=We,We=s[yt]),Yc(G,yt,zn(We,a,u,yt,s,R))}),G}function rN(s){var a=Ir(s);return function(u){return Ay(u,s,a)}}function Ay(s,a,u){var y=u.length;if(s==null)return!y;for(s=Yt(s);y--;){var S=u[y],R=a[S],G=s[S];if(G===r&&!(S in s)||!R(G))return!1}return!0}function xy(s,a,u){if(typeof s!="function")throw new kn(c);return rl(function(){s.apply(r,u)},a)}function Qc(s,a,u,y){var S=-1,R=Gu,G=!0,Q=s.length,X=[],ce=a.length;if(!Q)return X;u&&(a=tr(a,_n(u))),y?(R=Bd,G=!1):a.length>=i&&(R=zc,G=!1,a=new Do(a));e:for(;++S<Q;){var ue=s[S],ge=u==null?ue:u(ue);if(ue=y||ue!==0?ue:0,G&&ge===ge){for(var we=ce;we--;)if(a[we]===ge)continue e;X.push(ue)}else R(a,ge,y)||X.push(ue)}return X}var Ts=Jy(Ti),Sy=Jy(Xd,!0);function nN(s,a){var u=!0;return Ts(s,function(y,S,R){return u=!!a(y,S,R),u}),u}function fh(s,a,u){for(var y=-1,S=s.length;++y<S;){var R=s[y],G=a(R);if(G!=null&&(Q===r?G===G&&!An(G):u(G,Q)))var Q=G,X=R}return X}function iN(s,a,u,y){var S=s.length;for(u=ft(u),u<0&&(u=-u>S?0:S+u),y=y===r||y>S?S:ft(y),y<0&&(y+=S),y=u>y?0:qb(y);u<y;)s[u++]=a;return s}function Iy(s,a){var u=[];return Ts(s,function(y,S,R){a(y,S,R)&&u.push(y)}),u}function Nr(s,a,u,y,S){var R=-1,G=s.length;for(u||(u=WN),S||(S=[]);++R<G;){var Q=s[R];a>0&&u(Q)?a>1?Nr(Q,a-1,u,y,S):Ms(S,Q):y||(S[S.length]=Q)}return S}var Zd=Zy(),Dy=Zy(!0);function Ti(s,a){return s&&Zd(s,a,Ir)}function Xd(s,a){return s&&Dy(s,a,Ir)}function dh(s,a){return Os(a,function(u){return rs(s[u])})}function Oo(s,a){a=Rs(a,s);for(var u=0,y=a.length;s!=null&&u<y;)s=s[Ri(a[u++])];return u&&u==y?s:r}function Cy(s,a,u){var y=a(s);return at(s)?y:Ms(y,u(s))}function Qr(s){return s==null?s===r?Ge:Pe:So&&So in Yt(s)?jN(s):XN(s)}function ep(s,a){return s>a}function sN(s,a){return s!=null&&qt.call(s,a)}function oN(s,a){return s!=null&&a in Yt(s)}function aN(s,a,u){return s>=Ur(a,u)&&s<br(a,u)}function tp(s,a,u){for(var y=u?Bd:Gu,S=s[0].length,R=s.length,G=R,Q=se(R),X=1/0,ce=[];G--;){var ue=s[G];G&&a&&(ue=tr(ue,_n(a))),X=Ur(ue.length,X),Q[G]=!u&&(a||S>=120&&ue.length>=120)?new Do(G&&ue):r}ue=s[0];var ge=-1,we=Q[0];e:for(;++ge<S&&ce.length<X;){var Le=ue[ge],Ke=a?a(Le):Le;if(Le=u||Le!==0?Le:0,!(we?zc(we,Ke):y(ce,Ke,u))){for(G=R;--G;){var pt=Q[G];if(!(pt?zc(pt,Ke):y(s[G],Ke,u)))continue e}we&&we.push(Ke),ce.push(Le)}}return ce}function cN(s,a,u,y){return Ti(s,function(S,R,G){a(y,u(S),R,G)}),y}function Jc(s,a,u){a=Rs(a,s),s=gb(s,a);var y=s==null?s:s[Ri(Kn(a))];return y==null?r:Sr(y,s,u)}function Oy(s){return cr(s)&&Qr(s)==A}function lN(s){return cr(s)&&Qr(s)==Be}function uN(s){return cr(s)&&Qr(s)==V}function Zc(s,a,u,y,S){return s===a?!0:s==null||a==null||!cr(s)&&!cr(a)?s!==s&&a!==a:hN(s,a,u,y,Zc,S)}function hN(s,a,u,y,S,R){var G=at(s),Q=at(a),X=G?re:Fr(s),ce=Q?re:Fr(a);X=X==A?Ie:X,ce=ce==A?Ie:ce;var ue=X==Ie,ge=ce==Ie,we=X==ce;if(we&&Bs(s)){if(!Bs(a))return!1;G=!0,ue=!1}if(we&&!ue)return R||(R=new ii),G||Ua(s)?cb(s,a,u,y,S,R):UN(s,a,X,u,y,S,R);if(!(u&I)){var Le=ue&&qt.call(s,"__wrapped__"),Ke=ge&&qt.call(a,"__wrapped__");if(Le||Ke){var pt=Le?s.value():s,We=Ke?a.value():a;return R||(R=new ii),S(pt,We,u,y,R)}}return we?(R||(R=new ii),FN(s,a,u,y,S,R)):!1}function fN(s){return cr(s)&&Fr(s)==le}function rp(s,a,u,y){var S=u.length,R=S,G=!y;if(s==null)return!R;for(s=Yt(s);S--;){var Q=u[S];if(G&&Q[2]?Q[1]!==s[Q[0]]:!(Q[0]in s))return!1}for(;++S<R;){Q=u[S];var X=Q[0],ce=s[X],ue=Q[1];if(G&&Q[2]){if(ce===r&&!(X in s))return!1}else{var ge=new ii;if(y)var we=y(ce,ue,X,s,a,ge);if(!(we===r?Zc(ue,ce,I|k,y,ge):we))return!1}}return!0}function My(s){if(!sr(s)||GN(s))return!1;var a=rs(s)?fT:Ln;return a.test(Po(s))}function dN(s){return cr(s)&&Qr(s)==Ce}function pN(s){return cr(s)&&Fr(s)==Fe}function gN(s){return cr(s)&&Mh(s.length)&&!!Wt[Qr(s)]}function Py(s){return typeof s=="function"?s:s==null?dn:typeof s=="object"?at(s)?Ny(s[0],s[1]):Ty(s):Xb(s)}function np(s){if(!tl(s))return wT(s);var a=[];for(var u in Yt(s))qt.call(s,u)&&u!="constructor"&&a.push(u);return a}function mN(s){if(!sr(s))return ZN(s);var a=tl(s),u=[];for(var y in s)y=="constructor"&&(a||!qt.call(s,y))||u.push(y);return u}function ip(s,a){return s<a}function $y(s,a){var u=-1,y=hn(s)?se(s.length):[];return Ts(s,function(S,R,G){y[++u]=a(S,R,G)}),y}function Ty(s){var a=yp(s);return a.length==1&&a[0][2]?db(a[0][0],a[0][1]):function(u){return u===s||rp(u,s,a)}}function Ny(s,a){return _p(s)&&fb(a)?db(Ri(s),a):function(u){var y=Pp(u,s);return y===r&&y===a?$p(u,s):Zc(a,y,I|k)}}function ph(s,a,u,y,S){s!==a&&Zd(a,function(R,G){if(S||(S=new ii),sr(R))vN(s,a,G,u,ph,y,S);else{var Q=y?y(Ap(s,G),R,G+"",s,a,S):r;Q===r&&(Q=R),Qd(s,G,Q)}},fn)}function vN(s,a,u,y,S,R,G){var Q=Ap(s,u),X=Ap(a,u),ce=G.get(X);if(ce){Qd(s,u,ce);return}var ue=R?R(Q,X,u+"",s,a,G):r,ge=ue===r;if(ge){var we=at(X),Le=!we&&Bs(X),Ke=!we&&!Le&&Ua(X);ue=X,we||Le||Ke?at(Q)?ue=Q:dr(Q)?ue=un(Q):Le?(ge=!1,ue=Wy(X,!0)):Ke?(ge=!1,ue=Vy(X,!0)):ue=[]:nl(X)||$o(X)?(ue=Q,$o(Q)?ue=zb(Q):(!sr(Q)||rs(Q))&&(ue=hb(X))):ge=!1}ge&&(G.set(X,ue),S(ue,X,y,R,G),G.delete(X)),Qd(s,u,ue)}function Ry(s,a){var u=s.length;if(u)return a+=a<0?u:0,ts(a,u)?s[a]:r}function Ly(s,a,u){a.length?a=tr(a,function(R){return at(R)?function(G){return Oo(G,R.length===1?R[0]:R)}:R}):a=[dn];var y=-1;a=tr(a,_n(qe()));var S=$y(s,function(R,G,Q){var X=tr(a,function(ce){return ce(R)});return{criteria:X,index:++y,value:R}});return H$(S,function(R,G){return MN(R,G,u)})}function wN(s,a){return By(s,a,function(u,y){return $p(s,y)})}function By(s,a,u){for(var y=-1,S=a.length,R={};++y<S;){var G=a[y],Q=Oo(s,G);u(Q,G)&&Xc(R,Rs(G,s),Q)}return R}function yN(s){return function(a){return Oo(a,s)}}function sp(s,a,u,y){var S=y?z$:Da,R=-1,G=a.length,Q=s;for(s===a&&(a=un(a)),u&&(Q=tr(s,_n(u)));++R<G;)for(var X=0,ce=a[R],ue=u?u(ce):ce;(X=S(Q,ue,X,y))>-1;)Q!==s&&ih.call(Q,X,1),ih.call(s,X,1);return s}function Uy(s,a){for(var u=s?a.length:0,y=u-1;u--;){var S=a[u];if(u==y||S!==R){var R=S;ts(S)?ih.call(s,S,1):lp(s,S)}}return s}function op(s,a){return s+ah(wy()*(a-s+1))}function bN(s,a,u,y){for(var S=-1,R=br(oh((a-s)/(u||1)),0),G=se(R);R--;)G[y?R:++S]=s,s+=u;return G}function ap(s,a){var u="";if(!s||a<1||a>T)return u;do a%2&&(u+=s),a=ah(a/2),a&&(s+=s);while(a);return u}function gt(s,a){return xp(pb(s,a,dn),s+"")}function _N(s){return _y(Fa(s))}function EN(s,a){var u=Fa(s);return xh(u,Co(a,0,u.length))}function Xc(s,a,u,y){if(!sr(s))return s;a=Rs(a,s);for(var S=-1,R=a.length,G=R-1,Q=s;Q!=null&&++S<R;){var X=Ri(a[S]),ce=u;if(X==="__proto__"||X==="constructor"||X==="prototype")return s;if(S!=G){var ue=Q[X];ce=y?y(ue,X,Q):r,ce===r&&(ce=sr(ue)?ue:ts(a[S+1])?[]:{})}Yc(Q,X,ce),Q=Q[X]}return s}var Fy=ch?function(s,a){return ch.set(s,a),s}:dn,AN=sh?function(s,a){return sh(s,"toString",{configurable:!0,enumerable:!1,value:Np(a),writable:!0})}:dn;function xN(s){return xh(Fa(s))}function Hn(s,a,u){var y=-1,S=s.length;a<0&&(a=-a>S?0:S+a),u=u>S?S:u,u<0&&(u+=S),S=a>u?0:u-a>>>0,a>>>=0;for(var R=se(S);++y<S;)R[y]=s[y+a];return R}function SN(s,a){var u;return Ts(s,function(y,S,R){return u=a(y,S,R),!u}),!!u}function gh(s,a,u){var y=0,S=s==null?y:s.length;if(typeof a=="number"&&a===a&&S<=oe){for(;y<S;){var R=y+S>>>1,G=s[R];G!==null&&!An(G)&&(u?G<=a:G<a)?y=R+1:S=R}return S}return cp(s,a,dn,u)}function cp(s,a,u,y){var S=0,R=s==null?0:s.length;if(R===0)return 0;a=u(a);for(var G=a!==a,Q=a===null,X=An(a),ce=a===r;S<R;){var ue=ah((S+R)/2),ge=u(s[ue]),we=ge!==r,Le=ge===null,Ke=ge===ge,pt=An(ge);if(G)var We=y||Ke;else ce?We=Ke&&(y||we):Q?We=Ke&&we&&(y||!Le):X?We=Ke&&we&&!Le&&(y||!pt):Le||pt?We=!1:We=y?ge<=a:ge<a;We?S=ue+1:R=ue}return Ur(R,N)}function jy(s,a){for(var u=-1,y=s.length,S=0,R=[];++u<y;){var G=s[u],Q=a?a(G):G;if(!u||!si(Q,X)){var X=Q;R[S++]=G===0?0:G}}return R}function ky(s){return typeof s=="number"?s:An(s)?C:+s}function En(s){if(typeof s=="string")return s;if(at(s))return tr(s,En)+"";if(An(s))return yy?yy.call(s):"";var a=s+"";return a=="0"&&1/s==-O?"-0":a}function Ns(s,a,u){var y=-1,S=Gu,R=s.length,G=!0,Q=[],X=Q;if(u)G=!1,S=Bd;else if(R>=i){var ce=a?null:LN(s);if(ce)return Qu(ce);G=!1,S=zc,X=new Do}else X=a?[]:Q;e:for(;++y<R;){var ue=s[y],ge=a?a(ue):ue;if(ue=u||ue!==0?ue:0,G&&ge===ge){for(var we=X.length;we--;)if(X[we]===ge)continue e;a&&X.push(ge),Q.push(ue)}else S(X,ge,u)||(X!==Q&&X.push(ge),Q.push(ue))}return Q}function lp(s,a){return a=Rs(a,s),s=gb(s,a),s==null||delete s[Ri(Kn(a))]}function qy(s,a,u,y){return Xc(s,a,u(Oo(s,a)),y)}function mh(s,a,u,y){for(var S=s.length,R=y?S:-1;(y?R--:++R<S)&&a(s[R],R,s););return u?Hn(s,y?0:R,y?R+1:S):Hn(s,y?R+1:0,y?S:R)}function zy(s,a){var u=s;return u instanceof At&&(u=u.value()),Ud(a,function(y,S){return S.func.apply(S.thisArg,Ms([y],S.args))},u)}function up(s,a,u){var y=s.length;if(y<2)return y?Ns(s[0]):[];for(var S=-1,R=se(y);++S<y;)for(var G=s[S],Q=-1;++Q<y;)Q!=S&&(R[S]=Qc(R[S]||G,s[Q],a,u));return Ns(Nr(R,1),a,u)}function Hy(s,a,u){for(var y=-1,S=s.length,R=a.length,G={};++y<S;){var Q=y<R?a[y]:r;u(G,s[y],Q)}return G}function hp(s){return dr(s)?s:[]}function fp(s){return typeof s=="function"?s:dn}function Rs(s,a){return at(s)?s:_p(s,a)?[s]:yb(Bt(s))}var IN=gt;function Ls(s,a,u){var y=s.length;return u=u===r?y:u,!a&&u>=y?s:Hn(s,a,u)}var Ky=dT||function(s){return It.clearTimeout(s)};function Wy(s,a){if(a)return s.slice();var u=s.length,y=dy?dy(u):new s.constructor(u);return s.copy(y),y}function dp(s){var a=new s.constructor(s.byteLength);return new rh(a).set(new rh(s)),a}function DN(s,a){var u=a?dp(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function CN(s){var a=new s.constructor(s.source,vt.exec(s));return a.lastIndex=s.lastIndex,a}function ON(s){return Gc?Yt(Gc.call(s)):{}}function Vy(s,a){var u=a?dp(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Gy(s,a){if(s!==a){var u=s!==r,y=s===null,S=s===s,R=An(s),G=a!==r,Q=a===null,X=a===a,ce=An(a);if(!Q&&!ce&&!R&&s>a||R&&G&&X&&!Q&&!ce||y&&G&&X||!u&&X||!S)return 1;if(!y&&!R&&!ce&&s<a||ce&&u&&S&&!y&&!R||Q&&u&&S||!G&&S||!X)return-1}return 0}function MN(s,a,u){for(var y=-1,S=s.criteria,R=a.criteria,G=S.length,Q=u.length;++y<G;){var X=Gy(S[y],R[y]);if(X){if(y>=Q)return X;var ce=u[y];return X*(ce=="desc"?-1:1)}}return s.index-a.index}function Yy(s,a,u,y){for(var S=-1,R=s.length,G=u.length,Q=-1,X=a.length,ce=br(R-G,0),ue=se(X+ce),ge=!y;++Q<X;)ue[Q]=a[Q];for(;++S<G;)(ge||S<R)&&(ue[u[S]]=s[S]);for(;ce--;)ue[Q++]=s[S++];return ue}function Qy(s,a,u,y){for(var S=-1,R=s.length,G=-1,Q=u.length,X=-1,ce=a.length,ue=br(R-Q,0),ge=se(ue+ce),we=!y;++S<ue;)ge[S]=s[S];for(var Le=S;++X<ce;)ge[Le+X]=a[X];for(;++G<Q;)(we||S<R)&&(ge[Le+u[G]]=s[S++]);return ge}function un(s,a){var u=-1,y=s.length;for(a||(a=se(y));++u<y;)a[u]=s[u];return a}function Ni(s,a,u,y){var S=!u;u||(u={});for(var R=-1,G=a.length;++R<G;){var Q=a[R],X=y?y(u[Q],s[Q],Q,u,s):r;X===r&&(X=s[Q]),S?Zi(u,Q,X):Yc(u,Q,X)}return u}function PN(s,a){return Ni(s,bp(s),a)}function $N(s,a){return Ni(s,lb(s),a)}function vh(s,a){return function(u,y){var S=at(u)?B$:eN,R=a?a():{};return S(u,s,qe(y,2),R)}}function Ra(s){return gt(function(a,u){var y=-1,S=u.length,R=S>1?u[S-1]:r,G=S>2?u[2]:r;for(R=s.length>3&&typeof R=="function"?(S--,R):r,G&&Jr(u[0],u[1],G)&&(R=S<3?r:R,S=1),a=Yt(a);++y<S;){var Q=u[y];Q&&s(a,Q,y,R)}return a})}function Jy(s,a){return function(u,y){if(u==null)return u;if(!hn(u))return s(u,y);for(var S=u.length,R=a?S:-1,G=Yt(u);(a?R--:++R<S)&&y(G[R],R,G)!==!1;);return u}}function Zy(s){return function(a,u,y){for(var S=-1,R=Yt(a),G=y(a),Q=G.length;Q--;){var X=G[s?Q:++S];if(u(R[X],X,R)===!1)break}return a}}function TN(s,a,u){var y=a&W,S=el(s);function R(){var G=this&&this!==It&&this instanceof R?S:s;return G.apply(y?u:this,arguments)}return R}function Xy(s){return function(a){a=Bt(a);var u=Ca(a)?ni(a):r,y=u?u[0]:a.charAt(0),S=u?Ls(u,1).join(""):a.slice(1);return y[s]()+S}}function La(s){return function(a){return Ud(Jb(Qb(a).replace(kc,"")),s,"")}}function el(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=Na(s.prototype),y=s.apply(u,a);return sr(y)?y:u}}function NN(s,a,u){var y=el(s);function S(){for(var R=arguments.length,G=se(R),Q=R,X=Ba(S);Q--;)G[Q]=arguments[Q];var ce=R<3&&G[0]!==X&&G[R-1]!==X?[]:Ps(G,X);if(R-=ce.length,R<u)return ib(s,a,wh,S.placeholder,r,G,ce,r,r,u-R);var ue=this&&this!==It&&this instanceof S?y:s;return Sr(ue,this,G)}return S}function eb(s){return function(a,u,y){var S=Yt(a);if(!hn(a)){var R=qe(u,3);a=Ir(a),u=function(Q){return R(S[Q],Q,S)}}var G=s(a,u,y);return G>-1?S[R?a[G]:G]:r}}function tb(s){return es(function(a){var u=a.length,y=u,S=qn.prototype.thru;for(s&&a.reverse();y--;){var R=a[y];if(typeof R!="function")throw new kn(c);if(S&&!G&&Eh(R)=="wrapper")var G=new qn([],!0)}for(y=G?y:u;++y<u;){R=a[y];var Q=Eh(R),X=Q=="wrapper"?wp(R):r;X&&Ep(X[0])&&X[1]==(m|z|U|$)&&!X[4].length&&X[9]==1?G=G[Eh(X[0])].apply(G,X[3]):G=R.length==1&&Ep(R)?G[Q]():G.thru(R)}return function(){var ce=arguments,ue=ce[0];if(G&&ce.length==1&&at(ue))return G.plant(ue).value();for(var ge=0,we=u?a[ge].apply(this,ce):ue;++ge<u;)we=a[ge].call(this,we);return we}})}function wh(s,a,u,y,S,R,G,Q,X,ce){var ue=a&m,ge=a&W,we=a&Y,Le=a&(z|M),Ke=a&te,pt=we?r:el(s);function We(){for(var yt=arguments.length,Dt=se(yt),xn=yt;xn--;)Dt[xn]=arguments[xn];if(Le)var Zr=Ba(We),Sn=W$(Dt,Zr);if(y&&(Dt=Yy(Dt,y,S,Le)),R&&(Dt=Qy(Dt,R,G,Le)),yt-=Sn,Le&&yt<ce){var pr=Ps(Dt,Zr);return ib(s,a,wh,We.placeholder,u,Dt,pr,Q,X,ce-yt)}var oi=ge?u:this,is=we?oi[s]:s;return yt=Dt.length,Q?Dt=eR(Dt,Q):Ke&&yt>1&&Dt.reverse(),ue&&X<yt&&(Dt.length=X),this&&this!==It&&this instanceof We&&(is=pt||el(is)),is.apply(oi,Dt)}return We}function rb(s,a){return function(u,y){return cN(u,s,a(y),{})}}function yh(s,a){return function(u,y){var S;if(u===r&&y===r)return a;if(u!==r&&(S=u),y!==r){if(S===r)return y;typeof u=="string"||typeof y=="string"?(u=En(u),y=En(y)):(u=ky(u),y=ky(y)),S=s(u,y)}return S}}function pp(s){return es(function(a){return a=tr(a,_n(qe())),gt(function(u){var y=this;return s(a,function(S){return Sr(S,y,u)})})})}function bh(s,a){a=a===r?" ":En(a);var u=a.length;if(u<2)return u?ap(a,s):a;var y=ap(a,oh(s/Oa(a)));return Ca(a)?Ls(ni(y),0,s).join(""):y.slice(0,s)}function RN(s,a,u,y){var S=a&W,R=el(s);function G(){for(var Q=-1,X=arguments.length,ce=-1,ue=y.length,ge=se(ue+X),we=this&&this!==It&&this instanceof G?R:s;++ce<ue;)ge[ce]=y[ce];for(;X--;)ge[ce++]=arguments[++Q];return Sr(we,S?u:this,ge)}return G}function nb(s){return function(a,u,y){return y&&typeof y!="number"&&Jr(a,u,y)&&(u=y=r),a=ns(a),u===r?(u=a,a=0):u=ns(u),y=y===r?a<u?1:-1:ns(y),bN(a,u,y,s)}}function _h(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=Wn(a),u=Wn(u)),s(a,u)}}function ib(s,a,u,y,S,R,G,Q,X,ce){var ue=a&z,ge=ue?G:r,we=ue?r:G,Le=ue?R:r,Ke=ue?r:R;a|=ue?U:F,a&=~(ue?F:U),a&B||(a&=~(W|Y));var pt=[s,a,S,Le,ge,Ke,we,Q,X,ce],We=u.apply(r,pt);return Ep(s)&&mb(We,pt),We.placeholder=y,vb(We,s,a)}function gp(s){var a=yr[s];return function(u,y){if(u=Wn(u),y=y==null?0:Ur(ft(y),292),y&&vy(u)){var S=(Bt(u)+"e").split("e"),R=a(S[0]+"e"+(+S[1]+y));return S=(Bt(R)+"e").split("e"),+(S[0]+"e"+(+S[1]-y))}return a(u)}}var LN=$a&&1/Qu(new $a([,-0]))[1]==O?function(s){return new $a(s)}:Bp;function sb(s){return function(a){var u=Fr(a);return u==le?Kd(a):u==Fe?X$(a):K$(a,s(a))}}function Xi(s,a,u,y,S,R,G,Q){var X=a&Y;if(!X&&typeof s!="function")throw new kn(c);var ce=y?y.length:0;if(ce||(a&=~(U|F),y=S=r),G=G===r?G:br(ft(G),0),Q=Q===r?Q:ft(Q),ce-=S?S.length:0,a&F){var ue=y,ge=S;y=S=r}var we=X?r:wp(s),Le=[s,a,u,y,S,ue,ge,R,G,Q];if(we&&JN(Le,we),s=Le[0],a=Le[1],u=Le[2],y=Le[3],S=Le[4],Q=Le[9]=Le[9]===r?X?0:s.length:br(Le[9]-ce,0),!Q&&a&(z|M)&&(a&=~(z|M)),!a||a==W)var Ke=TN(s,a,u);else a==z||a==M?Ke=NN(s,a,Q):(a==U||a==(W|U))&&!S.length?Ke=RN(s,a,u,y):Ke=wh.apply(r,Le);var pt=we?Fy:mb;return vb(pt(Ke,Le),s,a)}function ob(s,a,u,y){return s===r||si(s,Pa[u])&&!qt.call(y,u)?a:s}function ab(s,a,u,y,S,R){return sr(s)&&sr(a)&&(R.set(a,s),ph(s,a,r,ab,R),R.delete(a)),s}function BN(s){return nl(s)?r:s}function cb(s,a,u,y,S,R){var G=u&I,Q=s.length,X=a.length;if(Q!=X&&!(G&&X>Q))return!1;var ce=R.get(s),ue=R.get(a);if(ce&&ue)return ce==a&&ue==s;var ge=-1,we=!0,Le=u&k?new Do:r;for(R.set(s,a),R.set(a,s);++ge<Q;){var Ke=s[ge],pt=a[ge];if(y)var We=G?y(pt,Ke,ge,a,s,R):y(Ke,pt,ge,s,a,R);if(We!==r){if(We)continue;we=!1;break}if(Le){if(!Fd(a,function(yt,Dt){if(!zc(Le,Dt)&&(Ke===yt||S(Ke,yt,u,y,R)))return Le.push(Dt)})){we=!1;break}}else if(!(Ke===pt||S(Ke,pt,u,y,R))){we=!1;break}}return R.delete(s),R.delete(a),we}function UN(s,a,u,y,S,R,G){switch(u){case _e:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Be:return!(s.byteLength!=a.byteLength||!R(new rh(s),new rh(a)));case H:case V:case Oe:return si(+s,+a);case j:return s.name==a.name&&s.message==a.message;case Ce:case Ee:return s==a+"";case le:var Q=Kd;case Fe:var X=y&I;if(Q||(Q=Qu),s.size!=a.size&&!X)return!1;var ce=G.get(s);if(ce)return ce==a;y|=k,G.set(s,a);var ue=cb(Q(s),Q(a),y,S,R,G);return G.delete(s),ue;case Ae:if(Gc)return Gc.call(s)==Gc.call(a)}return!1}function FN(s,a,u,y,S,R){var G=u&I,Q=mp(s),X=Q.length,ce=mp(a),ue=ce.length;if(X!=ue&&!G)return!1;for(var ge=X;ge--;){var we=Q[ge];if(!(G?we in a:qt.call(a,we)))return!1}var Le=R.get(s),Ke=R.get(a);if(Le&&Ke)return Le==a&&Ke==s;var pt=!0;R.set(s,a),R.set(a,s);for(var We=G;++ge<X;){we=Q[ge];var yt=s[we],Dt=a[we];if(y)var xn=G?y(Dt,yt,we,a,s,R):y(yt,Dt,we,s,a,R);if(!(xn===r?yt===Dt||S(yt,Dt,u,y,R):xn)){pt=!1;break}We||(We=we=="constructor")}if(pt&&!We){var Zr=s.constructor,Sn=a.constructor;Zr!=Sn&&"constructor"in s&&"constructor"in a&&!(typeof Zr=="function"&&Zr instanceof Zr&&typeof Sn=="function"&&Sn instanceof Sn)&&(pt=!1)}return R.delete(s),R.delete(a),pt}function es(s){return xp(pb(s,r,Ab),s+"")}function mp(s){return Cy(s,Ir,bp)}function vp(s){return Cy(s,fn,lb)}var wp=ch?function(s){return ch.get(s)}:Bp;function Eh(s){for(var a=s.name+"",u=Ta[a],y=qt.call(Ta,a)?u.length:0;y--;){var S=u[y],R=S.func;if(R==null||R==s)return S.name}return a}function Ba(s){var a=qt.call(P,"placeholder")?P:s;return a.placeholder}function qe(){var s=P.iteratee||Rp;return s=s===Rp?Py:s,arguments.length?s(arguments[0],arguments[1]):s}function Ah(s,a){var u=s.__data__;return VN(a)?u[typeof a=="string"?"string":"hash"]:u.map}function yp(s){for(var a=Ir(s),u=a.length;u--;){var y=a[u],S=s[y];a[u]=[y,S,fb(S)]}return a}function Mo(s,a){var u=Q$(s,a);return My(u)?u:r}function jN(s){var a=qt.call(s,So),u=s[So];try{s[So]=r;var y=!0}catch{}var S=eh.call(s);return y&&(a?s[So]=u:delete s[So]),S}var bp=Vd?function(s){return s==null?[]:(s=Yt(s),Os(Vd(s),function(a){return gy.call(s,a)}))}:Up,lb=Vd?function(s){for(var a=[];s;)Ms(a,bp(s)),s=nh(s);return a}:Up,Fr=Qr;(Gd&&Fr(new Gd(new ArrayBuffer(1)))!=_e||Kc&&Fr(new Kc)!=le||Yd&&Fr(Yd.resolve())!=Mt||$a&&Fr(new $a)!=Fe||Wc&&Fr(new Wc)!=be)&&(Fr=function(s){var a=Qr(s),u=a==Ie?s.constructor:r,y=u?Po(u):"";if(y)switch(y){case ET:return _e;case AT:return le;case xT:return Mt;case ST:return Fe;case IT:return be}return a});function kN(s,a,u){for(var y=-1,S=u.length;++y<S;){var R=u[y],G=R.size;switch(R.type){case"drop":s+=G;break;case"dropRight":a-=G;break;case"take":a=Ur(a,s+G);break;case"takeRight":s=br(s,a-G);break}}return{start:s,end:a}}function qN(s){var a=s.match(ke);return a?a[1].split(Ht):[]}function ub(s,a,u){a=Rs(a,s);for(var y=-1,S=a.length,R=!1;++y<S;){var G=Ri(a[y]);if(!(R=s!=null&&u(s,G)))break;s=s[G]}return R||++y!=S?R:(S=s==null?0:s.length,!!S&&Mh(S)&&ts(G,S)&&(at(s)||$o(s)))}function zN(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&qt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function hb(s){return typeof s.constructor=="function"&&!tl(s)?Na(nh(s)):{}}function HN(s,a,u){var y=s.constructor;switch(a){case Be:return dp(s);case H:case V:return new y(+s);case _e:return DN(s,u);case Me:case je:case $e:case Te:case lt:case Re:case Ne:case nr:case dt:return Vy(s,u);case le:return new y;case Oe:case Ee:return new y(s);case Ce:return CN(s);case Fe:return new y;case Ae:return ON(s)}}function KN(s,a){var u=a.length;if(!u)return s;var y=u-1;return a[y]=(u>1?"& ":"")+a[y],a=a.join(u>2?", ":" "),s.replace(Ze,`{
|
|
50
|
+
*/(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",_=1,E=2,x=4,I=1,F=2,W=1,Y=2,B=4,z=8,M=16,U=32,j=64,m=128,$=256,te=512,ee=30,ne="...",de=800,d=16,p=1,b=2,C=3,O=1/0,T=9007199254740991,L=17976931348623157e292,D=0/0,v=4294967295,N=v-1,oe=v>>>1,pe=[["ary",m],["bind",W],["bindKey",Y],["curry",z],["curryRight",M],["flip",te],["partial",U],["partialRight",j],["rearg",$]],A="[object Arguments]",re="[object Array]",q="[object AsyncFunction]",H="[object Boolean]",V="[object Date]",w="[object DOMException]",k="[object Error]",ie="[object Function]",he="[object GeneratorFunction]",le="[object Map]",Oe="[object Number]",Pe="[object Null]",Se="[object Object]",Mt="[object Promise]",ze="[object Proxy]",De="[object RegExp]",Fe="[object Set]",Ee="[object String]",Ae="[object Symbol]",Ge="[object Undefined]",be="[object WeakMap]",xe="[object WeakSet]",Be="[object ArrayBuffer]",_e="[object DataView]",Me="[object Float32Array]",je="[object Float64Array]",$e="[object Int8Array]",Te="[object Int16Array]",lt="[object Int32Array]",Re="[object Uint8Array]",Ne="[object Uint8ClampedArray]",nr="[object Uint16Array]",dt="[object Uint32Array]",Et=/\b__p \+= '';/g,ir=/\b(__p \+=) '' \+/g,It=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ot=/&(?:amp|lt|gt|quot|#39);/g,Vr=/[&<>"']/g,Ye=RegExp(Ot.source),He=RegExp(Vr.source),Rt=/<%-([\s\S]+?)%>/g,Qe=/<%([\s\S]+?)%>/g,Ve=/<%=([\s\S]+?)%>/g,Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xe=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lt=/[\\^$.*+?()[\]{}|]/g,tt=RegExp(Lt.source),Je=/^\s+/,Ft=/\s/,Ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ke=/\{\n\/\* \[wrapped with (.+)\] \*/,Ht=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jt=/[()=,{}\[\]\/\s]/,ti=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,Nn=/^[-+]0x[0-9a-f]+$/i,Rn=/^0b[01]+$/i,Ln=/^\[object .+?Constructor\]$/,Bn=/^0o[0-7]+$/i,Un=/^(?:0|[1-9]\d*)$/,xr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Di=/($^)/,fo=/['\n\r\u2028\u2029\\]/g,Oi="\\ud800-\\udfff",po="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",Mi="\\u20d0-\\u20ff",Ss=po+go+Mi,Cs="\\u2700-\\u27bf",Gr="a-z\\xdf-\\xf6\\xf8-\\xff",mo="\\xac\\xb1\\xd7\\xf7",vo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",wo="\\u2000-\\u206f",yo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pu="A-Z\\xc0-\\xd6\\xd8-\\xde",$u="\\ufe0e\\ufe0f",bo=mo+vo+wo+yo,Fc="['\u2019]",_o="["+Oi+"]",jc="["+bo+"]",Eo="["+Ss+"]",Tu="\\d+",Md="["+Cs+"]",Nu="["+Gr+"]",Ru="[^"+Oi+bo+Tu+Cs+Gr+Pu+"]",Ea="\\ud83c[\\udffb-\\udfff]",Pd="(?:"+Eo+"|"+Ea+")",Lu="[^"+Oi+"]",Aa="(?:\\ud83c[\\udde6-\\uddff]){2}",Ds="[\\ud800-\\udbff][\\udc00-\\udfff]",bn="["+Pu+"]",Bu="\\u200d",Uu="(?:"+Nu+"|"+Ru+")",Pi="(?:"+bn+"|"+Ru+")",Fu="(?:"+Fc+"(?:d|ll|m|re|s|t|ve))?",ju="(?:"+Fc+"(?:D|LL|M|RE|S|T|VE))?",ku=Pd+"?",qu="["+$u+"]?",$d="(?:"+Bu+"(?:"+[Lu,Aa,Ds].join("|")+")"+qu+ku+")*",Yi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hu=qu+ku+$d,xa="(?:"+[Md,Aa,Ds].join("|")+")"+Hu,Td="(?:"+[Lu+Eo+"?",Eo,Aa,Ds,_o].join("|")+")",kc=RegExp(Fc,"g"),Nd=RegExp(Eo,"g"),Ia=RegExp(Ea+"(?="+Ea+")|"+Td+Hu,"g"),Ku=RegExp([bn+"?"+Nu+"+"+Fu+"(?="+[jc,bn,"$"].join("|")+")",Pi+"+"+ju+"(?="+[jc,bn+Uu,"$"].join("|")+")",bn+"?"+Uu+"+"+Fu,bn+"+"+ju,zu,Yi,Tu,xa].join("|"),"g"),Wu=RegExp("["+Bu+Oi+Ss+$u+"]"),Ao=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rd=-1,Wt={};Wt[Me]=Wt[je]=Wt[$e]=Wt[Te]=Wt[lt]=Wt[Re]=Wt[Ne]=Wt[nr]=Wt[dt]=!0,Wt[A]=Wt[re]=Wt[Be]=Wt[H]=Wt[_e]=Wt[V]=Wt[k]=Wt[ie]=Wt[le]=Wt[Oe]=Wt[Se]=Wt[De]=Wt[Fe]=Wt[Ee]=Wt[be]=!1;var Kt={};Kt[A]=Kt[re]=Kt[Be]=Kt[_e]=Kt[H]=Kt[V]=Kt[Me]=Kt[je]=Kt[$e]=Kt[Te]=Kt[lt]=Kt[le]=Kt[Oe]=Kt[Se]=Kt[De]=Kt[Fe]=Kt[Ee]=Kt[Ae]=Kt[Re]=Kt[Ne]=Kt[nr]=Kt[dt]=!0,Kt[k]=Kt[ie]=Kt[be]=!1;var K={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},fe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,ot=parseInt,Zt=typeof yc=="object"&&yc&&yc.Object===Object&&yc,gr=typeof self=="object"&&self&&self.Object===Object&&self,St=Zt||gr||Function("return this")(),Gt=e&&!e.nodeType&&e,fr=Gt&&!0&&t&&!t.nodeType&&t,ln=fr&&fr.exports===Gt,mr=ln&&Zt.process,Xt=function(){try{var Z=fr&&fr.require&&fr.require("util").types;return Z||mr&&mr.binding&&mr.binding("util")}catch{}}(),Yr=Xt&&Xt.isArrayBuffer,ri=Xt&&Xt.isDate,Fn=Xt&&Xt.isMap,$i=Xt&&Xt.isRegExp,qc=Xt&&Xt.isSet,xo=Xt&&Xt.isTypedArray;function Ir(Z,ae,se){switch(se.length){case 0:return Z.call(ae);case 1:return Z.call(ae,se[0]);case 2:return Z.call(ae,se[0],se[1]);case 3:return Z.call(ae,se[0],se[1],se[2])}return Z.apply(ae,se)}function U$(Z,ae,se,Ce){for(var it=-1,Tt=Z==null?0:Z.length;++it<Tt;){var yr=Z[it];ae(Ce,yr,se(yr),Z)}return Ce}function jn(Z,ae){for(var se=-1,Ce=Z==null?0:Z.length;++se<Ce&&ae(Z[se],se,Z)!==!1;);return Z}function F$(Z,ae){for(var se=Z==null?0:Z.length;se--&&ae(Z[se],se,Z)!==!1;);return Z}function ry(Z,ae){for(var se=-1,Ce=Z==null?0:Z.length;++se<Ce;)if(!ae(Z[se],se,Z))return!1;return!0}function Os(Z,ae){for(var se=-1,Ce=Z==null?0:Z.length,it=0,Tt=[];++se<Ce;){var yr=Z[se];ae(yr,se,Z)&&(Tt[it++]=yr)}return Tt}function Gu(Z,ae){var se=Z==null?0:Z.length;return!!se&&Sa(Z,ae,0)>-1}function Ld(Z,ae,se){for(var Ce=-1,it=Z==null?0:Z.length;++Ce<it;)if(se(ae,Z[Ce]))return!0;return!1}function tr(Z,ae){for(var se=-1,Ce=Z==null?0:Z.length,it=Array(Ce);++se<Ce;)it[se]=ae(Z[se],se,Z);return it}function Ms(Z,ae){for(var se=-1,Ce=ae.length,it=Z.length;++se<Ce;)Z[it+se]=ae[se];return Z}function Bd(Z,ae,se,Ce){var it=-1,Tt=Z==null?0:Z.length;for(Ce&&Tt&&(se=Z[++it]);++it<Tt;)se=ae(se,Z[it],it,Z);return se}function j$(Z,ae,se,Ce){var it=Z==null?0:Z.length;for(Ce&&it&&(se=Z[--it]);it--;)se=ae(se,Z[it],it,Z);return se}function Ud(Z,ae){for(var se=-1,Ce=Z==null?0:Z.length;++se<Ce;)if(ae(Z[se],se,Z))return!0;return!1}var k$=Fd("length");function q$(Z){return Z.split("")}function z$(Z){return Z.match(rt)||[]}function ny(Z,ae,se){var Ce;return se(Z,function(it,Tt,yr){if(ae(it,Tt,yr))return Ce=Tt,!1}),Ce}function Yu(Z,ae,se,Ce){for(var it=Z.length,Tt=se+(Ce?1:-1);Ce?Tt--:++Tt<it;)if(ae(Z[Tt],Tt,Z))return Tt;return-1}function Sa(Z,ae,se){return ae===ae?tT(Z,ae,se):Yu(Z,iy,se)}function H$(Z,ae,se,Ce){for(var it=se-1,Tt=Z.length;++it<Tt;)if(Ce(Z[it],ae))return it;return-1}function iy(Z){return Z!==Z}function sy(Z,ae){var se=Z==null?0:Z.length;return se?kd(Z,ae)/se:D}function Fd(Z){return function(ae){return ae==null?r:ae[Z]}}function jd(Z){return function(ae){return Z==null?r:Z[ae]}}function oy(Z,ae,se,Ce,it){return it(Z,function(Tt,yr,Yt){se=Ce?(Ce=!1,Tt):ae(se,Tt,yr,Yt)}),se}function K$(Z,ae){var se=Z.length;for(Z.sort(ae);se--;)Z[se]=Z[se].value;return Z}function kd(Z,ae){for(var se,Ce=-1,it=Z.length;++Ce<it;){var Tt=ae(Z[Ce]);Tt!==r&&(se=se===r?Tt:se+Tt)}return se}function qd(Z,ae){for(var se=-1,Ce=Array(Z);++se<Z;)Ce[se]=ae(se);return Ce}function W$(Z,ae){return tr(ae,function(se){return[se,Z[se]]})}function ay(Z){return Z&&Z.slice(0,hy(Z)+1).replace(Je,"")}function _n(Z){return function(ae){return Z(ae)}}function zd(Z,ae){return tr(ae,function(se){return Z[se]})}function zc(Z,ae){return Z.has(ae)}function cy(Z,ae){for(var se=-1,Ce=Z.length;++se<Ce&&Sa(ae,Z[se],0)>-1;);return se}function ly(Z,ae){for(var se=Z.length;se--&&Sa(ae,Z[se],0)>-1;);return se}function V$(Z,ae){for(var se=Z.length,Ce=0;se--;)Z[se]===ae&&++Ce;return Ce}var G$=jd(K),Y$=jd(J);function Q$(Z){return"\\"+Ie[Z]}function J$(Z,ae){return Z==null?r:Z[ae]}function Ca(Z){return Wu.test(Z)}function Z$(Z){return Ao.test(Z)}function X$(Z){for(var ae,se=[];!(ae=Z.next()).done;)se.push(ae.value);return se}function Hd(Z){var ae=-1,se=Array(Z.size);return Z.forEach(function(Ce,it){se[++ae]=[it,Ce]}),se}function uy(Z,ae){return function(se){return Z(ae(se))}}function Ps(Z,ae){for(var se=-1,Ce=Z.length,it=0,Tt=[];++se<Ce;){var yr=Z[se];(yr===ae||yr===g)&&(Z[se]=g,Tt[it++]=se)}return Tt}function Qu(Z){var ae=-1,se=Array(Z.size);return Z.forEach(function(Ce){se[++ae]=Ce}),se}function eT(Z){var ae=-1,se=Array(Z.size);return Z.forEach(function(Ce){se[++ae]=[Ce,Ce]}),se}function tT(Z,ae,se){for(var Ce=se-1,it=Z.length;++Ce<it;)if(Z[Ce]===ae)return Ce;return-1}function rT(Z,ae,se){for(var Ce=se+1;Ce--;)if(Z[Ce]===ae)return Ce;return Ce}function Da(Z){return Ca(Z)?iT(Z):k$(Z)}function ni(Z){return Ca(Z)?sT(Z):q$(Z)}function hy(Z){for(var ae=Z.length;ae--&&Ft.test(Z.charAt(ae)););return ae}var nT=jd(fe);function iT(Z){for(var ae=Ia.lastIndex=0;Ia.test(Z);)++ae;return ae}function sT(Z){return Z.match(Ia)||[]}function oT(Z){return Z.match(Ku)||[]}var aT=function Z(ae){ae=ae==null?St:Oa.defaults(St.Object(),ae,Oa.pick(St,Vu));var se=ae.Array,Ce=ae.Date,it=ae.Error,Tt=ae.Function,yr=ae.Math,Yt=ae.Object,Kd=ae.RegExp,cT=ae.String,kn=ae.TypeError,Ju=se.prototype,lT=Tt.prototype,Ma=Yt.prototype,Zu=ae["__core-js_shared__"],Xu=lT.toString,qt=Ma.hasOwnProperty,uT=0,fy=function(){var s=/[^.]+$/.exec(Zu&&Zu.keys&&Zu.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),eh=Ma.toString,hT=Xu.call(Yt),fT=St._,dT=Kd("^"+Xu.call(qt).replace(Lt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),th=ln?ae.Buffer:r,$s=ae.Symbol,rh=ae.Uint8Array,dy=th?th.allocUnsafe:r,nh=uy(Yt.getPrototypeOf,Yt),py=Yt.create,gy=Ma.propertyIsEnumerable,ih=Ju.splice,my=$s?$s.isConcatSpreadable:r,Hc=$s?$s.iterator:r,Io=$s?$s.toStringTag:r,sh=function(){try{var s=Mo(Yt,"defineProperty");return s({},"",{}),s}catch{}}(),pT=ae.clearTimeout!==St.clearTimeout&&ae.clearTimeout,gT=Ce&&Ce.now!==St.Date.now&&Ce.now,mT=ae.setTimeout!==St.setTimeout&&ae.setTimeout,oh=yr.ceil,ah=yr.floor,Wd=Yt.getOwnPropertySymbols,vT=th?th.isBuffer:r,vy=ae.isFinite,wT=Ju.join,yT=uy(Yt.keys,Yt),br=yr.max,Ur=yr.min,bT=Ce.now,_T=ae.parseInt,wy=yr.random,ET=Ju.reverse,Vd=Mo(ae,"DataView"),Kc=Mo(ae,"Map"),Gd=Mo(ae,"Promise"),Pa=Mo(ae,"Set"),Wc=Mo(ae,"WeakMap"),Vc=Mo(Yt,"create"),ch=Wc&&new Wc,$a={},AT=Po(Vd),xT=Po(Kc),IT=Po(Gd),ST=Po(Pa),CT=Po(Wc),lh=$s?$s.prototype:r,Gc=lh?lh.valueOf:r,yy=lh?lh.toString:r;function P(s){if(cr(s)&&!at(s)&&!(s instanceof At)){if(s instanceof qn)return s;if(qt.call(s,"__wrapped__"))return bb(s)}return new qn(s)}var Ta=function(){function s(){}return function(a){if(!sr(a))return{};if(py)return py(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function uh(){}function qn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}P.templateSettings={escape:Rt,evaluate:Qe,interpolate:Ve,variable:"",imports:{_:P}},P.prototype=uh.prototype,P.prototype.constructor=P,qn.prototype=Ta(uh.prototype),qn.prototype.constructor=qn;function At(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function DT(){var s=new At(this.__wrapped__);return s.__actions__=un(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=un(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=un(this.__views__),s}function OT(){if(this.__filtered__){var s=new At(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function MT(){var s=this.__wrapped__.value(),a=this.__dir__,u=at(s),y=a<0,S=u?s.length:0,R=qN(0,S,this.__views__),G=R.start,Q=R.end,X=Q-G,ce=y?Q:G-1,ue=this.__iteratees__,ge=ue.length,we=0,Le=Ur(X,this.__takeCount__);if(!u||!y&&S==X&&Le==X)return zy(s,this.__actions__);var Ke=[];e:for(;X--&&we<Le;){ce+=a;for(var pt=-1,We=s[ce];++pt<ge;){var yt=ue[pt],Ct=yt.iteratee,xn=yt.type,Zr=Ct(We);if(xn==b)We=Zr;else if(!Zr){if(xn==p)continue e;break e}}Ke[we++]=We}return Ke}At.prototype=Ta(uh.prototype),At.prototype.constructor=At;function So(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function PT(){this.__data__=Vc?Vc(null):{},this.size=0}function $T(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function TT(s){var a=this.__data__;if(Vc){var u=a[s];return u===f?r:u}return qt.call(a,s)?a[s]:r}function NT(s){var a=this.__data__;return Vc?a[s]!==r:qt.call(a,s)}function RT(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Vc&&a===r?f:a,this}So.prototype.clear=PT,So.prototype.delete=$T,So.prototype.get=TT,So.prototype.has=NT,So.prototype.set=RT;function Qi(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function LT(){this.__data__=[],this.size=0}function BT(s){var a=this.__data__,u=hh(a,s);if(u<0)return!1;var y=a.length-1;return u==y?a.pop():ih.call(a,u,1),--this.size,!0}function UT(s){var a=this.__data__,u=hh(a,s);return u<0?r:a[u][1]}function FT(s){return hh(this.__data__,s)>-1}function jT(s,a){var u=this.__data__,y=hh(u,s);return y<0?(++this.size,u.push([s,a])):u[y][1]=a,this}Qi.prototype.clear=LT,Qi.prototype.delete=BT,Qi.prototype.get=UT,Qi.prototype.has=FT,Qi.prototype.set=jT;function Ji(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function kT(){this.size=0,this.__data__={hash:new So,map:new(Kc||Qi),string:new So}}function qT(s){var a=Ah(this,s).delete(s);return this.size-=a?1:0,a}function zT(s){return Ah(this,s).get(s)}function HT(s){return Ah(this,s).has(s)}function KT(s,a){var u=Ah(this,s),y=u.size;return u.set(s,a),this.size+=u.size==y?0:1,this}Ji.prototype.clear=kT,Ji.prototype.delete=qT,Ji.prototype.get=zT,Ji.prototype.has=HT,Ji.prototype.set=KT;function Co(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new Ji;++a<u;)this.add(s[a])}function WT(s){return this.__data__.set(s,f),this}function VT(s){return this.__data__.has(s)}Co.prototype.add=Co.prototype.push=WT,Co.prototype.has=VT;function ii(s){var a=this.__data__=new Qi(s);this.size=a.size}function GT(){this.__data__=new Qi,this.size=0}function YT(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function QT(s){return this.__data__.get(s)}function JT(s){return this.__data__.has(s)}function ZT(s,a){var u=this.__data__;if(u instanceof Qi){var y=u.__data__;if(!Kc||y.length<i-1)return y.push([s,a]),this.size=++u.size,this;u=this.__data__=new Ji(y)}return u.set(s,a),this.size=u.size,this}ii.prototype.clear=GT,ii.prototype.delete=YT,ii.prototype.get=QT,ii.prototype.has=JT,ii.prototype.set=ZT;function by(s,a){var u=at(s),y=!u&&$o(s),S=!u&&!y&&Bs(s),R=!u&&!y&&!S&&Ba(s),G=u||y||S||R,Q=G?qd(s.length,cT):[],X=Q.length;for(var ce in s)(a||qt.call(s,ce))&&!(G&&(ce=="length"||S&&(ce=="offset"||ce=="parent")||R&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||ts(ce,X)))&&Q.push(ce);return Q}function _y(s){var a=s.length;return a?s[sp(0,a-1)]:r}function XT(s,a){return xh(un(s),Do(a,0,s.length))}function eN(s){return xh(un(s))}function Yd(s,a,u){(u!==r&&!si(s[a],u)||u===r&&!(a in s))&&Zi(s,a,u)}function Yc(s,a,u){var y=s[a];(!(qt.call(s,a)&&si(y,u))||u===r&&!(a in s))&&Zi(s,a,u)}function hh(s,a){for(var u=s.length;u--;)if(si(s[u][0],a))return u;return-1}function tN(s,a,u,y){return Ts(s,function(S,R,G){a(y,S,u(S),G)}),y}function Ey(s,a){return s&&Ni(a,Sr(a),s)}function rN(s,a){return s&&Ni(a,fn(a),s)}function Zi(s,a,u){a=="__proto__"&&sh?sh(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function Qd(s,a){for(var u=-1,y=a.length,S=se(y),R=s==null;++u<y;)S[u]=R?r:Mp(s,a[u]);return S}function Do(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function zn(s,a,u,y,S,R){var G,Q=a&_,X=a&E,ce=a&x;if(u&&(G=S?u(s,y,S,R):u(s)),G!==r)return G;if(!sr(s))return s;var ue=at(s);if(ue){if(G=HN(s),!Q)return un(s,G)}else{var ge=Fr(s),we=ge==ie||ge==he;if(Bs(s))return Wy(s,Q);if(ge==Se||ge==A||we&&!S){if(G=X||we?{}:hb(s),!Q)return X?TN(s,rN(G,s)):$N(s,Ey(G,s))}else{if(!Kt[ge])return S?s:{};G=KN(s,ge,Q)}}R||(R=new ii);var Le=R.get(s);if(Le)return Le;R.set(s,G),jb(s)?s.forEach(function(We){G.add(zn(We,a,u,We,s,R))}):Ub(s)&&s.forEach(function(We,yt){G.set(yt,zn(We,a,u,yt,s,R))});var Ke=ce?X?mp:gp:X?fn:Sr,pt=ue?r:Ke(s);return jn(pt||s,function(We,yt){pt&&(yt=We,We=s[yt]),Yc(G,yt,zn(We,a,u,yt,s,R))}),G}function nN(s){var a=Sr(s);return function(u){return Ay(u,s,a)}}function Ay(s,a,u){var y=u.length;if(s==null)return!y;for(s=Yt(s);y--;){var S=u[y],R=a[S],G=s[S];if(G===r&&!(S in s)||!R(G))return!1}return!0}function xy(s,a,u){if(typeof s!="function")throw new kn(c);return rl(function(){s.apply(r,u)},a)}function Qc(s,a,u,y){var S=-1,R=Gu,G=!0,Q=s.length,X=[],ce=a.length;if(!Q)return X;u&&(a=tr(a,_n(u))),y?(R=Ld,G=!1):a.length>=i&&(R=zc,G=!1,a=new Co(a));e:for(;++S<Q;){var ue=s[S],ge=u==null?ue:u(ue);if(ue=y||ue!==0?ue:0,G&&ge===ge){for(var we=ce;we--;)if(a[we]===ge)continue e;X.push(ue)}else R(a,ge,y)||X.push(ue)}return X}var Ts=Jy(Ti),Iy=Jy(Zd,!0);function iN(s,a){var u=!0;return Ts(s,function(y,S,R){return u=!!a(y,S,R),u}),u}function fh(s,a,u){for(var y=-1,S=s.length;++y<S;){var R=s[y],G=a(R);if(G!=null&&(Q===r?G===G&&!An(G):u(G,Q)))var Q=G,X=R}return X}function sN(s,a,u,y){var S=s.length;for(u=ft(u),u<0&&(u=-u>S?0:S+u),y=y===r||y>S?S:ft(y),y<0&&(y+=S),y=u>y?0:qb(y);u<y;)s[u++]=a;return s}function Sy(s,a){var u=[];return Ts(s,function(y,S,R){a(y,S,R)&&u.push(y)}),u}function Nr(s,a,u,y,S){var R=-1,G=s.length;for(u||(u=VN),S||(S=[]);++R<G;){var Q=s[R];a>0&&u(Q)?a>1?Nr(Q,a-1,u,y,S):Ms(S,Q):y||(S[S.length]=Q)}return S}var Jd=Zy(),Cy=Zy(!0);function Ti(s,a){return s&&Jd(s,a,Sr)}function Zd(s,a){return s&&Cy(s,a,Sr)}function dh(s,a){return Os(a,function(u){return rs(s[u])})}function Oo(s,a){a=Rs(a,s);for(var u=0,y=a.length;s!=null&&u<y;)s=s[Ri(a[u++])];return u&&u==y?s:r}function Dy(s,a,u){var y=a(s);return at(s)?y:Ms(y,u(s))}function Qr(s){return s==null?s===r?Ge:Pe:Io&&Io in Yt(s)?kN(s):eR(s)}function Xd(s,a){return s>a}function oN(s,a){return s!=null&&qt.call(s,a)}function aN(s,a){return s!=null&&a in Yt(s)}function cN(s,a,u){return s>=Ur(a,u)&&s<br(a,u)}function ep(s,a,u){for(var y=u?Ld:Gu,S=s[0].length,R=s.length,G=R,Q=se(R),X=1/0,ce=[];G--;){var ue=s[G];G&&a&&(ue=tr(ue,_n(a))),X=Ur(ue.length,X),Q[G]=!u&&(a||S>=120&&ue.length>=120)?new Co(G&&ue):r}ue=s[0];var ge=-1,we=Q[0];e:for(;++ge<S&&ce.length<X;){var Le=ue[ge],Ke=a?a(Le):Le;if(Le=u||Le!==0?Le:0,!(we?zc(we,Ke):y(ce,Ke,u))){for(G=R;--G;){var pt=Q[G];if(!(pt?zc(pt,Ke):y(s[G],Ke,u)))continue e}we&&we.push(Ke),ce.push(Le)}}return ce}function lN(s,a,u,y){return Ti(s,function(S,R,G){a(y,u(S),R,G)}),y}function Jc(s,a,u){a=Rs(a,s),s=gb(s,a);var y=s==null?s:s[Ri(Kn(a))];return y==null?r:Ir(y,s,u)}function Oy(s){return cr(s)&&Qr(s)==A}function uN(s){return cr(s)&&Qr(s)==Be}function hN(s){return cr(s)&&Qr(s)==V}function Zc(s,a,u,y,S){return s===a?!0:s==null||a==null||!cr(s)&&!cr(a)?s!==s&&a!==a:fN(s,a,u,y,Zc,S)}function fN(s,a,u,y,S,R){var G=at(s),Q=at(a),X=G?re:Fr(s),ce=Q?re:Fr(a);X=X==A?Se:X,ce=ce==A?Se:ce;var ue=X==Se,ge=ce==Se,we=X==ce;if(we&&Bs(s)){if(!Bs(a))return!1;G=!0,ue=!1}if(we&&!ue)return R||(R=new ii),G||Ba(s)?cb(s,a,u,y,S,R):FN(s,a,X,u,y,S,R);if(!(u&I)){var Le=ue&&qt.call(s,"__wrapped__"),Ke=ge&&qt.call(a,"__wrapped__");if(Le||Ke){var pt=Le?s.value():s,We=Ke?a.value():a;return R||(R=new ii),S(pt,We,u,y,R)}}return we?(R||(R=new ii),jN(s,a,u,y,S,R)):!1}function dN(s){return cr(s)&&Fr(s)==le}function tp(s,a,u,y){var S=u.length,R=S,G=!y;if(s==null)return!R;for(s=Yt(s);S--;){var Q=u[S];if(G&&Q[2]?Q[1]!==s[Q[0]]:!(Q[0]in s))return!1}for(;++S<R;){Q=u[S];var X=Q[0],ce=s[X],ue=Q[1];if(G&&Q[2]){if(ce===r&&!(X in s))return!1}else{var ge=new ii;if(y)var we=y(ce,ue,X,s,a,ge);if(!(we===r?Zc(ue,ce,I|F,y,ge):we))return!1}}return!0}function My(s){if(!sr(s)||YN(s))return!1;var a=rs(s)?dT:Ln;return a.test(Po(s))}function pN(s){return cr(s)&&Qr(s)==De}function gN(s){return cr(s)&&Fr(s)==Fe}function mN(s){return cr(s)&&Mh(s.length)&&!!Wt[Qr(s)]}function Py(s){return typeof s=="function"?s:s==null?dn:typeof s=="object"?at(s)?Ny(s[0],s[1]):Ty(s):Xb(s)}function rp(s){if(!tl(s))return yT(s);var a=[];for(var u in Yt(s))qt.call(s,u)&&u!="constructor"&&a.push(u);return a}function vN(s){if(!sr(s))return XN(s);var a=tl(s),u=[];for(var y in s)y=="constructor"&&(a||!qt.call(s,y))||u.push(y);return u}function np(s,a){return s<a}function $y(s,a){var u=-1,y=hn(s)?se(s.length):[];return Ts(s,function(S,R,G){y[++u]=a(S,R,G)}),y}function Ty(s){var a=wp(s);return a.length==1&&a[0][2]?db(a[0][0],a[0][1]):function(u){return u===s||tp(u,s,a)}}function Ny(s,a){return bp(s)&&fb(a)?db(Ri(s),a):function(u){var y=Mp(u,s);return y===r&&y===a?Pp(u,s):Zc(a,y,I|F)}}function ph(s,a,u,y,S){s!==a&&Jd(a,function(R,G){if(S||(S=new ii),sr(R))wN(s,a,G,u,ph,y,S);else{var Q=y?y(Ep(s,G),R,G+"",s,a,S):r;Q===r&&(Q=R),Yd(s,G,Q)}},fn)}function wN(s,a,u,y,S,R,G){var Q=Ep(s,u),X=Ep(a,u),ce=G.get(X);if(ce){Yd(s,u,ce);return}var ue=R?R(Q,X,u+"",s,a,G):r,ge=ue===r;if(ge){var we=at(X),Le=!we&&Bs(X),Ke=!we&&!Le&&Ba(X);ue=X,we||Le||Ke?at(Q)?ue=Q:dr(Q)?ue=un(Q):Le?(ge=!1,ue=Wy(X,!0)):Ke?(ge=!1,ue=Vy(X,!0)):ue=[]:nl(X)||$o(X)?(ue=Q,$o(Q)?ue=zb(Q):(!sr(Q)||rs(Q))&&(ue=hb(X))):ge=!1}ge&&(G.set(X,ue),S(ue,X,y,R,G),G.delete(X)),Yd(s,u,ue)}function Ry(s,a){var u=s.length;if(u)return a+=a<0?u:0,ts(a,u)?s[a]:r}function Ly(s,a,u){a.length?a=tr(a,function(R){return at(R)?function(G){return Oo(G,R.length===1?R[0]:R)}:R}):a=[dn];var y=-1;a=tr(a,_n(qe()));var S=$y(s,function(R,G,Q){var X=tr(a,function(ce){return ce(R)});return{criteria:X,index:++y,value:R}});return K$(S,function(R,G){return PN(R,G,u)})}function yN(s,a){return By(s,a,function(u,y){return Pp(s,y)})}function By(s,a,u){for(var y=-1,S=a.length,R={};++y<S;){var G=a[y],Q=Oo(s,G);u(Q,G)&&Xc(R,Rs(G,s),Q)}return R}function bN(s){return function(a){return Oo(a,s)}}function ip(s,a,u,y){var S=y?H$:Sa,R=-1,G=a.length,Q=s;for(s===a&&(a=un(a)),u&&(Q=tr(s,_n(u)));++R<G;)for(var X=0,ce=a[R],ue=u?u(ce):ce;(X=S(Q,ue,X,y))>-1;)Q!==s&&ih.call(Q,X,1),ih.call(s,X,1);return s}function Uy(s,a){for(var u=s?a.length:0,y=u-1;u--;){var S=a[u];if(u==y||S!==R){var R=S;ts(S)?ih.call(s,S,1):cp(s,S)}}return s}function sp(s,a){return s+ah(wy()*(a-s+1))}function _N(s,a,u,y){for(var S=-1,R=br(oh((a-s)/(u||1)),0),G=se(R);R--;)G[y?R:++S]=s,s+=u;return G}function op(s,a){var u="";if(!s||a<1||a>T)return u;do a%2&&(u+=s),a=ah(a/2),a&&(s+=s);while(a);return u}function gt(s,a){return Ap(pb(s,a,dn),s+"")}function EN(s){return _y(Ua(s))}function AN(s,a){var u=Ua(s);return xh(u,Do(a,0,u.length))}function Xc(s,a,u,y){if(!sr(s))return s;a=Rs(a,s);for(var S=-1,R=a.length,G=R-1,Q=s;Q!=null&&++S<R;){var X=Ri(a[S]),ce=u;if(X==="__proto__"||X==="constructor"||X==="prototype")return s;if(S!=G){var ue=Q[X];ce=y?y(ue,X,Q):r,ce===r&&(ce=sr(ue)?ue:ts(a[S+1])?[]:{})}Yc(Q,X,ce),Q=Q[X]}return s}var Fy=ch?function(s,a){return ch.set(s,a),s}:dn,xN=sh?function(s,a){return sh(s,"toString",{configurable:!0,enumerable:!1,value:Tp(a),writable:!0})}:dn;function IN(s){return xh(Ua(s))}function Hn(s,a,u){var y=-1,S=s.length;a<0&&(a=-a>S?0:S+a),u=u>S?S:u,u<0&&(u+=S),S=a>u?0:u-a>>>0,a>>>=0;for(var R=se(S);++y<S;)R[y]=s[y+a];return R}function SN(s,a){var u;return Ts(s,function(y,S,R){return u=a(y,S,R),!u}),!!u}function gh(s,a,u){var y=0,S=s==null?y:s.length;if(typeof a=="number"&&a===a&&S<=oe){for(;y<S;){var R=y+S>>>1,G=s[R];G!==null&&!An(G)&&(u?G<=a:G<a)?y=R+1:S=R}return S}return ap(s,a,dn,u)}function ap(s,a,u,y){var S=0,R=s==null?0:s.length;if(R===0)return 0;a=u(a);for(var G=a!==a,Q=a===null,X=An(a),ce=a===r;S<R;){var ue=ah((S+R)/2),ge=u(s[ue]),we=ge!==r,Le=ge===null,Ke=ge===ge,pt=An(ge);if(G)var We=y||Ke;else ce?We=Ke&&(y||we):Q?We=Ke&&we&&(y||!Le):X?We=Ke&&we&&!Le&&(y||!pt):Le||pt?We=!1:We=y?ge<=a:ge<a;We?S=ue+1:R=ue}return Ur(R,N)}function jy(s,a){for(var u=-1,y=s.length,S=0,R=[];++u<y;){var G=s[u],Q=a?a(G):G;if(!u||!si(Q,X)){var X=Q;R[S++]=G===0?0:G}}return R}function ky(s){return typeof s=="number"?s:An(s)?D:+s}function En(s){if(typeof s=="string")return s;if(at(s))return tr(s,En)+"";if(An(s))return yy?yy.call(s):"";var a=s+"";return a=="0"&&1/s==-O?"-0":a}function Ns(s,a,u){var y=-1,S=Gu,R=s.length,G=!0,Q=[],X=Q;if(u)G=!1,S=Ld;else if(R>=i){var ce=a?null:BN(s);if(ce)return Qu(ce);G=!1,S=zc,X=new Co}else X=a?[]:Q;e:for(;++y<R;){var ue=s[y],ge=a?a(ue):ue;if(ue=u||ue!==0?ue:0,G&&ge===ge){for(var we=X.length;we--;)if(X[we]===ge)continue e;a&&X.push(ge),Q.push(ue)}else S(X,ge,u)||(X!==Q&&X.push(ge),Q.push(ue))}return Q}function cp(s,a){return a=Rs(a,s),s=gb(s,a),s==null||delete s[Ri(Kn(a))]}function qy(s,a,u,y){return Xc(s,a,u(Oo(s,a)),y)}function mh(s,a,u,y){for(var S=s.length,R=y?S:-1;(y?R--:++R<S)&&a(s[R],R,s););return u?Hn(s,y?0:R,y?R+1:S):Hn(s,y?R+1:0,y?S:R)}function zy(s,a){var u=s;return u instanceof At&&(u=u.value()),Bd(a,function(y,S){return S.func.apply(S.thisArg,Ms([y],S.args))},u)}function lp(s,a,u){var y=s.length;if(y<2)return y?Ns(s[0]):[];for(var S=-1,R=se(y);++S<y;)for(var G=s[S],Q=-1;++Q<y;)Q!=S&&(R[S]=Qc(R[S]||G,s[Q],a,u));return Ns(Nr(R,1),a,u)}function Hy(s,a,u){for(var y=-1,S=s.length,R=a.length,G={};++y<S;){var Q=y<R?a[y]:r;u(G,s[y],Q)}return G}function up(s){return dr(s)?s:[]}function hp(s){return typeof s=="function"?s:dn}function Rs(s,a){return at(s)?s:bp(s,a)?[s]:yb(Bt(s))}var CN=gt;function Ls(s,a,u){var y=s.length;return u=u===r?y:u,!a&&u>=y?s:Hn(s,a,u)}var Ky=pT||function(s){return St.clearTimeout(s)};function Wy(s,a){if(a)return s.slice();var u=s.length,y=dy?dy(u):new s.constructor(u);return s.copy(y),y}function fp(s){var a=new s.constructor(s.byteLength);return new rh(a).set(new rh(s)),a}function DN(s,a){var u=a?fp(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function ON(s){var a=new s.constructor(s.source,vt.exec(s));return a.lastIndex=s.lastIndex,a}function MN(s){return Gc?Yt(Gc.call(s)):{}}function Vy(s,a){var u=a?fp(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Gy(s,a){if(s!==a){var u=s!==r,y=s===null,S=s===s,R=An(s),G=a!==r,Q=a===null,X=a===a,ce=An(a);if(!Q&&!ce&&!R&&s>a||R&&G&&X&&!Q&&!ce||y&&G&&X||!u&&X||!S)return 1;if(!y&&!R&&!ce&&s<a||ce&&u&&S&&!y&&!R||Q&&u&&S||!G&&S||!X)return-1}return 0}function PN(s,a,u){for(var y=-1,S=s.criteria,R=a.criteria,G=S.length,Q=u.length;++y<G;){var X=Gy(S[y],R[y]);if(X){if(y>=Q)return X;var ce=u[y];return X*(ce=="desc"?-1:1)}}return s.index-a.index}function Yy(s,a,u,y){for(var S=-1,R=s.length,G=u.length,Q=-1,X=a.length,ce=br(R-G,0),ue=se(X+ce),ge=!y;++Q<X;)ue[Q]=a[Q];for(;++S<G;)(ge||S<R)&&(ue[u[S]]=s[S]);for(;ce--;)ue[Q++]=s[S++];return ue}function Qy(s,a,u,y){for(var S=-1,R=s.length,G=-1,Q=u.length,X=-1,ce=a.length,ue=br(R-Q,0),ge=se(ue+ce),we=!y;++S<ue;)ge[S]=s[S];for(var Le=S;++X<ce;)ge[Le+X]=a[X];for(;++G<Q;)(we||S<R)&&(ge[Le+u[G]]=s[S++]);return ge}function un(s,a){var u=-1,y=s.length;for(a||(a=se(y));++u<y;)a[u]=s[u];return a}function Ni(s,a,u,y){var S=!u;u||(u={});for(var R=-1,G=a.length;++R<G;){var Q=a[R],X=y?y(u[Q],s[Q],Q,u,s):r;X===r&&(X=s[Q]),S?Zi(u,Q,X):Yc(u,Q,X)}return u}function $N(s,a){return Ni(s,yp(s),a)}function TN(s,a){return Ni(s,lb(s),a)}function vh(s,a){return function(u,y){var S=at(u)?U$:tN,R=a?a():{};return S(u,s,qe(y,2),R)}}function Na(s){return gt(function(a,u){var y=-1,S=u.length,R=S>1?u[S-1]:r,G=S>2?u[2]:r;for(R=s.length>3&&typeof R=="function"?(S--,R):r,G&&Jr(u[0],u[1],G)&&(R=S<3?r:R,S=1),a=Yt(a);++y<S;){var Q=u[y];Q&&s(a,Q,y,R)}return a})}function Jy(s,a){return function(u,y){if(u==null)return u;if(!hn(u))return s(u,y);for(var S=u.length,R=a?S:-1,G=Yt(u);(a?R--:++R<S)&&y(G[R],R,G)!==!1;);return u}}function Zy(s){return function(a,u,y){for(var S=-1,R=Yt(a),G=y(a),Q=G.length;Q--;){var X=G[s?Q:++S];if(u(R[X],X,R)===!1)break}return a}}function NN(s,a,u){var y=a&W,S=el(s);function R(){var G=this&&this!==St&&this instanceof R?S:s;return G.apply(y?u:this,arguments)}return R}function Xy(s){return function(a){a=Bt(a);var u=Ca(a)?ni(a):r,y=u?u[0]:a.charAt(0),S=u?Ls(u,1).join(""):a.slice(1);return y[s]()+S}}function Ra(s){return function(a){return Bd(Jb(Qb(a).replace(kc,"")),s,"")}}function el(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=Ta(s.prototype),y=s.apply(u,a);return sr(y)?y:u}}function RN(s,a,u){var y=el(s);function S(){for(var R=arguments.length,G=se(R),Q=R,X=La(S);Q--;)G[Q]=arguments[Q];var ce=R<3&&G[0]!==X&&G[R-1]!==X?[]:Ps(G,X);if(R-=ce.length,R<u)return ib(s,a,wh,S.placeholder,r,G,ce,r,r,u-R);var ue=this&&this!==St&&this instanceof S?y:s;return Ir(ue,this,G)}return S}function eb(s){return function(a,u,y){var S=Yt(a);if(!hn(a)){var R=qe(u,3);a=Sr(a),u=function(Q){return R(S[Q],Q,S)}}var G=s(a,u,y);return G>-1?S[R?a[G]:G]:r}}function tb(s){return es(function(a){var u=a.length,y=u,S=qn.prototype.thru;for(s&&a.reverse();y--;){var R=a[y];if(typeof R!="function")throw new kn(c);if(S&&!G&&Eh(R)=="wrapper")var G=new qn([],!0)}for(y=G?y:u;++y<u;){R=a[y];var Q=Eh(R),X=Q=="wrapper"?vp(R):r;X&&_p(X[0])&&X[1]==(m|z|U|$)&&!X[4].length&&X[9]==1?G=G[Eh(X[0])].apply(G,X[3]):G=R.length==1&&_p(R)?G[Q]():G.thru(R)}return function(){var ce=arguments,ue=ce[0];if(G&&ce.length==1&&at(ue))return G.plant(ue).value();for(var ge=0,we=u?a[ge].apply(this,ce):ue;++ge<u;)we=a[ge].call(this,we);return we}})}function wh(s,a,u,y,S,R,G,Q,X,ce){var ue=a&m,ge=a&W,we=a&Y,Le=a&(z|M),Ke=a&te,pt=we?r:el(s);function We(){for(var yt=arguments.length,Ct=se(yt),xn=yt;xn--;)Ct[xn]=arguments[xn];if(Le)var Zr=La(We),In=V$(Ct,Zr);if(y&&(Ct=Yy(Ct,y,S,Le)),R&&(Ct=Qy(Ct,R,G,Le)),yt-=In,Le&&yt<ce){var pr=Ps(Ct,Zr);return ib(s,a,wh,We.placeholder,u,Ct,pr,Q,X,ce-yt)}var oi=ge?u:this,is=we?oi[s]:s;return yt=Ct.length,Q?Ct=tR(Ct,Q):Ke&&yt>1&&Ct.reverse(),ue&&X<yt&&(Ct.length=X),this&&this!==St&&this instanceof We&&(is=pt||el(is)),is.apply(oi,Ct)}return We}function rb(s,a){return function(u,y){return lN(u,s,a(y),{})}}function yh(s,a){return function(u,y){var S;if(u===r&&y===r)return a;if(u!==r&&(S=u),y!==r){if(S===r)return y;typeof u=="string"||typeof y=="string"?(u=En(u),y=En(y)):(u=ky(u),y=ky(y)),S=s(u,y)}return S}}function dp(s){return es(function(a){return a=tr(a,_n(qe())),gt(function(u){var y=this;return s(a,function(S){return Ir(S,y,u)})})})}function bh(s,a){a=a===r?" ":En(a);var u=a.length;if(u<2)return u?op(a,s):a;var y=op(a,oh(s/Da(a)));return Ca(a)?Ls(ni(y),0,s).join(""):y.slice(0,s)}function LN(s,a,u,y){var S=a&W,R=el(s);function G(){for(var Q=-1,X=arguments.length,ce=-1,ue=y.length,ge=se(ue+X),we=this&&this!==St&&this instanceof G?R:s;++ce<ue;)ge[ce]=y[ce];for(;X--;)ge[ce++]=arguments[++Q];return Ir(we,S?u:this,ge)}return G}function nb(s){return function(a,u,y){return y&&typeof y!="number"&&Jr(a,u,y)&&(u=y=r),a=ns(a),u===r?(u=a,a=0):u=ns(u),y=y===r?a<u?1:-1:ns(y),_N(a,u,y,s)}}function _h(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=Wn(a),u=Wn(u)),s(a,u)}}function ib(s,a,u,y,S,R,G,Q,X,ce){var ue=a&z,ge=ue?G:r,we=ue?r:G,Le=ue?R:r,Ke=ue?r:R;a|=ue?U:j,a&=~(ue?j:U),a&B||(a&=~(W|Y));var pt=[s,a,S,Le,ge,Ke,we,Q,X,ce],We=u.apply(r,pt);return _p(s)&&mb(We,pt),We.placeholder=y,vb(We,s,a)}function pp(s){var a=yr[s];return function(u,y){if(u=Wn(u),y=y==null?0:Ur(ft(y),292),y&&vy(u)){var S=(Bt(u)+"e").split("e"),R=a(S[0]+"e"+(+S[1]+y));return S=(Bt(R)+"e").split("e"),+(S[0]+"e"+(+S[1]-y))}return a(u)}}var BN=Pa&&1/Qu(new Pa([,-0]))[1]==O?function(s){return new Pa(s)}:Lp;function sb(s){return function(a){var u=Fr(a);return u==le?Hd(a):u==Fe?eT(a):W$(a,s(a))}}function Xi(s,a,u,y,S,R,G,Q){var X=a&Y;if(!X&&typeof s!="function")throw new kn(c);var ce=y?y.length:0;if(ce||(a&=~(U|j),y=S=r),G=G===r?G:br(ft(G),0),Q=Q===r?Q:ft(Q),ce-=S?S.length:0,a&j){var ue=y,ge=S;y=S=r}var we=X?r:vp(s),Le=[s,a,u,y,S,ue,ge,R,G,Q];if(we&&ZN(Le,we),s=Le[0],a=Le[1],u=Le[2],y=Le[3],S=Le[4],Q=Le[9]=Le[9]===r?X?0:s.length:br(Le[9]-ce,0),!Q&&a&(z|M)&&(a&=~(z|M)),!a||a==W)var Ke=NN(s,a,u);else a==z||a==M?Ke=RN(s,a,Q):(a==U||a==(W|U))&&!S.length?Ke=LN(s,a,u,y):Ke=wh.apply(r,Le);var pt=we?Fy:mb;return vb(pt(Ke,Le),s,a)}function ob(s,a,u,y){return s===r||si(s,Ma[u])&&!qt.call(y,u)?a:s}function ab(s,a,u,y,S,R){return sr(s)&&sr(a)&&(R.set(a,s),ph(s,a,r,ab,R),R.delete(a)),s}function UN(s){return nl(s)?r:s}function cb(s,a,u,y,S,R){var G=u&I,Q=s.length,X=a.length;if(Q!=X&&!(G&&X>Q))return!1;var ce=R.get(s),ue=R.get(a);if(ce&&ue)return ce==a&&ue==s;var ge=-1,we=!0,Le=u&F?new Co:r;for(R.set(s,a),R.set(a,s);++ge<Q;){var Ke=s[ge],pt=a[ge];if(y)var We=G?y(pt,Ke,ge,a,s,R):y(Ke,pt,ge,s,a,R);if(We!==r){if(We)continue;we=!1;break}if(Le){if(!Ud(a,function(yt,Ct){if(!zc(Le,Ct)&&(Ke===yt||S(Ke,yt,u,y,R)))return Le.push(Ct)})){we=!1;break}}else if(!(Ke===pt||S(Ke,pt,u,y,R))){we=!1;break}}return R.delete(s),R.delete(a),we}function FN(s,a,u,y,S,R,G){switch(u){case _e:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Be:return!(s.byteLength!=a.byteLength||!R(new rh(s),new rh(a)));case H:case V:case Oe:return si(+s,+a);case k:return s.name==a.name&&s.message==a.message;case De:case Ee:return s==a+"";case le:var Q=Hd;case Fe:var X=y&I;if(Q||(Q=Qu),s.size!=a.size&&!X)return!1;var ce=G.get(s);if(ce)return ce==a;y|=F,G.set(s,a);var ue=cb(Q(s),Q(a),y,S,R,G);return G.delete(s),ue;case Ae:if(Gc)return Gc.call(s)==Gc.call(a)}return!1}function jN(s,a,u,y,S,R){var G=u&I,Q=gp(s),X=Q.length,ce=gp(a),ue=ce.length;if(X!=ue&&!G)return!1;for(var ge=X;ge--;){var we=Q[ge];if(!(G?we in a:qt.call(a,we)))return!1}var Le=R.get(s),Ke=R.get(a);if(Le&&Ke)return Le==a&&Ke==s;var pt=!0;R.set(s,a),R.set(a,s);for(var We=G;++ge<X;){we=Q[ge];var yt=s[we],Ct=a[we];if(y)var xn=G?y(Ct,yt,we,a,s,R):y(yt,Ct,we,s,a,R);if(!(xn===r?yt===Ct||S(yt,Ct,u,y,R):xn)){pt=!1;break}We||(We=we=="constructor")}if(pt&&!We){var Zr=s.constructor,In=a.constructor;Zr!=In&&"constructor"in s&&"constructor"in a&&!(typeof Zr=="function"&&Zr instanceof Zr&&typeof In=="function"&&In instanceof In)&&(pt=!1)}return R.delete(s),R.delete(a),pt}function es(s){return Ap(pb(s,r,Ab),s+"")}function gp(s){return Dy(s,Sr,yp)}function mp(s){return Dy(s,fn,lb)}var vp=ch?function(s){return ch.get(s)}:Lp;function Eh(s){for(var a=s.name+"",u=$a[a],y=qt.call($a,a)?u.length:0;y--;){var S=u[y],R=S.func;if(R==null||R==s)return S.name}return a}function La(s){var a=qt.call(P,"placeholder")?P:s;return a.placeholder}function qe(){var s=P.iteratee||Np;return s=s===Np?Py:s,arguments.length?s(arguments[0],arguments[1]):s}function Ah(s,a){var u=s.__data__;return GN(a)?u[typeof a=="string"?"string":"hash"]:u.map}function wp(s){for(var a=Sr(s),u=a.length;u--;){var y=a[u],S=s[y];a[u]=[y,S,fb(S)]}return a}function Mo(s,a){var u=J$(s,a);return My(u)?u:r}function kN(s){var a=qt.call(s,Io),u=s[Io];try{s[Io]=r;var y=!0}catch{}var S=eh.call(s);return y&&(a?s[Io]=u:delete s[Io]),S}var yp=Wd?function(s){return s==null?[]:(s=Yt(s),Os(Wd(s),function(a){return gy.call(s,a)}))}:Bp,lb=Wd?function(s){for(var a=[];s;)Ms(a,yp(s)),s=nh(s);return a}:Bp,Fr=Qr;(Vd&&Fr(new Vd(new ArrayBuffer(1)))!=_e||Kc&&Fr(new Kc)!=le||Gd&&Fr(Gd.resolve())!=Mt||Pa&&Fr(new Pa)!=Fe||Wc&&Fr(new Wc)!=be)&&(Fr=function(s){var a=Qr(s),u=a==Se?s.constructor:r,y=u?Po(u):"";if(y)switch(y){case AT:return _e;case xT:return le;case IT:return Mt;case ST:return Fe;case CT:return be}return a});function qN(s,a,u){for(var y=-1,S=u.length;++y<S;){var R=u[y],G=R.size;switch(R.type){case"drop":s+=G;break;case"dropRight":a-=G;break;case"take":a=Ur(a,s+G);break;case"takeRight":s=br(s,a-G);break}}return{start:s,end:a}}function zN(s){var a=s.match(ke);return a?a[1].split(Ht):[]}function ub(s,a,u){a=Rs(a,s);for(var y=-1,S=a.length,R=!1;++y<S;){var G=Ri(a[y]);if(!(R=s!=null&&u(s,G)))break;s=s[G]}return R||++y!=S?R:(S=s==null?0:s.length,!!S&&Mh(S)&&ts(G,S)&&(at(s)||$o(s)))}function HN(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&qt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function hb(s){return typeof s.constructor=="function"&&!tl(s)?Ta(nh(s)):{}}function KN(s,a,u){var y=s.constructor;switch(a){case Be:return fp(s);case H:case V:return new y(+s);case _e:return DN(s,u);case Me:case je:case $e:case Te:case lt:case Re:case Ne:case nr:case dt:return Vy(s,u);case le:return new y;case Oe:case Ee:return new y(s);case De:return ON(s);case Fe:return new y;case Ae:return MN(s)}}function WN(s,a){var u=a.length;if(!u)return s;var y=u-1;return a[y]=(u>1?"& ":"")+a[y],a=a.join(u>2?", ":" "),s.replace(Ze,`{
|
|
51
51
|
/* [wrapped with `+a+`] */
|
|
52
|
-
`)}function WN(s){return at(s)||$o(s)||!!(my&&s&&s[my])}function ts(s,a){var u=typeof s;return a=a??T,!!a&&(u=="number"||u!="symbol"&&Un.test(s))&&s>-1&&s%1==0&&s<a}function Jr(s,a,u){if(!sr(u))return!1;var y=typeof a;return(y=="number"?hn(u)&&ts(a,u.length):y=="string"&&a in u)?si(u[a],s):!1}function _p(s,a){if(at(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||An(s)?!0:Xe.test(s)||!Pt.test(s)||a!=null&&s in Yt(a)}function VN(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function Ep(s){var a=Eh(s),u=P[a];if(typeof u!="function"||!(a in At.prototype))return!1;if(s===u)return!0;var y=wp(u);return!!y&&s===y[0]}function GN(s){return!!fy&&fy in s}var YN=Zu?rs:Fp;function tl(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||Pa;return s===u}function fb(s){return s===s&&!sr(s)}function db(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Yt(u))}}function QN(s){var a=Ch(s,function(y){return u.size===h&&u.clear(),y}),u=a.cache;return a}function JN(s,a){var u=s[1],y=a[1],S=u|y,R=S<(W|Y|m),G=y==m&&u==z||y==m&&u==$&&s[7].length<=a[8]||y==(m|$)&&a[7].length<=a[8]&&u==z;if(!(R||G))return s;y&W&&(s[2]=a[2],S|=u&W?0:B);var Q=a[3];if(Q){var X=s[3];s[3]=X?Yy(X,Q,a[4]):Q,s[4]=X?Ps(s[3],g):a[4]}return Q=a[5],Q&&(X=s[5],s[5]=X?Qy(X,Q,a[6]):Q,s[6]=X?Ps(s[5],g):a[6]),Q=a[7],Q&&(s[7]=Q),y&m&&(s[8]=s[8]==null?a[8]:Ur(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=S,s}function ZN(s){var a=[];if(s!=null)for(var u in Yt(s))a.push(u);return a}function XN(s){return eh.call(s)}function pb(s,a,u){return a=br(a===r?s.length-1:a,0),function(){for(var y=arguments,S=-1,R=br(y.length-a,0),G=se(R);++S<R;)G[S]=y[a+S];S=-1;for(var Q=se(a+1);++S<a;)Q[S]=y[S];return Q[a]=u(G),Sr(s,this,Q)}}function gb(s,a){return a.length<2?s:Oo(s,Hn(a,0,-1))}function eR(s,a){for(var u=s.length,y=Ur(a.length,u),S=un(s);y--;){var R=a[y];s[y]=ts(R,u)?S[R]:r}return s}function Ap(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var mb=wb(Fy),rl=gT||function(s,a){return It.setTimeout(s,a)},xp=wb(AN);function vb(s,a,u){var y=a+"";return xp(s,KN(y,tR(qN(y),u)))}function wb(s){var a=0,u=0;return function(){var y=yT(),S=d-(y-u);if(u=y,S>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function xh(s,a){var u=-1,y=s.length,S=y-1;for(a=a===r?y:a;++u<a;){var R=op(u,S),G=s[R];s[R]=s[u],s[u]=G}return s.length=a,s}var yb=QN(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(et,function(u,y,S,R){a.push(S?R.replace(ti,"$1"):y||u)}),a});function Ri(s){if(typeof s=="string"||An(s))return s;var a=s+"";return a=="0"&&1/s==-O?"-0":a}function Po(s){if(s!=null){try{return Xu.call(s)}catch{}try{return s+""}catch{}}return""}function tR(s,a){return jn(pe,function(u){var y="_."+u[0];a&u[1]&&!Gu(s,y)&&s.push(y)}),s.sort()}function bb(s){if(s instanceof At)return s.clone();var a=new qn(s.__wrapped__,s.__chain__);return a.__actions__=un(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function rR(s,a,u){(u?Jr(s,a,u):a===r)?a=1:a=br(ft(a),0);var y=s==null?0:s.length;if(!y||a<1)return[];for(var S=0,R=0,G=se(oh(y/a));S<y;)G[R++]=Hn(s,S,S+=a);return G}function nR(s){for(var a=-1,u=s==null?0:s.length,y=0,S=[];++a<u;){var R=s[a];R&&(S[y++]=R)}return S}function iR(){var s=arguments.length;if(!s)return[];for(var a=se(s-1),u=arguments[0],y=s;y--;)a[y-1]=arguments[y];return Ms(at(u)?un(u):[u],Nr(a,1))}var sR=gt(function(s,a){return dr(s)?Qc(s,Nr(a,1,dr,!0)):[]}),oR=gt(function(s,a){var u=Kn(a);return dr(u)&&(u=r),dr(s)?Qc(s,Nr(a,1,dr,!0),qe(u,2)):[]}),aR=gt(function(s,a){var u=Kn(a);return dr(u)&&(u=r),dr(s)?Qc(s,Nr(a,1,dr,!0),r,u):[]});function cR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:ft(a),Hn(s,a<0?0:a,y)):[]}function lR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:ft(a),a=y-a,Hn(s,0,a<0?0:a)):[]}function uR(s,a){return s&&s.length?mh(s,qe(a,3),!0,!0):[]}function hR(s,a){return s&&s.length?mh(s,qe(a,3),!0):[]}function fR(s,a,u,y){var S=s==null?0:s.length;return S?(u&&typeof u!="number"&&Jr(s,a,u)&&(u=0,y=S),iN(s,a,u,y)):[]}function _b(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=u==null?0:ft(u);return S<0&&(S=br(y+S,0)),Yu(s,qe(a,3),S)}function Eb(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=y-1;return u!==r&&(S=ft(u),S=u<0?br(y+S,0):Ur(S,y-1)),Yu(s,qe(a,3),S,!0)}function Ab(s){var a=s==null?0:s.length;return a?Nr(s,1):[]}function dR(s){var a=s==null?0:s.length;return a?Nr(s,O):[]}function pR(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:ft(a),Nr(s,a)):[]}function gR(s){for(var a=-1,u=s==null?0:s.length,y={};++a<u;){var S=s[a];y[S[0]]=S[1]}return y}function xb(s){return s&&s.length?s[0]:r}function mR(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=u==null?0:ft(u);return S<0&&(S=br(y+S,0)),Da(s,a,S)}function vR(s){var a=s==null?0:s.length;return a?Hn(s,0,-1):[]}var wR=gt(function(s){var a=tr(s,hp);return a.length&&a[0]===s[0]?tp(a):[]}),yR=gt(function(s){var a=Kn(s),u=tr(s,hp);return a===Kn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?tp(u,qe(a,2)):[]}),bR=gt(function(s){var a=Kn(s),u=tr(s,hp);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?tp(u,r,a):[]});function _R(s,a){return s==null?"":vT.call(s,a)}function Kn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function ER(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=y;return u!==r&&(S=ft(u),S=S<0?br(y+S,0):Ur(S,y-1)),a===a?tT(s,a,S):Yu(s,iy,S,!0)}function AR(s,a){return s&&s.length?Ry(s,ft(a)):r}var xR=gt(Sb);function Sb(s,a){return s&&s.length&&a&&a.length?sp(s,a):s}function SR(s,a,u){return s&&s.length&&a&&a.length?sp(s,a,qe(u,2)):s}function IR(s,a,u){return s&&s.length&&a&&a.length?sp(s,a,r,u):s}var DR=es(function(s,a){var u=s==null?0:s.length,y=Jd(s,a);return Uy(s,tr(a,function(S){return ts(S,u)?+S:S}).sort(Gy)),y});function CR(s,a){var u=[];if(!(s&&s.length))return u;var y=-1,S=[],R=s.length;for(a=qe(a,3);++y<R;){var G=s[y];a(G,y,s)&&(u.push(G),S.push(y))}return Uy(s,S),u}function Sp(s){return s==null?s:_T.call(s)}function OR(s,a,u){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Jr(s,a,u)?(a=0,u=y):(a=a==null?0:ft(a),u=u===r?y:ft(u)),Hn(s,a,u)):[]}function MR(s,a){return gh(s,a)}function PR(s,a,u){return cp(s,a,qe(u,2))}function $R(s,a){var u=s==null?0:s.length;if(u){var y=gh(s,a);if(y<u&&si(s[y],a))return y}return-1}function TR(s,a){return gh(s,a,!0)}function NR(s,a,u){return cp(s,a,qe(u,2),!0)}function RR(s,a){var u=s==null?0:s.length;if(u){var y=gh(s,a,!0)-1;if(si(s[y],a))return y}return-1}function LR(s){return s&&s.length?jy(s):[]}function BR(s,a){return s&&s.length?jy(s,qe(a,2)):[]}function UR(s){var a=s==null?0:s.length;return a?Hn(s,1,a):[]}function FR(s,a,u){return s&&s.length?(a=u||a===r?1:ft(a),Hn(s,0,a<0?0:a)):[]}function jR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:ft(a),a=y-a,Hn(s,a<0?0:a,y)):[]}function kR(s,a){return s&&s.length?mh(s,qe(a,3),!1,!0):[]}function qR(s,a){return s&&s.length?mh(s,qe(a,3)):[]}var zR=gt(function(s){return Ns(Nr(s,1,dr,!0))}),HR=gt(function(s){var a=Kn(s);return dr(a)&&(a=r),Ns(Nr(s,1,dr,!0),qe(a,2))}),KR=gt(function(s){var a=Kn(s);return a=typeof a=="function"?a:r,Ns(Nr(s,1,dr,!0),r,a)});function WR(s){return s&&s.length?Ns(s):[]}function VR(s,a){return s&&s.length?Ns(s,qe(a,2)):[]}function GR(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ns(s,r,a):[]}function Ip(s){if(!(s&&s.length))return[];var a=0;return s=Os(s,function(u){if(dr(u))return a=br(u.length,a),!0}),zd(a,function(u){return tr(s,jd(u))})}function Ib(s,a){if(!(s&&s.length))return[];var u=Ip(s);return a==null?u:tr(u,function(y){return Sr(a,r,y)})}var YR=gt(function(s,a){return dr(s)?Qc(s,a):[]}),QR=gt(function(s){return up(Os(s,dr))}),JR=gt(function(s){var a=Kn(s);return dr(a)&&(a=r),up(Os(s,dr),qe(a,2))}),ZR=gt(function(s){var a=Kn(s);return a=typeof a=="function"?a:r,up(Os(s,dr),r,a)}),XR=gt(Ip);function eL(s,a){return Hy(s||[],a||[],Yc)}function tL(s,a){return Hy(s||[],a||[],Xc)}var rL=gt(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,Ib(s,u)});function Db(s){var a=P(s);return a.__chain__=!0,a}function nL(s,a){return a(s),s}function Sh(s,a){return a(s)}var iL=es(function(s){var a=s.length,u=a?s[0]:0,y=this.__wrapped__,S=function(R){return Jd(R,s)};return a>1||this.__actions__.length||!(y instanceof At)||!ts(u)?this.thru(S):(y=y.slice(u,+u+(a?1:0)),y.__actions__.push({func:Sh,args:[S],thisArg:r}),new qn(y,this.__chain__).thru(function(R){return a&&!R.length&&R.push(r),R}))});function sL(){return Db(this)}function oL(){return new qn(this.value(),this.__chain__)}function aL(){this.__values__===r&&(this.__values__=kb(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function cL(){return this}function lL(s){for(var a,u=this;u instanceof uh;){var y=bb(u);y.__index__=0,y.__values__=r,a?S.__wrapped__=y:a=y;var S=y;u=u.__wrapped__}return S.__wrapped__=s,a}function uL(){var s=this.__wrapped__;if(s instanceof At){var a=s;return this.__actions__.length&&(a=new At(this)),a=a.reverse(),a.__actions__.push({func:Sh,args:[Sp],thisArg:r}),new qn(a,this.__chain__)}return this.thru(Sp)}function hL(){return zy(this.__wrapped__,this.__actions__)}var fL=vh(function(s,a,u){qt.call(s,u)?++s[u]:Zi(s,u,1)});function dL(s,a,u){var y=at(s)?ry:nN;return u&&Jr(s,a,u)&&(a=r),y(s,qe(a,3))}function pL(s,a){var u=at(s)?Os:Iy;return u(s,qe(a,3))}var gL=eb(_b),mL=eb(Eb);function vL(s,a){return Nr(Ih(s,a),1)}function wL(s,a){return Nr(Ih(s,a),O)}function yL(s,a,u){return u=u===r?1:ft(u),Nr(Ih(s,a),u)}function Cb(s,a){var u=at(s)?jn:Ts;return u(s,qe(a,3))}function Ob(s,a){var u=at(s)?U$:Sy;return u(s,qe(a,3))}var bL=vh(function(s,a,u){qt.call(s,u)?s[u].push(a):Zi(s,u,[a])});function _L(s,a,u,y){s=hn(s)?s:Fa(s),u=u&&!y?ft(u):0;var S=s.length;return u<0&&(u=br(S+u,0)),Ph(s)?u<=S&&s.indexOf(a,u)>-1:!!S&&Da(s,a,u)>-1}var EL=gt(function(s,a,u){var y=-1,S=typeof a=="function",R=hn(s)?se(s.length):[];return Ts(s,function(G){R[++y]=S?Sr(a,G,u):Jc(G,a,u)}),R}),AL=vh(function(s,a,u){Zi(s,u,a)});function Ih(s,a){var u=at(s)?tr:$y;return u(s,qe(a,3))}function xL(s,a,u,y){return s==null?[]:(at(a)||(a=a==null?[]:[a]),u=y?r:u,at(u)||(u=u==null?[]:[u]),Ly(s,a,u))}var SL=vh(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function IL(s,a,u){var y=at(s)?Ud:oy,S=arguments.length<3;return y(s,qe(a,4),u,S,Ts)}function DL(s,a,u){var y=at(s)?F$:oy,S=arguments.length<3;return y(s,qe(a,4),u,S,Sy)}function CL(s,a){var u=at(s)?Os:Iy;return u(s,Oh(qe(a,3)))}function OL(s){var a=at(s)?_y:_N;return a(s)}function ML(s,a,u){(u?Jr(s,a,u):a===r)?a=1:a=ft(a);var y=at(s)?ZT:EN;return y(s,a)}function PL(s){var a=at(s)?XT:xN;return a(s)}function $L(s){if(s==null)return 0;if(hn(s))return Ph(s)?Oa(s):s.length;var a=Fr(s);return a==le||a==Fe?s.size:np(s).length}function TL(s,a,u){var y=at(s)?Fd:SN;return u&&Jr(s,a,u)&&(a=r),y(s,qe(a,3))}var NL=gt(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Jr(s,a[0],a[1])?a=[]:u>2&&Jr(a[0],a[1],a[2])&&(a=[a[0]]),Ly(s,Nr(a,1),[])}),Dh=pT||function(){return It.Date.now()};function RL(s,a){if(typeof a!="function")throw new kn(c);return s=ft(s),function(){if(--s<1)return a.apply(this,arguments)}}function Mb(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,Xi(s,m,r,r,r,r,a)}function Pb(s,a){var u;if(typeof a!="function")throw new kn(c);return s=ft(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var Dp=gt(function(s,a,u){var y=W;if(u.length){var S=Ps(u,Ba(Dp));y|=U}return Xi(s,y,a,u,S)}),$b=gt(function(s,a,u){var y=W|Y;if(u.length){var S=Ps(u,Ba($b));y|=U}return Xi(a,y,s,u,S)});function Tb(s,a,u){a=u?r:a;var y=Xi(s,z,r,r,r,r,r,a);return y.placeholder=Tb.placeholder,y}function Nb(s,a,u){a=u?r:a;var y=Xi(s,M,r,r,r,r,r,a);return y.placeholder=Nb.placeholder,y}function Rb(s,a,u){var y,S,R,G,Q,X,ce=0,ue=!1,ge=!1,we=!0;if(typeof s!="function")throw new kn(c);a=Wn(a)||0,sr(u)&&(ue=!!u.leading,ge="maxWait"in u,R=ge?br(Wn(u.maxWait)||0,a):R,we="trailing"in u?!!u.trailing:we);function Le(pr){var oi=y,is=S;return y=S=r,ce=pr,G=s.apply(is,oi),G}function Ke(pr){return ce=pr,Q=rl(yt,a),ue?Le(pr):G}function pt(pr){var oi=pr-X,is=pr-ce,e3=a-oi;return ge?Ur(e3,R-is):e3}function We(pr){var oi=pr-X,is=pr-ce;return X===r||oi>=a||oi<0||ge&&is>=R}function yt(){var pr=Dh();if(We(pr))return Dt(pr);Q=rl(yt,pt(pr))}function Dt(pr){return Q=r,we&&y?Le(pr):(y=S=r,G)}function xn(){Q!==r&&Ky(Q),ce=0,y=X=S=Q=r}function Zr(){return Q===r?G:Dt(Dh())}function Sn(){var pr=Dh(),oi=We(pr);if(y=arguments,S=this,X=pr,oi){if(Q===r)return Ke(X);if(ge)return Ky(Q),Q=rl(yt,a),Le(X)}return Q===r&&(Q=rl(yt,a)),G}return Sn.cancel=xn,Sn.flush=Zr,Sn}var LL=gt(function(s,a){return xy(s,1,a)}),BL=gt(function(s,a,u){return xy(s,Wn(a)||0,u)});function UL(s){return Xi(s,te)}function Ch(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new kn(c);var u=function(){var y=arguments,S=a?a.apply(this,y):y[0],R=u.cache;if(R.has(S))return R.get(S);var G=s.apply(this,y);return u.cache=R.set(S,G)||R,G};return u.cache=new(Ch.Cache||Ji),u}Ch.Cache=Ji;function Oh(s){if(typeof s!="function")throw new kn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function FL(s){return Pb(2,s)}var jL=IN(function(s,a){a=a.length==1&&at(a[0])?tr(a[0],_n(qe())):tr(Nr(a,1),_n(qe()));var u=a.length;return gt(function(y){for(var S=-1,R=Ur(y.length,u);++S<R;)y[S]=a[S].call(this,y[S]);return Sr(s,this,y)})}),Cp=gt(function(s,a){var u=Ps(a,Ba(Cp));return Xi(s,U,r,a,u)}),Lb=gt(function(s,a){var u=Ps(a,Ba(Lb));return Xi(s,F,r,a,u)}),kL=es(function(s,a){return Xi(s,$,r,r,r,a)});function qL(s,a){if(typeof s!="function")throw new kn(c);return a=a===r?a:ft(a),gt(s,a)}function zL(s,a){if(typeof s!="function")throw new kn(c);return a=a==null?0:br(ft(a),0),gt(function(u){var y=u[a],S=Ls(u,0,a);return y&&Ms(S,y),Sr(s,this,S)})}function HL(s,a,u){var y=!0,S=!0;if(typeof s!="function")throw new kn(c);return sr(u)&&(y="leading"in u?!!u.leading:y,S="trailing"in u?!!u.trailing:S),Rb(s,a,{leading:y,maxWait:a,trailing:S})}function KL(s){return Mb(s,1)}function WL(s,a){return Cp(fp(a),s)}function VL(){if(!arguments.length)return[];var s=arguments[0];return at(s)?s:[s]}function GL(s){return zn(s,x)}function YL(s,a){return a=typeof a=="function"?a:r,zn(s,x,a)}function QL(s){return zn(s,_|x)}function JL(s,a){return a=typeof a=="function"?a:r,zn(s,_|x,a)}function ZL(s,a){return a==null||Ay(s,a,Ir(a))}function si(s,a){return s===a||s!==s&&a!==a}var XL=_h(ep),eB=_h(function(s,a){return s>=a}),$o=Oy(function(){return arguments}())?Oy:function(s){return cr(s)&&qt.call(s,"callee")&&!gy.call(s,"callee")},at=se.isArray,tB=Yr?_n(Yr):lN;function hn(s){return s!=null&&Mh(s.length)&&!rs(s)}function dr(s){return cr(s)&&hn(s)}function rB(s){return s===!0||s===!1||cr(s)&&Qr(s)==H}var Bs=mT||Fp,nB=ri?_n(ri):uN;function iB(s){return cr(s)&&s.nodeType===1&&!nl(s)}function sB(s){if(s==null)return!0;if(hn(s)&&(at(s)||typeof s=="string"||typeof s.splice=="function"||Bs(s)||Ua(s)||$o(s)))return!s.length;var a=Fr(s);if(a==le||a==Fe)return!s.size;if(tl(s))return!np(s).length;for(var u in s)if(qt.call(s,u))return!1;return!0}function oB(s,a){return Zc(s,a)}function aB(s,a,u){u=typeof u=="function"?u:r;var y=u?u(s,a):r;return y===r?Zc(s,a,r,u):!!y}function Op(s){if(!cr(s))return!1;var a=Qr(s);return a==j||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!nl(s)}function cB(s){return typeof s=="number"&&vy(s)}function rs(s){if(!sr(s))return!1;var a=Qr(s);return a==ie||a==he||a==q||a==ze}function Bb(s){return typeof s=="number"&&s==ft(s)}function Mh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=T}function sr(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function cr(s){return s!=null&&typeof s=="object"}var Ub=Fn?_n(Fn):fN;function lB(s,a){return s===a||rp(s,a,yp(a))}function uB(s,a,u){return u=typeof u=="function"?u:r,rp(s,a,yp(a),u)}function hB(s){return Fb(s)&&s!=+s}function fB(s){if(YN(s))throw new it(o);return My(s)}function dB(s){return s===null}function pB(s){return s==null}function Fb(s){return typeof s=="number"||cr(s)&&Qr(s)==Oe}function nl(s){if(!cr(s)||Qr(s)!=Ie)return!1;var a=nh(s);if(a===null)return!0;var u=qt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&Xu.call(u)==uT}var Mp=$i?_n($i):dN;function gB(s){return Bb(s)&&s>=-T&&s<=T}var jb=qc?_n(qc):pN;function Ph(s){return typeof s=="string"||!at(s)&&cr(s)&&Qr(s)==Ee}function An(s){return typeof s=="symbol"||cr(s)&&Qr(s)==Ae}var Ua=xo?_n(xo):gN;function mB(s){return s===r}function vB(s){return cr(s)&&Fr(s)==be}function wB(s){return cr(s)&&Qr(s)==xe}var yB=_h(ip),bB=_h(function(s,a){return s<=a});function kb(s){if(!s)return[];if(hn(s))return Ph(s)?ni(s):un(s);if(Hc&&s[Hc])return Z$(s[Hc]());var a=Fr(s),u=a==le?Kd:a==Fe?Qu:Fa;return u(s)}function ns(s){if(!s)return s===0?s:0;if(s=Wn(s),s===O||s===-O){var a=s<0?-1:1;return a*L}return s===s?s:0}function ft(s){var a=ns(s),u=a%1;return a===a?u?a-u:a:0}function qb(s){return s?Co(ft(s),0,v):0}function Wn(s){if(typeof s=="number")return s;if(An(s))return C;if(sr(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=sr(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=ay(s);var u=Rn.test(s);return u||Bn.test(s)?ot(s.slice(2),u?2:8):Nn.test(s)?C:+s}function zb(s){return Ni(s,fn(s))}function _B(s){return s?Co(ft(s),-T,T):s===0?s:0}function Bt(s){return s==null?"":En(s)}var EB=Ra(function(s,a){if(tl(a)||hn(a)){Ni(a,Ir(a),s);return}for(var u in a)qt.call(a,u)&&Yc(s,u,a[u])}),Hb=Ra(function(s,a){Ni(a,fn(a),s)}),$h=Ra(function(s,a,u,y){Ni(a,fn(a),s,y)}),AB=Ra(function(s,a,u,y){Ni(a,Ir(a),s,y)}),xB=es(Jd);function SB(s,a){var u=Na(s);return a==null?u:Ey(u,a)}var IB=gt(function(s,a){s=Yt(s);var u=-1,y=a.length,S=y>2?a[2]:r;for(S&&Jr(a[0],a[1],S)&&(y=1);++u<y;)for(var R=a[u],G=fn(R),Q=-1,X=G.length;++Q<X;){var ce=G[Q],ue=s[ce];(ue===r||si(ue,Pa[ce])&&!qt.call(s,ce))&&(s[ce]=R[ce])}return s}),DB=gt(function(s){return s.push(r,ab),Sr(Kb,r,s)});function CB(s,a){return ny(s,qe(a,3),Ti)}function OB(s,a){return ny(s,qe(a,3),Xd)}function MB(s,a){return s==null?s:Zd(s,qe(a,3),fn)}function PB(s,a){return s==null?s:Dy(s,qe(a,3),fn)}function $B(s,a){return s&&Ti(s,qe(a,3))}function TB(s,a){return s&&Xd(s,qe(a,3))}function NB(s){return s==null?[]:dh(s,Ir(s))}function RB(s){return s==null?[]:dh(s,fn(s))}function Pp(s,a,u){var y=s==null?r:Oo(s,a);return y===r?u:y}function LB(s,a){return s!=null&&ub(s,a,sN)}function $p(s,a){return s!=null&&ub(s,a,oN)}var BB=rb(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=eh.call(a)),s[a]=u},Np(dn)),UB=rb(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=eh.call(a)),qt.call(s,a)?s[a].push(u):s[a]=[u]},qe),FB=gt(Jc);function Ir(s){return hn(s)?by(s):np(s)}function fn(s){return hn(s)?by(s,!0):mN(s)}function jB(s,a){var u={};return a=qe(a,3),Ti(s,function(y,S,R){Zi(u,a(y,S,R),y)}),u}function kB(s,a){var u={};return a=qe(a,3),Ti(s,function(y,S,R){Zi(u,S,a(y,S,R))}),u}var qB=Ra(function(s,a,u){ph(s,a,u)}),Kb=Ra(function(s,a,u,y){ph(s,a,u,y)}),zB=es(function(s,a){var u={};if(s==null)return u;var y=!1;a=tr(a,function(R){return R=Rs(R,s),y||(y=R.length>1),R}),Ni(s,vp(s),u),y&&(u=zn(u,_|E|x,BN));for(var S=a.length;S--;)lp(u,a[S]);return u});function HB(s,a){return Wb(s,Oh(qe(a)))}var KB=es(function(s,a){return s==null?{}:wN(s,a)});function Wb(s,a){if(s==null)return{};var u=tr(vp(s),function(y){return[y]});return a=qe(a),By(s,u,function(y,S){return a(y,S[0])})}function WB(s,a,u){a=Rs(a,s);var y=-1,S=a.length;for(S||(S=1,s=r);++y<S;){var R=s==null?r:s[Ri(a[y])];R===r&&(y=S,R=u),s=rs(R)?R.call(s):R}return s}function VB(s,a,u){return s==null?s:Xc(s,a,u)}function GB(s,a,u,y){return y=typeof y=="function"?y:r,s==null?s:Xc(s,a,u,y)}var Vb=sb(Ir),Gb=sb(fn);function YB(s,a,u){var y=at(s),S=y||Bs(s)||Ua(s);if(a=qe(a,4),u==null){var R=s&&s.constructor;S?u=y?new R:[]:sr(s)?u=rs(R)?Na(nh(s)):{}:u={}}return(S?jn:Ti)(s,function(G,Q,X){return a(u,G,Q,X)}),u}function QB(s,a){return s==null?!0:lp(s,a)}function JB(s,a,u){return s==null?s:qy(s,a,fp(u))}function ZB(s,a,u,y){return y=typeof y=="function"?y:r,s==null?s:qy(s,a,fp(u),y)}function Fa(s){return s==null?[]:Hd(s,Ir(s))}function XB(s){return s==null?[]:Hd(s,fn(s))}function eU(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=Wn(u),u=u===u?u:0),a!==r&&(a=Wn(a),a=a===a?a:0),Co(Wn(s),a,u)}function tU(s,a,u){return a=ns(a),u===r?(u=a,a=0):u=ns(u),s=Wn(s),aN(s,a,u)}function rU(s,a,u){if(u&&typeof u!="boolean"&&Jr(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=ns(s),a===r?(a=s,s=0):a=ns(a)),s>a){var y=s;s=a,a=y}if(u||s%1||a%1){var S=wy();return Ur(s+S*(a-s+Vt("1e-"+((S+"").length-1))),a)}return op(s,a)}var nU=La(function(s,a,u){return a=a.toLowerCase(),s+(u?Yb(a):a)});function Yb(s){return Tp(Bt(s).toLowerCase())}function Qb(s){return s=Bt(s),s&&s.replace(xr,V$).replace(Rd,"")}function iU(s,a,u){s=Bt(s),a=En(a);var y=s.length;u=u===r?y:Co(ft(u),0,y);var S=u;return u-=a.length,u>=0&&s.slice(u,S)==a}function sU(s){return s=Bt(s),s&&He.test(s)?s.replace(Vr,G$):s}function oU(s){return s=Bt(s),s&&tt.test(s)?s.replace(Lt,"\\$&"):s}var aU=La(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),cU=La(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),lU=Xy("toLowerCase");function uU(s,a,u){s=Bt(s),a=ft(a);var y=a?Oa(s):0;if(!a||y>=a)return s;var S=(a-y)/2;return bh(ah(S),u)+s+bh(oh(S),u)}function hU(s,a,u){s=Bt(s),a=ft(a);var y=a?Oa(s):0;return a&&y<a?s+bh(a-y,u):s}function fU(s,a,u){s=Bt(s),a=ft(a);var y=a?Oa(s):0;return a&&y<a?bh(a-y,u)+s:s}function dU(s,a,u){return u||a==null?a=0:a&&(a=+a),bT(Bt(s).replace(Je,""),a||0)}function pU(s,a,u){return(u?Jr(s,a,u):a===r)?a=1:a=ft(a),ap(Bt(s),a)}function gU(){var s=arguments,a=Bt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var mU=La(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function vU(s,a,u){return u&&typeof u!="number"&&Jr(s,a,u)&&(a=u=r),u=u===r?v:u>>>0,u?(s=Bt(s),s&&(typeof a=="string"||a!=null&&!Mp(a))&&(a=En(a),!a&&Ca(s))?Ls(ni(s),0,u):s.split(a,u)):[]}var wU=La(function(s,a,u){return s+(u?" ":"")+Tp(a)});function yU(s,a,u){return s=Bt(s),u=u==null?0:Co(ft(u),0,s.length),a=En(a),s.slice(u,u+a.length)==a}function bU(s,a,u){var y=P.templateSettings;u&&Jr(s,a,u)&&(a=r),s=Bt(s),a=$h({},a,y,ob);var S=$h({},a.imports,y.imports,ob),R=Ir(S),G=Hd(S,R),Q,X,ce=0,ue=a.interpolate||Ci,ge="__p += '",we=Wd((a.escape||Ci).source+"|"+ue.source+"|"+(ue===Ve?kt:Ci).source+"|"+(a.evaluate||Ci).source+"|$","g"),Le="//# sourceURL="+(qt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ld+"]")+`
|
|
53
|
-
`;s.replace(we,function(We,yt,
|
|
52
|
+
`)}function VN(s){return at(s)||$o(s)||!!(my&&s&&s[my])}function ts(s,a){var u=typeof s;return a=a??T,!!a&&(u=="number"||u!="symbol"&&Un.test(s))&&s>-1&&s%1==0&&s<a}function Jr(s,a,u){if(!sr(u))return!1;var y=typeof a;return(y=="number"?hn(u)&&ts(a,u.length):y=="string"&&a in u)?si(u[a],s):!1}function bp(s,a){if(at(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||An(s)?!0:Xe.test(s)||!Pt.test(s)||a!=null&&s in Yt(a)}function GN(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function _p(s){var a=Eh(s),u=P[a];if(typeof u!="function"||!(a in At.prototype))return!1;if(s===u)return!0;var y=vp(u);return!!y&&s===y[0]}function YN(s){return!!fy&&fy in s}var QN=Zu?rs:Up;function tl(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||Ma;return s===u}function fb(s){return s===s&&!sr(s)}function db(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Yt(u))}}function JN(s){var a=Dh(s,function(y){return u.size===h&&u.clear(),y}),u=a.cache;return a}function ZN(s,a){var u=s[1],y=a[1],S=u|y,R=S<(W|Y|m),G=y==m&&u==z||y==m&&u==$&&s[7].length<=a[8]||y==(m|$)&&a[7].length<=a[8]&&u==z;if(!(R||G))return s;y&W&&(s[2]=a[2],S|=u&W?0:B);var Q=a[3];if(Q){var X=s[3];s[3]=X?Yy(X,Q,a[4]):Q,s[4]=X?Ps(s[3],g):a[4]}return Q=a[5],Q&&(X=s[5],s[5]=X?Qy(X,Q,a[6]):Q,s[6]=X?Ps(s[5],g):a[6]),Q=a[7],Q&&(s[7]=Q),y&m&&(s[8]=s[8]==null?a[8]:Ur(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=S,s}function XN(s){var a=[];if(s!=null)for(var u in Yt(s))a.push(u);return a}function eR(s){return eh.call(s)}function pb(s,a,u){return a=br(a===r?s.length-1:a,0),function(){for(var y=arguments,S=-1,R=br(y.length-a,0),G=se(R);++S<R;)G[S]=y[a+S];S=-1;for(var Q=se(a+1);++S<a;)Q[S]=y[S];return Q[a]=u(G),Ir(s,this,Q)}}function gb(s,a){return a.length<2?s:Oo(s,Hn(a,0,-1))}function tR(s,a){for(var u=s.length,y=Ur(a.length,u),S=un(s);y--;){var R=a[y];s[y]=ts(R,u)?S[R]:r}return s}function Ep(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var mb=wb(Fy),rl=mT||function(s,a){return St.setTimeout(s,a)},Ap=wb(xN);function vb(s,a,u){var y=a+"";return Ap(s,WN(y,rR(zN(y),u)))}function wb(s){var a=0,u=0;return function(){var y=bT(),S=d-(y-u);if(u=y,S>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function xh(s,a){var u=-1,y=s.length,S=y-1;for(a=a===r?y:a;++u<a;){var R=sp(u,S),G=s[R];s[R]=s[u],s[u]=G}return s.length=a,s}var yb=JN(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(et,function(u,y,S,R){a.push(S?R.replace(ti,"$1"):y||u)}),a});function Ri(s){if(typeof s=="string"||An(s))return s;var a=s+"";return a=="0"&&1/s==-O?"-0":a}function Po(s){if(s!=null){try{return Xu.call(s)}catch{}try{return s+""}catch{}}return""}function rR(s,a){return jn(pe,function(u){var y="_."+u[0];a&u[1]&&!Gu(s,y)&&s.push(y)}),s.sort()}function bb(s){if(s instanceof At)return s.clone();var a=new qn(s.__wrapped__,s.__chain__);return a.__actions__=un(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function nR(s,a,u){(u?Jr(s,a,u):a===r)?a=1:a=br(ft(a),0);var y=s==null?0:s.length;if(!y||a<1)return[];for(var S=0,R=0,G=se(oh(y/a));S<y;)G[R++]=Hn(s,S,S+=a);return G}function iR(s){for(var a=-1,u=s==null?0:s.length,y=0,S=[];++a<u;){var R=s[a];R&&(S[y++]=R)}return S}function sR(){var s=arguments.length;if(!s)return[];for(var a=se(s-1),u=arguments[0],y=s;y--;)a[y-1]=arguments[y];return Ms(at(u)?un(u):[u],Nr(a,1))}var oR=gt(function(s,a){return dr(s)?Qc(s,Nr(a,1,dr,!0)):[]}),aR=gt(function(s,a){var u=Kn(a);return dr(u)&&(u=r),dr(s)?Qc(s,Nr(a,1,dr,!0),qe(u,2)):[]}),cR=gt(function(s,a){var u=Kn(a);return dr(u)&&(u=r),dr(s)?Qc(s,Nr(a,1,dr,!0),r,u):[]});function lR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:ft(a),Hn(s,a<0?0:a,y)):[]}function uR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:ft(a),a=y-a,Hn(s,0,a<0?0:a)):[]}function hR(s,a){return s&&s.length?mh(s,qe(a,3),!0,!0):[]}function fR(s,a){return s&&s.length?mh(s,qe(a,3),!0):[]}function dR(s,a,u,y){var S=s==null?0:s.length;return S?(u&&typeof u!="number"&&Jr(s,a,u)&&(u=0,y=S),sN(s,a,u,y)):[]}function _b(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=u==null?0:ft(u);return S<0&&(S=br(y+S,0)),Yu(s,qe(a,3),S)}function Eb(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=y-1;return u!==r&&(S=ft(u),S=u<0?br(y+S,0):Ur(S,y-1)),Yu(s,qe(a,3),S,!0)}function Ab(s){var a=s==null?0:s.length;return a?Nr(s,1):[]}function pR(s){var a=s==null?0:s.length;return a?Nr(s,O):[]}function gR(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:ft(a),Nr(s,a)):[]}function mR(s){for(var a=-1,u=s==null?0:s.length,y={};++a<u;){var S=s[a];y[S[0]]=S[1]}return y}function xb(s){return s&&s.length?s[0]:r}function vR(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=u==null?0:ft(u);return S<0&&(S=br(y+S,0)),Sa(s,a,S)}function wR(s){var a=s==null?0:s.length;return a?Hn(s,0,-1):[]}var yR=gt(function(s){var a=tr(s,up);return a.length&&a[0]===s[0]?ep(a):[]}),bR=gt(function(s){var a=Kn(s),u=tr(s,up);return a===Kn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?ep(u,qe(a,2)):[]}),_R=gt(function(s){var a=Kn(s),u=tr(s,up);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?ep(u,r,a):[]});function ER(s,a){return s==null?"":wT.call(s,a)}function Kn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function AR(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=y;return u!==r&&(S=ft(u),S=S<0?br(y+S,0):Ur(S,y-1)),a===a?rT(s,a,S):Yu(s,iy,S,!0)}function xR(s,a){return s&&s.length?Ry(s,ft(a)):r}var IR=gt(Ib);function Ib(s,a){return s&&s.length&&a&&a.length?ip(s,a):s}function SR(s,a,u){return s&&s.length&&a&&a.length?ip(s,a,qe(u,2)):s}function CR(s,a,u){return s&&s.length&&a&&a.length?ip(s,a,r,u):s}var DR=es(function(s,a){var u=s==null?0:s.length,y=Qd(s,a);return Uy(s,tr(a,function(S){return ts(S,u)?+S:S}).sort(Gy)),y});function OR(s,a){var u=[];if(!(s&&s.length))return u;var y=-1,S=[],R=s.length;for(a=qe(a,3);++y<R;){var G=s[y];a(G,y,s)&&(u.push(G),S.push(y))}return Uy(s,S),u}function xp(s){return s==null?s:ET.call(s)}function MR(s,a,u){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Jr(s,a,u)?(a=0,u=y):(a=a==null?0:ft(a),u=u===r?y:ft(u)),Hn(s,a,u)):[]}function PR(s,a){return gh(s,a)}function $R(s,a,u){return ap(s,a,qe(u,2))}function TR(s,a){var u=s==null?0:s.length;if(u){var y=gh(s,a);if(y<u&&si(s[y],a))return y}return-1}function NR(s,a){return gh(s,a,!0)}function RR(s,a,u){return ap(s,a,qe(u,2),!0)}function LR(s,a){var u=s==null?0:s.length;if(u){var y=gh(s,a,!0)-1;if(si(s[y],a))return y}return-1}function BR(s){return s&&s.length?jy(s):[]}function UR(s,a){return s&&s.length?jy(s,qe(a,2)):[]}function FR(s){var a=s==null?0:s.length;return a?Hn(s,1,a):[]}function jR(s,a,u){return s&&s.length?(a=u||a===r?1:ft(a),Hn(s,0,a<0?0:a)):[]}function kR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:ft(a),a=y-a,Hn(s,a<0?0:a,y)):[]}function qR(s,a){return s&&s.length?mh(s,qe(a,3),!1,!0):[]}function zR(s,a){return s&&s.length?mh(s,qe(a,3)):[]}var HR=gt(function(s){return Ns(Nr(s,1,dr,!0))}),KR=gt(function(s){var a=Kn(s);return dr(a)&&(a=r),Ns(Nr(s,1,dr,!0),qe(a,2))}),WR=gt(function(s){var a=Kn(s);return a=typeof a=="function"?a:r,Ns(Nr(s,1,dr,!0),r,a)});function VR(s){return s&&s.length?Ns(s):[]}function GR(s,a){return s&&s.length?Ns(s,qe(a,2)):[]}function YR(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ns(s,r,a):[]}function Ip(s){if(!(s&&s.length))return[];var a=0;return s=Os(s,function(u){if(dr(u))return a=br(u.length,a),!0}),qd(a,function(u){return tr(s,Fd(u))})}function Sb(s,a){if(!(s&&s.length))return[];var u=Ip(s);return a==null?u:tr(u,function(y){return Ir(a,r,y)})}var QR=gt(function(s,a){return dr(s)?Qc(s,a):[]}),JR=gt(function(s){return lp(Os(s,dr))}),ZR=gt(function(s){var a=Kn(s);return dr(a)&&(a=r),lp(Os(s,dr),qe(a,2))}),XR=gt(function(s){var a=Kn(s);return a=typeof a=="function"?a:r,lp(Os(s,dr),r,a)}),eL=gt(Ip);function tL(s,a){return Hy(s||[],a||[],Yc)}function rL(s,a){return Hy(s||[],a||[],Xc)}var nL=gt(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,Sb(s,u)});function Cb(s){var a=P(s);return a.__chain__=!0,a}function iL(s,a){return a(s),s}function Ih(s,a){return a(s)}var sL=es(function(s){var a=s.length,u=a?s[0]:0,y=this.__wrapped__,S=function(R){return Qd(R,s)};return a>1||this.__actions__.length||!(y instanceof At)||!ts(u)?this.thru(S):(y=y.slice(u,+u+(a?1:0)),y.__actions__.push({func:Ih,args:[S],thisArg:r}),new qn(y,this.__chain__).thru(function(R){return a&&!R.length&&R.push(r),R}))});function oL(){return Cb(this)}function aL(){return new qn(this.value(),this.__chain__)}function cL(){this.__values__===r&&(this.__values__=kb(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function lL(){return this}function uL(s){for(var a,u=this;u instanceof uh;){var y=bb(u);y.__index__=0,y.__values__=r,a?S.__wrapped__=y:a=y;var S=y;u=u.__wrapped__}return S.__wrapped__=s,a}function hL(){var s=this.__wrapped__;if(s instanceof At){var a=s;return this.__actions__.length&&(a=new At(this)),a=a.reverse(),a.__actions__.push({func:Ih,args:[xp],thisArg:r}),new qn(a,this.__chain__)}return this.thru(xp)}function fL(){return zy(this.__wrapped__,this.__actions__)}var dL=vh(function(s,a,u){qt.call(s,u)?++s[u]:Zi(s,u,1)});function pL(s,a,u){var y=at(s)?ry:iN;return u&&Jr(s,a,u)&&(a=r),y(s,qe(a,3))}function gL(s,a){var u=at(s)?Os:Sy;return u(s,qe(a,3))}var mL=eb(_b),vL=eb(Eb);function wL(s,a){return Nr(Sh(s,a),1)}function yL(s,a){return Nr(Sh(s,a),O)}function bL(s,a,u){return u=u===r?1:ft(u),Nr(Sh(s,a),u)}function Db(s,a){var u=at(s)?jn:Ts;return u(s,qe(a,3))}function Ob(s,a){var u=at(s)?F$:Iy;return u(s,qe(a,3))}var _L=vh(function(s,a,u){qt.call(s,u)?s[u].push(a):Zi(s,u,[a])});function EL(s,a,u,y){s=hn(s)?s:Ua(s),u=u&&!y?ft(u):0;var S=s.length;return u<0&&(u=br(S+u,0)),Ph(s)?u<=S&&s.indexOf(a,u)>-1:!!S&&Sa(s,a,u)>-1}var AL=gt(function(s,a,u){var y=-1,S=typeof a=="function",R=hn(s)?se(s.length):[];return Ts(s,function(G){R[++y]=S?Ir(a,G,u):Jc(G,a,u)}),R}),xL=vh(function(s,a,u){Zi(s,u,a)});function Sh(s,a){var u=at(s)?tr:$y;return u(s,qe(a,3))}function IL(s,a,u,y){return s==null?[]:(at(a)||(a=a==null?[]:[a]),u=y?r:u,at(u)||(u=u==null?[]:[u]),Ly(s,a,u))}var SL=vh(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function CL(s,a,u){var y=at(s)?Bd:oy,S=arguments.length<3;return y(s,qe(a,4),u,S,Ts)}function DL(s,a,u){var y=at(s)?j$:oy,S=arguments.length<3;return y(s,qe(a,4),u,S,Iy)}function OL(s,a){var u=at(s)?Os:Sy;return u(s,Oh(qe(a,3)))}function ML(s){var a=at(s)?_y:EN;return a(s)}function PL(s,a,u){(u?Jr(s,a,u):a===r)?a=1:a=ft(a);var y=at(s)?XT:AN;return y(s,a)}function $L(s){var a=at(s)?eN:IN;return a(s)}function TL(s){if(s==null)return 0;if(hn(s))return Ph(s)?Da(s):s.length;var a=Fr(s);return a==le||a==Fe?s.size:rp(s).length}function NL(s,a,u){var y=at(s)?Ud:SN;return u&&Jr(s,a,u)&&(a=r),y(s,qe(a,3))}var RL=gt(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Jr(s,a[0],a[1])?a=[]:u>2&&Jr(a[0],a[1],a[2])&&(a=[a[0]]),Ly(s,Nr(a,1),[])}),Ch=gT||function(){return St.Date.now()};function LL(s,a){if(typeof a!="function")throw new kn(c);return s=ft(s),function(){if(--s<1)return a.apply(this,arguments)}}function Mb(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,Xi(s,m,r,r,r,r,a)}function Pb(s,a){var u;if(typeof a!="function")throw new kn(c);return s=ft(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var Sp=gt(function(s,a,u){var y=W;if(u.length){var S=Ps(u,La(Sp));y|=U}return Xi(s,y,a,u,S)}),$b=gt(function(s,a,u){var y=W|Y;if(u.length){var S=Ps(u,La($b));y|=U}return Xi(a,y,s,u,S)});function Tb(s,a,u){a=u?r:a;var y=Xi(s,z,r,r,r,r,r,a);return y.placeholder=Tb.placeholder,y}function Nb(s,a,u){a=u?r:a;var y=Xi(s,M,r,r,r,r,r,a);return y.placeholder=Nb.placeholder,y}function Rb(s,a,u){var y,S,R,G,Q,X,ce=0,ue=!1,ge=!1,we=!0;if(typeof s!="function")throw new kn(c);a=Wn(a)||0,sr(u)&&(ue=!!u.leading,ge="maxWait"in u,R=ge?br(Wn(u.maxWait)||0,a):R,we="trailing"in u?!!u.trailing:we);function Le(pr){var oi=y,is=S;return y=S=r,ce=pr,G=s.apply(is,oi),G}function Ke(pr){return ce=pr,Q=rl(yt,a),ue?Le(pr):G}function pt(pr){var oi=pr-X,is=pr-ce,e3=a-oi;return ge?Ur(e3,R-is):e3}function We(pr){var oi=pr-X,is=pr-ce;return X===r||oi>=a||oi<0||ge&&is>=R}function yt(){var pr=Ch();if(We(pr))return Ct(pr);Q=rl(yt,pt(pr))}function Ct(pr){return Q=r,we&&y?Le(pr):(y=S=r,G)}function xn(){Q!==r&&Ky(Q),ce=0,y=X=S=Q=r}function Zr(){return Q===r?G:Ct(Ch())}function In(){var pr=Ch(),oi=We(pr);if(y=arguments,S=this,X=pr,oi){if(Q===r)return Ke(X);if(ge)return Ky(Q),Q=rl(yt,a),Le(X)}return Q===r&&(Q=rl(yt,a)),G}return In.cancel=xn,In.flush=Zr,In}var BL=gt(function(s,a){return xy(s,1,a)}),UL=gt(function(s,a,u){return xy(s,Wn(a)||0,u)});function FL(s){return Xi(s,te)}function Dh(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new kn(c);var u=function(){var y=arguments,S=a?a.apply(this,y):y[0],R=u.cache;if(R.has(S))return R.get(S);var G=s.apply(this,y);return u.cache=R.set(S,G)||R,G};return u.cache=new(Dh.Cache||Ji),u}Dh.Cache=Ji;function Oh(s){if(typeof s!="function")throw new kn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function jL(s){return Pb(2,s)}var kL=CN(function(s,a){a=a.length==1&&at(a[0])?tr(a[0],_n(qe())):tr(Nr(a,1),_n(qe()));var u=a.length;return gt(function(y){for(var S=-1,R=Ur(y.length,u);++S<R;)y[S]=a[S].call(this,y[S]);return Ir(s,this,y)})}),Cp=gt(function(s,a){var u=Ps(a,La(Cp));return Xi(s,U,r,a,u)}),Lb=gt(function(s,a){var u=Ps(a,La(Lb));return Xi(s,j,r,a,u)}),qL=es(function(s,a){return Xi(s,$,r,r,r,a)});function zL(s,a){if(typeof s!="function")throw new kn(c);return a=a===r?a:ft(a),gt(s,a)}function HL(s,a){if(typeof s!="function")throw new kn(c);return a=a==null?0:br(ft(a),0),gt(function(u){var y=u[a],S=Ls(u,0,a);return y&&Ms(S,y),Ir(s,this,S)})}function KL(s,a,u){var y=!0,S=!0;if(typeof s!="function")throw new kn(c);return sr(u)&&(y="leading"in u?!!u.leading:y,S="trailing"in u?!!u.trailing:S),Rb(s,a,{leading:y,maxWait:a,trailing:S})}function WL(s){return Mb(s,1)}function VL(s,a){return Cp(hp(a),s)}function GL(){if(!arguments.length)return[];var s=arguments[0];return at(s)?s:[s]}function YL(s){return zn(s,x)}function QL(s,a){return a=typeof a=="function"?a:r,zn(s,x,a)}function JL(s){return zn(s,_|x)}function ZL(s,a){return a=typeof a=="function"?a:r,zn(s,_|x,a)}function XL(s,a){return a==null||Ay(s,a,Sr(a))}function si(s,a){return s===a||s!==s&&a!==a}var eB=_h(Xd),tB=_h(function(s,a){return s>=a}),$o=Oy(function(){return arguments}())?Oy:function(s){return cr(s)&&qt.call(s,"callee")&&!gy.call(s,"callee")},at=se.isArray,rB=Yr?_n(Yr):uN;function hn(s){return s!=null&&Mh(s.length)&&!rs(s)}function dr(s){return cr(s)&&hn(s)}function nB(s){return s===!0||s===!1||cr(s)&&Qr(s)==H}var Bs=vT||Up,iB=ri?_n(ri):hN;function sB(s){return cr(s)&&s.nodeType===1&&!nl(s)}function oB(s){if(s==null)return!0;if(hn(s)&&(at(s)||typeof s=="string"||typeof s.splice=="function"||Bs(s)||Ba(s)||$o(s)))return!s.length;var a=Fr(s);if(a==le||a==Fe)return!s.size;if(tl(s))return!rp(s).length;for(var u in s)if(qt.call(s,u))return!1;return!0}function aB(s,a){return Zc(s,a)}function cB(s,a,u){u=typeof u=="function"?u:r;var y=u?u(s,a):r;return y===r?Zc(s,a,r,u):!!y}function Dp(s){if(!cr(s))return!1;var a=Qr(s);return a==k||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!nl(s)}function lB(s){return typeof s=="number"&&vy(s)}function rs(s){if(!sr(s))return!1;var a=Qr(s);return a==ie||a==he||a==q||a==ze}function Bb(s){return typeof s=="number"&&s==ft(s)}function Mh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=T}function sr(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function cr(s){return s!=null&&typeof s=="object"}var Ub=Fn?_n(Fn):dN;function uB(s,a){return s===a||tp(s,a,wp(a))}function hB(s,a,u){return u=typeof u=="function"?u:r,tp(s,a,wp(a),u)}function fB(s){return Fb(s)&&s!=+s}function dB(s){if(QN(s))throw new it(o);return My(s)}function pB(s){return s===null}function gB(s){return s==null}function Fb(s){return typeof s=="number"||cr(s)&&Qr(s)==Oe}function nl(s){if(!cr(s)||Qr(s)!=Se)return!1;var a=nh(s);if(a===null)return!0;var u=qt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&Xu.call(u)==hT}var Op=$i?_n($i):pN;function mB(s){return Bb(s)&&s>=-T&&s<=T}var jb=qc?_n(qc):gN;function Ph(s){return typeof s=="string"||!at(s)&&cr(s)&&Qr(s)==Ee}function An(s){return typeof s=="symbol"||cr(s)&&Qr(s)==Ae}var Ba=xo?_n(xo):mN;function vB(s){return s===r}function wB(s){return cr(s)&&Fr(s)==be}function yB(s){return cr(s)&&Qr(s)==xe}var bB=_h(np),_B=_h(function(s,a){return s<=a});function kb(s){if(!s)return[];if(hn(s))return Ph(s)?ni(s):un(s);if(Hc&&s[Hc])return X$(s[Hc]());var a=Fr(s),u=a==le?Hd:a==Fe?Qu:Ua;return u(s)}function ns(s){if(!s)return s===0?s:0;if(s=Wn(s),s===O||s===-O){var a=s<0?-1:1;return a*L}return s===s?s:0}function ft(s){var a=ns(s),u=a%1;return a===a?u?a-u:a:0}function qb(s){return s?Do(ft(s),0,v):0}function Wn(s){if(typeof s=="number")return s;if(An(s))return D;if(sr(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=sr(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=ay(s);var u=Rn.test(s);return u||Bn.test(s)?ot(s.slice(2),u?2:8):Nn.test(s)?D:+s}function zb(s){return Ni(s,fn(s))}function EB(s){return s?Do(ft(s),-T,T):s===0?s:0}function Bt(s){return s==null?"":En(s)}var AB=Na(function(s,a){if(tl(a)||hn(a)){Ni(a,Sr(a),s);return}for(var u in a)qt.call(a,u)&&Yc(s,u,a[u])}),Hb=Na(function(s,a){Ni(a,fn(a),s)}),$h=Na(function(s,a,u,y){Ni(a,fn(a),s,y)}),xB=Na(function(s,a,u,y){Ni(a,Sr(a),s,y)}),IB=es(Qd);function SB(s,a){var u=Ta(s);return a==null?u:Ey(u,a)}var CB=gt(function(s,a){s=Yt(s);var u=-1,y=a.length,S=y>2?a[2]:r;for(S&&Jr(a[0],a[1],S)&&(y=1);++u<y;)for(var R=a[u],G=fn(R),Q=-1,X=G.length;++Q<X;){var ce=G[Q],ue=s[ce];(ue===r||si(ue,Ma[ce])&&!qt.call(s,ce))&&(s[ce]=R[ce])}return s}),DB=gt(function(s){return s.push(r,ab),Ir(Kb,r,s)});function OB(s,a){return ny(s,qe(a,3),Ti)}function MB(s,a){return ny(s,qe(a,3),Zd)}function PB(s,a){return s==null?s:Jd(s,qe(a,3),fn)}function $B(s,a){return s==null?s:Cy(s,qe(a,3),fn)}function TB(s,a){return s&&Ti(s,qe(a,3))}function NB(s,a){return s&&Zd(s,qe(a,3))}function RB(s){return s==null?[]:dh(s,Sr(s))}function LB(s){return s==null?[]:dh(s,fn(s))}function Mp(s,a,u){var y=s==null?r:Oo(s,a);return y===r?u:y}function BB(s,a){return s!=null&&ub(s,a,oN)}function Pp(s,a){return s!=null&&ub(s,a,aN)}var UB=rb(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=eh.call(a)),s[a]=u},Tp(dn)),FB=rb(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=eh.call(a)),qt.call(s,a)?s[a].push(u):s[a]=[u]},qe),jB=gt(Jc);function Sr(s){return hn(s)?by(s):rp(s)}function fn(s){return hn(s)?by(s,!0):vN(s)}function kB(s,a){var u={};return a=qe(a,3),Ti(s,function(y,S,R){Zi(u,a(y,S,R),y)}),u}function qB(s,a){var u={};return a=qe(a,3),Ti(s,function(y,S,R){Zi(u,S,a(y,S,R))}),u}var zB=Na(function(s,a,u){ph(s,a,u)}),Kb=Na(function(s,a,u,y){ph(s,a,u,y)}),HB=es(function(s,a){var u={};if(s==null)return u;var y=!1;a=tr(a,function(R){return R=Rs(R,s),y||(y=R.length>1),R}),Ni(s,mp(s),u),y&&(u=zn(u,_|E|x,UN));for(var S=a.length;S--;)cp(u,a[S]);return u});function KB(s,a){return Wb(s,Oh(qe(a)))}var WB=es(function(s,a){return s==null?{}:yN(s,a)});function Wb(s,a){if(s==null)return{};var u=tr(mp(s),function(y){return[y]});return a=qe(a),By(s,u,function(y,S){return a(y,S[0])})}function VB(s,a,u){a=Rs(a,s);var y=-1,S=a.length;for(S||(S=1,s=r);++y<S;){var R=s==null?r:s[Ri(a[y])];R===r&&(y=S,R=u),s=rs(R)?R.call(s):R}return s}function GB(s,a,u){return s==null?s:Xc(s,a,u)}function YB(s,a,u,y){return y=typeof y=="function"?y:r,s==null?s:Xc(s,a,u,y)}var Vb=sb(Sr),Gb=sb(fn);function QB(s,a,u){var y=at(s),S=y||Bs(s)||Ba(s);if(a=qe(a,4),u==null){var R=s&&s.constructor;S?u=y?new R:[]:sr(s)?u=rs(R)?Ta(nh(s)):{}:u={}}return(S?jn:Ti)(s,function(G,Q,X){return a(u,G,Q,X)}),u}function JB(s,a){return s==null?!0:cp(s,a)}function ZB(s,a,u){return s==null?s:qy(s,a,hp(u))}function XB(s,a,u,y){return y=typeof y=="function"?y:r,s==null?s:qy(s,a,hp(u),y)}function Ua(s){return s==null?[]:zd(s,Sr(s))}function eU(s){return s==null?[]:zd(s,fn(s))}function tU(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=Wn(u),u=u===u?u:0),a!==r&&(a=Wn(a),a=a===a?a:0),Do(Wn(s),a,u)}function rU(s,a,u){return a=ns(a),u===r?(u=a,a=0):u=ns(u),s=Wn(s),cN(s,a,u)}function nU(s,a,u){if(u&&typeof u!="boolean"&&Jr(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=ns(s),a===r?(a=s,s=0):a=ns(a)),s>a){var y=s;s=a,a=y}if(u||s%1||a%1){var S=wy();return Ur(s+S*(a-s+Vt("1e-"+((S+"").length-1))),a)}return sp(s,a)}var iU=Ra(function(s,a,u){return a=a.toLowerCase(),s+(u?Yb(a):a)});function Yb(s){return $p(Bt(s).toLowerCase())}function Qb(s){return s=Bt(s),s&&s.replace(xr,G$).replace(Nd,"")}function sU(s,a,u){s=Bt(s),a=En(a);var y=s.length;u=u===r?y:Do(ft(u),0,y);var S=u;return u-=a.length,u>=0&&s.slice(u,S)==a}function oU(s){return s=Bt(s),s&&He.test(s)?s.replace(Vr,Y$):s}function aU(s){return s=Bt(s),s&&tt.test(s)?s.replace(Lt,"\\$&"):s}var cU=Ra(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),lU=Ra(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),uU=Xy("toLowerCase");function hU(s,a,u){s=Bt(s),a=ft(a);var y=a?Da(s):0;if(!a||y>=a)return s;var S=(a-y)/2;return bh(ah(S),u)+s+bh(oh(S),u)}function fU(s,a,u){s=Bt(s),a=ft(a);var y=a?Da(s):0;return a&&y<a?s+bh(a-y,u):s}function dU(s,a,u){s=Bt(s),a=ft(a);var y=a?Da(s):0;return a&&y<a?bh(a-y,u)+s:s}function pU(s,a,u){return u||a==null?a=0:a&&(a=+a),_T(Bt(s).replace(Je,""),a||0)}function gU(s,a,u){return(u?Jr(s,a,u):a===r)?a=1:a=ft(a),op(Bt(s),a)}function mU(){var s=arguments,a=Bt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var vU=Ra(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function wU(s,a,u){return u&&typeof u!="number"&&Jr(s,a,u)&&(a=u=r),u=u===r?v:u>>>0,u?(s=Bt(s),s&&(typeof a=="string"||a!=null&&!Op(a))&&(a=En(a),!a&&Ca(s))?Ls(ni(s),0,u):s.split(a,u)):[]}var yU=Ra(function(s,a,u){return s+(u?" ":"")+$p(a)});function bU(s,a,u){return s=Bt(s),u=u==null?0:Do(ft(u),0,s.length),a=En(a),s.slice(u,u+a.length)==a}function _U(s,a,u){var y=P.templateSettings;u&&Jr(s,a,u)&&(a=r),s=Bt(s),a=$h({},a,y,ob);var S=$h({},a.imports,y.imports,ob),R=Sr(S),G=zd(S,R),Q,X,ce=0,ue=a.interpolate||Di,ge="__p += '",we=Kd((a.escape||Di).source+"|"+ue.source+"|"+(ue===Ve?kt:Di).source+"|"+(a.evaluate||Di).source+"|$","g"),Le="//# sourceURL="+(qt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rd+"]")+`
|
|
53
|
+
`;s.replace(we,function(We,yt,Ct,xn,Zr,In){return Ct||(Ct=xn),ge+=s.slice(ce,In).replace(fo,Q$),yt&&(Q=!0,ge+=`' +
|
|
54
54
|
__e(`+yt+`) +
|
|
55
55
|
'`),Zr&&(X=!0,ge+=`';
|
|
56
56
|
`+Zr+`;
|
|
57
|
-
__p += '`),
|
|
58
|
-
((__t = (`+
|
|
59
|
-
'`),ce=
|
|
57
|
+
__p += '`),Ct&&(ge+=`' +
|
|
58
|
+
((__t = (`+Ct+`)) == null ? '' : __t) +
|
|
59
|
+
'`),ce=In+We.length,We}),ge+=`';
|
|
60
60
|
`;var Ke=qt.call(a,"variable")&&a.variable;if(!Ke)ge=`with (obj) {
|
|
61
61
|
`+ge+`
|
|
62
62
|
}
|
|
63
|
-
`;else if(jt.test(Ke))throw new it(l);ge=(X?ge.replace(Et,""):ge).replace(ir,"$1").replace(
|
|
63
|
+
`;else if(jt.test(Ke))throw new it(l);ge=(X?ge.replace(Et,""):ge).replace(ir,"$1").replace(It,"$1;"),ge="function("+(Ke||"obj")+`) {
|
|
64
64
|
`+(Ke?"":`obj || (obj = {});
|
|
65
65
|
`)+"var __t, __p = ''"+(Q?", __e = _.escape":"")+(X?`, __j = Array.prototype.join;
|
|
66
66
|
function print() { __p += __j.call(arguments, '') }
|
|
67
67
|
`:`;
|
|
68
68
|
`)+ge+`return __p
|
|
69
|
-
}`;var pt=Zb(function(){return Tt(R,Le+"return "+ge).apply(r,G)});if(pt.source=ge,Op(pt))throw pt;return pt}function _U(s){return Bt(s).toLowerCase()}function EU(s){return Bt(s).toUpperCase()}function AU(s,a,u){if(s=Bt(s),s&&(u||a===r))return ay(s);if(!s||!(a=En(a)))return s;var y=ni(s),S=ni(a),R=cy(y,S),G=ly(y,S)+1;return Ls(y,R,G).join("")}function xU(s,a,u){if(s=Bt(s),s&&(u||a===r))return s.slice(0,hy(s)+1);if(!s||!(a=En(a)))return s;var y=ni(s),S=ly(y,ni(a))+1;return Ls(y,0,S).join("")}function SU(s,a,u){if(s=Bt(s),s&&(u||a===r))return s.replace(Je,"");if(!s||!(a=En(a)))return s;var y=ni(s),S=cy(y,ni(a));return Ls(y,S).join("")}function IU(s,a){var u=ee,y=ne;if(sr(a)){var S="separator"in a?a.separator:S;u="length"in a?ft(a.length):u,y="omission"in a?En(a.omission):y}s=Bt(s);var R=s.length;if(Ca(s)){var G=ni(s);R=G.length}if(u>=R)return s;var Q=u-Oa(y);if(Q<1)return y;var X=G?Ls(G,0,Q).join(""):s.slice(0,Q);if(S===r)return X+y;if(G&&(Q+=X.length-Q),Mp(S)){if(s.slice(Q).search(S)){var ce,ue=X;for(S.global||(S=Wd(S.source,Bt(vt.exec(S))+"g")),S.lastIndex=0;ce=S.exec(ue);)var ge=ce.index;X=X.slice(0,ge===r?Q:ge)}}else if(s.indexOf(En(S),Q)!=Q){var we=X.lastIndexOf(S);we>-1&&(X=X.slice(0,we))}return X+y}function DU(s){return s=Bt(s),s&&Ye.test(s)?s.replace(Ot,rT):s}var CU=La(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Tp=Xy("toUpperCase");function Jb(s,a,u){return s=Bt(s),a=u?r:a,a===r?J$(s)?sT(s):q$(s):s.match(a)||[]}var Zb=gt(function(s,a){try{return Sr(s,r,a)}catch(u){return Op(u)?u:new it(u)}}),OU=es(function(s,a){return jn(a,function(u){u=Ri(u),Zi(s,u,Dp(s[u],s))}),s});function MU(s){var a=s==null?0:s.length,u=qe();return s=a?tr(s,function(y){if(typeof y[1]!="function")throw new kn(c);return[u(y[0]),y[1]]}):[],gt(function(y){for(var S=-1;++S<a;){var R=s[S];if(Sr(R[0],this,y))return Sr(R[1],this,y)}})}function PU(s){return rN(zn(s,_))}function Np(s){return function(){return s}}function $U(s,a){return s==null||s!==s?a:s}var TU=tb(),NU=tb(!0);function dn(s){return s}function Rp(s){return Py(typeof s=="function"?s:zn(s,_))}function RU(s){return Ty(zn(s,_))}function LU(s,a){return Ny(s,zn(a,_))}var BU=gt(function(s,a){return function(u){return Jc(u,s,a)}}),UU=gt(function(s,a){return function(u){return Jc(s,u,a)}});function Lp(s,a,u){var y=Ir(a),S=dh(a,y);u==null&&!(sr(a)&&(S.length||!y.length))&&(u=a,a=s,s=this,S=dh(a,Ir(a)));var R=!(sr(u)&&"chain"in u)||!!u.chain,G=rs(s);return jn(S,function(Q){var X=a[Q];s[Q]=X,G&&(s.prototype[Q]=function(){var ce=this.__chain__;if(R||ce){var ue=s(this.__wrapped__),ge=ue.__actions__=un(this.__actions__);return ge.push({func:X,args:arguments,thisArg:s}),ue.__chain__=ce,ue}return X.apply(s,Ms([this.value()],arguments))})}),s}function FU(){return It._===this&&(It._=hT),this}function Bp(){}function jU(s){return s=ft(s),gt(function(a){return Ry(a,s)})}var kU=pp(tr),qU=pp(ry),zU=pp(Fd);function Xb(s){return _p(s)?jd(Ri(s)):yN(s)}function HU(s){return function(a){return s==null?r:Oo(s,a)}}var KU=nb(),WU=nb(!0);function Up(){return[]}function Fp(){return!1}function VU(){return{}}function GU(){return""}function YU(){return!0}function QU(s,a){if(s=ft(s),s<1||s>T)return[];var u=v,y=Ur(s,v);a=qe(a),s-=v;for(var S=zd(y,a);++u<s;)a(u);return S}function JU(s){return at(s)?tr(s,Ri):An(s)?[s]:un(yb(Bt(s)))}function ZU(s){var a=++lT;return Bt(s)+a}var XU=yh(function(s,a){return s+a},0),eF=gp("ceil"),tF=yh(function(s,a){return s/a},1),rF=gp("floor");function nF(s){return s&&s.length?fh(s,dn,ep):r}function iF(s,a){return s&&s.length?fh(s,qe(a,2),ep):r}function sF(s){return sy(s,dn)}function oF(s,a){return sy(s,qe(a,2))}function aF(s){return s&&s.length?fh(s,dn,ip):r}function cF(s,a){return s&&s.length?fh(s,qe(a,2),ip):r}var lF=yh(function(s,a){return s*a},1),uF=gp("round"),hF=yh(function(s,a){return s-a},0);function fF(s){return s&&s.length?qd(s,dn):0}function dF(s,a){return s&&s.length?qd(s,qe(a,2)):0}return P.after=RL,P.ary=Mb,P.assign=EB,P.assignIn=Hb,P.assignInWith=$h,P.assignWith=AB,P.at=xB,P.before=Pb,P.bind=Dp,P.bindAll=OU,P.bindKey=$b,P.castArray=VL,P.chain=Db,P.chunk=rR,P.compact=nR,P.concat=iR,P.cond=MU,P.conforms=PU,P.constant=Np,P.countBy=fL,P.create=SB,P.curry=Tb,P.curryRight=Nb,P.debounce=Rb,P.defaults=IB,P.defaultsDeep=DB,P.defer=LL,P.delay=BL,P.difference=sR,P.differenceBy=oR,P.differenceWith=aR,P.drop=cR,P.dropRight=lR,P.dropRightWhile=uR,P.dropWhile=hR,P.fill=fR,P.filter=pL,P.flatMap=vL,P.flatMapDeep=wL,P.flatMapDepth=yL,P.flatten=Ab,P.flattenDeep=dR,P.flattenDepth=pR,P.flip=UL,P.flow=TU,P.flowRight=NU,P.fromPairs=gR,P.functions=NB,P.functionsIn=RB,P.groupBy=bL,P.initial=vR,P.intersection=wR,P.intersectionBy=yR,P.intersectionWith=bR,P.invert=BB,P.invertBy=UB,P.invokeMap=EL,P.iteratee=Rp,P.keyBy=AL,P.keys=Ir,P.keysIn=fn,P.map=Ih,P.mapKeys=jB,P.mapValues=kB,P.matches=RU,P.matchesProperty=LU,P.memoize=Ch,P.merge=qB,P.mergeWith=Kb,P.method=BU,P.methodOf=UU,P.mixin=Lp,P.negate=Oh,P.nthArg=jU,P.omit=zB,P.omitBy=HB,P.once=FL,P.orderBy=xL,P.over=kU,P.overArgs=jL,P.overEvery=qU,P.overSome=zU,P.partial=Cp,P.partialRight=Lb,P.partition=SL,P.pick=KB,P.pickBy=Wb,P.property=Xb,P.propertyOf=HU,P.pull=xR,P.pullAll=Sb,P.pullAllBy=SR,P.pullAllWith=IR,P.pullAt=DR,P.range=KU,P.rangeRight=WU,P.rearg=kL,P.reject=CL,P.remove=CR,P.rest=qL,P.reverse=Sp,P.sampleSize=ML,P.set=VB,P.setWith=GB,P.shuffle=PL,P.slice=OR,P.sortBy=NL,P.sortedUniq=LR,P.sortedUniqBy=BR,P.split=vU,P.spread=zL,P.tail=UR,P.take=FR,P.takeRight=jR,P.takeRightWhile=kR,P.takeWhile=qR,P.tap=nL,P.throttle=HL,P.thru=Sh,P.toArray=kb,P.toPairs=Vb,P.toPairsIn=Gb,P.toPath=JU,P.toPlainObject=zb,P.transform=YB,P.unary=KL,P.union=zR,P.unionBy=HR,P.unionWith=KR,P.uniq=WR,P.uniqBy=VR,P.uniqWith=GR,P.unset=QB,P.unzip=Ip,P.unzipWith=Ib,P.update=JB,P.updateWith=ZB,P.values=Fa,P.valuesIn=XB,P.without=YR,P.words=Jb,P.wrap=WL,P.xor=QR,P.xorBy=JR,P.xorWith=ZR,P.zip=XR,P.zipObject=eL,P.zipObjectDeep=tL,P.zipWith=rL,P.entries=Vb,P.entriesIn=Gb,P.extend=Hb,P.extendWith=$h,Lp(P,P),P.add=XU,P.attempt=Zb,P.camelCase=nU,P.capitalize=Yb,P.ceil=eF,P.clamp=eU,P.clone=GL,P.cloneDeep=QL,P.cloneDeepWith=JL,P.cloneWith=YL,P.conformsTo=ZL,P.deburr=Qb,P.defaultTo=$U,P.divide=tF,P.endsWith=iU,P.eq=si,P.escape=sU,P.escapeRegExp=oU,P.every=dL,P.find=gL,P.findIndex=_b,P.findKey=CB,P.findLast=mL,P.findLastIndex=Eb,P.findLastKey=OB,P.floor=rF,P.forEach=Cb,P.forEachRight=Ob,P.forIn=MB,P.forInRight=PB,P.forOwn=$B,P.forOwnRight=TB,P.get=Pp,P.gt=XL,P.gte=eB,P.has=LB,P.hasIn=$p,P.head=xb,P.identity=dn,P.includes=_L,P.indexOf=mR,P.inRange=tU,P.invoke=FB,P.isArguments=$o,P.isArray=at,P.isArrayBuffer=tB,P.isArrayLike=hn,P.isArrayLikeObject=dr,P.isBoolean=rB,P.isBuffer=Bs,P.isDate=nB,P.isElement=iB,P.isEmpty=sB,P.isEqual=oB,P.isEqualWith=aB,P.isError=Op,P.isFinite=cB,P.isFunction=rs,P.isInteger=Bb,P.isLength=Mh,P.isMap=Ub,P.isMatch=lB,P.isMatchWith=uB,P.isNaN=hB,P.isNative=fB,P.isNil=pB,P.isNull=dB,P.isNumber=Fb,P.isObject=sr,P.isObjectLike=cr,P.isPlainObject=nl,P.isRegExp=Mp,P.isSafeInteger=gB,P.isSet=jb,P.isString=Ph,P.isSymbol=An,P.isTypedArray=Ua,P.isUndefined=mB,P.isWeakMap=vB,P.isWeakSet=wB,P.join=_R,P.kebabCase=aU,P.last=Kn,P.lastIndexOf=ER,P.lowerCase=cU,P.lowerFirst=lU,P.lt=yB,P.lte=bB,P.max=nF,P.maxBy=iF,P.mean=sF,P.meanBy=oF,P.min=aF,P.minBy=cF,P.stubArray=Up,P.stubFalse=Fp,P.stubObject=VU,P.stubString=GU,P.stubTrue=YU,P.multiply=lF,P.nth=AR,P.noConflict=FU,P.noop=Bp,P.now=Dh,P.pad=uU,P.padEnd=hU,P.padStart=fU,P.parseInt=dU,P.random=rU,P.reduce=IL,P.reduceRight=DL,P.repeat=pU,P.replace=gU,P.result=WB,P.round=uF,P.runInContext=Z,P.sample=OL,P.size=$L,P.snakeCase=mU,P.some=TL,P.sortedIndex=MR,P.sortedIndexBy=PR,P.sortedIndexOf=$R,P.sortedLastIndex=TR,P.sortedLastIndexBy=NR,P.sortedLastIndexOf=RR,P.startCase=wU,P.startsWith=yU,P.subtract=hF,P.sum=fF,P.sumBy=dF,P.template=bU,P.times=QU,P.toFinite=ns,P.toInteger=ft,P.toLength=qb,P.toLower=_U,P.toNumber=Wn,P.toSafeInteger=_B,P.toString=Bt,P.toUpper=EU,P.trim=AU,P.trimEnd=xU,P.trimStart=SU,P.truncate=IU,P.unescape=DU,P.uniqueId=ZU,P.upperCase=CU,P.upperFirst=Tp,P.each=Cb,P.eachRight=Ob,P.first=xb,Lp(P,function(){var s={};return Ti(P,function(a,u){qt.call(P.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),P.VERSION=n,jn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){P[s].placeholder=P}),jn(["drop","take"],function(s,a){At.prototype[s]=function(u){u=u===r?1:br(ft(u),0);var y=this.__filtered__&&!a?new At(this):this.clone();return y.__filtered__?y.__takeCount__=Ur(u,y.__takeCount__):y.__views__.push({size:Ur(u,v),type:s+(y.__dir__<0?"Right":"")}),y},At.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),jn(["filter","map","takeWhile"],function(s,a){var u=a+1,y=u==p||u==D;At.prototype[s]=function(S){var R=this.clone();return R.__iteratees__.push({iteratee:qe(S,3),type:u}),R.__filtered__=R.__filtered__||y,R}}),jn(["head","last"],function(s,a){var u="take"+(a?"Right":"");At.prototype[s]=function(){return this[u](1).value()[0]}}),jn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");At.prototype[s]=function(){return this.__filtered__?new At(this):this[u](1)}}),At.prototype.compact=function(){return this.filter(dn)},At.prototype.find=function(s){return this.filter(s).head()},At.prototype.findLast=function(s){return this.reverse().find(s)},At.prototype.invokeMap=gt(function(s,a){return typeof s=="function"?new At(this):this.map(function(u){return Jc(u,s,a)})}),At.prototype.reject=function(s){return this.filter(Oh(qe(s)))},At.prototype.slice=function(s,a){s=ft(s);var u=this;return u.__filtered__&&(s>0||a<0)?new At(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=ft(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},At.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},At.prototype.toArray=function(){return this.take(v)},Ti(At.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),y=/^(?:head|last)$/.test(a),S=P[y?"take"+(a=="last"?"Right":""):a],R=y||/^find/.test(a);S&&(P.prototype[a]=function(){var G=this.__wrapped__,Q=y?[1]:arguments,X=G instanceof At,ce=Q[0],ue=X||at(G),ge=function(yt){var Dt=S.apply(P,Ms([yt],Q));return y&&we?Dt[0]:Dt};ue&&u&&typeof ce=="function"&&ce.length!=1&&(X=ue=!1);var we=this.__chain__,Le=!!this.__actions__.length,Ke=R&&!we,pt=X&&!Le;if(!R&&ue){G=pt?G:new At(this);var We=s.apply(G,Q);return We.__actions__.push({func:Sh,args:[ge],thisArg:r}),new qn(We,we)}return Ke&&pt?s.apply(this,Q):(We=this.thru(ge),Ke?y?We.value()[0]:We.value():We)})}),jn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Ju[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);P.prototype[s]=function(){var S=arguments;if(y&&!this.__chain__){var R=this.value();return a.apply(at(R)?R:[],S)}return this[u](function(G){return a.apply(at(G)?G:[],S)})}}),Ti(At.prototype,function(s,a){var u=P[a];if(u){var y=u.name+"";qt.call(Ta,y)||(Ta[y]=[]),Ta[y].push({name:a,func:u})}}),Ta[wh(r,Y).name]=[{name:"wrapper",func:r}],At.prototype.clone=DT,At.prototype.reverse=CT,At.prototype.value=OT,P.prototype.at=iL,P.prototype.chain=sL,P.prototype.commit=oL,P.prototype.next=aL,P.prototype.plant=lL,P.prototype.reverse=uL,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=hL,P.prototype.first=P.prototype.head,Hc&&(P.prototype[Hc]=cL),P},Ma=oT();fr?((fr.exports=Ma)._=Ma,Gt._=Ma):It._=Ma}).call(yc)})(g0,g0.exports);var AD=Object.defineProperty,xD=Object.defineProperties,SD=Object.getOwnPropertyDescriptors,gw=Object.getOwnPropertySymbols,ID=Object.prototype.hasOwnProperty,DD=Object.prototype.propertyIsEnumerable,mw=(t,e,r)=>e in t?AD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zl=(t,e)=>{for(var r in e||(e={}))ID.call(e,r)&&mw(t,r,e[r]);if(gw)for(var r of gw(e))DD.call(e,r)&&mw(t,r,e[r]);return t},CD=(t,e)=>xD(t,SD(e));function ds(t,e,r){var n;const i=ml(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${ED}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Zs(t){return t.includes(":")?t.split(":")[1]:t}function vw(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OD(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function m0(t={},e={}){const r=ww(t),n=ww(e);return g0.exports.merge(r,n)}function ww(t){var e,r,n,i;const o={};if(!oc(t))return o;for(const[c,l]of Object.entries(t)){const f=Tf(c)?[c]:l.chains,h=l.methods||[],g=l.events||[],_=l.rpcMap||{},E=sc(c);o[E]=CD(Zl(Zl({},o[E]),l),{chains:vl(f,(e=o[E])==null?void 0:e.chains),methods:vl(h,(r=o[E])==null?void 0:r.methods),events:vl(g,(n=o[E])==null?void 0:n.events),rpcMap:Zl(Zl({},_),(i=o[E])==null?void 0:i.rpcMap)})}return o}function MD(t){return t.includes(":")?t.split(":")[2]:t}function yw(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=Tf(r)?[r]:n.chains?n.chains:vw(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}function v0(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const bw={},er=t=>bw[t],w0=(t,e)=>{bw[t]=e};class PD{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}var $D=Object.defineProperty,TD=Object.defineProperties,ND=Object.getOwnPropertyDescriptors,_w=Object.getOwnPropertySymbols,RD=Object.prototype.hasOwnProperty,LD=Object.prototype.propertyIsEnumerable,Ew=(t,e,r)=>e in t?$D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Aw=(t,e)=>{for(var r in e||(e={}))RD.call(e,r)&&Ew(t,r,e[r]);if(_w)for(var r of _w(e))LD.call(e,r)&&Ew(t,r,e[r]);return t},xw=(t,e)=>TD(t,ND(e));class BD{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||ds(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(Zs(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const o=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const c=this.client.session.get(e.topic),l=((i=c?.sessionProperties)==null?void 0:i.capabilities)||{};if(l!=null&&l[o])return l?.[o];const f=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:xw(Aw({},c.sessionProperties||{}),{capabilities:xw(Aw({},l||{}),{[o]:f})})})}catch(h){console.warn("Failed to update session with capabilities",h)}return f}}class UD{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class FD{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class jD{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=Zs(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class kD{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class qD{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class zD{constructor(e){this.name="near",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ds(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace);return typeof n>"u"?void 0:new Hi(new fs(n,er("disableProviderPing")))}}var HD=Object.defineProperty,KD=Object.defineProperties,WD=Object.getOwnPropertyDescriptors,Sw=Object.getOwnPropertySymbols,VD=Object.prototype.hasOwnProperty,GD=Object.prototype.propertyIsEnumerable,Iw=(t,e,r)=>e in t?HD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xl=(t,e)=>{for(var r in e||(e={}))VD.call(e,r)&&Iw(t,r,e[r]);if(Sw)for(var r of Sw(e))GD.call(e,r)&&Iw(t,r,e[r]);return t},y0=(t,e)=>KD(t,WD(e));class b0{constructor(e){this.events=new Dr.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:yi(Hl({level:e?.logger||dw})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new b0(e);return await r.initialize(),r}async request(e,r,n){const[i,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Xl({},e),chainId:`${i}:${o}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const o=new Date().getTime();this.request(e,n,i).then(c=>r(null,Wl(o,c))).catch(c=>r(c,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Ut("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:n}=await this.client.authenticate(e);r&&(this.uri=r,this.events.emit("display_uri",r));const i=await n();if(this.session=i.session,this.session){const o=yw(this.session.namespaces);this.namespaces=m0(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(o=>{this.session=o;const c=yw(o.namespaces);this.namespaces=m0(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==nw)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(wi(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await d0.init({logger:this.providerOpts.logger||dw,relayUrl:this.providerOpts.relayUrl||yD,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>sc(r)))];w0("client",this.client),w0("events",this.events),w0("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=OD(r,this.session),i=vw(n),o=m0(this.namespaces,this.optionalNamespaces),c=y0(Xl({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new BD({namespace:c});break;case"solana":this.rpcProviders[r]=new UD({namespace:c});break;case"cosmos":this.rpcProviders[r]=new FD({namespace:c});break;case"polkadot":this.rpcProviders[r]=new PD({namespace:c});break;case"cip34":this.rpcProviders[r]=new jD({namespace:c});break;case"elrond":this.rpcProviders[r]=new kD({namespace:c});break;case"multiversx":this.rpcProviders[r]=new qD({namespace:c});break;case"near":this.rpcProviders[r]=new zD({namespace:c});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&wi(i)&&this.events.emit("accountsChanged",i.map(MD))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=sc(i),l=v0(i)!==v0(o)?`${c}:${v0(o)}`:i;this.onChainChanged(l)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=y0(Xl({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",y0(Xl({},Ut("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ki.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>sc(c)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=sc(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${pw}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${pw}/${e}`)}}const YD=b0,QD="wc",JD="ethereum_provider",ZD=`${QD}@2:${JD}:`,XD="https://rpc.walletconnect.com/v1/",eu=["eth_sendTransaction","personal_sign"],Dw=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],tu=["chainChanged","accountsChanged"],Cw=["chainChanged","accountsChanged","message","disconnect","connect"];var eC=Object.defineProperty,tC=Object.defineProperties,rC=Object.getOwnPropertyDescriptors,Ow=Object.getOwnPropertySymbols,nC=Object.prototype.hasOwnProperty,iC=Object.prototype.propertyIsEnumerable,Mw=(t,e,r)=>e in t?eC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sa=(t,e)=>{for(var r in e||(e={}))nC.call(e,r)&&Mw(t,r,e[r]);if(Ow)for(var r of Ow(e))iC.call(e,r)&&Mw(t,r,e[r]);return t},_0=(t,e)=>tC(t,rC(e));function ru(t){return Number(t[0].split(":")[1])}function nu(t){return`0x${t.toString(16)}`}function sC(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!wi(e))throw new Error("Invalid chains");const f={chains:e,methods:n||eu,events:o||tu,rpcMap:sa({},e.length?{[ru(e)]:l[ru(e)]}:{})},h=o?.filter(x=>!tu.includes(x)),g=n?.filter(x=>!eu.includes(x));if(!r&&!c&&!i&&!(h!=null&&h.length)&&!(g!=null&&g.length))return{required:e.length?f:void 0};const _=h?.length&&g?.length||!r,E={chains:[...new Set(_?f.chains.concat(r||[]):r)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:Dw))],events:[...new Set(f.events.concat(c!=null&&c.length?c:Cw))],rpcMap:l};return{required:e.length?f:void 0,optional:r.length?E:void 0}}class iu{constructor(){this.events=new Dr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=ZD,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new iu;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=sC(this.rpc);try{const i=await new Promise(async(c,l)=>{var f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(_0(sa({namespaces:sa({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{l(new Error(h.message))})});if(!i)return;const o=Y1(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:nu(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{const r=await new Promise(async(i,o)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(_0(sa({},e),{chains:this.rpc.chains})).then(l=>{i(l)}).catch(l=>{o(new Error(l.message))})}),n=r.session;if(n){const i=Y1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:nu(this.chainId)})}return r}catch(r){throw this.signer.logger.error(r),r}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",nu(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",_0(sa({},Ut("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",nu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||eu:[],f=i.length?e?.events||tu:[],h=e?.optionalMethods||[],g=e?.optionalEvents||[],_=e?.rpcMap||this.buildRpcMap(c,e.projectId),E=e?.qrModalOptions||void 0;return{chains:i?.map(x=>this.formatChainId(x)),optionalChains:o.map(x=>this.formatChainId(x)),methods:l,events:f,optionalMethods:h,optionalEvents:g,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:E,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){this.rpc=this.getRpcConfig(e);const r=this.rpc.metadata;if(r===void 0)throw new Error("Metadata field is required");if(this.chainId=this.rpc.chains.length?ru(this.rpc.chains):ru(this.rpc.optionalChains),this.signer=await YD.init({projectId:this.rpc.projectId,metadata:r,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let n;try{const{WalletConnectModal:i}=await Promise.resolve().then(function(){return CC});n=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(n)try{this.modal=new n(sa({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&wi(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&wi(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${XD}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const oC=iu,aC=Symbol(),Pw=Object.getPrototypeOf,E0=new WeakMap,cC=t=>t&&(E0.has(t)?E0.get(t):Pw(t)===Object.prototype||Pw(t)===Array.prototype),lC=t=>cC(t)&&t[aC]||null,$w=(t,e=!0)=>{E0.set(t,e)},A0=t=>typeof t=="object"&&t!==null,ps=new WeakMap,su=new WeakSet,uC=(t=Object.is,e=(h,g)=>new Proxy(h,g),r=h=>A0(h)&&!su.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,o=(h,g,_=n)=>{const E=i.get(h);if(E?.[0]===g)return E[1];const x=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return $w(x,!0),i.set(h,[g,x]),Reflect.ownKeys(h).forEach(I=>{if(Object.getOwnPropertyDescriptor(x,I))return;const k=Reflect.get(h,I),W={value:k,enumerable:!0,configurable:!0};if(su.has(k))$w(k,!1);else if(k instanceof Promise)delete W.value,W.get=()=>_(k);else if(ps.has(k)){const[Y,B]=ps.get(k);W.value=o(Y,B(),_)}Object.defineProperty(x,I,W)}),Object.preventExtensions(x)},c=new WeakMap,l=[1,1],f=h=>{if(!A0(h))throw new Error("object required");const g=c.get(h);if(g)return g;let _=l[0];const E=new Set,x=(te,ee=++l[0])=>{_!==ee&&(_=ee,E.forEach(ne=>ne(te,ee)))};let I=l[1];const k=(te=++l[1])=>(I!==te&&!E.size&&(I=te,Y.forEach(([ee])=>{const ne=ee[1](te);ne>_&&(_=ne)})),_),W=te=>(ee,ne)=>{const de=[...ee];de[1]=[te,...de[1]],x(de,ne)},Y=new Map,B=(te,ee)=>{if(Y.has(te))throw new Error("prop listener already exists");if(E.size){const ne=ee[3](W(te));Y.set(te,[ee,ne])}else Y.set(te,[ee])},z=te=>{var ee;const ne=Y.get(te);ne&&(Y.delete(te),(ee=ne[1])==null||ee.call(ne))},M=te=>(E.add(te),E.size===1&&Y.forEach(([ne,de],d)=>{if(de)throw new Error("remove already exists");const p=ne[3](W(d));Y.set(d,[ne,p])}),()=>{E.delete(te),E.size===0&&Y.forEach(([ne,de],d)=>{de&&(de(),Y.set(d,[ne]))})}),U=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),m=e(U,{deleteProperty(te,ee){const ne=Reflect.get(te,ee);z(ee);const de=Reflect.deleteProperty(te,ee);return de&&x(["delete",[ee],ne]),de},set(te,ee,ne,de){const d=Reflect.has(te,ee),p=Reflect.get(te,ee,de);if(d&&(t(p,ne)||c.has(ne)&&t(p,c.get(ne))))return!0;z(ee),A0(ne)&&(ne=lC(ne)||ne);let b=ne;if(ne instanceof Promise)ne.then(D=>{ne.status="fulfilled",ne.value=D,x(["resolve",[ee],D])}).catch(D=>{ne.status="rejected",ne.reason=D,x(["reject",[ee],D])});else{!ps.has(ne)&&r(ne)&&(b=f(ne));const D=!su.has(b)&&ps.get(b);D&&B(ee,D)}return Reflect.set(te,ee,b,de),x(["set",[ee],ne,p]),!0}});c.set(h,m);const $=[U,k,o,M];return ps.set(m,$),Reflect.ownKeys(h).forEach(te=>{const ee=Object.getOwnPropertyDescriptor(h,te);"value"in ee&&(m[te]=h[te],delete ee.value,delete ee.writable),Object.defineProperty(U,te,ee)}),m})=>[f,ps,su,t,e,r,n,i,o,c,l],[hC]=uC();function gs(t={}){return hC(t)}function Xs(t,e,r){const n=ps.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const h=c(g=>{if(o.push(g),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,h()}}function fC(t,e){const r=ps.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}const Ar=gs({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),rr={state:Ar,subscribe(t){return Xs(Ar,()=>t(Ar))},push(t,e){t!==Ar.view&&(Ar.view=t,e&&(Ar.data=e),Ar.history.push(t))},reset(t){Ar.view=t,Ar.history=[t]},replace(t){Ar.history.length>1&&(Ar.history[Ar.history.length-1]=t,Ar.view=t)},goBack(){if(Ar.history.length>1){Ar.history.pop();const[t]=Ar.history.slice(-1);Ar.view=t}},setData(t){Ar.data=t}},Ue={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ue.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ue.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ue.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Ue.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ue.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=rr.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},dC=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Br=gs({enabled:dC,userSessionId:"",events:[],connectedWalletId:void 0}),Tw={state:Br,subscribe(t){return Xs(Br.events,()=>t(fC(Br.events[Br.events.length-1])))},initialize(){Br.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Br.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Br.connectedWalletId=t},click(t){if(Br.enabled){const e={type:"CLICK",name:t.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:t};Br.events.push(e)}},track(t){if(Br.enabled){const e={type:"TRACK",name:t.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:t};Br.events.push(e)}},view(t){if(Br.enabled){const e={type:"VIEW",name:t.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:t};Br.events.push(e)}}},xi=gs({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),hr={state:xi,subscribe(t){return Xs(xi,()=>t(xi))},setChains(t){xi.chains=t},setWalletConnectUri(t){xi.walletConnectUri=t},setIsCustomDesktop(t){xi.isCustomDesktop=t},setIsCustomMobile(t){xi.isCustomMobile=t},setIsDataLoaded(t){xi.isDataLoaded=t},setIsUiLoaded(t){xi.isUiLoaded=t},setIsAuth(t){xi.isAuth=t}},ou=gs({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),wn={state:ou,subscribe(t){return Xs(ou,()=>t(ou))},setConfig(t){var e,r;Tw.initialize(),hr.setChains(t.chains),hr.setIsAuth(!!t.enableAuthMode),hr.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),hr.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Ue.setModalVersionInStorage(),Object.assign(ou,t)}};var pC=Object.defineProperty,Nw=Object.getOwnPropertySymbols,gC=Object.prototype.hasOwnProperty,mC=Object.prototype.propertyIsEnumerable,Rw=(t,e,r)=>e in t?pC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vC=(t,e)=>{for(var r in e||(e={}))gC.call(e,r)&&Rw(t,r,e[r]);if(Nw)for(var r of Nw(e))mC.call(e,r)&&Rw(t,r,e[r]);return t};const x0="https://explorer-api.walletconnect.com",S0="wcm",I0="js-2.6.2";async function au(t,e){const r=vC({sdkType:S0,sdkVersion:I0},e),n=new URL(t,x0);return n.searchParams.append("projectId",wn.state.projectId),Object.entries(r).forEach(([i,o])=>{o&&n.searchParams.append(i,String(o))}),(await fetch(n)).json()}const eo={async getDesktopListings(t){return au("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return au("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return au("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return au("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${x0}/w3m/v1/getWalletImage/${t}?projectId=${wn.state.projectId}&sdkType=${S0}&sdkVersion=${I0}`},getAssetImageUrl(t){return`${x0}/w3m/v1/getAssetImage/${t}?projectId=${wn.state.projectId}&sdkType=${S0}&sdkVersion=${I0}`}};var wC=Object.defineProperty,Lw=Object.getOwnPropertySymbols,yC=Object.prototype.hasOwnProperty,bC=Object.prototype.propertyIsEnumerable,Bw=(t,e,r)=>e in t?wC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_C=(t,e)=>{for(var r in e||(e={}))yC.call(e,r)&&Bw(t,r,e[r]);if(Lw)for(var r of Lw(e))bC.call(e,r)&&Bw(t,r,e[r]);return t};const Uw=Ue.isMobile(),Si=gs({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),an={state:Si,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=wn.state;if(t==="NONE"||e==="ALL"&&!t)return Si.recomendedWallets;if(Ue.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await eo.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),f=t.indexOf(c.id);return l-f}),Si.recomendedWallets=i}else{const{chains:r,isAuth:n}=hr.state,i=r?.join(","),o=Ue.isArray(e),c={page:1,sdks:n?"auth_v1":void 0,entries:Ue.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:o?e.join(","):void 0},{listings:l}=Uw?await eo.getMobileListings(c):await eo.getDesktopListings(c);Si.recomendedWallets=Object.values(l)}return Si.recomendedWallets},async getWallets(t){const e=_C({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=wn.state,{recomendedWallets:i}=Si;if(n==="ALL")return Si.wallets;i.length?e.excludedIds=i.map(_=>_.id).join(","):Ue.isArray(r)&&(e.excludedIds=r.join(",")),Ue.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),hr.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:f}=Uw?await eo.getMobileListings(e):await eo.getDesktopListings(e),h=Object.values(l),g=c?"search":"wallets";return Si[g]={listings:[...Si[g].listings,...h],total:f,page:o??1},{listings:h,total:f}},getWalletImageUrl(t){return eo.getWalletImageUrl(t)},getAssetImageUrl(t){return eo.getAssetImageUrl(t)},resetSearch(){Si.search={listings:[],total:0,page:1}}},oa=gs({open:!1}),to={state:oa,subscribe(t){return Xs(oa,()=>t(oa))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=hr.state;if(Ue.removeWalletConnectDeepLink(),hr.setWalletConnectUri(t?.uri),hr.setChains(t?.chains),rr.reset("ConnectWallet"),r&&n)oa.open=!0,e();else{const i=setInterval(()=>{const o=hr.state;o.isUiLoaded&&o.isDataLoaded&&(clearInterval(i),oa.open=!0,e())},200)}})},close(){oa.open=!1}};var EC=Object.defineProperty,Fw=Object.getOwnPropertySymbols,AC=Object.prototype.hasOwnProperty,xC=Object.prototype.propertyIsEnumerable,jw=(t,e,r)=>e in t?EC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,SC=(t,e)=>{for(var r in e||(e={}))AC.call(e,r)&&jw(t,r,e[r]);if(Fw)for(var r of Fw(e))xC.call(e,r)&&jw(t,r,e[r]);return t};function IC(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const bc=gs({themeMode:IC()?"dark":"light"}),ms={state:bc,subscribe(t){return Xs(bc,()=>t(bc))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(bc.themeMode=e),r&&(bc.themeVariables=SC({},r))}},ro=gs({open:!1,message:"",variant:"success"}),vs={state:ro,subscribe(t){return Xs(ro,()=>t(ro))},openToast(t,e){ro.open=!0,ro.message=t,ro.variant=e},closeToast(){ro.open=!1}};class DC{constructor(e){this.openModal=to.open,this.closeModal=to.close,this.subscribeModal=to.subscribe,this.setTheme=ms.setThemeConfig,ms.setThemeConfig(e),wn.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return L$});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),hr.setIsUiLoaded(!0)}}}var CC=Object.freeze({__proto__:null,WalletConnectModal:DC});/**
|
|
69
|
+
}`;var pt=Zb(function(){return Tt(R,Le+"return "+ge).apply(r,G)});if(pt.source=ge,Dp(pt))throw pt;return pt}function EU(s){return Bt(s).toLowerCase()}function AU(s){return Bt(s).toUpperCase()}function xU(s,a,u){if(s=Bt(s),s&&(u||a===r))return ay(s);if(!s||!(a=En(a)))return s;var y=ni(s),S=ni(a),R=cy(y,S),G=ly(y,S)+1;return Ls(y,R,G).join("")}function IU(s,a,u){if(s=Bt(s),s&&(u||a===r))return s.slice(0,hy(s)+1);if(!s||!(a=En(a)))return s;var y=ni(s),S=ly(y,ni(a))+1;return Ls(y,0,S).join("")}function SU(s,a,u){if(s=Bt(s),s&&(u||a===r))return s.replace(Je,"");if(!s||!(a=En(a)))return s;var y=ni(s),S=cy(y,ni(a));return Ls(y,S).join("")}function CU(s,a){var u=ee,y=ne;if(sr(a)){var S="separator"in a?a.separator:S;u="length"in a?ft(a.length):u,y="omission"in a?En(a.omission):y}s=Bt(s);var R=s.length;if(Ca(s)){var G=ni(s);R=G.length}if(u>=R)return s;var Q=u-Da(y);if(Q<1)return y;var X=G?Ls(G,0,Q).join(""):s.slice(0,Q);if(S===r)return X+y;if(G&&(Q+=X.length-Q),Op(S)){if(s.slice(Q).search(S)){var ce,ue=X;for(S.global||(S=Kd(S.source,Bt(vt.exec(S))+"g")),S.lastIndex=0;ce=S.exec(ue);)var ge=ce.index;X=X.slice(0,ge===r?Q:ge)}}else if(s.indexOf(En(S),Q)!=Q){var we=X.lastIndexOf(S);we>-1&&(X=X.slice(0,we))}return X+y}function DU(s){return s=Bt(s),s&&Ye.test(s)?s.replace(Ot,nT):s}var OU=Ra(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),$p=Xy("toUpperCase");function Jb(s,a,u){return s=Bt(s),a=u?r:a,a===r?Z$(s)?oT(s):z$(s):s.match(a)||[]}var Zb=gt(function(s,a){try{return Ir(s,r,a)}catch(u){return Dp(u)?u:new it(u)}}),MU=es(function(s,a){return jn(a,function(u){u=Ri(u),Zi(s,u,Sp(s[u],s))}),s});function PU(s){var a=s==null?0:s.length,u=qe();return s=a?tr(s,function(y){if(typeof y[1]!="function")throw new kn(c);return[u(y[0]),y[1]]}):[],gt(function(y){for(var S=-1;++S<a;){var R=s[S];if(Ir(R[0],this,y))return Ir(R[1],this,y)}})}function $U(s){return nN(zn(s,_))}function Tp(s){return function(){return s}}function TU(s,a){return s==null||s!==s?a:s}var NU=tb(),RU=tb(!0);function dn(s){return s}function Np(s){return Py(typeof s=="function"?s:zn(s,_))}function LU(s){return Ty(zn(s,_))}function BU(s,a){return Ny(s,zn(a,_))}var UU=gt(function(s,a){return function(u){return Jc(u,s,a)}}),FU=gt(function(s,a){return function(u){return Jc(s,u,a)}});function Rp(s,a,u){var y=Sr(a),S=dh(a,y);u==null&&!(sr(a)&&(S.length||!y.length))&&(u=a,a=s,s=this,S=dh(a,Sr(a)));var R=!(sr(u)&&"chain"in u)||!!u.chain,G=rs(s);return jn(S,function(Q){var X=a[Q];s[Q]=X,G&&(s.prototype[Q]=function(){var ce=this.__chain__;if(R||ce){var ue=s(this.__wrapped__),ge=ue.__actions__=un(this.__actions__);return ge.push({func:X,args:arguments,thisArg:s}),ue.__chain__=ce,ue}return X.apply(s,Ms([this.value()],arguments))})}),s}function jU(){return St._===this&&(St._=fT),this}function Lp(){}function kU(s){return s=ft(s),gt(function(a){return Ry(a,s)})}var qU=dp(tr),zU=dp(ry),HU=dp(Ud);function Xb(s){return bp(s)?Fd(Ri(s)):bN(s)}function KU(s){return function(a){return s==null?r:Oo(s,a)}}var WU=nb(),VU=nb(!0);function Bp(){return[]}function Up(){return!1}function GU(){return{}}function YU(){return""}function QU(){return!0}function JU(s,a){if(s=ft(s),s<1||s>T)return[];var u=v,y=Ur(s,v);a=qe(a),s-=v;for(var S=qd(y,a);++u<s;)a(u);return S}function ZU(s){return at(s)?tr(s,Ri):An(s)?[s]:un(yb(Bt(s)))}function XU(s){var a=++uT;return Bt(s)+a}var eF=yh(function(s,a){return s+a},0),tF=pp("ceil"),rF=yh(function(s,a){return s/a},1),nF=pp("floor");function iF(s){return s&&s.length?fh(s,dn,Xd):r}function sF(s,a){return s&&s.length?fh(s,qe(a,2),Xd):r}function oF(s){return sy(s,dn)}function aF(s,a){return sy(s,qe(a,2))}function cF(s){return s&&s.length?fh(s,dn,np):r}function lF(s,a){return s&&s.length?fh(s,qe(a,2),np):r}var uF=yh(function(s,a){return s*a},1),hF=pp("round"),fF=yh(function(s,a){return s-a},0);function dF(s){return s&&s.length?kd(s,dn):0}function pF(s,a){return s&&s.length?kd(s,qe(a,2)):0}return P.after=LL,P.ary=Mb,P.assign=AB,P.assignIn=Hb,P.assignInWith=$h,P.assignWith=xB,P.at=IB,P.before=Pb,P.bind=Sp,P.bindAll=MU,P.bindKey=$b,P.castArray=GL,P.chain=Cb,P.chunk=nR,P.compact=iR,P.concat=sR,P.cond=PU,P.conforms=$U,P.constant=Tp,P.countBy=dL,P.create=SB,P.curry=Tb,P.curryRight=Nb,P.debounce=Rb,P.defaults=CB,P.defaultsDeep=DB,P.defer=BL,P.delay=UL,P.difference=oR,P.differenceBy=aR,P.differenceWith=cR,P.drop=lR,P.dropRight=uR,P.dropRightWhile=hR,P.dropWhile=fR,P.fill=dR,P.filter=gL,P.flatMap=wL,P.flatMapDeep=yL,P.flatMapDepth=bL,P.flatten=Ab,P.flattenDeep=pR,P.flattenDepth=gR,P.flip=FL,P.flow=NU,P.flowRight=RU,P.fromPairs=mR,P.functions=RB,P.functionsIn=LB,P.groupBy=_L,P.initial=wR,P.intersection=yR,P.intersectionBy=bR,P.intersectionWith=_R,P.invert=UB,P.invertBy=FB,P.invokeMap=AL,P.iteratee=Np,P.keyBy=xL,P.keys=Sr,P.keysIn=fn,P.map=Sh,P.mapKeys=kB,P.mapValues=qB,P.matches=LU,P.matchesProperty=BU,P.memoize=Dh,P.merge=zB,P.mergeWith=Kb,P.method=UU,P.methodOf=FU,P.mixin=Rp,P.negate=Oh,P.nthArg=kU,P.omit=HB,P.omitBy=KB,P.once=jL,P.orderBy=IL,P.over=qU,P.overArgs=kL,P.overEvery=zU,P.overSome=HU,P.partial=Cp,P.partialRight=Lb,P.partition=SL,P.pick=WB,P.pickBy=Wb,P.property=Xb,P.propertyOf=KU,P.pull=IR,P.pullAll=Ib,P.pullAllBy=SR,P.pullAllWith=CR,P.pullAt=DR,P.range=WU,P.rangeRight=VU,P.rearg=qL,P.reject=OL,P.remove=OR,P.rest=zL,P.reverse=xp,P.sampleSize=PL,P.set=GB,P.setWith=YB,P.shuffle=$L,P.slice=MR,P.sortBy=RL,P.sortedUniq=BR,P.sortedUniqBy=UR,P.split=wU,P.spread=HL,P.tail=FR,P.take=jR,P.takeRight=kR,P.takeRightWhile=qR,P.takeWhile=zR,P.tap=iL,P.throttle=KL,P.thru=Ih,P.toArray=kb,P.toPairs=Vb,P.toPairsIn=Gb,P.toPath=ZU,P.toPlainObject=zb,P.transform=QB,P.unary=WL,P.union=HR,P.unionBy=KR,P.unionWith=WR,P.uniq=VR,P.uniqBy=GR,P.uniqWith=YR,P.unset=JB,P.unzip=Ip,P.unzipWith=Sb,P.update=ZB,P.updateWith=XB,P.values=Ua,P.valuesIn=eU,P.without=QR,P.words=Jb,P.wrap=VL,P.xor=JR,P.xorBy=ZR,P.xorWith=XR,P.zip=eL,P.zipObject=tL,P.zipObjectDeep=rL,P.zipWith=nL,P.entries=Vb,P.entriesIn=Gb,P.extend=Hb,P.extendWith=$h,Rp(P,P),P.add=eF,P.attempt=Zb,P.camelCase=iU,P.capitalize=Yb,P.ceil=tF,P.clamp=tU,P.clone=YL,P.cloneDeep=JL,P.cloneDeepWith=ZL,P.cloneWith=QL,P.conformsTo=XL,P.deburr=Qb,P.defaultTo=TU,P.divide=rF,P.endsWith=sU,P.eq=si,P.escape=oU,P.escapeRegExp=aU,P.every=pL,P.find=mL,P.findIndex=_b,P.findKey=OB,P.findLast=vL,P.findLastIndex=Eb,P.findLastKey=MB,P.floor=nF,P.forEach=Db,P.forEachRight=Ob,P.forIn=PB,P.forInRight=$B,P.forOwn=TB,P.forOwnRight=NB,P.get=Mp,P.gt=eB,P.gte=tB,P.has=BB,P.hasIn=Pp,P.head=xb,P.identity=dn,P.includes=EL,P.indexOf=vR,P.inRange=rU,P.invoke=jB,P.isArguments=$o,P.isArray=at,P.isArrayBuffer=rB,P.isArrayLike=hn,P.isArrayLikeObject=dr,P.isBoolean=nB,P.isBuffer=Bs,P.isDate=iB,P.isElement=sB,P.isEmpty=oB,P.isEqual=aB,P.isEqualWith=cB,P.isError=Dp,P.isFinite=lB,P.isFunction=rs,P.isInteger=Bb,P.isLength=Mh,P.isMap=Ub,P.isMatch=uB,P.isMatchWith=hB,P.isNaN=fB,P.isNative=dB,P.isNil=gB,P.isNull=pB,P.isNumber=Fb,P.isObject=sr,P.isObjectLike=cr,P.isPlainObject=nl,P.isRegExp=Op,P.isSafeInteger=mB,P.isSet=jb,P.isString=Ph,P.isSymbol=An,P.isTypedArray=Ba,P.isUndefined=vB,P.isWeakMap=wB,P.isWeakSet=yB,P.join=ER,P.kebabCase=cU,P.last=Kn,P.lastIndexOf=AR,P.lowerCase=lU,P.lowerFirst=uU,P.lt=bB,P.lte=_B,P.max=iF,P.maxBy=sF,P.mean=oF,P.meanBy=aF,P.min=cF,P.minBy=lF,P.stubArray=Bp,P.stubFalse=Up,P.stubObject=GU,P.stubString=YU,P.stubTrue=QU,P.multiply=uF,P.nth=xR,P.noConflict=jU,P.noop=Lp,P.now=Ch,P.pad=hU,P.padEnd=fU,P.padStart=dU,P.parseInt=pU,P.random=nU,P.reduce=CL,P.reduceRight=DL,P.repeat=gU,P.replace=mU,P.result=VB,P.round=hF,P.runInContext=Z,P.sample=ML,P.size=TL,P.snakeCase=vU,P.some=NL,P.sortedIndex=PR,P.sortedIndexBy=$R,P.sortedIndexOf=TR,P.sortedLastIndex=NR,P.sortedLastIndexBy=RR,P.sortedLastIndexOf=LR,P.startCase=yU,P.startsWith=bU,P.subtract=fF,P.sum=dF,P.sumBy=pF,P.template=_U,P.times=JU,P.toFinite=ns,P.toInteger=ft,P.toLength=qb,P.toLower=EU,P.toNumber=Wn,P.toSafeInteger=EB,P.toString=Bt,P.toUpper=AU,P.trim=xU,P.trimEnd=IU,P.trimStart=SU,P.truncate=CU,P.unescape=DU,P.uniqueId=XU,P.upperCase=OU,P.upperFirst=$p,P.each=Db,P.eachRight=Ob,P.first=xb,Rp(P,function(){var s={};return Ti(P,function(a,u){qt.call(P.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),P.VERSION=n,jn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){P[s].placeholder=P}),jn(["drop","take"],function(s,a){At.prototype[s]=function(u){u=u===r?1:br(ft(u),0);var y=this.__filtered__&&!a?new At(this):this.clone();return y.__filtered__?y.__takeCount__=Ur(u,y.__takeCount__):y.__views__.push({size:Ur(u,v),type:s+(y.__dir__<0?"Right":"")}),y},At.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),jn(["filter","map","takeWhile"],function(s,a){var u=a+1,y=u==p||u==C;At.prototype[s]=function(S){var R=this.clone();return R.__iteratees__.push({iteratee:qe(S,3),type:u}),R.__filtered__=R.__filtered__||y,R}}),jn(["head","last"],function(s,a){var u="take"+(a?"Right":"");At.prototype[s]=function(){return this[u](1).value()[0]}}),jn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");At.prototype[s]=function(){return this.__filtered__?new At(this):this[u](1)}}),At.prototype.compact=function(){return this.filter(dn)},At.prototype.find=function(s){return this.filter(s).head()},At.prototype.findLast=function(s){return this.reverse().find(s)},At.prototype.invokeMap=gt(function(s,a){return typeof s=="function"?new At(this):this.map(function(u){return Jc(u,s,a)})}),At.prototype.reject=function(s){return this.filter(Oh(qe(s)))},At.prototype.slice=function(s,a){s=ft(s);var u=this;return u.__filtered__&&(s>0||a<0)?new At(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=ft(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},At.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},At.prototype.toArray=function(){return this.take(v)},Ti(At.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),y=/^(?:head|last)$/.test(a),S=P[y?"take"+(a=="last"?"Right":""):a],R=y||/^find/.test(a);S&&(P.prototype[a]=function(){var G=this.__wrapped__,Q=y?[1]:arguments,X=G instanceof At,ce=Q[0],ue=X||at(G),ge=function(yt){var Ct=S.apply(P,Ms([yt],Q));return y&&we?Ct[0]:Ct};ue&&u&&typeof ce=="function"&&ce.length!=1&&(X=ue=!1);var we=this.__chain__,Le=!!this.__actions__.length,Ke=R&&!we,pt=X&&!Le;if(!R&&ue){G=pt?G:new At(this);var We=s.apply(G,Q);return We.__actions__.push({func:Ih,args:[ge],thisArg:r}),new qn(We,we)}return Ke&&pt?s.apply(this,Q):(We=this.thru(ge),Ke?y?We.value()[0]:We.value():We)})}),jn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Ju[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);P.prototype[s]=function(){var S=arguments;if(y&&!this.__chain__){var R=this.value();return a.apply(at(R)?R:[],S)}return this[u](function(G){return a.apply(at(G)?G:[],S)})}}),Ti(At.prototype,function(s,a){var u=P[a];if(u){var y=u.name+"";qt.call($a,y)||($a[y]=[]),$a[y].push({name:a,func:u})}}),$a[wh(r,Y).name]=[{name:"wrapper",func:r}],At.prototype.clone=DT,At.prototype.reverse=OT,At.prototype.value=MT,P.prototype.at=sL,P.prototype.chain=oL,P.prototype.commit=aL,P.prototype.next=cL,P.prototype.plant=uL,P.prototype.reverse=hL,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=fL,P.prototype.first=P.prototype.head,Hc&&(P.prototype[Hc]=lL),P},Oa=aT();fr?((fr.exports=Oa)._=Oa,Gt._=Oa):St._=Oa}).call(yc)})(p0,p0.exports);var xC=Object.defineProperty,IC=Object.defineProperties,SC=Object.getOwnPropertyDescriptors,gw=Object.getOwnPropertySymbols,CC=Object.prototype.hasOwnProperty,DC=Object.prototype.propertyIsEnumerable,mw=(t,e,r)=>e in t?xC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zl=(t,e)=>{for(var r in e||(e={}))CC.call(e,r)&&mw(t,r,e[r]);if(gw)for(var r of gw(e))DC.call(e,r)&&mw(t,r,e[r]);return t},OC=(t,e)=>IC(t,SC(e));function ds(t,e,r){var n;const i=Sl(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${AC}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Zs(t){return t.includes(":")?t.split(":")[1]:t}function vw(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function MC(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function g0(t={},e={}){const r=ww(t),n=ww(e);return p0.exports.merge(r,n)}function ww(t){var e,r,n,i;const o={};if(!hc(t))return o;for(const[c,l]of Object.entries(t)){const f=Kf(c)?[c]:l.chains,h=l.methods||[],g=l.events||[],_=l.rpcMap||{},E=uc(c);o[E]=OC(Zl(Zl({},o[E]),l),{chains:Cl(f,(e=o[E])==null?void 0:e.chains),methods:Cl(h,(r=o[E])==null?void 0:r.methods),events:Cl(g,(n=o[E])==null?void 0:n.events),rpcMap:Zl(Zl({},_),(i=o[E])==null?void 0:i.rpcMap)})}return o}function PC(t){return t.includes(":")?t.split(":")[2]:t}function yw(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=Kf(r)?[r]:n.chains?n.chains:vw(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}function m0(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const bw={},er=t=>bw[t],v0=(t,e)=>{bw[t]=e};class $C{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}var TC=Object.defineProperty,NC=Object.defineProperties,RC=Object.getOwnPropertyDescriptors,_w=Object.getOwnPropertySymbols,LC=Object.prototype.hasOwnProperty,BC=Object.prototype.propertyIsEnumerable,Ew=(t,e,r)=>e in t?TC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Aw=(t,e)=>{for(var r in e||(e={}))LC.call(e,r)&&Ew(t,r,e[r]);if(_w)for(var r of _w(e))BC.call(e,r)&&Ew(t,r,e[r]);return t},xw=(t,e)=>NC(t,RC(e));class UC{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||ds(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(Zs(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const o=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const c=this.client.session.get(e.topic),l=((i=c?.sessionProperties)==null?void 0:i.capabilities)||{};if(l!=null&&l[o])return l?.[o];const f=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:xw(Aw({},c.sessionProperties||{}),{capabilities:xw(Aw({},l||{}),{[o]:f})})})}catch(h){console.warn("Failed to update session with capabilities",h)}return f}}class FC{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class jC{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class kC{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=Zs(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class qC{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class zC{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Hi(new fs(n,er("disableProviderPing")))}}class HC{constructor(e){this.name="near",this.namespace=e.namespace,this.events=er("events"),this.client=er("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ds(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Ki.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ds(e,this.namespace);return typeof n>"u"?void 0:new Hi(new fs(n,er("disableProviderPing")))}}var KC=Object.defineProperty,WC=Object.defineProperties,VC=Object.getOwnPropertyDescriptors,Iw=Object.getOwnPropertySymbols,GC=Object.prototype.hasOwnProperty,YC=Object.prototype.propertyIsEnumerable,Sw=(t,e,r)=>e in t?KC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xl=(t,e)=>{for(var r in e||(e={}))GC.call(e,r)&&Sw(t,r,e[r]);if(Iw)for(var r of Iw(e))YC.call(e,r)&&Sw(t,r,e[r]);return t},w0=(t,e)=>WC(t,VC(e));class y0{constructor(e){this.events=new Cr.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:ai(ml({level:e?.logger||dw})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new y0(e);return await r.initialize(),r}async request(e,r,n){const[i,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Xl({},e),chainId:`${i}:${o}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const o=new Date().getTime();this.request(e,n,i).then(c=>r(null,Wl(o,c))).catch(c=>r(c,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Ut("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:n}=await this.client.authenticate(e);r&&(this.uri=r,this.events.emit("display_uri",r));const i=await n();if(this.session=i.session,this.session){const o=yw(this.session.namespaces);this.namespaces=g0(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(o=>{this.session=o;const c=yw(o.namespaces);this.namespaces=g0(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==nw)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(bi(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await f0.init({logger:this.providerOpts.logger||dw,relayUrl:this.providerOpts.relayUrl||bC,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>uc(r)))];v0("client",this.client),v0("events",this.events),v0("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=MC(r,this.session),i=vw(n),o=g0(this.namespaces,this.optionalNamespaces),c=w0(Xl({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new UC({namespace:c});break;case"solana":this.rpcProviders[r]=new FC({namespace:c});break;case"cosmos":this.rpcProviders[r]=new jC({namespace:c});break;case"polkadot":this.rpcProviders[r]=new $C({namespace:c});break;case"cip34":this.rpcProviders[r]=new kC({namespace:c});break;case"elrond":this.rpcProviders[r]=new qC({namespace:c});break;case"multiversx":this.rpcProviders[r]=new zC({namespace:c});break;case"near":this.rpcProviders[r]=new HC({namespace:c});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&bi(i)&&this.events.emit("accountsChanged",i.map(PC))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=uc(i),l=m0(i)!==m0(o)?`${c}:${m0(o)}`:i;this.onChainChanged(l)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=w0(Xl({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",w0(Xl({},Ut("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ki.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>uc(c)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=uc(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${pw}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${pw}/${e}`)}}const QC=y0,JC="wc",ZC="ethereum_provider",XC=`${JC}@2:${ZC}:`,eD="https://rpc.walletconnect.com/v1/",eu=["eth_sendTransaction","personal_sign"],Cw=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],tu=["chainChanged","accountsChanged"],Dw=["chainChanged","accountsChanged","message","disconnect","connect"];var tD=Object.defineProperty,rD=Object.defineProperties,nD=Object.getOwnPropertyDescriptors,Ow=Object.getOwnPropertySymbols,iD=Object.prototype.hasOwnProperty,sD=Object.prototype.propertyIsEnumerable,Mw=(t,e,r)=>e in t?tD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ia=(t,e)=>{for(var r in e||(e={}))iD.call(e,r)&&Mw(t,r,e[r]);if(Ow)for(var r of Ow(e))sD.call(e,r)&&Mw(t,r,e[r]);return t},b0=(t,e)=>rD(t,nD(e));function ru(t){return Number(t[0].split(":")[1])}function nu(t){return`0x${t.toString(16)}`}function oD(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!bi(e))throw new Error("Invalid chains");const f={chains:e,methods:n||eu,events:o||tu,rpcMap:ia({},e.length?{[ru(e)]:l[ru(e)]}:{})},h=o?.filter(x=>!tu.includes(x)),g=n?.filter(x=>!eu.includes(x));if(!r&&!c&&!i&&!(h!=null&&h.length)&&!(g!=null&&g.length))return{required:e.length?f:void 0};const _=h?.length&&g?.length||!r,E={chains:[...new Set(_?f.chains.concat(r||[]):r)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:Cw))],events:[...new Set(f.events.concat(c!=null&&c.length?c:Dw))],rpcMap:l};return{required:e.length?f:void 0,optional:r.length?E:void 0}}class iu{constructor(){this.events=new Cr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=XC,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new iu;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=oD(this.rpc);try{const i=await new Promise(async(c,l)=>{var f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(b0(ia({namespaces:ia({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{l(new Error(h.message))})});if(!i)return;const o=wg(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:nu(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{const r=await new Promise(async(i,o)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(b0(ia({},e),{chains:this.rpc.chains})).then(l=>{i(l)}).catch(l=>{o(new Error(l.message))})}),n=r.session;if(n){const i=wg(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:nu(this.chainId)})}return r}catch(r){throw this.signer.logger.error(r),r}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{console.log({session_event:"session_event",payload:e});const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{console.log({session_event:"session_event",chainId:e});const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",nu(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{console.log({session_update:"session_event",payload:e}),this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",b0(ia({},Ut("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",nu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||eu:[],f=i.length?e?.events||tu:[],h=e?.optionalMethods||[],g=e?.optionalEvents||[],_=e?.rpcMap||this.buildRpcMap(c,e.projectId),E=e?.qrModalOptions||void 0;return{chains:i?.map(x=>this.formatChainId(x)),optionalChains:o.map(x=>this.formatChainId(x)),methods:l,events:f,optionalMethods:h,optionalEvents:g,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:E,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?ru(this.rpc.chains):ru(this.rpc.optionalChains),this.signer=await QC.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return OD});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(ia({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&bi(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&bi(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${eD}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const aD=iu,cD=Symbol(),Pw=Object.getPrototypeOf,_0=new WeakMap,lD=t=>t&&(_0.has(t)?_0.get(t):Pw(t)===Object.prototype||Pw(t)===Array.prototype),uD=t=>lD(t)&&t[cD]||null,$w=(t,e=!0)=>{_0.set(t,e)},E0=t=>typeof t=="object"&&t!==null,ps=new WeakMap,su=new WeakSet,hD=(t=Object.is,e=(h,g)=>new Proxy(h,g),r=h=>E0(h)&&!su.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,o=(h,g,_=n)=>{const E=i.get(h);if(E?.[0]===g)return E[1];const x=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return $w(x,!0),i.set(h,[g,x]),Reflect.ownKeys(h).forEach(I=>{if(Object.getOwnPropertyDescriptor(x,I))return;const F=Reflect.get(h,I),W={value:F,enumerable:!0,configurable:!0};if(su.has(F))$w(F,!1);else if(F instanceof Promise)delete W.value,W.get=()=>_(F);else if(ps.has(F)){const[Y,B]=ps.get(F);W.value=o(Y,B(),_)}Object.defineProperty(x,I,W)}),Object.preventExtensions(x)},c=new WeakMap,l=[1,1],f=h=>{if(!E0(h))throw new Error("object required");const g=c.get(h);if(g)return g;let _=l[0];const E=new Set,x=(te,ee=++l[0])=>{_!==ee&&(_=ee,E.forEach(ne=>ne(te,ee)))};let I=l[1];const F=(te=++l[1])=>(I!==te&&!E.size&&(I=te,Y.forEach(([ee])=>{const ne=ee[1](te);ne>_&&(_=ne)})),_),W=te=>(ee,ne)=>{const de=[...ee];de[1]=[te,...de[1]],x(de,ne)},Y=new Map,B=(te,ee)=>{if(Y.has(te))throw new Error("prop listener already exists");if(E.size){const ne=ee[3](W(te));Y.set(te,[ee,ne])}else Y.set(te,[ee])},z=te=>{var ee;const ne=Y.get(te);ne&&(Y.delete(te),(ee=ne[1])==null||ee.call(ne))},M=te=>(E.add(te),E.size===1&&Y.forEach(([ne,de],d)=>{if(de)throw new Error("remove already exists");const p=ne[3](W(d));Y.set(d,[ne,p])}),()=>{E.delete(te),E.size===0&&Y.forEach(([ne,de],d)=>{de&&(de(),Y.set(d,[ne]))})}),U=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),m=e(U,{deleteProperty(te,ee){const ne=Reflect.get(te,ee);z(ee);const de=Reflect.deleteProperty(te,ee);return de&&x(["delete",[ee],ne]),de},set(te,ee,ne,de){const d=Reflect.has(te,ee),p=Reflect.get(te,ee,de);if(d&&(t(p,ne)||c.has(ne)&&t(p,c.get(ne))))return!0;z(ee),E0(ne)&&(ne=uD(ne)||ne);let b=ne;if(ne instanceof Promise)ne.then(C=>{ne.status="fulfilled",ne.value=C,x(["resolve",[ee],C])}).catch(C=>{ne.status="rejected",ne.reason=C,x(["reject",[ee],C])});else{!ps.has(ne)&&r(ne)&&(b=f(ne));const C=!su.has(b)&&ps.get(b);C&&B(ee,C)}return Reflect.set(te,ee,b,de),x(["set",[ee],ne,p]),!0}});c.set(h,m);const $=[U,F,o,M];return ps.set(m,$),Reflect.ownKeys(h).forEach(te=>{const ee=Object.getOwnPropertyDescriptor(h,te);"value"in ee&&(m[te]=h[te],delete ee.value,delete ee.writable),Object.defineProperty(U,te,ee)}),m})=>[f,ps,su,t,e,r,n,i,o,c,l],[fD]=hD();function gs(t={}){return fD(t)}function Xs(t,e,r){const n=ps.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const h=c(g=>{if(o.push(g),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,h()}}function dD(t,e){const r=ps.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}const Ar=gs({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),rr={state:Ar,subscribe(t){return Xs(Ar,()=>t(Ar))},push(t,e){t!==Ar.view&&(Ar.view=t,e&&(Ar.data=e),Ar.history.push(t))},reset(t){Ar.view=t,Ar.history=[t]},replace(t){Ar.history.length>1&&(Ar.history[Ar.history.length-1]=t,Ar.view=t)},goBack(){if(Ar.history.length>1){Ar.history.pop();const[t]=Ar.history.slice(-1);Ar.view=t}},setData(t){Ar.data=t}},Ue={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ue.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ue.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ue.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Ue.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ue.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=rr.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},pD=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Br=gs({enabled:pD,userSessionId:"",events:[],connectedWalletId:void 0}),Tw={state:Br,subscribe(t){return Xs(Br.events,()=>t(dD(Br.events[Br.events.length-1])))},initialize(){Br.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Br.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Br.connectedWalletId=t},click(t){if(Br.enabled){const e={type:"CLICK",name:t.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:t};Br.events.push(e)}},track(t){if(Br.enabled){const e={type:"TRACK",name:t.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:t};Br.events.push(e)}},view(t){if(Br.enabled){const e={type:"VIEW",name:t.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:t};Br.events.push(e)}}},xi=gs({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),hr={state:xi,subscribe(t){return Xs(xi,()=>t(xi))},setChains(t){xi.chains=t},setWalletConnectUri(t){xi.walletConnectUri=t},setIsCustomDesktop(t){xi.isCustomDesktop=t},setIsCustomMobile(t){xi.isCustomMobile=t},setIsDataLoaded(t){xi.isDataLoaded=t},setIsUiLoaded(t){xi.isUiLoaded=t},setIsAuth(t){xi.isAuth=t}},ou=gs({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),wn={state:ou,subscribe(t){return Xs(ou,()=>t(ou))},setConfig(t){var e,r;Tw.initialize(),hr.setChains(t.chains),hr.setIsAuth(!!t.enableAuthMode),hr.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),hr.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Ue.setModalVersionInStorage(),Object.assign(ou,t)}};var gD=Object.defineProperty,Nw=Object.getOwnPropertySymbols,mD=Object.prototype.hasOwnProperty,vD=Object.prototype.propertyIsEnumerable,Rw=(t,e,r)=>e in t?gD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wD=(t,e)=>{for(var r in e||(e={}))mD.call(e,r)&&Rw(t,r,e[r]);if(Nw)for(var r of Nw(e))vD.call(e,r)&&Rw(t,r,e[r]);return t};const A0="https://explorer-api.walletconnect.com",x0="wcm",I0="js-2.6.2";async function au(t,e){const r=wD({sdkType:x0,sdkVersion:I0},e),n=new URL(t,A0);return n.searchParams.append("projectId",wn.state.projectId),Object.entries(r).forEach(([i,o])=>{o&&n.searchParams.append(i,String(o))}),(await fetch(n)).json()}const eo={async getDesktopListings(t){return au("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return au("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return au("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return au("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${A0}/w3m/v1/getWalletImage/${t}?projectId=${wn.state.projectId}&sdkType=${x0}&sdkVersion=${I0}`},getAssetImageUrl(t){return`${A0}/w3m/v1/getAssetImage/${t}?projectId=${wn.state.projectId}&sdkType=${x0}&sdkVersion=${I0}`}};var yD=Object.defineProperty,Lw=Object.getOwnPropertySymbols,bD=Object.prototype.hasOwnProperty,_D=Object.prototype.propertyIsEnumerable,Bw=(t,e,r)=>e in t?yD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ED=(t,e)=>{for(var r in e||(e={}))bD.call(e,r)&&Bw(t,r,e[r]);if(Lw)for(var r of Lw(e))_D.call(e,r)&&Bw(t,r,e[r]);return t};const Uw=Ue.isMobile(),Ii=gs({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),an={state:Ii,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=wn.state;if(t==="NONE"||e==="ALL"&&!t)return Ii.recomendedWallets;if(Ue.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await eo.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),f=t.indexOf(c.id);return l-f}),Ii.recomendedWallets=i}else{const{chains:r,isAuth:n}=hr.state,i=r?.join(","),o=Ue.isArray(e),c={page:1,sdks:n?"auth_v1":void 0,entries:Ue.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:o?e.join(","):void 0},{listings:l}=Uw?await eo.getMobileListings(c):await eo.getDesktopListings(c);Ii.recomendedWallets=Object.values(l)}return Ii.recomendedWallets},async getWallets(t){const e=ED({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=wn.state,{recomendedWallets:i}=Ii;if(n==="ALL")return Ii.wallets;i.length?e.excludedIds=i.map(_=>_.id).join(","):Ue.isArray(r)&&(e.excludedIds=r.join(",")),Ue.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),hr.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:f}=Uw?await eo.getMobileListings(e):await eo.getDesktopListings(e),h=Object.values(l),g=c?"search":"wallets";return Ii[g]={listings:[...Ii[g].listings,...h],total:f,page:o??1},{listings:h,total:f}},getWalletImageUrl(t){return eo.getWalletImageUrl(t)},getAssetImageUrl(t){return eo.getAssetImageUrl(t)},resetSearch(){Ii.search={listings:[],total:0,page:1}}},sa=gs({open:!1}),to={state:sa,subscribe(t){return Xs(sa,()=>t(sa))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=hr.state;if(Ue.removeWalletConnectDeepLink(),hr.setWalletConnectUri(t?.uri),hr.setChains(t?.chains),rr.reset("ConnectWallet"),r&&n)sa.open=!0,e();else{const i=setInterval(()=>{const o=hr.state;o.isUiLoaded&&o.isDataLoaded&&(clearInterval(i),sa.open=!0,e())},200)}})},close(){sa.open=!1}};var AD=Object.defineProperty,Fw=Object.getOwnPropertySymbols,xD=Object.prototype.hasOwnProperty,ID=Object.prototype.propertyIsEnumerable,jw=(t,e,r)=>e in t?AD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,SD=(t,e)=>{for(var r in e||(e={}))xD.call(e,r)&&jw(t,r,e[r]);if(Fw)for(var r of Fw(e))ID.call(e,r)&&jw(t,r,e[r]);return t};function CD(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const bc=gs({themeMode:CD()?"dark":"light"}),ms={state:bc,subscribe(t){return Xs(bc,()=>t(bc))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(bc.themeMode=e),r&&(bc.themeVariables=SD({},r))}},ro=gs({open:!1,message:"",variant:"success"}),vs={state:ro,subscribe(t){return Xs(ro,()=>t(ro))},openToast(t,e){ro.open=!0,ro.message=t,ro.variant=e},closeToast(){ro.open=!1}};class DD{constructor(e){this.openModal=to.open,this.closeModal=to.close,this.subscribeModal=to.subscribe,this.setTheme=ms.setThemeConfig,ms.setThemeConfig(e),wn.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return B$});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),hr.setIsUiLoaded(!0)}}}var OD=Object.freeze({__proto__:null,WalletConnectModal:DD});/**
|
|
70
70
|
* @license
|
|
71
71
|
* Copyright 2019 Google LLC
|
|
72
72
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
73
|
-
*/const cu=window,
|
|
73
|
+
*/const cu=window,S0=cu.ShadowRoot&&(cu.ShadyCSS===void 0||cu.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,C0=Symbol(),kw=new WeakMap;class qw{constructor(e,r,n){if(this._$cssResult$=!0,n!==C0)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(S0&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=kw.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&kw.set(r,e))}return e}toString(){return this.cssText}}const MD=t=>new qw(typeof t=="string"?t:t+"",void 0,C0),$t=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,o)=>n+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new qw(r,t,C0)},PD=(t,e)=>{S0?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=cu.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},zw=S0?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return MD(r)})(t):t;/**
|
|
74
74
|
* @license
|
|
75
75
|
* Copyright 2017 Google LLC
|
|
76
76
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
77
|
-
*/var
|
|
77
|
+
*/var D0;const lu=window,Hw=lu.trustedTypes,$D=Hw?Hw.emptyScript:"",Kw=lu.reactiveElementPolyfillSupport,O0={toAttribute(t,e){switch(e){case Boolean:t=t?$D:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Ww=(t,e)=>e!==t&&(e==e||t==t),M0={attribute:!0,type:String,converter:O0,reflect:!1,hasChanged:Ww},P0="finalized";class oa extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=M0){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||M0}static finalize(){if(this.hasOwnProperty(P0))return!1;this[P0]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(zw(i))}else e!==void 0&&r.push(zw(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return PD(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=M0){var i;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:O0).toAttribute(r,n.type);this._$El=e,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){const c=i.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:O0;this._$El=o,this[o]=l.fromAttribute(r,c.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ww)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}oa[P0]=!0,oa.elementProperties=new Map,oa.elementStyles=[],oa.shadowRootOptions={mode:"open"},Kw?.({ReactiveElement:oa}),((D0=lu.reactiveElementVersions)!==null&&D0!==void 0?D0:lu.reactiveElementVersions=[]).push("1.6.3");/**
|
|
78
78
|
* @license
|
|
79
79
|
* Copyright 2017 Google LLC
|
|
80
80
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
-
*/var
|
|
82
|
-
\f\r]`,Ac=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qw=/-->/g,Jw=/>/g,io=RegExp(`>|${
|
|
83
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Zw=/'/g,Xw=/"/g,e2=/^(?:script|style|textarea|title)$/i,t2=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),ve=t2(1),ar=t2(2),so=Symbol.for("lit-noChange"),wr=Symbol.for("lit-nothing"),r2=new WeakMap,oo=no.createTreeWalker(no,129,null,!1);function n2(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vw!==void 0?Vw.createHTML(e):e}const
|
|
81
|
+
*/var $0;const uu=window,aa=uu.trustedTypes,Vw=aa?aa.createPolicy("lit-html",{createHTML:t=>t}):void 0,T0="$lit$",ws=`lit$${(Math.random()+"").slice(9)}$`,Gw="?"+ws,TD=`<${Gw}>`,no=document,_c=()=>no.createComment(""),Ec=t=>t===null||typeof t!="object"&&typeof t!="function",Yw=Array.isArray,ND=t=>Yw(t)||typeof t?.[Symbol.iterator]=="function",N0=`[
|
|
82
|
+
\f\r]`,Ac=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qw=/-->/g,Jw=/>/g,io=RegExp(`>|${N0}(?:([^\\s"'>=/]+)(${N0}*=${N0}*(?:[^
|
|
83
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Zw=/'/g,Xw=/"/g,e2=/^(?:script|style|textarea|title)$/i,t2=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),ve=t2(1),ar=t2(2),so=Symbol.for("lit-noChange"),wr=Symbol.for("lit-nothing"),r2=new WeakMap,oo=no.createTreeWalker(no,129,null,!1);function n2(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vw!==void 0?Vw.createHTML(e):e}const RD=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=Ac;for(let l=0;l<r;l++){const f=t[l];let h,g,_=-1,E=0;for(;E<f.length&&(c.lastIndex=E,g=c.exec(f),g!==null);)E=c.lastIndex,c===Ac?g[1]==="!--"?c=Qw:g[1]!==void 0?c=Jw:g[2]!==void 0?(e2.test(g[2])&&(i=RegExp("</"+g[2],"g")),c=io):g[3]!==void 0&&(c=io):c===io?g[0]===">"?(c=i??Ac,_=-1):g[1]===void 0?_=-2:(_=c.lastIndex-g[2].length,h=g[1],c=g[3]===void 0?io:g[3]==='"'?Xw:Zw):c===Xw||c===Zw?c=io:c===Qw||c===Jw?c=Ac:(c=io,i=void 0);const x=c===io&&t[l+1].startsWith("/>")?" ":"";o+=c===Ac?f+TD:_>=0?(n.push(h),f.slice(0,_)+T0+f.slice(_)+ws+x):f+ws+(_===-2?(n.push(void 0),l):x)}return[n2(t,o+(t[r]||"<?>")+(e===2?"</svg>":"")),n]};class xc{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,f=this.parts,[h,g]=RD(e,r);if(this.el=xc.createElement(h,n),oo.currentNode=this.el.content,r===2){const _=this.el.content,E=_.firstChild;E.remove(),_.append(...E.childNodes)}for(;(i=oo.nextNode())!==null&&f.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const _=[];for(const E of i.getAttributeNames())if(E.endsWith(T0)||E.startsWith(ws)){const x=g[c++];if(_.push(E),x!==void 0){const I=i.getAttribute(x.toLowerCase()+T0).split(ws),F=/([.?@])?(.*)/.exec(x);f.push({type:1,index:o,name:F[2],strings:I,ctor:F[1]==="."?BD:F[1]==="?"?FD:F[1]==="@"?jD:hu})}else f.push({type:6,index:o})}for(const E of _)i.removeAttribute(E)}if(e2.test(i.tagName)){const _=i.textContent.split(ws),E=_.length-1;if(E>0){i.textContent=aa?aa.emptyScript:"";for(let x=0;x<E;x++)i.append(_[x],_c()),oo.nextNode(),f.push({type:2,index:++o});i.append(_[E],_c())}}}else if(i.nodeType===8)if(i.data===Gw)f.push({type:2,index:o});else{let _=-1;for(;(_=i.data.indexOf(ws,_+1))!==-1;)f.push({type:7,index:o}),_+=ws.length-1}o++}}static createElement(e,r){const n=no.createElement("template");return n.innerHTML=e,n}}function ca(t,e,r=t,n){var i,o,c,l;if(e===so)return e;let f=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const h=Ec(e)?void 0:e._$litDirective$;return f?.constructor!==h&&((o=f?._$AO)===null||o===void 0||o.call(f,!1),h===void 0?f=void 0:(f=new h(t),f._$AT(t,r,n)),n!==void 0?((c=(l=r)._$Co)!==null&&c!==void 0?c:l._$Co=[])[n]=f:r._$Cl=f),f!==void 0&&(e=ca(t,f._$AS(t,e.values),f,n)),e}class LD{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:no).importNode(n,!0);oo.currentNode=o;let c=oo.nextNode(),l=0,f=0,h=i[0];for(;h!==void 0;){if(l===h.index){let g;h.type===2?g=new Ic(c,c.nextSibling,this,e):h.type===1?g=new h.ctor(c,h.name,h.strings,this,e):h.type===6&&(g=new kD(c,this,e)),this._$AV.push(g),h=i[++f]}l!==h?.index&&(c=oo.nextNode(),l++)}return oo.currentNode=no,o}v(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Ic{constructor(e,r,n,i){var o;this.type=2,this._$AH=wr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=ca(this,e,r),Ec(e)?e===wr||e==null||e===""?(this._$AH!==wr&&this._$AR(),this._$AH=wr):e!==this._$AH&&e!==so&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):ND(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==wr&&Ec(this._$AH)?this._$AA.nextSibling.data=e:this.$(no.createTextNode(e)),this._$AH=e}g(e){var r;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=xc.createElement(n2(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.v(n);else{const c=new LD(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=r2.get(e.strings);return r===void 0&&r2.set(e.strings,r=new xc(e)),r}T(e){Yw(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of e)i===r.length?r.push(n=new Ic(this.k(_c()),this.k(_c()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class hu{constructor(e,r,n,i,o){this.type=1,this._$AH=wr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=wr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const o=this.strings;let c=!1;if(o===void 0)e=ca(this,e,r,0),c=!Ec(e)||e!==this._$AH&&e!==so,c&&(this._$AH=e);else{const l=e;let f,h;for(e=o[0],f=0;f<o.length-1;f++)h=ca(this,l[n+f],r,f),h===so&&(h=this._$AH[f]),c||(c=!Ec(h)||h!==this._$AH[f]),h===wr?e=wr:e!==wr&&(e+=(h??"")+o[f+1]),this._$AH[f]=h}c&&!i&&this.j(e)}j(e){e===wr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class BD extends hu{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===wr?void 0:e}}const UD=aa?aa.emptyScript:"";class FD extends hu{constructor(){super(...arguments),this.type=4}j(e){e&&e!==wr?this.element.setAttribute(this.name,UD):this.element.removeAttribute(this.name)}}class jD extends hu{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=ca(this,e,r,0))!==null&&n!==void 0?n:wr)===so)return;const i=this._$AH,o=e===wr&&i!==wr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==wr&&(i===wr||o);o&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class kD{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ca(this,e)}}const i2=uu.litHtmlPolyfillSupport;i2?.(xc,Ic),(($0=uu.litHtmlVersions)!==null&&$0!==void 0?$0:uu.litHtmlVersions=[]).push("2.8.0");const qD=(t,e,r)=>{var n,i;const o=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let c=o._$litPart$;if(c===void 0){const l=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=c=new Ic(e.insertBefore(_c(),l),l,void 0,r??{})}return c._$AI(t),c};/**
|
|
84
84
|
* @license
|
|
85
85
|
* Copyright 2017 Google LLC
|
|
86
86
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
87
|
-
*/var L0
|
|
87
|
+
*/var R0,L0;class mt extends oa{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qD(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return so}}mt.finalized=!0,mt._$litElement$=!0,(R0=globalThis.litElementHydrateSupport)===null||R0===void 0||R0.call(globalThis,{LitElement:mt});const s2=globalThis.litElementPolyfillSupport;s2?.({LitElement:mt}),((L0=globalThis.litElementVersions)!==null&&L0!==void 0?L0:globalThis.litElementVersions=[]).push("3.3.3");/**
|
|
88
88
|
* @license
|
|
89
89
|
* Copyright 2017 Google LLC
|
|
90
90
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
91
|
-
*/const
|
|
91
|
+
*/const Dt=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{const{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(c){customElements.define(r,c)}}})(t,e);/**
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2017 Google LLC
|
|
94
94
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
-
*/const
|
|
95
|
+
*/const zD=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},HD=(t,e,r)=>{e.constructor.createProperty(r,t)};function ht(t){return(e,r)=>r!==void 0?HD(t,e,r):zD(t,e)}/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2017 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -100,24 +100,24 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2021 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/var
|
|
103
|
+
*/var B0;((B0=window.HTMLSlotElement)===null||B0===void 0?void 0:B0.prototype.assignedElements)!=null;/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2017 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const
|
|
107
|
+
*/const KD={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},WD=t=>(...e)=>({_$litDirective$:t,values:e});class VD{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright 2018 Google LLC
|
|
110
110
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
111
|
-
*/const Wi=KC(class extends WC{constructor(t){var e;if(super(t),t.type!==HC.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return so}});function VC(t,e){t.indexOf(e)===-1&&t.push(e)}const o2=(t,e,r)=>Math.min(Math.max(r,t),e),Tn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},fu=t=>typeof t=="number",ua=t=>Array.isArray(t)&&!fu(t[0]),GC=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function YC(t,e){return ua(t)?t[GC(0,t.length,e)]:t}const a2=(t,e,r)=>-r*t+r*e+t,c2=()=>{},ys=t=>t,F0=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function l2(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=F0(0,e,n);t.push(a2(r,1,i))}}function QC(t){const e=[0];return l2(e,t-1),e}function JC(t,e=QC(t.length),r=ys){const n=t.length,i=n-e.length;return i>0&&l2(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=o2(0,1,F0(e[c],e[c+1],o));return l=YC(r,c)(l),a2(t[c],t[c+1],l)}}const u2=t=>Array.isArray(t)&&fu(t[0]),j0=t=>typeof t=="object"&&!!t.createAnimation,ao=t=>typeof t=="function",ZC=t=>typeof t=="string",Ic={ms:t=>t*1e3,s:t=>t/1e3},h2=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,XC=1e-7,eO=12;function tO(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=h2(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>XC&&++l<eO);return c}function Dc(t,e,r,n){if(t===e&&r===n)return ys;const i=o=>tO(o,0,1,t,r);return o=>o===0||o===1?o:h2(i(o),e,n)}const rO=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return o2(0,1,i/t)},f2={ease:Dc(.25,.1,.25,1),"ease-in":Dc(.42,0,1,1),"ease-in-out":Dc(.42,0,.58,1),"ease-out":Dc(0,0,.58,1)},nO=/\((.*?)\)/;function d2(t){if(ao(t))return t;if(u2(t))return Dc(...t);if(f2[t])return f2[t];if(t.startsWith("steps")){const e=nO.exec(t);if(e){const r=e[1].split(",");return rO(parseFloat(r[0]),r[1].trim())}}return ys}class p2{constructor(e,r=[0,1],{easing:n,duration:i=Tn.duration,delay:o=Tn.delay,endDelay:c=Tn.endDelay,repeat:l=Tn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=ys,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((_,E)=>{this.resolve=_,this.reject=E}),n=n||Tn.easing,j0(n)){const _=n.createAnimation(r);n=_.easing,r=_.keyframes||r,i=_.duration||i}this.repeat=l,this.easing=ua(n)?ys:d2(n),this.updateDuration(i);const g=JC(r,f,ua(n)?n.map(d2):ys);this.tick=_=>{var E;o=o;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(_-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const I=x/this.duration;let k=Math.floor(I),W=I%1;!W&&I>=1&&(W=1),W===1&&k--;const Y=k%2;(h==="reverse"||h==="alternate"&&Y||h==="alternate-reverse"&&!Y)&&(W=1-W);const B=x>=this.totalDuration?1:Math.min(W,1),z=g(this.easing(B));e(z),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(E=this.resolve)===null||E===void 0||E.call(this,z)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var k0=function(){};process.env.NODE_ENV!=="production"&&(k0=function(t,e){if(!t)throw new Error(e)});class iO{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const q0=new WeakMap;function g2(t){return q0.has(t)||q0.set(t,{transforms:[],values:new Map}),q0.get(t)}function sO(t,e){return t.has(e)||t.set(e,new iO),t.get(e)}const oO=["","X","Y","Z"],aO=["translate","scale","rotate","skew"],du={x:"translateX",y:"translateY",z:"translateZ"},m2={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},cO={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:m2,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ys},skew:m2},Cc=new Map,z0=t=>`--motion-${t}`,pu=["x","y","z"];aO.forEach(t=>{oO.forEach(e=>{pu.push(t+e),Cc.set(z0(t+e),cO[t])})});const lO=(t,e)=>pu.indexOf(t)-pu.indexOf(e),uO=new Set(pu),v2=t=>uO.has(t),hO=(t,e)=>{du[e]&&(e=du[e]);const{transforms:r}=g2(t);VC(r,e),t.style.transform=fO(r)},fO=t=>t.sort(lO).reduce(dO,"").trim(),dO=(t,e)=>`${t} ${e}(var(${z0(e)}))`,H0=t=>t.startsWith("--"),w2=new Set;function pO(t){if(!w2.has(t)){w2.add(t);try{const{syntax:e,initialValue:r}=Cc.has(t)?Cc.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const K0=(t,e)=>document.createElement("div").animate(t,e),y2={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{K0({opacity:[1]})}catch{return!1}return!0},finished:()=>!!K0({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{K0({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},W0={},ha={};for(const t in y2)ha[t]=()=>(W0[t]===void 0&&(W0[t]=y2[t]()),W0[t]);const gO=.015,mO=(t,e)=>{let r="";const n=Math.round(e/gO);for(let i=0;i<n;i++)r+=t(F0(0,n-1,i))+", ";return r.substring(0,r.length-2)},b2=(t,e)=>ao(t)?ha.linearEasing()?`linear(${mO(t,e)})`:Tn.easing:u2(t)?vO(t):t,vO=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function wO(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const yO=t=>Array.isArray(t)?t:[t];function V0(t){return du[t]&&(t=du[t]),v2(t)?z0(t):t}const gu={get:(t,e)=>{e=V0(e);let r=H0(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=Cc.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=V0(e),H0(e)?t.style.setProperty(e,r):t.style[e]=r}};function _2(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function bO(t,e){var r;let n=e?.toDefaultUnit||ys;const i=t[t.length-1];if(ZC(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function _O(){return window.__MOTION_DEV_TOOLS_RECORD}function EO(t,e,r,n={},i){const o=_O(),c=n.record!==!1&&o;let l,{duration:f=Tn.duration,delay:h=Tn.delay,endDelay:g=Tn.endDelay,repeat:_=Tn.repeat,easing:E=Tn.easing,persist:x=!1,direction:I,offset:k,allowWebkitAcceleration:W=!1}=n;const Y=g2(t),B=v2(e);let z=ha.waapi();B&&hO(t,e);const M=V0(e),U=sO(Y.values,M),F=Cc.get(M);return _2(U.animation,!(j0(E)&&U.generator)&&n.record!==!1),()=>{const m=()=>{var ee,ne;return(ne=(ee=gu.get(t,M))!==null&&ee!==void 0?ee:F?.initialValue)!==null&&ne!==void 0?ne:0};let $=wO(yO(r),m);const te=bO($,F);if(j0(E)){const ee=E.createAnimation($,e!=="opacity",m,M,U);E=ee.easing,$=ee.keyframes||$,f=ee.duration||f}if(H0(M)&&(ha.cssRegisterProperty()?pO(M):z=!1),B&&!ha.linearEasing()&&(ao(E)||ua(E)&&E.some(ao))&&(z=!1),z){F&&($=$.map(de=>fu(de)?F.toDefaultUnit(de):de)),$.length===1&&(!ha.partialKeyframes()||c)&&$.unshift(m());const ee={delay:Ic.ms(h),duration:Ic.ms(f),endDelay:Ic.ms(g),easing:ua(E)?void 0:b2(E,f),direction:I,iterations:_+1,fill:"both"};l=t.animate({[M]:$,offset:k,easing:ua(E)?E.map(de=>b2(de,f)):void 0},ee),l.finished||(l.finished=new Promise((de,d)=>{l.onfinish=de,l.oncancel=d}));const ne=$[$.length-1];l.finished.then(()=>{x||(gu.set(t,M,ne),l.cancel())}).catch(c2),W||(l.playbackRate=1.000001)}else if(i&&B)$=$.map(ee=>typeof ee=="string"?parseFloat(ee):ee),$.length===1&&$.unshift(parseFloat(m())),l=new i(ee=>{gu.set(t,M,te?te(ee):ee)},$,Object.assign(Object.assign({},n),{duration:f,easing:E}));else{const ee=$[$.length-1];gu.set(t,M,F&&fu(ee)?F.toDefaultUnit(ee):ee)}return c&&o(t,e,$,{duration:f,delay:h,easing:E,repeat:_,offset:k},"motion-one"),U.setAnimation(l),l}}const AO=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function E2(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const xO=t=>t(),A2=(t,e,r=Tn.duration)=>new Proxy({animations:t.map(xO).filter(Boolean),duration:r,options:e},IO),SO=t=>t.animations[0],IO={get:(t,e)=>{const r=SO(t);switch(e){case"duration":return t.duration;case"currentTime":return Ic.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(DO)).catch(c2)),t.finished;case"stop":return()=>{t.animations.forEach(n=>_2(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Ic.ms(r);case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},DO=t=>t.finished;function CO(t,e,r){return ao(t)?t(e,r):t}function OO(t){return function(r,n,i={}){r=E2(r);const o=r.length;k0(!!o,"No valid element provided."),k0(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const f=r[l];for(const h in n){const g=AO(i,h);g.delay=CO(g.delay,l,o);const _=EO(f,h,n[h],g,t);c.push(_)}}return A2(c,i,i.duration)}}const MO=OO(p2);function PO(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}typeof SuppressedError=="function"&&SuppressedError;const $O={any:0,all:1};function TO(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=E2(t),c=new WeakMap,l=h=>{h.forEach(g=>{const _=c.get(g.target);if(g.isIntersecting!==!!_)if(g.isIntersecting){const E=e(g);ao(E)?c.set(g.target,E):f.unobserve(g.target)}else _&&(_(g),c.delete(g.target))})},f=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:$O[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function G0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function x2(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const NO={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=PO(n,["once"]);return TO(t,c=>{if(e(),x2(t,"viewenter",c),!i)return l=>{r(),x2(t,"viewleave",l)}},o)}},S2=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),G0(t,e,n))};[...Object.keys({inView:NO,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=S2(t,"hoverstart",e),i=S2(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),G0(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),G0(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function RO(t,e={}){return A2([()=>{const r=new p2(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function co(t,e,r){return(ao(t)?RO:MO)(t,e,r)}/**
|
|
111
|
+
*/const Wi=WD(class extends VD{constructor(t){var e;if(super(t),t.type!==KD.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return so}});function GD(t,e){t.indexOf(e)===-1&&t.push(e)}const o2=(t,e,r)=>Math.min(Math.max(r,t),e),Tn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},fu=t=>typeof t=="number",la=t=>Array.isArray(t)&&!fu(t[0]),YD=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function QD(t,e){return la(t)?t[YD(0,t.length,e)]:t}const a2=(t,e,r)=>-r*t+r*e+t,c2=()=>{},ys=t=>t,U0=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function l2(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=U0(0,e,n);t.push(a2(r,1,i))}}function JD(t){const e=[0];return l2(e,t-1),e}function ZD(t,e=JD(t.length),r=ys){const n=t.length,i=n-e.length;return i>0&&l2(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=o2(0,1,U0(e[c],e[c+1],o));return l=QD(r,c)(l),a2(t[c],t[c+1],l)}}const u2=t=>Array.isArray(t)&&fu(t[0]),F0=t=>typeof t=="object"&&!!t.createAnimation,ao=t=>typeof t=="function",XD=t=>typeof t=="string",Sc={ms:t=>t*1e3,s:t=>t/1e3},h2=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,eO=1e-7,tO=12;function rO(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=h2(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>eO&&++l<tO);return c}function Cc(t,e,r,n){if(t===e&&r===n)return ys;const i=o=>rO(o,0,1,t,r);return o=>o===0||o===1?o:h2(i(o),e,n)}const nO=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return o2(0,1,i/t)},f2={ease:Cc(.25,.1,.25,1),"ease-in":Cc(.42,0,1,1),"ease-in-out":Cc(.42,0,.58,1),"ease-out":Cc(0,0,.58,1)},iO=/\((.*?)\)/;function d2(t){if(ao(t))return t;if(u2(t))return Cc(...t);if(f2[t])return f2[t];if(t.startsWith("steps")){const e=iO.exec(t);if(e){const r=e[1].split(",");return nO(parseFloat(r[0]),r[1].trim())}}return ys}class p2{constructor(e,r=[0,1],{easing:n,duration:i=Tn.duration,delay:o=Tn.delay,endDelay:c=Tn.endDelay,repeat:l=Tn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=ys,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((_,E)=>{this.resolve=_,this.reject=E}),n=n||Tn.easing,F0(n)){const _=n.createAnimation(r);n=_.easing,r=_.keyframes||r,i=_.duration||i}this.repeat=l,this.easing=la(n)?ys:d2(n),this.updateDuration(i);const g=ZD(r,f,la(n)?n.map(d2):ys);this.tick=_=>{var E;o=o;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(_-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const I=x/this.duration;let F=Math.floor(I),W=I%1;!W&&I>=1&&(W=1),W===1&&F--;const Y=F%2;(h==="reverse"||h==="alternate"&&Y||h==="alternate-reverse"&&!Y)&&(W=1-W);const B=x>=this.totalDuration?1:Math.min(W,1),z=g(this.easing(B));e(z),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(E=this.resolve)===null||E===void 0||E.call(this,z)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var j0=function(){};process.env.NODE_ENV!=="production"&&(j0=function(t,e){if(!t)throw new Error(e)});class sO{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const k0=new WeakMap;function g2(t){return k0.has(t)||k0.set(t,{transforms:[],values:new Map}),k0.get(t)}function oO(t,e){return t.has(e)||t.set(e,new sO),t.get(e)}const aO=["","X","Y","Z"],cO=["translate","scale","rotate","skew"],du={x:"translateX",y:"translateY",z:"translateZ"},m2={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},lO={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:m2,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ys},skew:m2},Dc=new Map,q0=t=>`--motion-${t}`,pu=["x","y","z"];cO.forEach(t=>{aO.forEach(e=>{pu.push(t+e),Dc.set(q0(t+e),lO[t])})});const uO=(t,e)=>pu.indexOf(t)-pu.indexOf(e),hO=new Set(pu),v2=t=>hO.has(t),fO=(t,e)=>{du[e]&&(e=du[e]);const{transforms:r}=g2(t);GD(r,e),t.style.transform=dO(r)},dO=t=>t.sort(uO).reduce(pO,"").trim(),pO=(t,e)=>`${t} ${e}(var(${q0(e)}))`,z0=t=>t.startsWith("--"),w2=new Set;function gO(t){if(!w2.has(t)){w2.add(t);try{const{syntax:e,initialValue:r}=Dc.has(t)?Dc.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const H0=(t,e)=>document.createElement("div").animate(t,e),y2={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{H0({opacity:[1]})}catch{return!1}return!0},finished:()=>!!H0({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{H0({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},K0={},ua={};for(const t in y2)ua[t]=()=>(K0[t]===void 0&&(K0[t]=y2[t]()),K0[t]);const mO=.015,vO=(t,e)=>{let r="";const n=Math.round(e/mO);for(let i=0;i<n;i++)r+=t(U0(0,n-1,i))+", ";return r.substring(0,r.length-2)},b2=(t,e)=>ao(t)?ua.linearEasing()?`linear(${vO(t,e)})`:Tn.easing:u2(t)?wO(t):t,wO=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function yO(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const bO=t=>Array.isArray(t)?t:[t];function W0(t){return du[t]&&(t=du[t]),v2(t)?q0(t):t}const gu={get:(t,e)=>{e=W0(e);let r=z0(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=Dc.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=W0(e),z0(e)?t.style.setProperty(e,r):t.style[e]=r}};function _2(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function _O(t,e){var r;let n=e?.toDefaultUnit||ys;const i=t[t.length-1];if(XD(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function EO(){return window.__MOTION_DEV_TOOLS_RECORD}function AO(t,e,r,n={},i){const o=EO(),c=n.record!==!1&&o;let l,{duration:f=Tn.duration,delay:h=Tn.delay,endDelay:g=Tn.endDelay,repeat:_=Tn.repeat,easing:E=Tn.easing,persist:x=!1,direction:I,offset:F,allowWebkitAcceleration:W=!1}=n;const Y=g2(t),B=v2(e);let z=ua.waapi();B&&fO(t,e);const M=W0(e),U=oO(Y.values,M),j=Dc.get(M);return _2(U.animation,!(F0(E)&&U.generator)&&n.record!==!1),()=>{const m=()=>{var ee,ne;return(ne=(ee=gu.get(t,M))!==null&&ee!==void 0?ee:j?.initialValue)!==null&&ne!==void 0?ne:0};let $=yO(bO(r),m);const te=_O($,j);if(F0(E)){const ee=E.createAnimation($,e!=="opacity",m,M,U);E=ee.easing,$=ee.keyframes||$,f=ee.duration||f}if(z0(M)&&(ua.cssRegisterProperty()?gO(M):z=!1),B&&!ua.linearEasing()&&(ao(E)||la(E)&&E.some(ao))&&(z=!1),z){j&&($=$.map(de=>fu(de)?j.toDefaultUnit(de):de)),$.length===1&&(!ua.partialKeyframes()||c)&&$.unshift(m());const ee={delay:Sc.ms(h),duration:Sc.ms(f),endDelay:Sc.ms(g),easing:la(E)?void 0:b2(E,f),direction:I,iterations:_+1,fill:"both"};l=t.animate({[M]:$,offset:F,easing:la(E)?E.map(de=>b2(de,f)):void 0},ee),l.finished||(l.finished=new Promise((de,d)=>{l.onfinish=de,l.oncancel=d}));const ne=$[$.length-1];l.finished.then(()=>{x||(gu.set(t,M,ne),l.cancel())}).catch(c2),W||(l.playbackRate=1.000001)}else if(i&&B)$=$.map(ee=>typeof ee=="string"?parseFloat(ee):ee),$.length===1&&$.unshift(parseFloat(m())),l=new i(ee=>{gu.set(t,M,te?te(ee):ee)},$,Object.assign(Object.assign({},n),{duration:f,easing:E}));else{const ee=$[$.length-1];gu.set(t,M,j&&fu(ee)?j.toDefaultUnit(ee):ee)}return c&&o(t,e,$,{duration:f,delay:h,easing:E,repeat:_,offset:F},"motion-one"),U.setAnimation(l),l}}const xO=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function E2(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const IO=t=>t(),A2=(t,e,r=Tn.duration)=>new Proxy({animations:t.map(IO).filter(Boolean),duration:r,options:e},CO),SO=t=>t.animations[0],CO={get:(t,e)=>{const r=SO(t);switch(e){case"duration":return t.duration;case"currentTime":return Sc.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(DO)).catch(c2)),t.finished;case"stop":return()=>{t.animations.forEach(n=>_2(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Sc.ms(r);case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},DO=t=>t.finished;function OO(t,e,r){return ao(t)?t(e,r):t}function MO(t){return function(r,n,i={}){r=E2(r);const o=r.length;j0(!!o,"No valid element provided."),j0(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const f=r[l];for(const h in n){const g=xO(i,h);g.delay=OO(g.delay,l,o);const _=AO(f,h,n[h],g,t);c.push(_)}}return A2(c,i,i.duration)}}const PO=MO(p2);function $O(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}typeof SuppressedError=="function"&&SuppressedError;const TO={any:0,all:1};function NO(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=E2(t),c=new WeakMap,l=h=>{h.forEach(g=>{const _=c.get(g.target);if(g.isIntersecting!==!!_)if(g.isIntersecting){const E=e(g);ao(E)?c.set(g.target,E):f.unobserve(g.target)}else _&&(_(g),c.delete(g.target))})},f=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:TO[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function V0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function x2(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const RO={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=$O(n,["once"]);return NO(t,c=>{if(e(),x2(t,"viewenter",c),!i)return l=>{r(),x2(t,"viewleave",l)}},o)}},I2=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),V0(t,e,n))};[...Object.keys({inView:RO,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=I2(t,"hoverstart",e),i=I2(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),V0(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),V0(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function LO(t,e={}){return A2([()=>{const r=new p2(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function co(t,e,r){return(ao(t)?LO:PO)(t,e,r)}/**
|
|
112
112
|
* @license
|
|
113
113
|
* Copyright 2018 Google LLC
|
|
114
114
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
115
|
-
*/const Wr=t=>t??wr;var Oc={},
|
|
116
|
-
]))+`;
|
|
117
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var
|
|
118
|
-
Suggested mode is: `+e.toString(M));switch(z===e.KANJI&&!l.isKanjiModeEnabled()&&(z=e.BYTE),z){case e.NUMERIC:return new r(Y);case e.ALPHANUMERIC:return new n(Y);case e.KANJI:return new o(Y);case e.BYTE:return new i(Y)}}t.fromArray=function(B){return B.reduce(function(z,M){return typeof M=="string"?z.push(W(M,null)):M.data&&z.push(W(M.data,M.mode)),z},[])},t.fromString=function(B,z){const M=_(B,l.isKanjiModeEnabled()),U=I(M),F
|
|
115
|
+
*/const Wr=t=>t??wr;var Oc={},BO=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},S2={},yn={};let G0;const UO=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];yn.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},yn.getSymbolTotalCodewords=function(e){return UO[e]},yn.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},yn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');G0=e},yn.isKanjiModeEnabled=function(){return typeof G0<"u"},yn.toSJIS=function(e){return G0(e)};var mu={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(mu);function C2(){this.buffer=[],this.length=0}C2.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const 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 FO=C2;function Mc(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Mc.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},Mc.prototype.get=function(t,e){return this.data[t*this.size+e]},Mc.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},Mc.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var jO=Mc,D2={};(function(t){const e=yn.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let f=1;f<i-1;f++)l[f]=l[f-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let f=0;f<c;f++)l===0&&f===0||l===0&&f===c-1||l===c-1&&f===0||i.push([o[l],o[f]]);return i}})(D2);var O2={};const kO=yn.getSymbolSize,M2=7;O2.getPositions=function(e){const r=kO(e);return[[0,0],[r-M2,0],[0,r-M2]]};var P2={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let c=0,l=0,f=0,h=null,g=null;for(let _=0;_<o;_++){l=f=0,h=g=null;for(let E=0;E<o;E++){let x=i.get(_,E);x===h?l++:(l>=5&&(c+=e.N1+(l-5)),h=x,l=1),x=i.get(E,_),x===g?f++:(f>=5&&(c+=e.N1+(f-5)),g=x,f=1)}l>=5&&(c+=e.N1+(l-5)),f>=5&&(c+=e.N1+(f-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let f=0;f<o-1;f++){const h=i.get(l,f)+i.get(l,f+1)+i.get(l+1,f)+i.get(l+1,f+1);(h===4||h===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,f=0;for(let h=0;h<o;h++){l=f=0;for(let g=0;g<o;g++)l=l<<1&2047|i.get(h,g),g>=10&&(l===1488||l===93)&&c++,f=f<<1&2047|i.get(g,h),g>=10&&(f===1488||f===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let f=0;f<c;f++)o+=i.data[f];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let f=0;f<c;f++)o.isReserved(f,l)||o.xor(f,l,r(i,f,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,f=1/0;for(let h=0;h<c;h++){o(h),t.applyMask(h,i);const g=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(h,i),g<f&&(f=g,l=h)}return l}})(P2);var vu={};const bs=mu,wu=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],yu=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];vu.getBlocksCount=function(e,r){switch(r){case bs.L:return wu[(e-1)*4+0];case bs.M:return wu[(e-1)*4+1];case bs.Q:return wu[(e-1)*4+2];case bs.H:return wu[(e-1)*4+3];default:return}},vu.getTotalCodewordsCount=function(e,r){switch(r){case bs.L:return yu[(e-1)*4+0];case bs.M:return yu[(e-1)*4+1];case bs.Q:return yu[(e-1)*4+2];case bs.H:return yu[(e-1)*4+3];default:return}};var $2={},bu={};const Pc=new Uint8Array(512),_u=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Pc[r]=e,_u[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Pc[r]=Pc[r-255]})(),bu.log=function(e){if(e<1)throw new Error("log("+e+")");return _u[e]},bu.exp=function(e){return Pc[e]},bu.mul=function(e,r){return e===0||r===0?0:Pc[_u[e]+_u[r]]},function(t){const e=bu;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let f=0;f<i.length;f++)o[f]^=e.mul(i[f],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}($2);const T2=$2;function Y0(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Y0.prototype.initialize=function(e){this.degree=e,this.genPoly=T2.generateECPolynomial(this.degree)},Y0.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=T2.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var qO=Y0,N2={},_s={},Q0={};Q0.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Si={};const R2="[0-9]+",zO="[A-Z $%*+\\-./:]+";let $c="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";$c=$c.replace(/u/g,"\\u");const HO="(?:(?![A-Z0-9 $%*+\\-./:]|"+$c+`)(?:.|[\r
|
|
116
|
+
]))+`;Si.KANJI=new RegExp($c,"g"),Si.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Si.BYTE=new RegExp(HO,"g"),Si.NUMERIC=new RegExp(R2,"g"),Si.ALPHANUMERIC=new RegExp(zO,"g");const KO=new RegExp("^"+$c+"$"),WO=new RegExp("^"+R2+"$"),VO=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Si.testKanji=function(e){return KO.test(e)},Si.testNumeric=function(e){return WO.test(e)},Si.testAlphanumeric=function(e){return VO.test(e)},function(t){const e=Q0,r=Si;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,c){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?o.ccBits[0]:c<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,c){if(t.isValid(o))return o;try{return n(o)}catch{return c}}}(_s),function(t){const e=yn,r=vu,n=mu,i=_s,o=Q0,c=7973,l=e.getBCHDigit(c);function f(E,x,I){for(let F=1;F<=40;F++)if(x<=t.getCapacity(F,I,E))return F}function h(E,x){return i.getCharCountIndicator(E,x)+4}function g(E,x){let I=0;return E.forEach(function(F){const W=h(F.mode,x);I+=W+F.getBitsLength()}),I}function _(E,x){for(let I=1;I<=40;I++)if(g(E,I)<=t.getCapacity(I,x,i.MIXED))return I}t.from=function(x,I){return o.isValid(x)?parseInt(x,10):I},t.getCapacity=function(x,I,F){if(!o.isValid(x))throw new Error("Invalid QR Code version");typeof F>"u"&&(F=i.BYTE);const W=e.getSymbolTotalCodewords(x),Y=r.getTotalCodewordsCount(x,I),B=(W-Y)*8;if(F===i.MIXED)return B;const z=B-h(F,x);switch(F){case i.NUMERIC:return Math.floor(z/10*3);case i.ALPHANUMERIC:return Math.floor(z/11*2);case i.KANJI:return Math.floor(z/13);case i.BYTE:default:return Math.floor(z/8)}},t.getBestVersionForData=function(x,I){let F;const W=n.from(I,n.M);if(Array.isArray(x)){if(x.length>1)return _(x,W);if(x.length===0)return 1;F=x[0]}else F=x;return f(F.mode,F.getLength(),W)},t.getEncodedBits=function(x){if(!o.isValid(x)||x<7)throw new Error("Invalid QR Code version");let I=x<<12;for(;e.getBCHDigit(I)-l>=0;)I^=c<<e.getBCHDigit(I)-l;return x<<12|I}}(N2);var L2={};const J0=yn,B2=1335,GO=21522,U2=J0.getBCHDigit(B2);L2.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;J0.getBCHDigit(i)-U2>=0;)i^=B2<<J0.getBCHDigit(i)-U2;return(n<<10|i)^GO};var F2={};const YO=_s;function ha(t){this.mode=YO.NUMERIC,this.data=t.toString()}ha.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},ha.prototype.getLength=function(){return this.data.length},ha.prototype.getBitsLength=function(){return ha.getBitsLength(this.data.length)},ha.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var QO=ha;const JO=_s,Z0=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function fa(t){this.mode=JO.ALPHANUMERIC,this.data=t}fa.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},fa.prototype.getLength=function(){return this.data.length},fa.prototype.getBitsLength=function(){return fa.getBitsLength(this.data.length)},fa.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Z0.indexOf(this.data[r])*45;n+=Z0.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(Z0.indexOf(this.data[r]),6)};var ZO=fa,XO=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const eM=XO,tM=_s;function da(t){this.mode=tM.BYTE,typeof t=="string"&&(t=eM(t)),this.data=new Uint8Array(t)}da.getBitsLength=function(e){return e*8},da.prototype.getLength=function(){return this.data.length},da.prototype.getBitsLength=function(){return da.getBitsLength(this.data.length)},da.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var rM=da;const nM=_s,iM=yn;function pa(t){this.mode=nM.KANJI,this.data=t}pa.getBitsLength=function(e){return e*13},pa.prototype.getLength=function(){return this.data.length},pa.prototype.getBitsLength=function(){return pa.getBitsLength(this.data.length)},pa.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=iM.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
117
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var sM=pa,j2={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},c={};c[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var f,h,g,_,E,x,I,F,W;!l.empty();){f=l.pop(),h=f.value,_=f.cost,E=r[h]||{};for(g in E)E.hasOwnProperty(g)&&(x=E[g],I=_+x,F=c[g],W=typeof c[g]>"u",(W||F>I)&&(c[g]=I,l.push(g,I),o[g]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var Y=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(Y)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(j2),function(t){const e=_s,r=QO,n=ZO,i=rM,o=sM,c=Si,l=yn,f=j2.exports;function h(Y){return unescape(encodeURIComponent(Y)).length}function g(Y,B,z){const M=[];let U;for(;(U=Y.exec(z))!==null;)M.push({data:U[0],index:U.index,mode:B,length:U[0].length});return M}function _(Y){const B=g(c.NUMERIC,e.NUMERIC,Y),z=g(c.ALPHANUMERIC,e.ALPHANUMERIC,Y);let M,U;return l.isKanjiModeEnabled()?(M=g(c.BYTE,e.BYTE,Y),U=g(c.KANJI,e.KANJI,Y)):(M=g(c.BYTE_KANJI,e.BYTE,Y),U=[]),B.concat(z,M,U).sort(function(m,$){return m.index-$.index}).map(function(m){return{data:m.data,mode:m.mode,length:m.length}})}function E(Y,B){switch(B){case e.NUMERIC:return r.getBitsLength(Y);case e.ALPHANUMERIC:return n.getBitsLength(Y);case e.KANJI:return o.getBitsLength(Y);case e.BYTE:return i.getBitsLength(Y)}}function x(Y){return Y.reduce(function(B,z){const M=B.length-1>=0?B[B.length-1]:null;return M&&M.mode===z.mode?(B[B.length-1].data+=z.data,B):(B.push(z),B)},[])}function I(Y){const B=[];for(let z=0;z<Y.length;z++){const M=Y[z];switch(M.mode){case e.NUMERIC:B.push([M,{data:M.data,mode:e.ALPHANUMERIC,length:M.length},{data:M.data,mode:e.BYTE,length:M.length}]);break;case e.ALPHANUMERIC:B.push([M,{data:M.data,mode:e.BYTE,length:M.length}]);break;case e.KANJI:B.push([M,{data:M.data,mode:e.BYTE,length:h(M.data)}]);break;case e.BYTE:B.push([{data:M.data,mode:e.BYTE,length:h(M.data)}])}}return B}function F(Y,B){const z={},M={start:{}};let U=["start"];for(let j=0;j<Y.length;j++){const m=Y[j],$=[];for(let te=0;te<m.length;te++){const ee=m[te],ne=""+j+te;$.push(ne),z[ne]={node:ee,lastCount:0},M[ne]={};for(let de=0;de<U.length;de++){const d=U[de];z[d]&&z[d].node.mode===ee.mode?(M[d][ne]=E(z[d].lastCount+ee.length,ee.mode)-E(z[d].lastCount,ee.mode),z[d].lastCount+=ee.length):(z[d]&&(z[d].lastCount=ee.length),M[d][ne]=E(ee.length,ee.mode)+4+e.getCharCountIndicator(ee.mode,B))}}U=$}for(let j=0;j<U.length;j++)M[U[j]].end=0;return{map:M,table:z}}function W(Y,B){let z;const M=e.getBestModeForData(Y);if(z=e.from(B,M),z!==e.BYTE&&z.bit<M.bit)throw new Error('"'+Y+'" cannot be encoded with mode '+e.toString(z)+`.
|
|
118
|
+
Suggested mode is: `+e.toString(M));switch(z===e.KANJI&&!l.isKanjiModeEnabled()&&(z=e.BYTE),z){case e.NUMERIC:return new r(Y);case e.ALPHANUMERIC:return new n(Y);case e.KANJI:return new o(Y);case e.BYTE:return new i(Y)}}t.fromArray=function(B){return B.reduce(function(z,M){return typeof M=="string"?z.push(W(M,null)):M.data&&z.push(W(M.data,M.mode)),z},[])},t.fromString=function(B,z){const M=_(B,l.isKanjiModeEnabled()),U=I(M),j=F(U,z),m=f.find_path(j.map,"start","end"),$=[];for(let te=1;te<m.length-1;te++)$.push(j.table[m[te]].node);return t.fromArray(x($))},t.rawSplit=function(B){return t.fromArray(_(B,l.isKanjiModeEnabled()))}}(F2);const Eu=yn,X0=mu,oM=FO,aM=jO,cM=D2,lM=O2,ed=P2,td=vu,uM=qO,Au=N2,hM=L2,fM=_s,rd=F2;function dM(t,e){const r=t.size,n=lM.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],c=n[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||r<=o+l))for(let f=-1;f<=7;f++)c+f<=-1||r<=c+f||(l>=0&&l<=6&&(f===0||f===6)||f>=0&&f<=6&&(l===0||l===6)||l>=2&&l<=4&&f>=2&&f<=4?t.set(o+l,c+f,!0,!0):t.set(o+l,c+f,!1,!0))}}function pM(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function gM(t,e){const r=cM.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let c=-2;c<=2;c++)for(let l=-2;l<=2;l++)c===-2||c===2||l===-2||l===2||c===0&&l===0?t.set(i+c,o+l,!0,!0):t.set(i+c,o+l,!1,!0)}}function mM(t,e){const r=t.size,n=Au.getEncodedBits(e);let i,o,c;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+r-8-3,c=(n>>l&1)===1,t.set(i,o,c,!0),t.set(o,i,c,!0)}function nd(t,e,r){const n=t.size,i=hM.getEncodedBits(e,r);let o,c;for(o=0;o<15;o++)c=(i>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(n-15+o,8,c,!0),o<8?t.set(8,n-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(n-8,8,1,!0)}function vM(t,e){const r=t.size;let n=-1,i=r-1,o=7,c=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let f=0;f<2;f++)if(!t.isReserved(i,l-f)){let h=!1;c<e.length&&(h=(e[c]>>>o&1)===1),t.set(i,l-f,h),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function wM(t,e,r){const n=new oM;r.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),fM.getCharCountIndicator(f.mode,t)),f.write(n)});const i=Eu.getSymbolTotalCodewords(t),o=td.getTotalCodewordsCount(t,e),c=(i-o)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(c-n.getLengthInBits())/8;for(let f=0;f<l;f++)n.put(f%2?17:236,8);return yM(n,t,e)}function yM(t,e,r){const n=Eu.getSymbolTotalCodewords(e),i=td.getTotalCodewordsCount(e,r),o=n-i,c=td.getBlocksCount(e,r),l=n%c,f=c-l,h=Math.floor(n/c),g=Math.floor(o/c),_=g+1,E=h-g,x=new uM(E);let I=0;const F=new Array(c),W=new Array(c);let Y=0;const B=new Uint8Array(t.buffer);for(let m=0;m<c;m++){const $=m<f?g:_;F[m]=B.slice(I,I+$),W[m]=x.encode(F[m]),I+=$,Y=Math.max(Y,$)}const z=new Uint8Array(n);let M=0,U,j;for(U=0;U<Y;U++)for(j=0;j<c;j++)U<F[j].length&&(z[M++]=F[j][U]);for(U=0;U<E;U++)for(j=0;j<c;j++)z[M++]=W[j][U];return z}function bM(t,e,r,n){let i;if(Array.isArray(t))i=rd.fromArray(t);else if(typeof t=="string"){let h=e;if(!h){const g=rd.rawSplit(t);h=Au.getBestVersionForData(g,r)}i=rd.fromString(t,h||40)}else throw new Error("Invalid data");const o=Au.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
|
|
119
119
|
The chosen QR Code version cannot contain this amount of data.
|
|
120
120
|
Minimum version required to store current data is: `+o+`.
|
|
121
|
-
`);const c=
|
|
122
|
-
`;return typeof n=="function"&&n(null,E),E};const EM=LO,ad=I2,H2=k2,AM=q2;function cd(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!EM())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(f,h){try{const g=ad.create(r,n);f(t(g,e,n))}catch(g){h(g)}})}try{const f=ad.create(r,n);i(null,t(f,e,n))}catch(f){i(f)}}Oc.create=ad.create,Oc.toCanvas=cd.bind(null,H2.render),Oc.toDataURL=cd.bind(null,H2.renderToDataURL),Oc.toString=cd.bind(null,function(t,e,r){return AM.render(t,r)});var xM=Object.defineProperty,K2=Object.getOwnPropertySymbols,SM=Object.prototype.hasOwnProperty,IM=Object.prototype.propertyIsEnumerable,W2=(t,e,r)=>e in t?xM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ld=(t,e)=>{for(var r in e||(e={}))SM.call(e,r)&&W2(t,r,e[r]);if(K2)for(var r of K2(e))IM.call(e,r)&&W2(t,r,e[r]);return t};function DM(){var t;const e=(t=ms.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function V2(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const xt={getPreset(t){return V2()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=ms.state;if(t){const r=ld(ld(ld({},DM()),V2()),e);Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:$t`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},CM=$t`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var OM=Object.defineProperty,MM=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?MM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OM(e,r,i),i};let Es=class extends mt{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),ve`<button class="${Wi(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};Es.styles=[xt.globalCss,CM],ma([ht({type:Boolean})],Es.prototype,"disabled",2),ma([ht()],Es.prototype,"iconLeft",2),ma([ht()],Es.prototype,"iconRight",2),ma([ht()],Es.prototype,"onClick",2),ma([ht()],Es.prototype,"variant",2),Es=ma([Ct("wcm-button")],Es);const PM=$t`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var $M=Object.defineProperty,TM=Object.getOwnPropertyDescriptor,ud=(t,e,r,n)=>{for(var i=n>1?void 0:n?TM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$M(e,r,i),i};let Tc=class extends mt{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return ve`<button ?disabled="${this.disabled}" class="${Wi(t)}"><slot></slot></button>`}};Tc.styles=[xt.globalCss,PM],ud([ht({type:Boolean})],Tc.prototype,"disabled",2),ud([ht()],Tc.prototype,"variant",2),Tc=ud([Ct("wcm-button-big")],Tc);const NM=$t`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var RM=Object.defineProperty,LM=Object.getOwnPropertyDescriptor,BM=(t,e,r,n)=>{for(var i=n>1?void 0:n?LM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&RM(e,r,i),i};let hd=class extends mt{render(){return ve`<div><slot></slot></div>`}};hd.styles=[xt.globalCss,NM],hd=BM([Ct("wcm-info-footer")],hd);const Nt={CROSS_ICON:ar`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:ar`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:ar`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:ar`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:ar`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:ar`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:ar`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:ar`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:ar`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:ar`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:ar`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:ar`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:ar`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:ar`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:ar`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,SEARCH_ICON:ar`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,WALLET_PLACEHOLDER:ar`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,GLOBE_ICON:ar`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},UM=$t`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var FM=Object.defineProperty,jM=Object.getOwnPropertyDescriptor,kM=(t,e,r,n)=>{for(var i=n>1?void 0:n?jM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&FM(e,r,i),i};let fd=class extends mt{render(){return ve`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Nt.WALLET_CONNECT_LOGO} <button @click="${to.close}">${Nt.CROSS_ICON}</button></div>`}};fd.styles=[xt.globalCss,UM],fd=kM([Ct("wcm-modal-backcard")],fd);const qM=$t`main{padding:20px;padding-top:0;width:100%}`;var zM=Object.defineProperty,HM=Object.getOwnPropertyDescriptor,KM=(t,e,r,n)=>{for(var i=n>1?void 0:n?HM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zM(e,r,i),i};let dd=class extends mt{render(){return ve`<main><slot></slot></main>`}};dd.styles=[xt.globalCss,qM],dd=KM([Ct("wcm-modal-content")],dd);const WM=$t`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var VM=Object.defineProperty,GM=Object.getOwnPropertyDescriptor,YM=(t,e,r,n)=>{for(var i=n>1?void 0:n?GM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&VM(e,r,i),i};let pd=class extends mt{render(){return ve`<footer><slot></slot></footer>`}};pd.styles=[xt.globalCss,WM],pd=YM([Ct("wcm-modal-footer")],pd);const QM=$t`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var JM=Object.defineProperty,ZM=Object.getOwnPropertyDescriptor,Nc=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JM(e,r,i),i};let lo=class extends mt{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return ve`<button class="wcm-back-btn" @click="${rr.goBack}">${Nt.BACK_ICON}</button>`}actionBtnTemplate(){return ve`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"wcm-border":this.border},e=rr.state.history.length>1,r=this.title?ve`<wcm-text variant="big-bold">${this.title}</wcm-text>`:ve`<slot></slot>`;return ve`<header class="${Wi(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};lo.styles=[xt.globalCss,QM],Nc([ht()],lo.prototype,"title",2),Nc([ht()],lo.prototype,"onAction",2),Nc([ht()],lo.prototype,"actionIcon",2),Nc([ht({type:Boolean})],lo.prototype,"border",2),lo=Nc([Ct("wcm-modal-header")],lo);const nt={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=wn.state;return r!=null&&r[t]?r[t]:e?an.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=nt.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Ue.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{walletConnectUri:e}=hr.state,{mobile:r,name:n}=t,i=r?.native,o=r?.universal;nt.setRecentWallet(t);function c(l){let f="";i?f=Ue.formatUniversalUrl(i,l,n):o&&(f=Ue.formatNativeUrl(o,l,n)),Ue.openHref(f,"_self")}e&&c(e)},handleAndroidLinking(){const{walletConnectUri:t}=hr.state;t&&(Ue.setWalletConnectAndroidDeepLink(t),Ue.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=hr.state;if(t)try{await navigator.clipboard.writeText(t),vs.openToast("Link copied","success")}catch{vs.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=wn.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(nt.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(nt.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Ue.openHref(nt.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=Ue.getWalletRouterData(),r=!!t?.native,n=!!t?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:r,isMobile:i,isWeb:n}},goToConnectingView(t){rr.setData({Wallet:t});const e=Ue.isMobile(),{isDesktop:r,isWeb:n,isMobile:i}=nt.getCachedRouterWalletPlatforms();e?i?rr.push("MobileConnecting"):n?rr.push("WebConnecting"):rr.push("InstallWallet"):r?rr.push("DesktopConnecting"):n?rr.push("WebConnecting"):i?rr.push("MobileQrcodeConnecting"):rr.push("InstallWallet")}},XM=$t`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var eP=Object.defineProperty,tP=Object.getOwnPropertyDescriptor,gd=(t,e,r,n)=>{for(var i=n>1?void 0:n?tP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&eP(e,r,i),i};let Rc=class extends mt{constructor(){super(),this.view=rr.state.view,this.prevView=rr.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=rr.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&co(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return nt.getShadowRootElement(this,".wcm-router")}get contentEl(){return nt.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return ve`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return ve`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return ve`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return ve`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return ve`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return ve`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return ve`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return ve`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return ve`<div>Not Found</div>`}}async onChangeRoute(){await co(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=rr.state.view,co(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return ve`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Rc.styles=[xt.globalCss,XM],gd([cn()],Rc.prototype,"view",2),gd([cn()],Rc.prototype,"prevView",2),Rc=gd([Ct("wcm-modal-router")],Rc);const rP=$t`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var nP=Object.defineProperty,iP=Object.getOwnPropertyDescriptor,G2=(t,e,r,n)=>{for(var i=n>1?void 0:n?iP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&nP(e,r,i),i};let xu=class extends mt{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=vs.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>vs.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),vs.closeToast()}render(){const{message:t,variant:e}=vs.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?ve`<div class="${Wi(r)}">${e==="success"?Nt.CHECKMARK_ICON:null} ${e==="error"?Nt.CROSS_ICON:null}<wcm-text variant="small-regular">${t}</wcm-text></div>`:null}};xu.styles=[xt.globalCss,rP],G2([cn()],xu.prototype,"open",2),xu=G2([Ct("wcm-modal-toast")],xu);const sP=.1,Y2=2.5,Vi=7;function md(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+sP}function oP(t,e){const r=Array.prototype.slice.call(Oc.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const aP={generate(t,e,r){const n="#141414",i="#ffffff",o=[],c=oP(t,"Q"),l=e/c.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:I,y:k})=>{const W=(c.length-Vi)*l*I,Y=(c.length-Vi)*l*k,B=.45;for(let z=0;z<f.length;z+=1){const M=l*(Vi-z*2);o.push(ar`<rect fill="${z%2===0?n:i}" height="${M}" rx="${M*B}" ry="${M*B}" width="${M}" x="${W+l*z}" y="${Y+l*z}">`)}});const h=Math.floor((r+25)/l),g=c.length/2-h/2,_=c.length/2+h/2-1,E=[];c.forEach((I,k)=>{I.forEach((W,Y)=>{if(c[k][Y]&&!(k<Vi&&Y<Vi||k>c.length-(Vi+1)&&Y<Vi||k<Vi&&Y>c.length-(Vi+1))&&!(k>g&&k<_&&Y>g&&Y<_)){const B=k*l+l/2,z=Y*l+l/2;E.push([B,z])}})});const x={};return E.forEach(([I,k])=>{x[I]?x[I].push(k):x[I]=[k]}),Object.entries(x).map(([I,k])=>{const W=k.filter(Y=>k.every(B=>!md(Y,B,l)));return[Number(I),W]}).forEach(([I,k])=>{k.forEach(W=>{o.push(ar`<circle cx="${I}" cy="${W}" fill="${n}" r="${l/Y2}">`)})}),Object.entries(x).filter(([I,k])=>k.length>1).map(([I,k])=>{const W=k.filter(Y=>k.some(B=>md(Y,B,l)));return[Number(I),W]}).map(([I,k])=>{k.sort((Y,B)=>Y<B?-1:1);const W=[];for(const Y of k){const B=W.find(z=>z.some(M=>md(Y,M,l)));B?B.push(Y):W.push([Y])}return[I,W.map(Y=>[Y[0],Y[Y.length-1]])]}).forEach(([I,k])=>{k.forEach(([W,Y])=>{o.push(ar`<line x1="${I}" x2="${I}" y1="${W}" y2="${Y}" stroke="${n}" stroke-width="${l/(Y2/2)}" stroke-linecap="round">`)})}),o}},cP=$t`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var lP=Object.defineProperty,uP=Object.getOwnPropertyDescriptor,va=(t,e,r,n)=>{for(var i=n>1?void 0:n?uP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&lP(e,r,i),i};let Gi=class extends mt{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=ms.state.themeMode==="light"?this.size:this.size-36;return ar`<svg height="${t}" width="${t}">${aP.generate(this.uri,t,t/4)}</svg>`}render(){const t={"wcm-dark":ms.state.themeMode==="dark"};return ve`<div style="${`width: ${this.size}px`}" class="${Wi(t)}">${this.walletId||this.imageUrl?ve`<wcm-wallet-image walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}" imageUrl="${Wr(this.imageUrl)}"></wcm-wallet-image>`:Nt.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Gi.styles=[xt.globalCss,cP],va([ht()],Gi.prototype,"uri",2),va([ht({type:Number})],Gi.prototype,"size",2),va([ht()],Gi.prototype,"imageId",2),va([ht()],Gi.prototype,"walletId",2),va([ht()],Gi.prototype,"imageUrl",2),Gi=va([Ct("wcm-qrcode")],Gi);const hP=$t`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var fP=Object.defineProperty,dP=Object.getOwnPropertyDescriptor,Q2=(t,e,r,n)=>{for(var i=n>1?void 0:n?dP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&fP(e,r,i),i};let Su=class extends mt{constructor(){super(...arguments),this.onChange=()=>null}render(){return ve`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Nt.SEARCH_ICON}`}};Su.styles=[xt.globalCss,hP],Q2([ht()],Su.prototype,"onChange",2),Su=Q2([Ct("wcm-search-input")],Su);const pP=$t`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var gP=Object.defineProperty,mP=Object.getOwnPropertyDescriptor,vP=(t,e,r,n)=>{for(var i=n>1?void 0:n?mP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gP(e,r,i),i};let vd=class extends mt{render(){return ve`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};vd.styles=[xt.globalCss,pP],vd=vP([Ct("wcm-spinner")],vd);const wP=$t`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var yP=Object.defineProperty,bP=Object.getOwnPropertyDescriptor,wd=(t,e,r,n)=>{for(var i=n>1?void 0:n?bP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&yP(e,r,i),i};let Lc=class extends mt{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return ve`<span><slot class="${Wi(t)}"></slot></span>`}};Lc.styles=[xt.globalCss,wP],wd([ht()],Lc.prototype,"variant",2),wd([ht()],Lc.prototype,"color",2),Lc=wd([Ct("wcm-text")],Lc);const _P=$t`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var EP=Object.defineProperty,AP=Object.getOwnPropertyDescriptor,As=(t,e,r,n)=>{for(var i=n>1?void 0:n?AP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EP(e,r,i),i};let Di=class extends mt{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?ve`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?ve`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){Tw.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return ve`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Wr(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(t=this.label)!=null?t:nt.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Di.styles=[xt.globalCss,_P],As([ht()],Di.prototype,"onClick",2),As([ht()],Di.prototype,"name",2),As([ht()],Di.prototype,"walletId",2),As([ht()],Di.prototype,"label",2),As([ht()],Di.prototype,"imageId",2),As([ht({type:Boolean})],Di.prototype,"installed",2),As([ht({type:Boolean})],Di.prototype,"recent",2),Di=As([Ct("wcm-wallet-button")],Di);const xP=$t`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var SP=Object.defineProperty,IP=Object.getOwnPropertyDescriptor,Iu=(t,e,r,n)=>{for(var i=n>1?void 0:n?IP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SP(e,r,i),i};let wa=class extends mt{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:nt.getWalletIcon({id:this.walletId,image_id:this.imageId});return ve`${e.length?ve`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Nt.WALLET_PLACEHOLDER}`}};wa.styles=[xt.globalCss,xP],Iu([ht()],wa.prototype,"walletId",2),Iu([ht()],wa.prototype,"imageId",2),Iu([ht()],wa.prototype,"imageUrl",2),wa=Iu([Ct("wcm-wallet-image")],wa);var DP=Object.defineProperty,CP=Object.getOwnPropertyDescriptor,J2=(t,e,r,n)=>{for(var i=n>1?void 0:n?CP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&DP(e,r,i),i};let yd=class extends mt{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>nt.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(wn.state.enableExplorer){await an.getRecomendedWallets(),hr.setIsDataLoaded(!0);const{recomendedWallets:t}=an.state,e=t.map(r=>nt.getWalletIcon(r));await this.loadImages(e)}else hr.setIsDataLoaded(!0)}async preloadCustomImages(){const t=nt.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),vs.openToast("Failed preloading","error")}}};J2([cn()],yd.prototype,"preload",2),yd=J2([Ct("wcm-explorer-context")],yd);var OP=Object.defineProperty,MP=Object.getOwnPropertyDescriptor,PP=(t,e,r,n)=>{for(var i=n>1?void 0:n?MP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OP(e,r,i),i};let Z2=class extends mt{constructor(){super(),this.unsubscribeTheme=void 0,xt.setTheme(),this.unsubscribeTheme=ms.subscribe(xt.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};Z2=PP([Ct("wcm-theme-context")],Z2);const $P=$t`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var TP=Object.defineProperty,NP=Object.getOwnPropertyDescriptor,RP=(t,e,r,n)=>{for(var i=n>1?void 0:n?NP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TP(e,r,i),i};let bd=class extends mt{onGoToQrcode(){rr.push("Qrcode")}render(){const{recomendedWallets:t}=an.state,e=[...t,...t],r=Ue.RECOMMENDED_WALLET_AMOUNT*2;return ve`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Nt.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Nt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r)].map((n,i)=>{const o=e[i%e.length];return o?ve`<wcm-wallet-image walletId="${o.id}" imageId="${o.image_id}"></wcm-wallet-image>`:Nt.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${nt.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};bd.styles=[xt.globalCss,$P],bd=RP([Ct("wcm-android-wallet-selection")],bd);const LP=$t`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var BP=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var i=n>1?void 0:n?UP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&BP(e,r,i),i};let xs=class extends mt{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=ms.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:xt.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return ve`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return ve`<div class="${Wi(t)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};xs.styles=[xt.globalCss,LP],ya([ht()],xs.prototype,"walletId",2),ya([ht()],xs.prototype,"imageId",2),ya([ht({type:Boolean})],xs.prototype,"isError",2),ya([ht({type:Boolean})],xs.prototype,"isStale",2),ya([ht()],xs.prototype,"label",2),xs=ya([Ct("wcm-connector-waiting")],xs);const ba={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=wn.state,i=(t=ba.recentWallet())==null?void 0:t.id,o=Ue.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Ue.isMobile()?c?.map(({id:l,name:f,links:h})=>({id:l,name:f,mobile:h,links:h})):c?.map(({id:l,name:f,links:h})=>({id:l,name:f,desktop:h,links:h})))!=null?e:[]},recentWallet(){return nt.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=ba.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=an.state;return n.filter(i=>r!==i.id)}},Ss={onConnecting(t){nt.goToConnectingView(t)},manualWalletsTemplate(){return ba.manualWallets().map(t=>ve`<wcm-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(t=!1){return ba.recomendedWallets(t).map(e=>ve`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const t=ba.recentWallet();if(t)return ve`<wcm-wallet-button name="${t.name}" walletId="${t.id}" imageId="${Wr(t.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`}},FP=$t`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var jP=Object.defineProperty,kP=Object.getOwnPropertyDescriptor,qP=(t,e,r,n)=>{for(var i=n>1?void 0:n?kP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jP(e,r,i),i};let _d=class extends mt{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=wn.state,r=t!=="ALL"&&e,n=Ss.manualWalletsTemplate(),i=Ss.recomendedWalletsTemplate();let o=[Ss.recentWalletTemplate(),...n,...i];o=o.filter(Boolean);const c=o.length>4||r;let l=[];c?l=o.slice(0,3):l=o;const f=!!l.length;return ve`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Nt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Nt.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${f?ve`<wcm-modal-footer><div class="wcm-desktop-title">${Nt.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${l} ${c?ve`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};_d.styles=[xt.globalCss,FP],_d=qP([Ct("wcm-desktop-wallet-selection")],_d);const zP=$t`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var HP=Object.defineProperty,KP=Object.getOwnPropertyDescriptor,WP=(t,e,r,n)=>{for(var i=n>1?void 0:n?KP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&HP(e,r,i),i};let Ed=class extends mt{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=wn.state;return t??e?ve`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?ve`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?ve`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};Ed.styles=[xt.globalCss,zP],Ed=WP([Ct("wcm-legal-notice")],Ed);const VP=$t`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var GP=Object.defineProperty,YP=Object.getOwnPropertyDescriptor,QP=(t,e,r,n)=>{for(var i=n>1?void 0:n?YP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GP(e,r,i),i};let Ad=class extends mt{onQrcode(){rr.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=wn.state,r=t!=="ALL"&&e,n=Ss.manualWalletsTemplate(),i=Ss.recomendedWalletsTemplate();let o=[Ss.recentWalletTemplate(),...n,...i];o=o.filter(Boolean);const c=o.length>8||r;let l=[];c?l=o.slice(0,7):l=o;const f=!!l.length;return ve`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Nt.QRCODE_ICON}"></wcm-modal-header>${f?ve`<wcm-modal-content><div>${l} ${c?ve`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};Ad.styles=[xt.globalCss,VP],Ad=QP([Ct("wcm-mobile-wallet-selection")],Ad);const JP=$t`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var ZP=Object.defineProperty,XP=Object.getOwnPropertyDescriptor,xd=(t,e,r,n)=>{for(var i=n>1?void 0:n?XP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZP(e,r,i),i};let _a=class extends mt{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=to.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return nt.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return nt.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&to.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=nt.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([co(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,co(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=nt.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([co(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,co(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?to.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return ve`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${Wi(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?ve`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};_a.styles=[xt.globalCss,JP],xd([cn()],_a.prototype,"open",2),xd([cn()],_a.prototype,"active",2),_a=xd([Ct("wcm-modal")],_a);const e$=$t`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var t$=Object.defineProperty,r$=Object.getOwnPropertyDescriptor,Bc=(t,e,r,n)=>{for(var i=n>1?void 0:n?r$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&t$(e,r,i),i};let uo=class extends mt{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Ue.isMobile()?rr.replace("MobileConnecting"):rr.replace("MobileQrcodeConnecting")}onDesktop(){rr.replace("DesktopConnecting")}onWeb(){rr.replace("WebConnecting")}render(){return ve`<div>${this.isRetry?ve`<slot></slot>`:null} ${this.isMobile?ve`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Nt.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?ve`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Nt.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?ve`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Nt.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};uo.styles=[xt.globalCss,e$],Bc([ht({type:Boolean})],uo.prototype,"isMobile",2),Bc([ht({type:Boolean})],uo.prototype,"isDesktop",2),Bc([ht({type:Boolean})],uo.prototype,"isWeb",2),Bc([ht({type:Boolean})],uo.prototype,"isRetry",2),uo=Bc([Ct("wcm-platform-selection")],uo);const n$=$t`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var i$=Object.defineProperty,s$=Object.getOwnPropertyDescriptor,o$=(t,e,r,n)=>{for(var i=n>1?void 0:n?s$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&i$(e,r,i),i};let Sd=class extends mt{onClick(){rr.push("WalletExplorer")}render(){const{recomendedWallets:t}=an.state,e=ba.manualWallets(),r=[...t,...e].reverse().slice(0,4);return ve`<button @click="${this.onClick}"><div class="wcm-icons">${r.map(n=>{const i=nt.getWalletIcon(n);if(i)return ve`<img crossorigin="anonymous" src="${i}">`;const o=nt.getWalletIcon({id:n.id});return o?ve`<img crossorigin="anonymous" src="${o}">`:Nt.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Nt.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};Sd.styles=[xt.globalCss,n$],Sd=o$([Ct("wcm-view-all-wallets-button")],Sd);const a$=$t`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var c$=Object.defineProperty,l$=Object.getOwnPropertyDescriptor,Du=(t,e,r,n)=>{for(var i=n>1?void 0:n?l$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&c$(e,r,i),i};let Ea=class extends mt{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=hr.state;this.uri=t},0)}get overlayEl(){return nt.getShadowRootElement(this,".wcm-qr-container")}render(){return ve`<div class="wcm-qr-container">${this.uri?ve`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}"></wcm-qrcode>`:ve`<wcm-spinner></wcm-spinner>`}</div>`}};Ea.styles=[xt.globalCss,a$],Du([ht()],Ea.prototype,"walletId",2),Du([ht()],Ea.prototype,"imageId",2),Du([cn()],Ea.prototype,"uri",2),Ea=Du([Ct("wcm-walletconnect-qr")],Ea);var u$=Object.defineProperty,h$=Object.getOwnPropertyDescriptor,f$=(t,e,r,n)=>{for(var i=n>1?void 0:n?h$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&u$(e,r,i),i};let Id=class extends mt{viewTemplate(){return Ue.isAndroid()?ve`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Ue.isMobile()?ve`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:ve`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return ve`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};Id.styles=[xt.globalCss],Id=f$([Ct("wcm-connect-wallet-view")],Id);const d$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var p$=Object.defineProperty,g$=Object.getOwnPropertyDescriptor,X2=(t,e,r,n)=>{for(var i=n>1?void 0:n?g$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&p$(e,r,i),i};let Cu=class extends mt{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=Ue.getWalletRouterData(),n=e?.native;if(n){const i=Ue.formatNativeUrl(n,t,r);Ue.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:t}=hr.state,e=Ue.getWalletRouterData();nt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Ue.getWalletRouterData(),{isMobile:n,isWeb:i}=nt.getCachedRouterWalletPlatforms();return ve`<wcm-modal-header title="${t}" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Nt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Cu.styles=[xt.globalCss,d$],X2([cn()],Cu.prototype,"isError",2),Cu=X2([Ct("wcm-desktop-connecting-view")],Cu);const m$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var v$=Object.defineProperty,w$=Object.getOwnPropertyDescriptor,y$=(t,e,r,n)=>{for(var i=n>1?void 0:n?w$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&v$(e,r,i),i};let Dd=class extends mt{onInstall(t){t&&Ue.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Ue.getWalletRouterData();return ve`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Nt.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};Dd.styles=[xt.globalCss,m$],Dd=y$([Ct("wcm-install-wallet-view")],Dd);const b$=$t`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var _$=Object.defineProperty,E$=Object.getOwnPropertyDescriptor,ey=(t,e,r,n)=>{for(var i=n>1?void 0:n?E$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_$(e,r,i),i};let Ou=class extends mt{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Ue.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Ue.formatNativeUrl(i,t,n);Ue.openHref(c,"_self")}else if(o){const c=Ue.formatUniversalUrl(o,t,n);Ue.openHref(c,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=hr.state,r=Ue.getWalletRouterData();nt.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&Ue.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Ue.getWalletRouterData(),{isWeb:o}=nt.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return ve`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${o}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Nt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${l?ve`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Wr(r)}"></wcm-wallet-image><wcm-text>${`Get ${t}`}</wcm-text></div><wcm-button .iconRight="${Nt.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Ou.styles=[xt.globalCss,b$],ey([cn()],Ou.prototype,"isError",2),Ou=ey([Ct("wcm-mobile-connecting-view")],Ou);const A$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var x$=Object.defineProperty,S$=Object.getOwnPropertyDescriptor,I$=(t,e,r,n)=>{for(var i=n>1?void 0:n?S$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&x$(e,r,i),i};let Cd=class extends mt{render(){const{name:t,id:e,image_id:r}=Ue.getWalletRouterData(),{isDesktop:n,isWeb:i}=nt.getCachedRouterWalletPlatforms();return ve`<wcm-modal-header title="${t}" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Wr(r)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};Cd.styles=[xt.globalCss,A$],Cd=I$([Ct("wcm-mobile-qr-connecting-view")],Cd);var D$=Object.defineProperty,C$=Object.getOwnPropertyDescriptor,O$=(t,e,r,n)=>{for(var i=n>1?void 0:n?C$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&D$(e,r,i),i};let Od=class extends mt{render(){return ve`<wcm-modal-header title="Scan the code" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};Od.styles=[xt.globalCss],Od=O$([Ct("wcm-qrcode-view")],Od);const M$=$t`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var P$=Object.defineProperty,$$=Object.getOwnPropertyDescriptor,Uc=(t,e,r,n)=>{for(var i=n>1?void 0:n?$$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&P$(e,r,i),i};const Md=40;let ho=class extends mt{constructor(){super(...arguments),this.loading=!an.state.wallets.listings.length,this.firstFetch=!an.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=nt.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,an.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),an.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return nt.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=an.state,{listings:r,total:n}=this.search?e:t;return n<=Md||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=an.state,{listings:n,total:i,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||i>Md&&n.length<i))try{this.loading=!0;const c=(t=hr.state.chains)==null?void 0:t.join(","),{listings:l}=await an.getWallets({page:this.firstFetch?1:o+1,entries:Md,search:this.search,version:2,chains:c}),f=l.map(h=>nt.getWalletIcon(h));await Promise.all([...f.map(async h=>nt.preloadImage(h)),Ue.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),vs.openToast(nt.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Ue.isAndroid()?nt.handleMobileLinking(t):nt.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=an.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Ss.manualWalletsTemplate(),c=Ss.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:h})=>nt.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>nt.caseSafeIncludes(h[0],this.search)));const l=!this.loading&&!r.length&&!c.length,f={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":l};return ve`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${Wi(f)}"><div class="wcm-grid">${n?null:o} ${n?null:c} ${n?null:r.map(h=>ve`${h?ve`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${l?ve`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!l&&this.loading?ve`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ho.styles=[xt.globalCss,M$],Uc([cn()],ho.prototype,"loading",2),Uc([cn()],ho.prototype,"firstFetch",2),Uc([cn()],ho.prototype,"search",2),Uc([cn()],ho.prototype,"endReached",2),ho=Uc([Ct("wcm-wallet-explorer-view")],ho);const T$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var N$=Object.defineProperty,R$=Object.getOwnPropertyDescriptor,ty=(t,e,r,n)=>{for(var i=n>1?void 0:n?R$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&N$(e,r,i),i};let Mu=class extends mt{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=Ue.getWalletRouterData(),n=e?.universal;if(n){const i=Ue.formatUniversalUrl(n,t,r);Ue.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:t}=hr.state,e=Ue.getWalletRouterData();nt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Ue.getWalletRouterData(),{isMobile:n,isDesktop:i}=nt.getCachedRouterWalletPlatforms(),o=Ue.isMobile();return ve`<wcm-modal-header title="${t}" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${o?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Nt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Mu.styles=[xt.globalCss,T$],ty([cn()],Mu.prototype,"isError",2),Mu=ty([Ct("wcm-web-connecting-view")],Mu);var L$=Object.freeze({__proto__:null,get WcmModal(){return _a},get WcmQrCode(){return Gi}});Vn.EthereumProvider=oC,Vn.OPTIONAL_EVENTS=Cw,Vn.OPTIONAL_METHODS=Dw,Vn.REQUIRED_EVENTS=tu,Vn.REQUIRED_METHODS=eu,Vn.default=iu,Object.defineProperty(Vn,"__esModule",{value:!0})});
|
|
121
|
+
`);const c=wM(e,r,i),l=Eu.getSymbolSize(e),f=new aM(l);return dM(f,e),pM(f),gM(f,e),nd(f,r,0),e>=7&&mM(f,e),vM(f,c),isNaN(n)&&(n=ed.getBestMask(f,nd.bind(null,f,r))),ed.applyMask(n,f),nd(f,r,n),{modules:f,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}S2.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=X0.M,i,o;return typeof r<"u"&&(n=X0.from(r.errorCorrectionLevel,X0.M),i=Au.from(r.version),o=ed.from(r.maskPattern),r.toSJISFunc&&Eu.setToSJISFunction(r.toSJISFunc)),bM(e,i,n,o)};var k2={},id={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(o){return[o,o]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,o=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:o,scale:o?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const o=t.getScale(n,i);return Math.floor((n+i.margin*2)*o)},t.qrToImageData=function(n,i,o){const c=i.modules.size,l=i.modules.data,f=t.getScale(c,o),h=Math.floor((c+o.margin*2)*f),g=o.margin*f,_=[o.color.light,o.color.dark];for(let E=0;E<h;E++)for(let x=0;x<h;x++){let I=(E*h+x)*4,F=o.color.light;if(E>=g&&x>=g&&E<h-g&&x<h-g){const W=Math.floor((E-g)/f),Y=Math.floor((x-g)/f);F=_[l[W*c+Y]?1:0]}n[I++]=F.r,n[I++]=F.g,n[I++]=F.b,n[I]=F.a}}})(id),function(t){const e=id;function r(i,o,c){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=c,o.width=c,o.style.height=c+"px",o.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,c,l){let f=l,h=c;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),c||(h=n()),f=e.getOptions(f);const g=e.getImageWidth(o.modules.size,f),_=h.getContext("2d"),E=_.createImageData(g,g);return e.qrToImageData(E.data,o,f),r(_,h,g),_.putImageData(E,0,0),h},t.renderToDataURL=function(o,c,l){let f=l;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),f||(f={});const h=t.render(o,c,f),g=f.type||"image/png",_=f.rendererOpts||{};return h.toDataURL(g,_.quality)}}(k2);var q2={};const _M=id;function z2(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function sd(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function EM(t,e,r){let n="",i=0,o=!1,c=0;for(let l=0;l<t.length;l++){const f=Math.floor(l%e),h=Math.floor(l/e);!f&&!o&&(o=!0),t[l]?(c++,l>0&&f>0&&t[l-1]||(n+=o?sd("M",f+r,.5+h+r):sd("m",i,0),i=0,o=!1),f+1<e&&t[l+1]||(n+=sd("h",c),c=0)):i++}return n}q2.render=function(e,r,n){const i=_M.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,f=i.color.light.a?"<path "+z2(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",h="<path "+z2(i.color.dark,"stroke")+' d="'+EM(c,o,i.margin)+'"/>',g='viewBox="0 0 '+l+" "+l+'"',E='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+g+' shape-rendering="crispEdges">'+f+h+`</svg>
|
|
122
|
+
`;return typeof n=="function"&&n(null,E),E};const AM=BO,od=S2,H2=k2,xM=q2;function ad(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!AM())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(f,h){try{const g=od.create(r,n);f(t(g,e,n))}catch(g){h(g)}})}try{const f=od.create(r,n);i(null,t(f,e,n))}catch(f){i(f)}}Oc.create=od.create,Oc.toCanvas=ad.bind(null,H2.render),Oc.toDataURL=ad.bind(null,H2.renderToDataURL),Oc.toString=ad.bind(null,function(t,e,r){return xM.render(t,r)});var IM=Object.defineProperty,K2=Object.getOwnPropertySymbols,SM=Object.prototype.hasOwnProperty,CM=Object.prototype.propertyIsEnumerable,W2=(t,e,r)=>e in t?IM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cd=(t,e)=>{for(var r in e||(e={}))SM.call(e,r)&&W2(t,r,e[r]);if(K2)for(var r of K2(e))CM.call(e,r)&&W2(t,r,e[r]);return t};function DM(){var t;const e=(t=ms.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function V2(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const xt={getPreset(t){return V2()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=ms.state;if(t){const r=cd(cd(cd({},DM()),V2()),e);Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:$t`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},OM=$t`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var MM=Object.defineProperty,PM=Object.getOwnPropertyDescriptor,ga=(t,e,r,n)=>{for(var i=n>1?void 0:n?PM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&MM(e,r,i),i};let Es=class extends mt{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),ve`<button class="${Wi(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};Es.styles=[xt.globalCss,OM],ga([ht({type:Boolean})],Es.prototype,"disabled",2),ga([ht()],Es.prototype,"iconLeft",2),ga([ht()],Es.prototype,"iconRight",2),ga([ht()],Es.prototype,"onClick",2),ga([ht()],Es.prototype,"variant",2),Es=ga([Dt("wcm-button")],Es);const $M=$t`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var TM=Object.defineProperty,NM=Object.getOwnPropertyDescriptor,ld=(t,e,r,n)=>{for(var i=n>1?void 0:n?NM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TM(e,r,i),i};let Tc=class extends mt{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return ve`<button ?disabled="${this.disabled}" class="${Wi(t)}"><slot></slot></button>`}};Tc.styles=[xt.globalCss,$M],ld([ht({type:Boolean})],Tc.prototype,"disabled",2),ld([ht()],Tc.prototype,"variant",2),Tc=ld([Dt("wcm-button-big")],Tc);const RM=$t`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var LM=Object.defineProperty,BM=Object.getOwnPropertyDescriptor,UM=(t,e,r,n)=>{for(var i=n>1?void 0:n?BM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LM(e,r,i),i};let ud=class extends mt{render(){return ve`<div><slot></slot></div>`}};ud.styles=[xt.globalCss,RM],ud=UM([Dt("wcm-info-footer")],ud);const Nt={CROSS_ICON:ar`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:ar`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:ar`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:ar`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:ar`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:ar`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:ar`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:ar`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:ar`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:ar`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:ar`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:ar`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:ar`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:ar`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:ar`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,SEARCH_ICON:ar`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,WALLET_PLACEHOLDER:ar`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,GLOBE_ICON:ar`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},FM=$t`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var jM=Object.defineProperty,kM=Object.getOwnPropertyDescriptor,qM=(t,e,r,n)=>{for(var i=n>1?void 0:n?kM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jM(e,r,i),i};let hd=class extends mt{render(){return ve`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Nt.WALLET_CONNECT_LOGO} <button @click="${to.close}">${Nt.CROSS_ICON}</button></div>`}};hd.styles=[xt.globalCss,FM],hd=qM([Dt("wcm-modal-backcard")],hd);const zM=$t`main{padding:20px;padding-top:0;width:100%}`;var HM=Object.defineProperty,KM=Object.getOwnPropertyDescriptor,WM=(t,e,r,n)=>{for(var i=n>1?void 0:n?KM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&HM(e,r,i),i};let fd=class extends mt{render(){return ve`<main><slot></slot></main>`}};fd.styles=[xt.globalCss,zM],fd=WM([Dt("wcm-modal-content")],fd);const VM=$t`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var GM=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,QM=(t,e,r,n)=>{for(var i=n>1?void 0:n?YM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GM(e,r,i),i};let dd=class extends mt{render(){return ve`<footer><slot></slot></footer>`}};dd.styles=[xt.globalCss,VM],dd=QM([Dt("wcm-modal-footer")],dd);const JM=$t`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var ZM=Object.defineProperty,XM=Object.getOwnPropertyDescriptor,Nc=(t,e,r,n)=>{for(var i=n>1?void 0:n?XM(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZM(e,r,i),i};let lo=class extends mt{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return ve`<button class="wcm-back-btn" @click="${rr.goBack}">${Nt.BACK_ICON}</button>`}actionBtnTemplate(){return ve`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"wcm-border":this.border},e=rr.state.history.length>1,r=this.title?ve`<wcm-text variant="big-bold">${this.title}</wcm-text>`:ve`<slot></slot>`;return ve`<header class="${Wi(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};lo.styles=[xt.globalCss,JM],Nc([ht()],lo.prototype,"title",2),Nc([ht()],lo.prototype,"onAction",2),Nc([ht()],lo.prototype,"actionIcon",2),Nc([ht({type:Boolean})],lo.prototype,"border",2),lo=Nc([Dt("wcm-modal-header")],lo);const nt={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=wn.state;return r!=null&&r[t]?r[t]:e?an.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=nt.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Ue.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{walletConnectUri:e}=hr.state,{mobile:r,name:n}=t,i=r?.native,o=r?.universal;nt.setRecentWallet(t);function c(l){let f="";i?f=Ue.formatUniversalUrl(i,l,n):o&&(f=Ue.formatNativeUrl(o,l,n)),Ue.openHref(f,"_self")}e&&c(e)},handleAndroidLinking(){const{walletConnectUri:t}=hr.state;t&&(Ue.setWalletConnectAndroidDeepLink(t),Ue.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=hr.state;if(t)try{await navigator.clipboard.writeText(t),vs.openToast("Link copied","success")}catch{vs.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=wn.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(nt.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(nt.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Ue.openHref(nt.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=Ue.getWalletRouterData(),r=!!t?.native,n=!!t?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:r,isMobile:i,isWeb:n}},goToConnectingView(t){rr.setData({Wallet:t});const e=Ue.isMobile(),{isDesktop:r,isWeb:n,isMobile:i}=nt.getCachedRouterWalletPlatforms();e?i?rr.push("MobileConnecting"):n?rr.push("WebConnecting"):rr.push("InstallWallet"):r?rr.push("DesktopConnecting"):n?rr.push("WebConnecting"):i?rr.push("MobileQrcodeConnecting"):rr.push("InstallWallet")}},eP=$t`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var tP=Object.defineProperty,rP=Object.getOwnPropertyDescriptor,pd=(t,e,r,n)=>{for(var i=n>1?void 0:n?rP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tP(e,r,i),i};let Rc=class extends mt{constructor(){super(),this.view=rr.state.view,this.prevView=rr.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=rr.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&co(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return nt.getShadowRootElement(this,".wcm-router")}get contentEl(){return nt.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return ve`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return ve`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return ve`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return ve`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return ve`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return ve`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return ve`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return ve`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return ve`<div>Not Found</div>`}}async onChangeRoute(){await co(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=rr.state.view,co(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return ve`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Rc.styles=[xt.globalCss,eP],pd([cn()],Rc.prototype,"view",2),pd([cn()],Rc.prototype,"prevView",2),Rc=pd([Dt("wcm-modal-router")],Rc);const nP=$t`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var iP=Object.defineProperty,sP=Object.getOwnPropertyDescriptor,G2=(t,e,r,n)=>{for(var i=n>1?void 0:n?sP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&iP(e,r,i),i};let xu=class extends mt{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=vs.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>vs.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),vs.closeToast()}render(){const{message:t,variant:e}=vs.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?ve`<div class="${Wi(r)}">${e==="success"?Nt.CHECKMARK_ICON:null} ${e==="error"?Nt.CROSS_ICON:null}<wcm-text variant="small-regular">${t}</wcm-text></div>`:null}};xu.styles=[xt.globalCss,nP],G2([cn()],xu.prototype,"open",2),xu=G2([Dt("wcm-modal-toast")],xu);const oP=.1,Y2=2.5,Vi=7;function gd(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+oP}function aP(t,e){const r=Array.prototype.slice.call(Oc.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const cP={generate(t,e,r){const n="#141414",i="#ffffff",o=[],c=aP(t,"Q"),l=e/c.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:I,y:F})=>{const W=(c.length-Vi)*l*I,Y=(c.length-Vi)*l*F,B=.45;for(let z=0;z<f.length;z+=1){const M=l*(Vi-z*2);o.push(ar`<rect fill="${z%2===0?n:i}" height="${M}" rx="${M*B}" ry="${M*B}" width="${M}" x="${W+l*z}" y="${Y+l*z}">`)}});const h=Math.floor((r+25)/l),g=c.length/2-h/2,_=c.length/2+h/2-1,E=[];c.forEach((I,F)=>{I.forEach((W,Y)=>{if(c[F][Y]&&!(F<Vi&&Y<Vi||F>c.length-(Vi+1)&&Y<Vi||F<Vi&&Y>c.length-(Vi+1))&&!(F>g&&F<_&&Y>g&&Y<_)){const B=F*l+l/2,z=Y*l+l/2;E.push([B,z])}})});const x={};return E.forEach(([I,F])=>{x[I]?x[I].push(F):x[I]=[F]}),Object.entries(x).map(([I,F])=>{const W=F.filter(Y=>F.every(B=>!gd(Y,B,l)));return[Number(I),W]}).forEach(([I,F])=>{F.forEach(W=>{o.push(ar`<circle cx="${I}" cy="${W}" fill="${n}" r="${l/Y2}">`)})}),Object.entries(x).filter(([I,F])=>F.length>1).map(([I,F])=>{const W=F.filter(Y=>F.some(B=>gd(Y,B,l)));return[Number(I),W]}).map(([I,F])=>{F.sort((Y,B)=>Y<B?-1:1);const W=[];for(const Y of F){const B=W.find(z=>z.some(M=>gd(Y,M,l)));B?B.push(Y):W.push([Y])}return[I,W.map(Y=>[Y[0],Y[Y.length-1]])]}).forEach(([I,F])=>{F.forEach(([W,Y])=>{o.push(ar`<line x1="${I}" x2="${I}" y1="${W}" y2="${Y}" stroke="${n}" stroke-width="${l/(Y2/2)}" stroke-linecap="round">`)})}),o}},lP=$t`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var uP=Object.defineProperty,hP=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?hP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&uP(e,r,i),i};let Gi=class extends mt{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=ms.state.themeMode==="light"?this.size:this.size-36;return ar`<svg height="${t}" width="${t}">${cP.generate(this.uri,t,t/4)}</svg>`}render(){const t={"wcm-dark":ms.state.themeMode==="dark"};return ve`<div style="${`width: ${this.size}px`}" class="${Wi(t)}">${this.walletId||this.imageUrl?ve`<wcm-wallet-image walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}" imageUrl="${Wr(this.imageUrl)}"></wcm-wallet-image>`:Nt.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Gi.styles=[xt.globalCss,lP],ma([ht()],Gi.prototype,"uri",2),ma([ht({type:Number})],Gi.prototype,"size",2),ma([ht()],Gi.prototype,"imageId",2),ma([ht()],Gi.prototype,"walletId",2),ma([ht()],Gi.prototype,"imageUrl",2),Gi=ma([Dt("wcm-qrcode")],Gi);const fP=$t`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var dP=Object.defineProperty,pP=Object.getOwnPropertyDescriptor,Q2=(t,e,r,n)=>{for(var i=n>1?void 0:n?pP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&dP(e,r,i),i};let Iu=class extends mt{constructor(){super(...arguments),this.onChange=()=>null}render(){return ve`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Nt.SEARCH_ICON}`}};Iu.styles=[xt.globalCss,fP],Q2([ht()],Iu.prototype,"onChange",2),Iu=Q2([Dt("wcm-search-input")],Iu);const gP=$t`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var mP=Object.defineProperty,vP=Object.getOwnPropertyDescriptor,wP=(t,e,r,n)=>{for(var i=n>1?void 0:n?vP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&mP(e,r,i),i};let md=class extends mt{render(){return ve`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};md.styles=[xt.globalCss,gP],md=wP([Dt("wcm-spinner")],md);const yP=$t`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var bP=Object.defineProperty,_P=Object.getOwnPropertyDescriptor,vd=(t,e,r,n)=>{for(var i=n>1?void 0:n?_P(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&bP(e,r,i),i};let Lc=class extends mt{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return ve`<span><slot class="${Wi(t)}"></slot></span>`}};Lc.styles=[xt.globalCss,yP],vd([ht()],Lc.prototype,"variant",2),vd([ht()],Lc.prototype,"color",2),Lc=vd([Dt("wcm-text")],Lc);const EP=$t`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var AP=Object.defineProperty,xP=Object.getOwnPropertyDescriptor,As=(t,e,r,n)=>{for(var i=n>1?void 0:n?xP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&AP(e,r,i),i};let Ci=class extends mt{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?ve`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?ve`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){Tw.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return ve`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Wr(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(t=this.label)!=null?t:nt.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Ci.styles=[xt.globalCss,EP],As([ht()],Ci.prototype,"onClick",2),As([ht()],Ci.prototype,"name",2),As([ht()],Ci.prototype,"walletId",2),As([ht()],Ci.prototype,"label",2),As([ht()],Ci.prototype,"imageId",2),As([ht({type:Boolean})],Ci.prototype,"installed",2),As([ht({type:Boolean})],Ci.prototype,"recent",2),Ci=As([Dt("wcm-wallet-button")],Ci);const IP=$t`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var SP=Object.defineProperty,CP=Object.getOwnPropertyDescriptor,Su=(t,e,r,n)=>{for(var i=n>1?void 0:n?CP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SP(e,r,i),i};let va=class extends mt{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:nt.getWalletIcon({id:this.walletId,image_id:this.imageId});return ve`${e.length?ve`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Nt.WALLET_PLACEHOLDER}`}};va.styles=[xt.globalCss,IP],Su([ht()],va.prototype,"walletId",2),Su([ht()],va.prototype,"imageId",2),Su([ht()],va.prototype,"imageUrl",2),va=Su([Dt("wcm-wallet-image")],va);var DP=Object.defineProperty,OP=Object.getOwnPropertyDescriptor,J2=(t,e,r,n)=>{for(var i=n>1?void 0:n?OP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&DP(e,r,i),i};let wd=class extends mt{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>nt.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(wn.state.enableExplorer){await an.getRecomendedWallets(),hr.setIsDataLoaded(!0);const{recomendedWallets:t}=an.state,e=t.map(r=>nt.getWalletIcon(r));await this.loadImages(e)}else hr.setIsDataLoaded(!0)}async preloadCustomImages(){const t=nt.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),vs.openToast("Failed preloading","error")}}};J2([cn()],wd.prototype,"preload",2),wd=J2([Dt("wcm-explorer-context")],wd);var MP=Object.defineProperty,PP=Object.getOwnPropertyDescriptor,$P=(t,e,r,n)=>{for(var i=n>1?void 0:n?PP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&MP(e,r,i),i};let Z2=class extends mt{constructor(){super(),this.unsubscribeTheme=void 0,xt.setTheme(),this.unsubscribeTheme=ms.subscribe(xt.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};Z2=$P([Dt("wcm-theme-context")],Z2);const TP=$t`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var NP=Object.defineProperty,RP=Object.getOwnPropertyDescriptor,LP=(t,e,r,n)=>{for(var i=n>1?void 0:n?RP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&NP(e,r,i),i};let yd=class extends mt{onGoToQrcode(){rr.push("Qrcode")}render(){const{recomendedWallets:t}=an.state,e=[...t,...t],r=Ue.RECOMMENDED_WALLET_AMOUNT*2;return ve`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Nt.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Nt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r)].map((n,i)=>{const o=e[i%e.length];return o?ve`<wcm-wallet-image walletId="${o.id}" imageId="${o.image_id}"></wcm-wallet-image>`:Nt.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${nt.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};yd.styles=[xt.globalCss,TP],yd=LP([Dt("wcm-android-wallet-selection")],yd);const BP=$t`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var UP=Object.defineProperty,FP=Object.getOwnPropertyDescriptor,wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?FP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&UP(e,r,i),i};let xs=class extends mt{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=ms.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:xt.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return ve`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return ve`<div class="${Wi(t)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};xs.styles=[xt.globalCss,BP],wa([ht()],xs.prototype,"walletId",2),wa([ht()],xs.prototype,"imageId",2),wa([ht({type:Boolean})],xs.prototype,"isError",2),wa([ht({type:Boolean})],xs.prototype,"isStale",2),wa([ht()],xs.prototype,"label",2),xs=wa([Dt("wcm-connector-waiting")],xs);const ya={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=wn.state,i=(t=ya.recentWallet())==null?void 0:t.id,o=Ue.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Ue.isMobile()?c?.map(({id:l,name:f,links:h})=>({id:l,name:f,mobile:h,links:h})):c?.map(({id:l,name:f,links:h})=>({id:l,name:f,desktop:h,links:h})))!=null?e:[]},recentWallet(){return nt.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=ya.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=an.state;return n.filter(i=>r!==i.id)}},Is={onConnecting(t){nt.goToConnectingView(t)},manualWalletsTemplate(){return ya.manualWallets().map(t=>ve`<wcm-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(t=!1){return ya.recomendedWallets(t).map(e=>ve`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const t=ya.recentWallet();if(t)return ve`<wcm-wallet-button name="${t.name}" walletId="${t.id}" imageId="${Wr(t.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`}},jP=$t`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var kP=Object.defineProperty,qP=Object.getOwnPropertyDescriptor,zP=(t,e,r,n)=>{for(var i=n>1?void 0:n?qP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&kP(e,r,i),i};let bd=class extends mt{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=wn.state,r=t!=="ALL"&&e,n=Is.manualWalletsTemplate(),i=Is.recomendedWalletsTemplate();let o=[Is.recentWalletTemplate(),...n,...i];o=o.filter(Boolean);const c=o.length>4||r;let l=[];c?l=o.slice(0,3):l=o;const f=!!l.length;return ve`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Nt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Nt.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${f?ve`<wcm-modal-footer><div class="wcm-desktop-title">${Nt.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${l} ${c?ve`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};bd.styles=[xt.globalCss,jP],bd=zP([Dt("wcm-desktop-wallet-selection")],bd);const HP=$t`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var KP=Object.defineProperty,WP=Object.getOwnPropertyDescriptor,VP=(t,e,r,n)=>{for(var i=n>1?void 0:n?WP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&KP(e,r,i),i};let _d=class extends mt{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=wn.state;return t??e?ve`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?ve`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?ve`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};_d.styles=[xt.globalCss,HP],_d=VP([Dt("wcm-legal-notice")],_d);const GP=$t`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var YP=Object.defineProperty,QP=Object.getOwnPropertyDescriptor,JP=(t,e,r,n)=>{for(var i=n>1?void 0:n?QP(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&YP(e,r,i),i};let Ed=class extends mt{onQrcode(){rr.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=wn.state,r=t!=="ALL"&&e,n=Is.manualWalletsTemplate(),i=Is.recomendedWalletsTemplate();let o=[Is.recentWalletTemplate(),...n,...i];o=o.filter(Boolean);const c=o.length>8||r;let l=[];c?l=o.slice(0,7):l=o;const f=!!l.length;return ve`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Nt.QRCODE_ICON}"></wcm-modal-header>${f?ve`<wcm-modal-content><div>${l} ${c?ve`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};Ed.styles=[xt.globalCss,GP],Ed=JP([Dt("wcm-mobile-wallet-selection")],Ed);const ZP=$t`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var XP=Object.defineProperty,e$=Object.getOwnPropertyDescriptor,Ad=(t,e,r,n)=>{for(var i=n>1?void 0:n?e$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&XP(e,r,i),i};let ba=class extends mt{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=to.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return nt.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return nt.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&to.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=nt.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([co(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,co(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=nt.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([co(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,co(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?to.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return ve`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${Wi(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?ve`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};ba.styles=[xt.globalCss,ZP],Ad([cn()],ba.prototype,"open",2),Ad([cn()],ba.prototype,"active",2),ba=Ad([Dt("wcm-modal")],ba);const t$=$t`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var r$=Object.defineProperty,n$=Object.getOwnPropertyDescriptor,Bc=(t,e,r,n)=>{for(var i=n>1?void 0:n?n$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&r$(e,r,i),i};let uo=class extends mt{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Ue.isMobile()?rr.replace("MobileConnecting"):rr.replace("MobileQrcodeConnecting")}onDesktop(){rr.replace("DesktopConnecting")}onWeb(){rr.replace("WebConnecting")}render(){return ve`<div>${this.isRetry?ve`<slot></slot>`:null} ${this.isMobile?ve`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Nt.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?ve`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Nt.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?ve`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Nt.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};uo.styles=[xt.globalCss,t$],Bc([ht({type:Boolean})],uo.prototype,"isMobile",2),Bc([ht({type:Boolean})],uo.prototype,"isDesktop",2),Bc([ht({type:Boolean})],uo.prototype,"isWeb",2),Bc([ht({type:Boolean})],uo.prototype,"isRetry",2),uo=Bc([Dt("wcm-platform-selection")],uo);const i$=$t`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var s$=Object.defineProperty,o$=Object.getOwnPropertyDescriptor,a$=(t,e,r,n)=>{for(var i=n>1?void 0:n?o$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&s$(e,r,i),i};let xd=class extends mt{onClick(){rr.push("WalletExplorer")}render(){const{recomendedWallets:t}=an.state,e=ya.manualWallets(),r=[...t,...e].reverse().slice(0,4);return ve`<button @click="${this.onClick}"><div class="wcm-icons">${r.map(n=>{const i=nt.getWalletIcon(n);if(i)return ve`<img crossorigin="anonymous" src="${i}">`;const o=nt.getWalletIcon({id:n.id});return o?ve`<img crossorigin="anonymous" src="${o}">`:Nt.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Nt.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};xd.styles=[xt.globalCss,i$],xd=a$([Dt("wcm-view-all-wallets-button")],xd);const c$=$t`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var l$=Object.defineProperty,u$=Object.getOwnPropertyDescriptor,Cu=(t,e,r,n)=>{for(var i=n>1?void 0:n?u$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&l$(e,r,i),i};let _a=class extends mt{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=hr.state;this.uri=t},0)}get overlayEl(){return nt.getShadowRootElement(this,".wcm-qr-container")}render(){return ve`<div class="wcm-qr-container">${this.uri?ve`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}"></wcm-qrcode>`:ve`<wcm-spinner></wcm-spinner>`}</div>`}};_a.styles=[xt.globalCss,c$],Cu([ht()],_a.prototype,"walletId",2),Cu([ht()],_a.prototype,"imageId",2),Cu([cn()],_a.prototype,"uri",2),_a=Cu([Dt("wcm-walletconnect-qr")],_a);var h$=Object.defineProperty,f$=Object.getOwnPropertyDescriptor,d$=(t,e,r,n)=>{for(var i=n>1?void 0:n?f$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&h$(e,r,i),i};let Id=class extends mt{viewTemplate(){return Ue.isAndroid()?ve`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Ue.isMobile()?ve`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:ve`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return ve`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};Id.styles=[xt.globalCss],Id=d$([Dt("wcm-connect-wallet-view")],Id);const p$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var g$=Object.defineProperty,m$=Object.getOwnPropertyDescriptor,X2=(t,e,r,n)=>{for(var i=n>1?void 0:n?m$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&g$(e,r,i),i};let Du=class extends mt{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=Ue.getWalletRouterData(),n=e?.native;if(n){const i=Ue.formatNativeUrl(n,t,r);Ue.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:t}=hr.state,e=Ue.getWalletRouterData();nt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Ue.getWalletRouterData(),{isMobile:n,isWeb:i}=nt.getCachedRouterWalletPlatforms();return ve`<wcm-modal-header title="${t}" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Nt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Du.styles=[xt.globalCss,p$],X2([cn()],Du.prototype,"isError",2),Du=X2([Dt("wcm-desktop-connecting-view")],Du);const v$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var w$=Object.defineProperty,y$=Object.getOwnPropertyDescriptor,b$=(t,e,r,n)=>{for(var i=n>1?void 0:n?y$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&w$(e,r,i),i};let Sd=class extends mt{onInstall(t){t&&Ue.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Ue.getWalletRouterData();return ve`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Nt.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};Sd.styles=[xt.globalCss,v$],Sd=b$([Dt("wcm-install-wallet-view")],Sd);const _$=$t`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var E$=Object.defineProperty,A$=Object.getOwnPropertyDescriptor,ey=(t,e,r,n)=>{for(var i=n>1?void 0:n?A$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&E$(e,r,i),i};let Ou=class extends mt{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Ue.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Ue.formatNativeUrl(i,t,n);Ue.openHref(c,"_self")}else if(o){const c=Ue.formatUniversalUrl(o,t,n);Ue.openHref(c,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=hr.state,r=Ue.getWalletRouterData();nt.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&Ue.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Ue.getWalletRouterData(),{isWeb:o}=nt.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return ve`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${o}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Nt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${l?ve`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Wr(r)}"></wcm-wallet-image><wcm-text>${`Get ${t}`}</wcm-text></div><wcm-button .iconRight="${Nt.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Ou.styles=[xt.globalCss,_$],ey([cn()],Ou.prototype,"isError",2),Ou=ey([Dt("wcm-mobile-connecting-view")],Ou);const x$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var I$=Object.defineProperty,S$=Object.getOwnPropertyDescriptor,C$=(t,e,r,n)=>{for(var i=n>1?void 0:n?S$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&I$(e,r,i),i};let Cd=class extends mt{render(){const{name:t,id:e,image_id:r}=Ue.getWalletRouterData(),{isDesktop:n,isWeb:i}=nt.getCachedRouterWalletPlatforms();return ve`<wcm-modal-header title="${t}" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Wr(r)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};Cd.styles=[xt.globalCss,x$],Cd=C$([Dt("wcm-mobile-qr-connecting-view")],Cd);var D$=Object.defineProperty,O$=Object.getOwnPropertyDescriptor,M$=(t,e,r,n)=>{for(var i=n>1?void 0:n?O$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&D$(e,r,i),i};let Dd=class extends mt{render(){return ve`<wcm-modal-header title="Scan the code" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};Dd.styles=[xt.globalCss],Dd=M$([Dt("wcm-qrcode-view")],Dd);const P$=$t`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var $$=Object.defineProperty,T$=Object.getOwnPropertyDescriptor,Uc=(t,e,r,n)=>{for(var i=n>1?void 0:n?T$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$$(e,r,i),i};const Od=40;let ho=class extends mt{constructor(){super(...arguments),this.loading=!an.state.wallets.listings.length,this.firstFetch=!an.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=nt.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,an.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),an.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return nt.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=an.state,{listings:r,total:n}=this.search?e:t;return n<=Od||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=an.state,{listings:n,total:i,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||i>Od&&n.length<i))try{this.loading=!0;const c=(t=hr.state.chains)==null?void 0:t.join(","),{listings:l}=await an.getWallets({page:this.firstFetch?1:o+1,entries:Od,search:this.search,version:2,chains:c}),f=l.map(h=>nt.getWalletIcon(h));await Promise.all([...f.map(async h=>nt.preloadImage(h)),Ue.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),vs.openToast(nt.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Ue.isAndroid()?nt.handleMobileLinking(t):nt.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=an.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Is.manualWalletsTemplate(),c=Is.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:h})=>nt.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>nt.caseSafeIncludes(h[0],this.search)));const l=!this.loading&&!r.length&&!c.length,f={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":l};return ve`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${Wi(f)}"><div class="wcm-grid">${n?null:o} ${n?null:c} ${n?null:r.map(h=>ve`${h?ve`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${l?ve`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!l&&this.loading?ve`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ho.styles=[xt.globalCss,P$],Uc([cn()],ho.prototype,"loading",2),Uc([cn()],ho.prototype,"firstFetch",2),Uc([cn()],ho.prototype,"search",2),Uc([cn()],ho.prototype,"endReached",2),ho=Uc([Dt("wcm-wallet-explorer-view")],ho);const N$=$t`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var R$=Object.defineProperty,L$=Object.getOwnPropertyDescriptor,ty=(t,e,r,n)=>{for(var i=n>1?void 0:n?L$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&R$(e,r,i),i};let Mu=class extends mt{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=Ue.getWalletRouterData(),n=e?.universal;if(n){const i=Ue.formatUniversalUrl(n,t,r);Ue.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:t}=hr.state,e=Ue.getWalletRouterData();nt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Ue.getWalletRouterData(),{isMobile:n,isDesktop:i}=nt.getCachedRouterWalletPlatforms(),o=Ue.isMobile();return ve`<wcm-modal-header title="${t}" .onAction="${nt.handleUriCopy}" .actionIcon="${Nt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Wr(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${o?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Nt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Mu.styles=[xt.globalCss,N$],ty([cn()],Mu.prototype,"isError",2),Mu=ty([Dt("wcm-web-connecting-view")],Mu);var B$=Object.freeze({__proto__:null,get WcmModal(){return ba},get WcmQrCode(){return Gi}});Vn.EthereumProvider=aD,Vn.OPTIONAL_EVENTS=Dw,Vn.OPTIONAL_METHODS=Cw,Vn.REQUIRED_EVENTS=tu,Vn.REQUIRED_METHODS=eu,Vn.default=iu,Object.defineProperty(Vn,"__esModule",{value:!0})});
|
|
123
123
|
//# sourceMappingURL=index.umd.js.map
|