@ledgerhq/connect-kit 1.1.0-beta.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -1
- package/dist/umd/components/Modal/Modal.d.ts +0 -1
- package/dist/umd/index.d.ts +1 -4
- package/dist/umd/index.js +12 -12
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/lib/supportOptions.d.ts +1 -3
- package/dist/umd/support/EthereumProvider/EthereumProvider.d.ts +24 -21
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
@@ -169,7 +169,7 @@ t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?i-1:0,h=
|
|
169
169
|
`,vt=rt.a`
|
170
170
|
color: #BBB0FF;
|
171
171
|
cursor: pointer;
|
172
|
-
`;
|
172
|
+
`;let mt=e=>{};const _t=({onClose:e,children:t})=>{const[n,r]=w.exports.useState(!0);mt=r;const i=()=>{mt(!1),e&&e()},o=e=>{var t;"ModalWrapper"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.id)&&i()};return n?_.exports.jsxs(_.exports.Fragment,{children:[_.exports.jsx(it,{}),_.exports.jsx(ct,Object.assign({id:"ModalWrapper",onClick:o},{children:_.exports.jsxs(ut,{children:[_.exports.jsxs(ht,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='72' height='24' viewBox='0 0 72 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M61.3616 22.4887V23.9996H71.7318V17.1853H70.2208V22.4887H61.3616ZM61.3616 0V1.51096H70.2208V6.81473H71.7318V0H61.3616ZM56.0137 11.689V8.17796H58.3842C59.5398 8.17796 59.9546 8.56305 59.9546 9.61506V10.2372C59.9546 11.3186 59.5545 11.689 58.3842 11.689H56.0137ZM59.7764 12.311C60.8578 12.0296 61.6133 11.022 61.6133 9.82231C61.6133 9.06683 61.3172 8.38521 60.7542 7.83698C60.0432 7.15536 59.0948 6.81473 57.8653 6.81473H54.5322V17.1849H56.0137V13.0518H58.2361C59.3767 13.0518 59.836 13.5258 59.836 14.7112V17.1853H61.3469V14.9482C61.3469 13.3186 60.9618 12.6965 59.7764 12.5187V12.311ZM47.303 12.6517H51.866V11.2888H47.303V8.17761H52.3102V6.81473H45.7916V17.1849H52.5325V15.822H47.303V12.6517ZM42.3398 13.1999V13.9109C42.3398 15.4072 41.7916 15.8963 40.414 15.8963H40.0881C38.7102 15.8963 38.0436 15.4516 38.0436 13.3925V10.6072C38.0436 8.53329 38.7399 8.10338 40.1175 8.10338H40.4137C41.7618 8.10338 42.1914 8.60716 42.2061 9.99979H43.8357C43.6876 7.9553 42.3248 6.66665 40.2803 6.66665C39.2878 6.66665 38.4581 6.97787 37.836 7.57021C36.9027 8.44437 36.3842 9.92593 36.3842 11.9998C36.3842 13.9999 36.8288 15.4814 37.7471 16.3997C38.3692 17.0071 39.2286 17.333 40.073 17.333C40.9619 17.333 41.7769 16.9773 42.1914 16.2071H42.3986V17.1849H43.7615V11.837H39.7467V13.1999H42.3398ZM29.2737 8.17761H30.8886C32.4146 8.17761 33.2443 8.5627 33.2443 10.6369V13.3627C33.2443 15.4366 32.4146 15.822 30.8886 15.822H29.2737V8.17761ZM31.0216 17.1853C33.8513 17.1853 34.903 15.0372 34.903 12.0002C34.903 8.91874 33.7771 6.81509 30.9919 6.81509H27.7917V17.1853H31.0216ZM20.6367 12.6517H25.1997V11.2888H20.6367V8.17761H25.644V6.81473H19.1254V17.1849H25.8663V15.822H20.6367V12.6517ZM11.8962 6.81473H10.3852V17.1849H17.2V15.822H11.8962V6.81473ZM0 17.1853V24H10.3702V22.4887H1.51096V17.1853H0ZM0 0V6.81473H1.51096V1.51096H10.3702V0H0Z' fill='white'/%3e%3c/svg%3e"}),_.exports.jsx(lt,Object.assign({onClick:i},{children:_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M22 2L2 22' stroke='white' stroke-width='3'/%3e%3cpath d='M2 2L22 22' stroke='white' stroke-width='3'/%3e%3c/svg%3e"})}))]}),_.exports.jsx(_.exports.Fragment,{children:t})]})}))]}):null};var bt,wt,Et,St,Ot={exports:{}},Rt={},xt={exports:{}},It={};function Ct(){return wt||(wt=1,function(e){e.exports=(bt||(bt=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,s=o>>>1;r<s;){var a=2*(r+1)-1,c=e[a],u=a+1,l=e[u];if(0>i(c,n))u<o&&0>i(l,c)?(e[r]=l,e[u]=n,r=u):(e[r]=c,e[a]=n,r=a);else{if(!(u<o&&0>i(l,n)))break e;e[r]=l,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],u=[],l=1,f=null,h=3,d=!1,p=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var i=n(u);null!==i;){if(null===i.callback)r(u);else{if(!(i.startTime<=e))break;r(u),i.sortIndex=i.expirationTime,t(c,i)}i=n(u)}}function b(e){if(g=!1,_(e),!p)if(null!==n(c))p=!0,A(w);else{var t=n(u);null!==t&&T(b,t.startTime-e)}}function w(t,i){p=!1,g&&(g=!1,v(R),R=-1),d=!0;var o=h;try{for(_(i),f=n(c);null!==f&&(!(f.expirationTime>i)||t&&!C());){var s=f.callback;if("function"==typeof s){f.callback=null,h=f.priorityLevel;var a=s(f.expirationTime<=i);i=e.unstable_now(),"function"==typeof a?f.callback=a:f===n(c)&&r(c),_(i)}else r(c);f=n(c)}if(null!==f)var l=!0;else{var y=n(u);null!==y&&T(b,y.startTime-i),l=!1}return l}finally{f=null,h=o,d=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,S=!1,O=null,R=-1,x=5,I=-1;function C(){return!(e.unstable_now()-I<x)}function P(){if(null!==O){var t=e.unstable_now();I=t;var n=!0;try{n=O(!0,t)}finally{n?E():(S=!1,O=null)}}else S=!1}if("function"==typeof m)E=function(){m(P)};else if("undefined"!=typeof MessageChannel){var k=new MessageChannel,N=k.port2;k.port1.onmessage=P,E=function(){N.postMessage(null)}}else E=function(){y(P,0)};function A(e){O=e,S||(S=!0,E())}function T(t,n){R=y((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||d||(p=!0,A(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(r,i,o){var s=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?s+o:s,r){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return r={id:l++,callback:i,priorityLevel:r,startTime:o,expirationTime:a=o+a,sortIndex:-1},o>s?(r.sortIndex=o,t(u,r),null===n(c)&&r===n(u)&&(g?(v(R),R=-1):g=!0,T(b,o-s))):(r.sortIndex=a,t(c,r),p||d||(p=!0,A(w))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(It)),It)}(xt)),xt.exports}
|
173
173
|
/**
|
174
174
|
* @license React
|
175
175
|
* react-dom.production.min.js
|
@@ -178,7 +178,7 @@ t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?i-1:0,h=
|
|
178
178
|
*
|
179
179
|
* This source code is licensed under the MIT license found in the
|
180
180
|
* LICENSE file in the root directory of this source tree.
|
181
|
-
*/function Nt(){if(Ot)return It;Ot=1;var e=w.exports,t=kt();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(e,t){s(e,t),s(e+"Capture",t)}function s(e,t){for(i[e]=t,e=0;e<t.length;e++)r.add(t[e])}var a=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,l={},f={};function h(e,t,n,r,i,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var d={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){d[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];d[t]=new h(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){d[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){d[e]=new h(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){d[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){d[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){d[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){d[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){d[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var p=/[\-:]([a-z])/g;function g(e){return e[1].toUpperCase()}function y(e,t,n,r){var i=d.hasOwnProperty(t)?d[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!c.call(f,e)||!c.call(l,e)&&(u.test(e)?f[e]=!0:(l[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(p,g);d[t]=new h(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(p,g);d[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(p,g);d[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){d[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)})),d.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){d[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)}));var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,m=Symbol.for("react.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),R=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),A=Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=A&&e[A]||e["@@iterator"])?e:null}var M,L=Object.assign;function U(e){if(void 0===M)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var j=!1;function D(e,t){if(!e||j)return"";j=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a]){var c="\n"+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=s&&0<=a);break}}}finally{j=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?U(e):""}function z(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=D(e.type,!1);case 11:return e=D(e.type.render,!1);case 1:return e=D(e.type,!0);default:return""}}function B(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case b:return"Fragment";case _:return"Portal";case S:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case R:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case x:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case P:return null!==(t=e.displayName||null)?t:B(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return B(e(t))}catch(e){}}return null}function F(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return B(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function $(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function W(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function G(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Y(e,t){null!=(t=t.checked)&&y(e,"checked",t,!1)}function Q(e,t){Y(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?X(e,t.type,n):t.hasOwnProperty("defaultValue")&&X(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function X(e,t,n){"number"===t&&W(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Z=Array.isArray;function ee(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function te(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return L({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ne(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Z(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:H(r)}}function re(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ae,ce,ue=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ae=ae||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ae.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function le(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function de(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function pe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=de(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(fe).forEach((function(e){he.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]}))}));var ge=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ge[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var me=null;function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var be=null,we=null,Ee=null;function Se(e){if(e=bi(e)){if("function"!=typeof be)throw Error(n(280));var t=e.stateNode;t&&(t=Ei(t),be(e.stateNode,e.type,t))}}function Oe(e){we?Ee?Ee.push(e):Ee=[e]:we=e}function Re(){if(we){var e=we,t=Ee;if(Ee=we=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function xe(e,t){return e(t)}function Ie(){}var Ce=!1;function Pe(e,t,n){if(Ce)return e(t,n);Ce=!0;try{return xe(e,t,n)}finally{Ce=!1,(null!==we||null!==Ee)&&(Ie(),Re())}}function ke(e,t){var r=e.stateNode;if(null===r)return null;var i=Ei(r);if(null===i)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Ne=!1;if(a)try{var Ae={};Object.defineProperty(Ae,"passive",{get:function(){Ne=!0}}),window.addEventListener("test",Ae,Ae),window.removeEventListener("test",Ae,Ae)}catch(ce){Ne=!1}function Te(e,t,n,r,i,o,s,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var Me=!1,Le=null,Ue=!1,je=null,De={onError:function(e){Me=!0,Le=e}};function ze(e,t,n,r,i,o,s,a,c){Me=!1,Le=null,Te.apply(De,arguments)}function Be(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Fe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(Be(e)!==e)throw Error(n(188))}function $e(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Be(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,i=t;;){var o=r.return;if(null===o)break;var s=o.alternate;if(null===s){if(null!==(i=o.return)){r=i;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===r)return He(o),e;if(s===i)return He(o),t;s=s.sibling}throw Error(n(188))}if(r.return!==i.return)r=o,i=s;else{for(var a=!1,c=o.child;c;){if(c===r){a=!0,r=o,i=s;break}if(c===i){a=!0,i=o,r=s;break}c=c.sibling}if(!a){for(c=s.child;c;){if(c===r){a=!0,r=s,i=o;break}if(c===i){a=!0,i=s,r=o;break}c=c.sibling}if(!a)throw Error(n(189))}}if(r.alternate!==i)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?Ve(e):null}function Ve(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ve(e);if(null!==t)return t;e=e.sibling}return null}var qe=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ke=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ye=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,et=t.unstable_LowPriority,tt=t.unstable_IdlePriority,nt=null,rt=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/st|0)|0},ot=Math.log,st=Math.LN2;var at=64,ct=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=268435455&n;if(0!==s){var a=s&~i;0!==a?r=ut(a):0!==(o&=s)&&(r=ut(o))}else 0!==(s=n&~i)?r=ut(s):0!==o&&(r=ut(o));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-it(t)),r|=e[n],t&=~i;return r}function ft(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ht(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function dt(){var e=at;return 0==(4194240&(at<<=1))&&(at=64),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var vt=0;function mt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var _t,bt,wt,Et,St,Rt=!1,xt=[],Ct=null,Pt=null,Nt=null,At=new Map,Tt=new Map,Mt=[],Lt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ut(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":Pt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":At.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tt.delete(t.pointerId)}}function jt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&(null!==(t=bi(t))&&bt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Dt(e){var t=_i(e.target);if(null!==t){var n=Be(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Fe(n)))return e.blockedOn=t,void St(e.priority,(function(){wt(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function zt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=bi(n))&&bt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);me=r,n.target.dispatchEvent(r),me=null,t.shift()}return!0}function Bt(e,t,n){zt(e)&&n.delete(t)}function Ft(){Rt=!1,null!==Ct&&zt(Ct)&&(Ct=null),null!==Pt&&zt(Pt)&&(Pt=null),null!==Nt&&zt(Nt)&&(Nt=null),At.forEach(Bt),Tt.forEach(Bt)}function Ht(e,n){e.blockedOn===n&&(e.blockedOn=null,Rt||(Rt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ft)))}function $t(e){function t(t){return Ht(t,e)}if(0<xt.length){Ht(xt[0],e);for(var n=1;n<xt.length;n++){var r=xt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ct&&Ht(Ct,e),null!==Pt&&Ht(Pt,e),null!==Nt&&Ht(Nt,e),At.forEach(t),Tt.forEach(t),n=0;n<Mt.length;n++)(r=Mt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Mt.length&&null===(n=Mt[0]).blockedOn;)Dt(n),null===n.blockedOn&&Mt.shift()}var Vt=v.ReactCurrentBatchConfig,qt=!0;function Wt(e,t,n,r){var i=vt,o=Vt.transition;Vt.transition=null;try{vt=1,Gt(e,t,n,r)}finally{vt=i,Vt.transition=o}}function Kt(e,t,n,r){var i=vt,o=Vt.transition;Vt.transition=null;try{vt=4,Gt(e,t,n,r)}finally{vt=i,Vt.transition=o}}function Gt(e,t,n,r){if(qt){var i=Qt(e,t,n,r);if(null===i)qr(e,t,r,Yt,n),Ut(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Ct=jt(Ct,e,t,n,r,i),!0;case"dragenter":return Pt=jt(Pt,e,t,n,r,i),!0;case"mouseover":return Nt=jt(Nt,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return At.set(o,jt(At.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Tt.set(o,jt(Tt.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Ut(e,r),4&t&&-1<Lt.indexOf(e)){for(;null!==i;){var o=bi(i);if(null!==o&&_t(o),null===(o=Qt(e,t,n,r))&&qr(e,t,r,Yt,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else qr(e,t,r,null,n)}}var Yt=null;function Qt(e,t,n,r){if(Yt=null,null!==(e=_i(e=_e(r))))if(null===(t=Be(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Fe(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yt=e,null}function Jt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qe()){case Je:return 1;case Xe:return 4;case Ze:case et:return 16;case tt:return 536870912;default:return 16}default:return 16}}var Xt=null,Zt=null,en=null;function tn(){if(en)return en;var e,t,n=Zt,r=n.length,i="value"in Xt?Xt.value:Xt.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var s=r-e;for(t=1;t<=s&&n[r-t]===i[o-t];t++);return en=i.slice(e,1<t?1-t:void 0)}function nn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rn(){return!0}function on(){return!1}function sn(e){function t(t,n,r,i,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rn:on,this.isPropagationStopped=on,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var an,cn,un,ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=sn(ln),hn=L({},ln,{view:0,detail:0}),dn=sn(hn),pn=L({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(an=e.screenX-un.screenX,cn=e.screenY-un.screenY):cn=an=0,un=e),an)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=sn(pn),yn=sn(L({},pn,{dataTransfer:0})),vn=sn(L({},hn,{relatedTarget:0})),mn=sn(L({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),_n=L({},ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=sn(_n),wn=sn(L({},ln,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},On={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=On[e])&&!!t[e]}function xn(){return Rn}var In=L({},hn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=nn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xn,charCode:function(e){return"keypress"===e.type?nn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?nn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Cn=sn(In),Pn=sn(L({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=sn(L({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xn})),Nn=sn(L({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=L({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Tn=sn(An),Mn=[9,13,27,32],Ln=a&&"CompositionEvent"in window,Un=null;a&&"documentMode"in document&&(Un=document.documentMode);var jn=a&&"TextEvent"in window&&!Un,Dn=a&&(!Ln||Un&&8<Un&&11>=Un),zn=String.fromCharCode(32),Bn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var $n=!1;var Vn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function Wn(e,t,n,r){Oe(r),0<(t=Kr(t,"onChange")).length&&(n=new fn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Gn=null;function Yn(e){zr(e,0)}function Qn(e){if(q(wi(e)))return e}function Jn(e,t){if("change"===e)return t}var Xn=!1;if(a){var Zn;if(a){var er="oninput"in document;if(!er){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),er="function"==typeof tr.oninput}Zn=er}else Zn=!1;Xn=Zn&&(!document.documentMode||9<document.documentMode)}function nr(){Kn&&(Kn.detachEvent("onpropertychange",rr),Gn=Kn=null)}function rr(e){if("value"===e.propertyName&&Qn(Gn)){var t=[];Wn(t,Gn,e,_e(e)),Pe(Yn,t)}}function ir(e,t,n){"focusin"===e?(nr(),Gn=n,(Kn=t).attachEvent("onpropertychange",rr)):"focusout"===e&&nr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Gn)}function sr(e,t){if("click"===e)return Qn(t)}function ar(e,t){if("input"===e||"change"===e)return Qn(t)}var cr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ur(e,t){if(cr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!c.call(t,i)||!cr(e[i],t[i]))return!1}return!0}function lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fr(e,t){var n,r=lr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lr(r)}}function hr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dr(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=W((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function gr(e){var t=dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=fr(n,o);var s=fr(n,r);i&&s&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var yr=a&&"documentMode"in document&&11>=document.documentMode,vr=null,mr=null,_r=null,br=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==vr||vr!==W(r)||("selectionStart"in(r=vr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},_r&&ur(_r,r)||(_r=r,0<(r=Kr(mr,"onSelect")).length&&(t=new fn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:Er("Animation","AnimationEnd"),animationiteration:Er("Animation","AnimationIteration"),animationstart:Er("Animation","AnimationStart"),transitionend:Er("Transition","TransitionEnd")},Or={},Rr={};function xr(e){if(Or[e])return Or[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Rr)return Or[e]=n[t];return e}a&&(Rr=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var Ir=xr("animationend"),Cr=xr("animationiteration"),Pr=xr("animationstart"),kr=xr("transitionend"),Nr=new Map,Ar="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Tr(e,t){Nr.set(e,t),o(t,[e])}for(var Mr=0;Mr<Ar.length;Mr++){var Lr=Ar[Mr];Tr(Lr.toLowerCase(),"on"+(Lr[0].toUpperCase()+Lr.slice(1)))}Tr(Ir,"onAnimationEnd"),Tr(Cr,"onAnimationIteration"),Tr(Pr,"onAnimationStart"),Tr("dblclick","onDoubleClick"),Tr("focusin","onFocus"),Tr("focusout","onBlur"),Tr(kr,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ur="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),jr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ur));function Dr(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,i,o,s,a,c,u){if(ze.apply(this,arguments),Me){if(!Me)throw Error(n(198));var l=Le;Me=!1,Le=null,Ue||(Ue=!0,je=l)}}(i,t,void 0,e),e.currentTarget=null}function zr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==o&&i.isPropagationStopped())break e;Dr(i,a,u),o=c}else for(s=0;s<r.length;s++){if(c=(a=r[s]).instance,u=a.currentTarget,a=a.listener,c!==o&&i.isPropagationStopped())break e;Dr(i,a,u),o=c}}}if(Ue)throw e=je,Ue=!1,je=null,e}function Br(e,t){var n=t[yi];void 0===n&&(n=t[yi]=new Set);var r=e+"__bubble";n.has(r)||(Vr(t,e,2,!1),n.add(r))}function Fr(e,t,n){var r=0;t&&(r|=4),Vr(n,e,r,t)}var Hr="_reactListening"+Math.random().toString(36).slice(2);function $r(e){if(!e[Hr]){e[Hr]=!0,r.forEach((function(t){"selectionchange"!==t&&(jr.has(t)||Fr(t,!1,e),Fr(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Hr]||(t[Hr]=!0,Fr("selectionchange",!1,t))}}function Vr(e,t,n,r){switch(Jt(t)){case 1:var i=Wt;break;case 4:i=Kt;break;default:i=Gt}n=i.bind(null,t,n,e),i=void 0,!Ne||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function qr(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===s)for(s=r.return;null!==s;){var c=s.tag;if((3===c||4===c)&&((c=s.stateNode.containerInfo)===i||8===c.nodeType&&c.parentNode===i))return;s=s.return}for(;null!==a;){if(null===(s=_i(a)))return;if(5===(c=s.tag)||6===c){r=o=s;continue e}a=a.parentNode}}r=r.return}Pe((function(){var r=o,i=_e(n),s=[];e:{var a=Nr.get(e);if(void 0!==a){var c=fn,u=e;switch(e){case"keypress":if(0===nn(n))break e;case"keydown":case"keyup":c=Cn;break;case"focusin":u="focus",c=vn;break;case"focusout":u="blur",c=vn;break;case"beforeblur":case"afterblur":c=vn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=kn;break;case Ir:case Cr:case Pr:c=mn;break;case kr:c=Nn;break;case"scroll":c=dn;break;case"wheel":c=Tn;break;case"copy":case"cut":case"paste":c=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=Pn}var l=0!=(4&t),f=!l&&"scroll"===e,h=l?null!==a?a+"Capture":null:a;l=[];for(var d,p=r;null!==p;){var g=(d=p).stateNode;if(5===d.tag&&null!==g&&(d=g,null!==h&&(null!=(g=ke(p,h))&&l.push(Wr(p,g,d)))),f)break;p=p.return}0<l.length&&(a=new c(a,u,null,n,i),s.push({event:a,listeners:l}))}}if(0==(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===me||!(u=n.relatedTarget||n.fromElement)||!_i(u)&&!u[gi])&&(c||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?_i(u):null)&&(u!==(f=Be(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(c=null,u=r),c!==u)){if(l=gn,g="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(l=Pn,g="onPointerLeave",h="onPointerEnter",p="pointer"),f=null==c?a:wi(c),d=null==u?a:wi(u),(a=new l(g,p+"leave",c,n,i)).target=f,a.relatedTarget=d,g=null,_i(i)===r&&((l=new l(h,p+"enter",u,n,i)).target=d,l.relatedTarget=f,g=l),f=g,c&&u)e:{for(h=u,p=0,d=l=c;d;d=Gr(d))p++;for(d=0,g=h;g;g=Gr(g))d++;for(;0<p-d;)l=Gr(l),p--;for(;0<d-p;)h=Gr(h),d--;for(;p--;){if(l===h||null!==h&&l===h.alternate)break e;l=Gr(l),h=Gr(h)}l=null}else l=null;null!==c&&Yr(s,a,c,l,!1),null!==u&&null!==f&&Yr(s,f,u,l,!0)}if("select"===(c=(a=r?wi(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===c&&"file"===a.type)var y=Jn;else if(qn(a))if(Xn)y=ar;else{y=or;var v=ir}else(c=a.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(y=sr);switch(y&&(y=y(e,r))?Wn(s,y,n,i):(v&&v(e,a,r),"focusout"===e&&(v=a._wrapperState)&&v.controlled&&"number"===a.type&&X(a,"number",a.value)),v=r?wi(r):window,e){case"focusin":(qn(v)||"true"===v.contentEditable)&&(vr=v,mr=r,_r=null);break;case"focusout":_r=mr=vr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,wr(s,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":wr(s,n,i)}var m;if(Ln)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else $n?Fn(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(Dn&&"ko"!==n.locale&&($n||"onCompositionStart"!==_?"onCompositionEnd"===_&&$n&&(m=tn()):(Zt="value"in(Xt=i)?Xt.value:Xt.textContent,$n=!0)),0<(v=Kr(r,_)).length&&(_=new wn(_,e,null,n,i),s.push({event:_,listeners:v}),m?_.data=m:null!==(m=Hn(n))&&(_.data=m))),(m=jn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(Bn=!0,zn);case"textInput":return(e=t.data)===zn&&Bn?null:e;default:return null}}(e,n):function(e,t){if($n)return"compositionend"===e||!Ln&&Fn(e,t)?(e=tn(),en=Zt=Xt=null,$n=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Kr(r,"onBeforeInput")).length&&(i=new wn("onBeforeInput","beforeinput",null,n,i),s.push({event:i,listeners:r}),i.data=m))}zr(s,t)}))}function Wr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=ke(e,n))&&r.unshift(Wr(e,o,i)),null!=(o=ke(e,t))&&r.push(Wr(e,o,i))),e=e.return}return r}function Gr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Yr(e,t,n,r,i){for(var o=t._reactName,s=[];null!==n&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(null!==c&&c===r)break;5===a.tag&&null!==u&&(a=u,i?null!=(c=ke(n,o))&&s.unshift(Wr(n,c,a)):i||null!=(c=ke(n,o))&&s.push(Wr(n,c,a))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var Qr=/\r\n?/g,Jr=/\u0000|\uFFFD/g;function Xr(e){return("string"==typeof e?e:""+e).replace(Qr,"\n").replace(Jr,"")}function Zr(e,t,r){if(t=Xr(t),Xr(e)!==t&&r)throw Error(n(425))}function ei(){}var ti=null,ni=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ii="function"==typeof setTimeout?setTimeout:void 0,oi="function"==typeof clearTimeout?clearTimeout:void 0,si="function"==typeof Promise?Promise:void 0,ai="function"==typeof queueMicrotask?queueMicrotask:void 0!==si?function(e){return si.resolve(null).then(e).catch(ci)}:ii;function ci(e){setTimeout((function(){throw e}))}function ui(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void $t(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);$t(t)}function li(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function fi(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var hi=Math.random().toString(36).slice(2),di="__reactFiber$"+hi,pi="__reactProps$"+hi,gi="__reactContainer$"+hi,yi="__reactEvents$"+hi,vi="__reactListeners$"+hi,mi="__reactHandles$"+hi;function _i(e){var t=e[di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gi]||n[di]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=fi(e);null!==e;){if(n=e[di])return n;e=fi(e)}return t}n=(e=n).parentNode}return null}function bi(e){return!(e=e[di]||e[gi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function Ei(e){return e[pi]||null}var Si=[],Oi=-1;function Ri(e){return{current:e}}function xi(e){0>Oi||(e.current=Si[Oi],Si[Oi]=null,Oi--)}function Ii(e,t){Oi++,Si[Oi]=e.current,e.current=t}var Ci={},Pi=Ri(Ci),ki=Ri(!1),Ni=Ci;function Ai(e,t){var n=e.type.contextTypes;if(!n)return Ci;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ti(e){return null!=(e=e.childContextTypes)}function Mi(){xi(ki),xi(Pi)}function Li(e,t,r){if(Pi.current!==Ci)throw Error(n(168));Ii(Pi,t),Ii(ki,r)}function Ui(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,"function"!=typeof i.getChildContext)return r;for(var o in i=i.getChildContext())if(!(o in t))throw Error(n(108,F(e)||"Unknown",o));return L({},r,i)}function ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ci,Ni=Pi.current,Ii(Pi,e),Ii(ki,ki.current),!0}function Di(e,t,r){var i=e.stateNode;if(!i)throw Error(n(169));r?(e=Ui(e,t,Ni),i.__reactInternalMemoizedMergedChildContext=e,xi(ki),xi(Pi),Ii(Pi,e)):xi(ki),Ii(ki,r)}var zi=null,Bi=!1,Fi=!1;function Hi(e){null===zi?zi=[e]:zi.push(e)}function $i(){if(!Fi&&null!==zi){Fi=!0;var e=0,t=vt;try{var n=zi;for(vt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}zi=null,Bi=!1}catch(t){throw null!==zi&&(zi=zi.slice(e+1)),qe(Je,$i),t}finally{vt=t,Fi=!1}}return null}var Vi=[],qi=0,Wi=null,Ki=0,Gi=[],Yi=0,Qi=null,Ji=1,Xi="";function Zi(e,t){Vi[qi++]=Ki,Vi[qi++]=Wi,Wi=e,Ki=t}function eo(e,t,n){Gi[Yi++]=Ji,Gi[Yi++]=Xi,Gi[Yi++]=Qi,Qi=e;var r=Ji;e=Xi;var i=32-it(r)-1;r&=~(1<<i),n+=1;var o=32-it(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Ji=1<<32-it(t)+i|n<<i|r,Xi=o+e}else Ji=1<<o|n<<i|r,Xi=e}function to(e){null!==e.return&&(Zi(e,1),eo(e,1,0))}function no(e){for(;e===Wi;)Wi=Vi[--qi],Vi[qi]=null,Ki=Vi[--qi],Vi[qi]=null;for(;e===Qi;)Qi=Gi[--Yi],Gi[Yi]=null,Xi=Gi[--Yi],Gi[Yi]=null,Ji=Gi[--Yi],Gi[Yi]=null}var ro=null,io=null,oo=!1,so=null;function ao(e,t){var n=Tu(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function co(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ro=e,io=li(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ro=e,io=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Qi?{id:Ji,overflow:Xi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Tu(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ro=e,io=null,!0);default:return!1}}function uo(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function lo(e){if(oo){var t=io;if(t){var r=t;if(!co(e,t)){if(uo(e))throw Error(n(418));t=li(r.nextSibling);var i=ro;t&&co(e,t)?ao(i,r):(e.flags=-4097&e.flags|2,oo=!1,ro=e)}}else{if(uo(e))throw Error(n(418));e.flags=-4097&e.flags|2,oo=!1,ro=e}}}function fo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ro=e}function ho(e){if(e!==ro)return!1;if(!oo)return fo(e),oo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=io)){if(uo(e))throw po(),Error(n(418));for(;t;)ao(e,t),t=li(t.nextSibling)}if(fo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){io=li(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}io=null}}else io=ro?li(e.stateNode.nextSibling):null;return!0}function po(){for(var e=io;e;)e=li(e.nextSibling)}function go(){io=ro=null,oo=!1}function yo(e){null===so?so=[e]:so.push(e)}var vo=v.ReactCurrentBatchConfig;function mo(e,t){if(e&&e.defaultProps){for(var n in t=L({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var _o=Ri(null),bo=null,wo=null,Eo=null;function So(){Eo=wo=bo=null}function Oo(e){var t=_o.current;xi(_o),e._currentValue=t}function Ro(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xo(e,t){bo=e,Eo=wo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(wa=!0),e.firstContext=null)}function Io(e){var t=e._currentValue;if(Eo!==e)if(e={context:e,memoizedValue:t,next:null},null===wo){if(null===bo)throw Error(n(308));wo=e,bo.dependencies={lanes:0,firstContext:e}}else wo=wo.next=e;return t}var Co=null;function Po(e){null===Co?Co=[e]:Co.push(e)}function ko(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Po(t)):(n.next=i.next,i.next=n),t.interleaved=n,No(e,r)}function No(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ao=!1;function To(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Lo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uo(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&kc)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,No(e,n)}return null===(i=r.interleaved)?(t.next=t,Po(r)):(t.next=i.next,i.next=t),r.interleaved=t,No(e,n)}function jo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}function Do(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function zo(e,t,n,r){var i=e.updateQueue;Ao=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var c=a,u=c.next;c.next=null,null===s?o=u:s.next=u,s=c;var l=e.alternate;null!==l&&((a=(l=l.updateQueue).lastBaseUpdate)!==s&&(null===a?l.firstBaseUpdate=u:a.next=u,l.lastBaseUpdate=c))}if(null!==o){var f=i.baseState;for(s=0,l=u=c=null,a=o;;){var h=a.lane,d=a.eventTime;if((r&h)===h){null!==l&&(l=l.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,g=a;switch(h=t,d=n,g.tag){case 1:if("function"==typeof(p=g.payload)){f=p.call(d,f,h);break e}f=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(h="function"==typeof(p=g.payload)?p.call(d,f,h):p))break e;f=L({},f,h);break e;case 2:Ao=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[a]:h.push(a))}else d={eventTime:d,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===l?(u=l=d,c=f):l=l.next=d,s|=h;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(h=a).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===l&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=l,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);Dc|=s,e.lanes=s,e.memoizedState=f}}function Bo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],o=i.callback;if(null!==o){if(i.callback=null,i=r,"function"!=typeof o)throw Error(n(191,o));o.call(i)}}}var Fo=(new e.Component).refs;function Ho(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:L({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var $o={isMounted:function(e){return!!(e=e._reactInternals)&&Be(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=nu(),i=ru(e),o=Lo(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=Uo(e,o,i))&&(iu(t,e,i,r),jo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=nu(),i=ru(e),o=Lo(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Uo(e,o,i))&&(iu(t,e,i,r),jo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nu(),r=ru(e),i=Lo(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=Uo(e,i,r))&&(iu(t,e,r,n),jo(t,e,r))}};function Vo(e,t,n,r,i,o,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,s):!t.prototype||!t.prototype.isPureReactComponent||(!ur(n,r)||!ur(i,o))}function qo(e,t,n){var r=!1,i=Ci,o=t.contextType;return"object"==typeof o&&null!==o?o=Io(o):(i=Ti(t)?Ni:Pi.current,o=(r=null!=(r=t.contextTypes))?Ai(e,i):Ci),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=$o,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Wo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&$o.enqueueReplaceState(t,t.state,null)}function Ko(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Fo,To(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=Io(o):(o=Ti(t)?Ni:Pi.current,i.context=Ai(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Ho(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&$o.enqueueReplaceState(i,i.state,null),zo(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function Go(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var i=r.stateNode}if(!i)throw Error(n(147,e));var o=i,s=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=o.refs;t===Fo&&(t=o.refs={}),null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function Yo(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qo(e){return(0,e._init)(e._payload)}function Jo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Lu(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=zu(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function u(e,t,n,r){var i=n.type;return i===b?f(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===k&&Qo(i)===t.type)?((r=o(t,n.props)).ref=Go(e,t,n),r.return=e,r):((r=Uu(n.type,n.key,n.props,null,e.mode,r)).ref=Go(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Bu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=ju(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=zu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case m:return(n=Uu(t.type,t.key,t.props,null,e.mode,n)).ref=Go(e,null,t),n.return=e,n;case _:return(t=Bu(t,e.mode,n)).return=e,t;case k:return h(e,(0,t._init)(t._payload),n)}if(Z(t)||T(t))return(t=ju(t,e.mode,n,null)).return=e,t;Yo(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:c(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case m:return n.key===i?u(e,t,n,r):null;case _:return n.key===i?l(e,t,n,r):null;case k:return d(e,t,(i=n._init)(n._payload),r)}if(Z(n)||T(n))return null!==i?null:f(e,t,n,r,null);Yo(e,n)}return null}function p(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return c(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case m:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case _:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case k:return p(e,t,n,(0,r._init)(r._payload),i)}if(Z(r)||T(r))return f(t,e=e.get(n)||null,r,i,null);Yo(t,r)}return null}function g(n,o,a,c){for(var u=null,l=null,f=o,g=o=0,y=null;null!==f&&g<a.length;g++){f.index>g?(y=f,f=null):y=f.sibling;var v=d(n,f,a[g],c);if(null===v){null===f&&(f=y);break}e&&f&&null===v.alternate&&t(n,f),o=s(v,o,g),null===l?u=v:l.sibling=v,l=v,f=y}if(g===a.length)return r(n,f),oo&&Zi(n,g),u;if(null===f){for(;g<a.length;g++)null!==(f=h(n,a[g],c))&&(o=s(f,o,g),null===l?u=f:l.sibling=f,l=f);return oo&&Zi(n,g),u}for(f=i(n,f);g<a.length;g++)null!==(y=p(f,n,g,a[g],c))&&(e&&null!==y.alternate&&f.delete(null===y.key?g:y.key),o=s(y,o,g),null===l?u=y:l.sibling=y,l=y);return e&&f.forEach((function(e){return t(n,e)})),oo&&Zi(n,g),u}function y(o,a,c,u){var l=T(c);if("function"!=typeof l)throw Error(n(150));if(null==(c=l.call(c)))throw Error(n(151));for(var f=l=null,g=a,y=a=0,v=null,m=c.next();null!==g&&!m.done;y++,m=c.next()){g.index>y?(v=g,g=null):v=g.sibling;var _=d(o,g,m.value,u);if(null===_){null===g&&(g=v);break}e&&g&&null===_.alternate&&t(o,g),a=s(_,a,y),null===f?l=_:f.sibling=_,f=_,g=v}if(m.done)return r(o,g),oo&&Zi(o,y),l;if(null===g){for(;!m.done;y++,m=c.next())null!==(m=h(o,m.value,u))&&(a=s(m,a,y),null===f?l=m:f.sibling=m,f=m);return oo&&Zi(o,y),l}for(g=i(o,g);!m.done;y++,m=c.next())null!==(m=p(g,o,y,m.value,u))&&(e&&null!==m.alternate&&g.delete(null===m.key?y:m.key),a=s(m,a,y),null===f?l=m:f.sibling=m,f=m);return e&&g.forEach((function(e){return t(o,e)})),oo&&Zi(o,y),l}return function e(n,i,s,c){if("object"==typeof s&&null!==s&&s.type===b&&null===s.key&&(s=s.props.children),"object"==typeof s&&null!==s){switch(s.$$typeof){case m:e:{for(var u=s.key,l=i;null!==l;){if(l.key===u){if((u=s.type)===b){if(7===l.tag){r(n,l.sibling),(i=o(l,s.props.children)).return=n,n=i;break e}}else if(l.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===k&&Qo(u)===l.type){r(n,l.sibling),(i=o(l,s.props)).ref=Go(n,l,s),i.return=n,n=i;break e}r(n,l);break}t(n,l),l=l.sibling}s.type===b?((i=ju(s.props.children,n.mode,c,s.key)).return=n,n=i):((c=Uu(s.type,s.key,s.props,null,n.mode,c)).ref=Go(n,i,s),c.return=n,n=c)}return a(n);case _:e:{for(l=s.key;null!==i;){if(i.key===l){if(4===i.tag&&i.stateNode.containerInfo===s.containerInfo&&i.stateNode.implementation===s.implementation){r(n,i.sibling),(i=o(i,s.children||[])).return=n,n=i;break e}r(n,i);break}t(n,i),i=i.sibling}(i=Bu(s,n.mode,c)).return=n,n=i}return a(n);case k:return e(n,i,(l=s._init)(s._payload),c)}if(Z(s))return g(n,i,s,c);if(T(s))return y(n,i,s,c);Yo(n,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==i&&6===i.tag?(r(n,i.sibling),(i=o(i,s)).return=n,n=i):(r(n,i),(i=zu(s,n.mode,c)).return=n,n=i),a(n)):r(n,i)}}var Xo=Jo(!0),Zo=Jo(!1),es={},ts=Ri(es),ns=Ri(es),rs=Ri(es);function is(e){if(e===es)throw Error(n(174));return e}function os(e,t){switch(Ii(rs,t),Ii(ns,e),Ii(ts,es),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:se(null,"");break;default:t=se(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}xi(ts),Ii(ts,t)}function ss(){xi(ts),xi(ns),xi(rs)}function as(e){is(rs.current);var t=is(ts.current),n=se(t,e.type);t!==n&&(Ii(ns,e),Ii(ts,n))}function cs(e){ns.current===e&&(xi(ts),xi(ns))}var us=Ri(0);function ls(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fs=[];function hs(){for(var e=0;e<fs.length;e++)fs[e]._workInProgressVersionPrimary=null;fs.length=0}var ds=v.ReactCurrentDispatcher,ps=v.ReactCurrentBatchConfig,gs=0,ys=null,vs=null,ms=null,_s=!1,bs=!1,ws=0,Es=0;function Ss(){throw Error(n(321))}function Os(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function Rs(e,t,r,i,o,s){if(gs=s,ys=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ds.current=null===e||null===e.memoizedState?ca:ua,e=r(i,o),bs){s=0;do{if(bs=!1,ws=0,25<=s)throw Error(n(301));s+=1,ms=vs=null,t.updateQueue=null,ds.current=la,e=r(i,o)}while(bs)}if(ds.current=aa,t=null!==vs&&null!==vs.next,gs=0,ms=vs=ys=null,_s=!1,t)throw Error(n(300));return e}function xs(){var e=0!==ws;return ws=0,e}function Is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ms?ys.memoizedState=ms=e:ms=ms.next=e,ms}function Cs(){if(null===vs){var e=ys.alternate;e=null!==e?e.memoizedState:null}else e=vs.next;var t=null===ms?ys.memoizedState:ms.next;if(null!==t)ms=t,vs=e;else{if(null===e)throw Error(n(310));e={memoizedState:(vs=e).memoizedState,baseState:vs.baseState,baseQueue:vs.baseQueue,queue:vs.queue,next:null},null===ms?ys.memoizedState=ms=e:ms=ms.next=e}return ms}function Ps(e,t){return"function"==typeof t?t(e):t}function ks(e){var t=Cs(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=vs,o=i.baseQueue,s=r.pending;if(null!==s){if(null!==o){var a=o.next;o.next=s.next,s.next=a}i.baseQueue=o=s,r.pending=null}if(null!==o){s=o.next,i=i.baseState;var c=a=null,u=null,l=s;do{var f=l.lane;if((gs&f)===f)null!==u&&(u=u.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),i=l.hasEagerState?l.eagerState:e(i,l.action);else{var h={lane:f,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};null===u?(c=u=h,a=i):u=u.next=h,ys.lanes|=f,Dc|=f}l=l.next}while(null!==l&&l!==s);null===u?a=i:u.next=c,cr(i,t.memoizedState)||(wa=!0),t.memoizedState=i,t.baseState=a,t.baseQueue=u,r.lastRenderedState=i}if(null!==(e=r.interleaved)){o=e;do{s=o.lane,ys.lanes|=s,Dc|=s,o=o.next}while(o!==e)}else null===o&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ns(e){var t=Cs(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=r.dispatch,o=r.pending,s=t.memoizedState;if(null!==o){r.pending=null;var a=o=o.next;do{s=e(s,a.action),a=a.next}while(a!==o);cr(s,t.memoizedState)||(wa=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),r.lastRenderedState=s}return[s,i]}function As(){}function Ts(e,t){var r=ys,i=Cs(),o=t(),s=!cr(i.memoizedState,o);if(s&&(i.memoizedState=o,wa=!0),i=i.queue,qs(Us.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||null!==ms&&1&ms.memoizedState.tag){if(r.flags|=2048,Bs(9,Ls.bind(null,r,i,o,t),void 0,null),null===Nc)throw Error(n(349));0!=(30&gs)||Ms(r,t,o)}return o}function Ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ys.updateQueue)?(t={lastEffect:null,stores:null},ys.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ls(e,t,n,r){t.value=n,t.getSnapshot=r,js(t)&&Ds(e)}function Us(e,t,n){return n((function(){js(t)&&Ds(e)}))}function js(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cr(e,n)}catch(e){return!0}}function Ds(e){var t=No(e,1);null!==t&&iu(t,e,1,-1)}function zs(e){var t=Is();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:e},t.queue=e,e=e.dispatch=ra.bind(null,ys,e),[t.memoizedState,e]}function Bs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ys.updateQueue)?(t={lastEffect:null,stores:null},ys.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return Cs().memoizedState}function Hs(e,t,n,r){var i=Is();ys.flags|=e,i.memoizedState=Bs(1|t,n,void 0,void 0===r?null:r)}function $s(e,t,n,r){var i=Cs();r=void 0===r?null:r;var o=void 0;if(null!==vs){var s=vs.memoizedState;if(o=s.destroy,null!==r&&Os(r,s.deps))return void(i.memoizedState=Bs(t,n,o,r))}ys.flags|=e,i.memoizedState=Bs(1|t,n,o,r)}function Vs(e,t){return Hs(8390656,8,e,t)}function qs(e,t){return $s(2048,8,e,t)}function Ws(e,t){return $s(4,2,e,t)}function Ks(e,t){return $s(4,4,e,t)}function Gs(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ys(e,t,n){return n=null!=n?n.concat([e]):null,$s(4,4,Gs.bind(null,t,e),n)}function Qs(){}function Js(e,t){var n=Cs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Os(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=Cs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Os(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Zs(e,t,n){return 0==(21&gs)?(e.baseState&&(e.baseState=!1,wa=!0),e.memoizedState=n):(cr(n,t)||(n=dt(),ys.lanes|=n,Dc|=n,e.baseState=!0),t)}function ea(e,t){var n=vt;vt=0!==n&&4>n?n:4,e(!0);var r=ps.transition;ps.transition={};try{e(!1),t()}finally{vt=n,ps.transition=r}}function ta(){return Cs().memoizedState}function na(e,t,n){var r=ru(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ia(e))oa(t,n);else if(null!==(n=ko(e,t,n,r))){iu(n,e,r,nu()),sa(n,t,r)}}function ra(e,t,n){var r=ru(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ia(e))oa(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,cr(a,s)){var c=t.interleaved;return null===c?(i.next=i,Po(t)):(i.next=c.next,c.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=ko(e,t,i,r))&&(iu(n,e,r,i=nu()),sa(n,t,r))}}function ia(e){var t=e.alternate;return e===ys||null!==t&&t===ys}function oa(e,t){bs=_s=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sa(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}var aa={readContext:Io,useCallback:Ss,useContext:Ss,useEffect:Ss,useImperativeHandle:Ss,useInsertionEffect:Ss,useLayoutEffect:Ss,useMemo:Ss,useReducer:Ss,useRef:Ss,useState:Ss,useDebugValue:Ss,useDeferredValue:Ss,useTransition:Ss,useMutableSource:Ss,useSyncExternalStore:Ss,useId:Ss,unstable_isNewReconciler:!1},ca={readContext:Io,useCallback:function(e,t){return Is().memoizedState=[e,void 0===t?null:t],e},useContext:Io,useEffect:Vs,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Hs(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Hs(4,2,e,t)},useMemo:function(e,t){var n=Is();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Is();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=na.bind(null,ys,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Is().memoizedState=e},useState:zs,useDebugValue:Qs,useDeferredValue:function(e){return Is().memoizedState=e},useTransition:function(){var e=zs(!1),t=e[0];return e=ea.bind(null,e[1]),Is().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ys,o=Is();if(oo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Nc)throw Error(n(349));0!=(30&gs)||Ms(i,t,r)}o.memoizedState=r;var s={value:r,getSnapshot:t};return o.queue=s,Vs(Us.bind(null,i,s,e),[e]),i.flags|=2048,Bs(9,Ls.bind(null,i,s,r,t),void 0,null),r},useId:function(){var e=Is(),t=Nc.identifierPrefix;if(oo){var n=Xi;t=":"+t+"R"+(n=(Ji&~(1<<32-it(Ji)-1)).toString(32)+n),0<(n=ws++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Es++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ua={readContext:Io,useCallback:Js,useContext:Io,useEffect:qs,useImperativeHandle:Ys,useInsertionEffect:Ws,useLayoutEffect:Ks,useMemo:Xs,useReducer:ks,useRef:Fs,useState:function(){return ks(Ps)},useDebugValue:Qs,useDeferredValue:function(e){return Zs(Cs(),vs.memoizedState,e)},useTransition:function(){return[ks(Ps)[0],Cs().memoizedState]},useMutableSource:As,useSyncExternalStore:Ts,useId:ta,unstable_isNewReconciler:!1},la={readContext:Io,useCallback:Js,useContext:Io,useEffect:qs,useImperativeHandle:Ys,useInsertionEffect:Ws,useLayoutEffect:Ks,useMemo:Xs,useReducer:Ns,useRef:Fs,useState:function(){return Ns(Ps)},useDebugValue:Qs,useDeferredValue:function(e){var t=Cs();return null===vs?t.memoizedState=e:Zs(t,vs.memoizedState,e)},useTransition:function(){return[Ns(Ps)[0],Cs().memoizedState]},useMutableSource:As,useSyncExternalStore:Ts,useId:ta,unstable_isNewReconciler:!1};function fa(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function ha(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function da(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var pa="function"==typeof WeakMap?WeakMap:Map;function ga(e,t,n){(n=Lo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Wc||(Wc=!0,Kc=r),da(0,t)},n}function ya(e,t,n){(n=Lo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){da(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){da(0,t),"function"!=typeof r&&(null===Gc?Gc=new Set([this]):Gc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function va(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new pa;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Iu.bind(null,e,t,n),t.then(e,e))}function ma(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function _a(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Lo(-1,1)).tag=2,Uo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var ba=v.ReactCurrentOwner,wa=!1;function Ea(e,t,n,r){t.child=null===e?Zo(t,null,n,r):Xo(t,e.child,n,r)}function Sa(e,t,n,r,i){n=n.render;var o=t.ref;return xo(t,i),r=Rs(e,t,n,r,o,i),n=xs(),null===e||wa?(oo&&n&&to(t),t.flags|=1,Ea(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wa(e,t,i))}function Oa(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||Mu(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Uu(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ra(e,t,o,r,i))}if(o=e.child,0==(e.lanes&i)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:ur)(s,r)&&e.ref===t.ref)return Wa(e,t,i)}return t.flags|=1,(e=Lu(o,r)).ref=t.ref,e.return=t,t.child=e}function Ra(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(ur(o,r)&&e.ref===t.ref){if(wa=!1,t.pendingProps=r=o,0==(e.lanes&i))return t.lanes=e.lanes,Wa(e,t,i);0!=(131072&e.flags)&&(wa=!0)}}return Ca(e,t,n,r,i)}function xa(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Lc,Mc),Mc|=n;else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ii(Lc,Mc),Mc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ii(Lc,Mc),Mc|=r}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ii(Lc,Mc),Mc|=r;return Ea(e,t,i,n),t.child}function Ia(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ca(e,t,n,r,i){var o=Ti(n)?Ni:Pi.current;return o=Ai(t,o),xo(t,i),n=Rs(e,t,n,r,o,i),r=xs(),null===e||wa?(oo&&r&&to(t),t.flags|=1,Ea(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wa(e,t,i))}function Pa(e,t,n,r,i){if(Ti(n)){var o=!0;ji(t)}else o=!1;if(xo(t,i),null===t.stateNode)qa(e,t),qo(t,n,r),Ko(t,n,r,i),r=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,u=n.contextType;"object"==typeof u&&null!==u?u=Io(u):u=Ai(t,u=Ti(n)?Ni:Pi.current);var l=n.getDerivedStateFromProps,f="function"==typeof l||"function"==typeof s.getSnapshotBeforeUpdate;f||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==r||c!==u)&&Wo(t,s,r,u),Ao=!1;var h=t.memoizedState;s.state=h,zo(t,r,s,i),c=t.memoizedState,a!==r||h!==c||ki.current||Ao?("function"==typeof l&&(Ho(t,n,l,r),c=t.memoizedState),(a=Ao||Vo(t,n,a,r,h,c,u))?(f||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=a):("function"==typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Mo(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:mo(t.type,a),s.props=u,f=t.pendingProps,h=s.context,"object"==typeof(c=n.contextType)&&null!==c?c=Io(c):c=Ai(t,c=Ti(n)?Ni:Pi.current);var d=n.getDerivedStateFromProps;(l="function"==typeof d||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==f||h!==c)&&Wo(t,s,r,c),Ao=!1,h=t.memoizedState,s.state=h,zo(t,r,s,i);var p=t.memoizedState;a!==f||h!==p||ki.current||Ao?("function"==typeof d&&(Ho(t,n,d,r),p=t.memoizedState),(u=Ao||Vo(t,n,u,r,h,p,c)||!1)?(l||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,p,c),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,p,c)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=c,r=u):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ka(e,t,n,r,o,i)}function ka(e,t,n,r,i,o){Ia(e,t);var s=0!=(128&t.flags);if(!r&&!s)return i&&Di(t,n,!1),Wa(e,t,o);r=t.stateNode,ba.current=t;var a=s&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&s?(t.child=Xo(t,e.child,null,o),t.child=Xo(t,null,a,o)):Ea(e,t,a,o),t.memoizedState=r.state,i&&Di(t,n,!0),t.child}function Na(e){var t=e.stateNode;t.pendingContext?Li(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Li(0,t.context,!1),os(e,t.containerInfo)}function Aa(e,t,n,r,i){return go(),yo(i),t.flags|=256,Ea(e,t,n,r),t.child}var Ta,Ma,La,Ua,ja={dehydrated:null,treeContext:null,retryLane:0};function Da(e){return{baseLanes:e,cachePool:null,transitions:null}}function za(e,t,r){var i,o=t.pendingProps,s=us.current,a=!1,c=0!=(128&t.flags);if((i=c)||(i=(null===e||null!==e.memoizedState)&&0!=(2&s)),i?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Ii(us,1&s),null===e)return lo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(c=o.children,e=o.fallback,a?(o=t.mode,a=t.child,c={mode:"hidden",children:c},0==(1&o)&&null!==a?(a.childLanes=0,a.pendingProps=c):a=Du(c,o,0,null),e=ju(e,o,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Da(r),t.memoizedState=ja,e):Ba(t,c));if(null!==(s=e.memoizedState)&&null!==(i=s.dehydrated))return function(e,t,r,i,o,s,a){if(r)return 256&t.flags?(t.flags&=-257,Fa(e,t,a,i=ha(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,o=t.mode,i=Du({mode:"visible",children:i.children},o,0,null),(s=ju(s,o,a,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!=(1&t.mode)&&Xo(t,e.child,null,a),t.child.memoizedState=Da(a),t.memoizedState=ja,s);if(0==(1&t.mode))return Fa(e,t,a,null);if("$!"===o.data){if(i=o.nextSibling&&o.nextSibling.dataset)var c=i.dgst;return i=c,Fa(e,t,a,i=ha(s=Error(n(419)),i,void 0))}if(c=0!=(a&e.childLanes),wa||c){if(null!==(i=Nc)){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(i.suspendedLanes|a))?0:o)&&o!==s.retryLane&&(s.retryLane=o,No(e,o),iu(i,e,o,-1))}return vu(),Fa(e,t,a,i=ha(Error(n(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Pu.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,io=li(o.nextSibling),ro=t,oo=!0,so=null,null!==e&&(Gi[Yi++]=Ji,Gi[Yi++]=Xi,Gi[Yi++]=Qi,Ji=e.id,Xi=e.overflow,Qi=t),t=Ba(t,i.children),t.flags|=4096,t)}(e,t,c,o,i,s,r);if(a){a=o.fallback,c=t.mode,i=(s=e.child).sibling;var u={mode:"hidden",children:o.children};return 0==(1&c)&&t.child!==s?((o=t.child).childLanes=0,o.pendingProps=u,t.deletions=null):(o=Lu(s,u)).subtreeFlags=14680064&s.subtreeFlags,null!==i?a=Lu(i,a):(a=ju(a,c,r,null)).flags|=2,a.return=t,o.return=t,o.sibling=a,t.child=o,o=a,a=t.child,c=null===(c=e.child.memoizedState)?Da(r):{baseLanes:c.baseLanes|r,cachePool:null,transitions:c.transitions},a.memoizedState=c,a.childLanes=e.childLanes&~r,t.memoizedState=ja,o}return e=(a=e.child).sibling,o=Lu(a,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=r),o.return=t,o.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=o,t.memoizedState=null,o}function Ba(e,t){return(t=Du({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fa(e,t,n,r){return null!==r&&yo(r),Xo(t,e.child,null,n),(e=Ba(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ha(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ro(e.return,t,n)}function $a(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Va(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Ea(e,t,r.children,n),0!=(2&(r=us.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ha(e,n,t);else if(19===e.tag)Ha(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ii(us,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===ls(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$a(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ls(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$a(t,!0,n,null,o);break;case"together":$a(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qa(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wa(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Dc|=t.lanes,0==(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Lu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Lu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Ka(e,t){if(!oo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ga(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ya(e,t,r){var o=t.pendingProps;switch(no(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ga(t),null;case 1:case 17:return Ti(t.type)&&Mi(),Ga(t),null;case 3:return o=t.stateNode,ss(),xi(ki),xi(Pi),hs(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(ho(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==so&&(cu(so),so=null))),Ma(e,t),Ga(t),null;case 5:cs(t);var s=is(rs.current);if(r=t.type,null!==e&&null!=t.stateNode)La(e,t,r,o,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(null===t.stateNode)throw Error(n(166));return Ga(t),null}if(e=is(ts.current),ho(t)){o=t.stateNode,r=t.type;var a=t.memoizedProps;switch(o[di]=t,o[pi]=a,e=0!=(1&t.mode),r){case"dialog":Br("cancel",o),Br("close",o);break;case"iframe":case"object":case"embed":Br("load",o);break;case"video":case"audio":for(s=0;s<Ur.length;s++)Br(Ur[s],o);break;case"source":Br("error",o);break;case"img":case"image":case"link":Br("error",o),Br("load",o);break;case"details":Br("toggle",o);break;case"input":G(o,a),Br("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!a.multiple},Br("invalid",o);break;case"textarea":ne(o,a),Br("invalid",o)}for(var c in ye(r,a),s=null,a)if(a.hasOwnProperty(c)){var u=a[c];"children"===c?"string"==typeof u?o.textContent!==u&&(!0!==a.suppressHydrationWarning&&Zr(o.textContent,u,e),s=["children",u]):"number"==typeof u&&o.textContent!==""+u&&(!0!==a.suppressHydrationWarning&&Zr(o.textContent,u,e),s=["children",""+u]):i.hasOwnProperty(c)&&null!=u&&"onScroll"===c&&Br("scroll",o)}switch(r){case"input":V(o),J(o,a,!0);break;case"textarea":V(o),ie(o);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(o.onclick=ei)}o=s,t.updateQueue=o,null!==o&&(t.flags|=4)}else{c=9===s.nodeType?s:s.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof o.is?e=c.createElement(r,{is:o.is}):(e=c.createElement(r),"select"===r&&(c=e,o.multiple?c.multiple=!0:o.size&&(c.size=o.size))):e=c.createElementNS(e,r),e[di]=t,e[pi]=o,Ta(e,t,!1,!1),t.stateNode=e;e:{switch(c=ve(r,o),r){case"dialog":Br("cancel",e),Br("close",e),s=o;break;case"iframe":case"object":case"embed":Br("load",e),s=o;break;case"video":case"audio":for(s=0;s<Ur.length;s++)Br(Ur[s],e);s=o;break;case"source":Br("error",e),s=o;break;case"img":case"image":case"link":Br("error",e),Br("load",e),s=o;break;case"details":Br("toggle",e),s=o;break;case"input":G(e,o),s=K(e,o),Br("invalid",e);break;case"option":default:s=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},s=L({},o,{value:void 0}),Br("invalid",e);break;case"textarea":ne(e,o),s=te(e,o),Br("invalid",e)}for(a in ye(r,s),u=s)if(u.hasOwnProperty(a)){var l=u[a];"style"===a?pe(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&ue(e,l):"children"===a?"string"==typeof l?("textarea"!==r||""!==l)&&le(e,l):"number"==typeof l&&le(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(i.hasOwnProperty(a)?null!=l&&"onScroll"===a&&Br("scroll",e):null!=l&&y(e,a,l,c))}switch(r){case"input":V(e),J(e,o,!1);break;case"textarea":V(e),ie(e);break;case"option":null!=o.value&&e.setAttribute("value",""+H(o.value));break;case"select":e.multiple=!!o.multiple,null!=(a=o.value)?ee(e,!!o.multiple,a,!1):null!=o.defaultValue&&ee(e,!!o.multiple,o.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=ei)}switch(r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ga(t),null;case 6:if(e&&null!=t.stateNode)Ua(e,t,e.memoizedProps,o);else{if("string"!=typeof o&&null===t.stateNode)throw Error(n(166));if(r=is(rs.current),is(ts.current),ho(t)){if(o=t.stateNode,r=t.memoizedProps,o[di]=t,(a=o.nodeValue!==r)&&null!==(e=ro))switch(e.tag){case 3:Zr(o.nodeValue,r,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zr(o.nodeValue,r,0!=(1&e.mode))}a&&(t.flags|=4)}else(o=(9===r.nodeType?r:r.ownerDocument).createTextNode(o))[di]=t,t.stateNode=o}return Ga(t),null;case 13:if(xi(us),o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(oo&&null!==io&&0!=(1&t.mode)&&0==(128&t.flags))po(),go(),t.flags|=98560,a=!1;else if(a=ho(t),null!==o&&null!==o.dehydrated){if(null===e){if(!a)throw Error(n(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(n(317));a[di]=t}else go(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ga(t),a=!1}else null!==so&&(cu(so),so=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=r,t):((o=null!==o)!==(null!==e&&null!==e.memoizedState)&&o&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&us.current)?0===Uc&&(Uc=3):vu())),null!==t.updateQueue&&(t.flags|=4),Ga(t),null);case 4:return ss(),Ma(e,t),null===e&&$r(t.stateNode.containerInfo),Ga(t),null;case 10:return Oo(t.type._context),Ga(t),null;case 19:if(xi(us),null===(a=t.memoizedState))return Ga(t),null;if(o=0!=(128&t.flags),null===(c=a.rendering))if(o)Ka(a,!1);else{if(0!==Uc||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(c=ls(e))){for(t.flags|=128,Ka(a,!1),null!==(o=c.updateQueue)&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=r,r=t.child;null!==r;)e=o,(a=r).flags&=14680066,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ii(us,1&us.current|2),t.child}e=e.sibling}null!==a.tail&&Ye()>Vc&&(t.flags|=128,o=!0,Ka(a,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=ls(c))){if(t.flags|=128,o=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Ka(a,!0),null===a.tail&&"hidden"===a.tailMode&&!c.alternate&&!oo)return Ga(t),null}else 2*Ye()-a.renderingStartTime>Vc&&1073741824!==r&&(t.flags|=128,o=!0,Ka(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(null!==(r=a.last)?r.sibling=c:t.child=c,a.last=c)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ye(),t.sibling=null,r=us.current,Ii(us,o?1&r|2:1&r),t):(Ga(t),null);case 22:case 23:return du(),o=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==o&&(t.flags|=8192),o&&0!=(1&t.mode)?0!=(1073741824&Mc)&&(Ga(t),6&t.subtreeFlags&&(t.flags|=8192)):Ga(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Qa(e,t){switch(no(t),t.tag){case 1:return Ti(t.type)&&Mi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ss(),xi(ki),xi(Pi),hs(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return cs(t),null;case 13:if(xi(us),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return xi(us),null;case 4:return ss(),null;case 10:return Oo(t.type._context),null;case 22:case 23:return du(),null;default:return null}}Ta=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ma=function(){},La=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,is(ts.current);var s,a=null;switch(n){case"input":o=K(e,o),r=K(e,r),a=[];break;case"select":o=L({},o,{value:void 0}),r=L({},r,{value:void 0}),a=[];break;case"textarea":o=te(e,o),r=te(e,r),a=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=ei)}for(l in ye(n,r),n=null,o)if(!r.hasOwnProperty(l)&&o.hasOwnProperty(l)&&null!=o[l])if("style"===l){var c=o[l];for(s in c)c.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(i.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in r){var u=r[l];if(c=null!=o?o[l]:void 0,r.hasOwnProperty(l)&&u!==c&&(null!=u||null!=c))if("style"===l)if(c){for(s in c)!c.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&c[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(a||(a=[]),a.push(l,n)),n=u;else"dangerouslySetInnerHTML"===l?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(a=a||[]).push(l,u)):"children"===l?"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(l,""+u):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(i.hasOwnProperty(l)?(null!=u&&"onScroll"===l&&Br("scroll",e),a||c===u||(a=[])):(a=a||[]).push(l,u))}n&&(a=a||[]).push("style",n);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Ua=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ja=!1,Xa=!1,Za="function"==typeof WeakSet?WeakSet:Set,ec=null;function tc(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){xu(e,t,n)}else n.current=null}function nc(e,t,n){try{n()}catch(n){xu(e,t,n)}}var rc=!1;function ic(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&nc(t,n,o)}i=i.next}while(i!==r)}}function oc(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sc(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function ac(e){var t=e.alternate;null!==t&&(e.alternate=null,ac(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[di],delete t[pi],delete t[yi],delete t[vi],delete t[mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cc(e){return 5===e.tag||3===e.tag||4===e.tag}function uc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function lc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=ei));else if(4!==r&&null!==(e=e.child))for(lc(e,t,n),e=e.sibling;null!==e;)lc(e,t,n),e=e.sibling}function fc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(fc(e,t,n),e=e.sibling;null!==e;)fc(e,t,n),e=e.sibling}var hc=null,dc=!1;function pc(e,t,n){for(n=n.child;null!==n;)gc(e,t,n),n=n.sibling}function gc(e,t,n){if(rt&&"function"==typeof rt.onCommitFiberUnmount)try{rt.onCommitFiberUnmount(nt,n)}catch(e){}switch(n.tag){case 5:Xa||tc(n,t);case 6:var r=hc,i=dc;hc=null,pc(e,t,n),dc=i,null!==(hc=r)&&(dc?(e=hc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):hc.removeChild(n.stateNode));break;case 18:null!==hc&&(dc?(e=hc,n=n.stateNode,8===e.nodeType?ui(e.parentNode,n):1===e.nodeType&&ui(e,n),$t(e)):ui(hc,n.stateNode));break;case 4:r=hc,i=dc,hc=n.stateNode.containerInfo,dc=!0,pc(e,t,n),hc=r,dc=i;break;case 0:case 11:case 14:case 15:if(!Xa&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!=(2&o)||0!=(4&o))&&nc(n,t,s),i=i.next}while(i!==r)}pc(e,t,n);break;case 1:if(!Xa&&(tc(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){xu(n,t,e)}pc(e,t,n);break;case 21:pc(e,t,n);break;case 22:1&n.mode?(Xa=(r=Xa)||null!==n.memoizedState,pc(e,t,n),Xa=r):pc(e,t,n);break;default:pc(e,t,n)}}function yc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Za),t.forEach((function(t){var r=ku.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function vc(e,t){var r=t.deletions;if(null!==r)for(var i=0;i<r.length;i++){var o=r[i];try{var s=e,a=t,c=a;e:for(;null!==c;){switch(c.tag){case 5:hc=c.stateNode,dc=!1;break e;case 3:case 4:hc=c.stateNode.containerInfo,dc=!0;break e}c=c.return}if(null===hc)throw Error(n(160));gc(s,a,o),hc=null,dc=!1;var u=o.alternate;null!==u&&(u.return=null),o.return=null}catch(e){xu(o,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)mc(t,e),t=t.sibling}function mc(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vc(t,e),_c(e),4&i){try{ic(3,e,e.return),oc(3,e)}catch(t){xu(e,e.return,t)}try{ic(5,e,e.return)}catch(t){xu(e,e.return,t)}}break;case 1:vc(t,e),_c(e),512&i&&null!==r&&tc(r,r.return);break;case 5:if(vc(t,e),_c(e),512&i&&null!==r&&tc(r,r.return),32&e.flags){var o=e.stateNode;try{le(o,"")}catch(t){xu(e,e.return,t)}}if(4&i&&null!=(o=e.stateNode)){var s=e.memoizedProps,a=null!==r?r.memoizedProps:s,c=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===c&&"radio"===s.type&&null!=s.name&&Y(o,s),ve(c,a);var l=ve(c,s);for(a=0;a<u.length;a+=2){var f=u[a],h=u[a+1];"style"===f?pe(o,h):"dangerouslySetInnerHTML"===f?ue(o,h):"children"===f?le(o,h):y(o,f,h,l)}switch(c){case"input":Q(o,s);break;case"textarea":re(o,s);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var p=s.value;null!=p?ee(o,!!s.multiple,p,!1):d!==!!s.multiple&&(null!=s.defaultValue?ee(o,!!s.multiple,s.defaultValue,!0):ee(o,!!s.multiple,s.multiple?[]:"",!1))}o[pi]=s}catch(t){xu(e,e.return,t)}}break;case 6:if(vc(t,e),_c(e),4&i){if(null===e.stateNode)throw Error(n(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(t){xu(e,e.return,t)}}break;case 3:if(vc(t,e),_c(e),4&i&&null!==r&&r.memoizedState.isDehydrated)try{$t(t.containerInfo)}catch(t){xu(e,e.return,t)}break;case 4:default:vc(t,e),_c(e);break;case 13:vc(t,e),_c(e),8192&(o=e.child).flags&&(s=null!==o.memoizedState,o.stateNode.isHidden=s,!s||null!==o.alternate&&null!==o.alternate.memoizedState||($c=Ye())),4&i&&yc(e);break;case 22:if(f=null!==r&&null!==r.memoizedState,1&e.mode?(Xa=(l=Xa)||f,vc(t,e),Xa=l):vc(t,e),_c(e),8192&i){if(l=null!==e.memoizedState,(e.stateNode.isHidden=l)&&!f&&0!=(1&e.mode))for(ec=e,f=e.child;null!==f;){for(h=ec=f;null!==ec;){switch(p=(d=ec).child,d.tag){case 0:case 11:case 14:case 15:ic(4,d,d.return);break;case 1:tc(d,d.return);var g=d.stateNode;if("function"==typeof g.componentWillUnmount){i=d,r=d.return;try{t=i,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){xu(i,r,e)}}break;case 5:tc(d,d.return);break;case 22:if(null!==d.memoizedState){Sc(h);continue}}null!==p?(p.return=d,ec=p):Sc(h)}f=f.sibling}e:for(f=null,h=e;;){if(5===h.tag){if(null===f){f=h;try{o=h.stateNode,l?"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none":(c=h.stateNode,a=null!=(u=h.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,c.style.display=de("display",a))}catch(t){xu(e,e.return,t)}}}else if(6===h.tag){if(null===f)try{h.stateNode.nodeValue=l?"":h.memoizedProps}catch(t){xu(e,e.return,t)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:vc(t,e),_c(e),4&i&&yc(e);case 21:}}function _c(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(cc(r)){var i=r;break e}r=r.return}throw Error(n(160))}switch(i.tag){case 5:var o=i.stateNode;32&i.flags&&(le(o,""),i.flags&=-33),fc(e,uc(e),o);break;case 3:case 4:var s=i.stateNode.containerInfo;lc(e,uc(e),s);break;default:throw Error(n(161))}}catch(t){xu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bc(e,t,n){ec=e,wc(e)}function wc(e,t,n){for(var r=0!=(1&e.mode);null!==ec;){var i=ec,o=i.child;if(22===i.tag&&r){var s=null!==i.memoizedState||Ja;if(!s){var a=i.alternate,c=null!==a&&null!==a.memoizedState||Xa;a=Ja;var u=Xa;if(Ja=s,(Xa=c)&&!u)for(ec=i;null!==ec;)c=(s=ec).child,22===s.tag&&null!==s.memoizedState?Oc(i):null!==c?(c.return=s,ec=c):Oc(i);for(;null!==o;)ec=o,wc(o),o=o.sibling;ec=i,Ja=a,Xa=u}Ec(e)}else 0!=(8772&i.subtreeFlags)&&null!==o?(o.return=i,ec=o):Ec(e)}}function Ec(e){for(;null!==ec;){var t=ec;if(0!=(8772&t.flags)){var r=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Xa||oc(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Xa)if(null===r)i.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:mo(t.type,r.memoizedProps);i.componentDidUpdate(o,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Bo(t,s,i);break;case 3:var a=t.updateQueue;if(null!==a){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Bo(t,a,r)}break;case 5:var c=t.stateNode;if(null===r&&4&t.flags){r=c;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var l=t.alternate;if(null!==l){var f=l.memoizedState;if(null!==f){var h=f.dehydrated;null!==h&&$t(h)}}}break;default:throw Error(n(163))}Xa||512&t.flags&&sc(t)}catch(e){xu(t,t.return,e)}}if(t===e){ec=null;break}if(null!==(r=t.sibling)){r.return=t.return,ec=r;break}ec=t.return}}function Sc(e){for(;null!==ec;){var t=ec;if(t===e){ec=null;break}var n=t.sibling;if(null!==n){n.return=t.return,ec=n;break}ec=t.return}}function Oc(e){for(;null!==ec;){var t=ec;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{oc(4,t)}catch(e){xu(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){xu(t,i,e)}}var o=t.return;try{sc(t)}catch(e){xu(t,o,e)}break;case 5:var s=t.return;try{sc(t)}catch(e){xu(t,s,e)}}}catch(e){xu(t,t.return,e)}if(t===e){ec=null;break}var a=t.sibling;if(null!==a){a.return=t.return,ec=a;break}ec=t.return}}var Rc,xc=Math.ceil,Ic=v.ReactCurrentDispatcher,Cc=v.ReactCurrentOwner,Pc=v.ReactCurrentBatchConfig,kc=0,Nc=null,Ac=null,Tc=0,Mc=0,Lc=Ri(0),Uc=0,jc=null,Dc=0,zc=0,Bc=0,Fc=null,Hc=null,$c=0,Vc=1/0,qc=null,Wc=!1,Kc=null,Gc=null,Yc=!1,Qc=null,Jc=0,Xc=0,Zc=null,eu=-1,tu=0;function nu(){return 0!=(6&kc)?Ye():-1!==eu?eu:eu=Ye()}function ru(e){return 0==(1&e.mode)?1:0!=(2&kc)&&0!==Tc?Tc&-Tc:null!==vo.transition?(0===tu&&(tu=dt()),tu):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Jt(e.type)}function iu(e,t,r,i){if(50<Xc)throw Xc=0,Zc=null,Error(n(185));gt(e,r,i),0!=(2&kc)&&e===Nc||(e===Nc&&(0==(2&kc)&&(zc|=r),4===Uc&&uu(e,Tc)),ou(e,i),1===r&&0===kc&&0==(1&t.mode)&&(Vc=Ye()+500,Bi&&$i()))}function ou(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-it(o),a=1<<s,c=i[s];-1===c?0!=(a&n)&&0==(a&r)||(i[s]=ft(a,t)):c<=t&&(e.expiredLanes|=a),o&=~a}}(e,t);var r=lt(e,e===Nc?Tc:0);if(0===r)null!==n&&We(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&We(n),1===t)0===e.tag?function(e){Bi=!0,Hi(e)}(lu.bind(null,e)):Hi(lu.bind(null,e)),ai((function(){0==(6&kc)&&$i()})),n=null;else{switch(mt(r)){case 1:n=Je;break;case 4:n=Xe;break;case 16:default:n=Ze;break;case 536870912:n=tt}n=Nu(n,su.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function su(e,t){if(eu=-1,tu=0,0!=(6&kc))throw Error(n(327));var r=e.callbackNode;if(Ou()&&e.callbackNode!==r)return null;var i=lt(e,e===Nc?Tc:0);if(0===i)return null;if(0!=(30&i)||0!=(i&e.expiredLanes)||t)t=mu(e,i);else{t=i;var o=kc;kc|=2;var s=yu();for(Nc===e&&Tc===t||(qc=null,Vc=Ye()+500,pu(e,t));;)try{bu();break}catch(t){gu(e,t)}So(),Ic.current=s,kc=o,null!==Ac?t=0:(Nc=null,Tc=0,t=Uc)}if(0!==t){if(2===t&&(0!==(o=ht(e))&&(i=o,t=au(e,o))),1===t)throw r=jc,pu(e,0),uu(e,i),ou(e,Ye()),r;if(6===t)uu(e,i);else{if(o=e.current.alternate,0==(30&i)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!cr(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=mu(e,i))&&(0!==(s=ht(e))&&(i=s,t=au(e,s))),1===t))throw r=jc,pu(e,0),uu(e,i),ou(e,Ye()),r;switch(e.finishedWork=o,e.finishedLanes=i,t){case 0:case 1:throw Error(n(345));case 2:case 5:Su(e,Hc,qc);break;case 3:if(uu(e,i),(130023424&i)===i&&10<(t=$c+500-Ye())){if(0!==lt(e,0))break;if(((o=e.suspendedLanes)&i)!==i){nu(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ii(Su.bind(null,e,Hc,qc),t);break}Su(e,Hc,qc);break;case 4:if(uu(e,i),(4194240&i)===i)break;for(t=e.eventTimes,o=-1;0<i;){var a=31-it(i);s=1<<a,(a=t[a])>o&&(o=a),i&=~s}if(i=o,10<(i=(120>(i=Ye()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xc(i/1960))-i)){e.timeoutHandle=ii(Su.bind(null,e,Hc,qc),i);break}Su(e,Hc,qc);break;default:throw Error(n(329))}}}return ou(e,Ye()),e.callbackNode===r?su.bind(null,e):null}function au(e,t){var n=Fc;return e.current.memoizedState.isDehydrated&&(pu(e,t).flags|=256),2!==(e=mu(e,t))&&(t=Hc,Hc=n,null!==t&&cu(t)),e}function cu(e){null===Hc?Hc=e:Hc.push.apply(Hc,e)}function uu(e,t){for(t&=~Bc,t&=~zc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),r=1<<n;e[n]=-1,t&=~r}}function lu(e){if(0!=(6&kc))throw Error(n(327));Ou();var t=lt(e,0);if(0==(1&t))return ou(e,Ye()),null;var r=mu(e,t);if(0!==e.tag&&2===r){var i=ht(e);0!==i&&(t=i,r=au(e,i))}if(1===r)throw r=jc,pu(e,0),uu(e,t),ou(e,Ye()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Su(e,Hc,qc),ou(e,Ye()),null}function fu(e,t){var n=kc;kc|=1;try{return e(t)}finally{0===(kc=n)&&(Vc=Ye()+500,Bi&&$i())}}function hu(e){null!==Qc&&0===Qc.tag&&0==(6&kc)&&Ou();var t=kc;kc|=1;var n=Pc.transition,r=vt;try{if(Pc.transition=null,vt=1,e)return e()}finally{vt=r,Pc.transition=n,0==(6&(kc=t))&&$i()}}function du(){Mc=Lc.current,xi(Lc)}function pu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oi(n)),null!==Ac)for(n=Ac.return;null!==n;){var r=n;switch(no(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Mi();break;case 3:ss(),xi(ki),xi(Pi),hs();break;case 5:cs(r);break;case 4:ss();break;case 13:case 19:xi(us);break;case 10:Oo(r.type._context);break;case 22:case 23:du()}n=n.return}if(Nc=e,Ac=e=Lu(e.current,null),Tc=Mc=t,Uc=0,jc=null,Bc=zc=Dc=0,Hc=Fc=null,null!==Co){for(t=0;t<Co.length;t++)if(null!==(r=(n=Co[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var s=o.next;o.next=i,r.next=s}n.pending=r}Co=null}return e}function gu(e,t){for(;;){var r=Ac;try{if(So(),ds.current=aa,_s){for(var i=ys.memoizedState;null!==i;){var o=i.queue;null!==o&&(o.pending=null),i=i.next}_s=!1}if(gs=0,ms=vs=ys=null,bs=!1,ws=0,Cc.current=null,null===r||null===r.return){Uc=1,jc=t,Ac=null;break}e:{var s=e,a=r.return,c=r,u=t;if(t=Tc,c.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var l=u,f=c,h=f.tag;if(0==(1&f.mode)&&(0===h||11===h||15===h)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=ma(a);if(null!==p){p.flags&=-257,_a(p,a,c,0,t),1&p.mode&&va(s,l,t),u=l;var g=(t=p).updateQueue;if(null===g){var y=new Set;y.add(u),t.updateQueue=y}else g.add(u);break e}if(0==(1&t)){va(s,l,t),vu();break e}u=Error(n(426))}else if(oo&&1&c.mode){var v=ma(a);if(null!==v){0==(65536&v.flags)&&(v.flags|=256),_a(v,a,c,0,t),yo(fa(u,c));break e}}s=u=fa(u,c),4!==Uc&&(Uc=2),null===Fc?Fc=[s]:Fc.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,Do(s,ga(0,u,t));break e;case 1:c=u;var m=s.type,_=s.stateNode;if(0==(128&s.flags)&&("function"==typeof m.getDerivedStateFromError||null!==_&&"function"==typeof _.componentDidCatch&&(null===Gc||!Gc.has(_)))){s.flags|=65536,t&=-t,s.lanes|=t,Do(s,ya(s,c,t));break e}}s=s.return}while(null!==s)}Eu(r)}catch(e){t=e,Ac===r&&null!==r&&(Ac=r=r.return);continue}break}}function yu(){var e=Ic.current;return Ic.current=aa,null===e?aa:e}function vu(){0!==Uc&&3!==Uc&&2!==Uc||(Uc=4),null===Nc||0==(268435455&Dc)&&0==(268435455&zc)||uu(Nc,Tc)}function mu(e,t){var r=kc;kc|=2;var i=yu();for(Nc===e&&Tc===t||(qc=null,pu(e,t));;)try{_u();break}catch(t){gu(e,t)}if(So(),kc=r,Ic.current=i,null!==Ac)throw Error(n(261));return Nc=null,Tc=0,Uc}function _u(){for(;null!==Ac;)wu(Ac)}function bu(){for(;null!==Ac&&!Ke();)wu(Ac)}function wu(e){var t=Rc(e.alternate,e,Mc);e.memoizedProps=e.pendingProps,null===t?Eu(e):Ac=t,Cc.current=null}function Eu(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=Ya(n,t,Mc)))return void(Ac=n)}else{if(null!==(n=Qa(n,t)))return n.flags&=32767,void(Ac=n);if(null===e)return Uc=6,void(Ac=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Ac=t);Ac=t=e}while(null!==t);0===Uc&&(Uc=5)}function Su(e,t,r){var i=vt,o=Pc.transition;try{Pc.transition=null,vt=1,function(e,t,r,i){do{Ou()}while(null!==Qc);if(0!=(6&kc))throw Error(n(327));r=e.finishedWork;var o=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-it(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,s),e===Nc&&(Ac=Nc=null,Tc=0),0==(2064&r.subtreeFlags)&&0==(2064&r.flags)||Yc||(Yc=!0,Nu(Ze,(function(){return Ou(),null}))),s=0!=(15990&r.flags),0!=(15990&r.subtreeFlags)||s){s=Pc.transition,Pc.transition=null;var a=vt;vt=1;var c=kc;kc|=4,Cc.current=null,function(e,t){if(ti=qt,pr(e=dr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(i&&0!==i.rangeCount){r=i.anchorNode;var o=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{r.nodeType,s.nodeType}catch(e){r=null;break e}var a=0,c=-1,u=-1,l=0,f=0,h=e,d=null;t:for(;;){for(var p;h!==r||0!==o&&3!==h.nodeType||(c=a+o),h!==s||0!==i&&3!==h.nodeType||(u=a+i),3===h.nodeType&&(a+=h.nodeValue.length),null!==(p=h.firstChild);)d=h,h=p;for(;;){if(h===e)break t;if(d===r&&++l===o&&(c=a),d===s&&++f===i&&(u=a),null!==(p=h.nextSibling))break;d=(h=d).parentNode}h=p}r=-1===c||-1===u?null:{start:c,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(ni={focusedElem:e,selectionRange:r},qt=!1,ec=t;null!==ec;)if(e=(t=ec).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ec=e;else for(;null!==ec;){t=ec;try{var g=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var y=g.memoizedProps,v=g.memoizedState,m=t.stateNode,_=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:mo(t.type,y),v);m.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(n(163))}}catch(e){xu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ec=e;break}ec=t.return}g=rc,rc=!1}(e,r),mc(r,e),gr(ni),qt=!!ti,ni=ti=null,e.current=r,bc(r),Ge(),kc=c,vt=a,Pc.transition=s}else e.current=r;if(Yc&&(Yc=!1,Qc=e,Jc=o),s=e.pendingLanes,0===s&&(Gc=null),function(e){if(rt&&"function"==typeof rt.onCommitFiberRoot)try{rt.onCommitFiberRoot(nt,e,void 0,128==(128&e.current.flags))}catch(e){}}(r.stateNode),ou(e,Ye()),null!==t)for(i=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],i(o.value,{componentStack:o.stack,digest:o.digest});if(Wc)throw Wc=!1,e=Kc,Kc=null,e;0!=(1&Jc)&&0!==e.tag&&Ou(),s=e.pendingLanes,0!=(1&s)?e===Zc?Xc++:(Xc=0,Zc=e):Xc=0,$i()}(e,t,r,i)}finally{Pc.transition=o,vt=i}return null}function Ou(){if(null!==Qc){var e=mt(Jc),t=Pc.transition,r=vt;try{if(Pc.transition=null,vt=16>e?16:e,null===Qc)var i=!1;else{if(e=Qc,Qc=null,Jc=0,0!=(6&kc))throw Error(n(331));var o=kc;for(kc|=4,ec=e.current;null!==ec;){var s=ec,a=s.child;if(0!=(16&ec.flags)){var c=s.deletions;if(null!==c){for(var u=0;u<c.length;u++){var l=c[u];for(ec=l;null!==ec;){var f=ec;switch(f.tag){case 0:case 11:case 15:ic(8,f,s)}var h=f.child;if(null!==h)h.return=f,ec=h;else for(;null!==ec;){var d=(f=ec).sibling,p=f.return;if(ac(f),f===l){ec=null;break}if(null!==d){d.return=p,ec=d;break}ec=p}}}var g=s.alternate;if(null!==g){var y=g.child;if(null!==y){g.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(null!==y)}}ec=s}}if(0!=(2064&s.subtreeFlags)&&null!==a)a.return=s,ec=a;else e:for(;null!==ec;){if(0!=(2048&(s=ec).flags))switch(s.tag){case 0:case 11:case 15:ic(9,s,s.return)}var m=s.sibling;if(null!==m){m.return=s.return,ec=m;break e}ec=s.return}}var _=e.current;for(ec=_;null!==ec;){var b=(a=ec).child;if(0!=(2064&a.subtreeFlags)&&null!==b)b.return=a,ec=b;else e:for(a=_;null!==ec;){if(0!=(2048&(c=ec).flags))try{switch(c.tag){case 0:case 11:case 15:oc(9,c)}}catch(e){xu(c,c.return,e)}if(c===a){ec=null;break e}var w=c.sibling;if(null!==w){w.return=c.return,ec=w;break e}ec=c.return}}if(kc=o,$i(),rt&&"function"==typeof rt.onPostCommitFiberRoot)try{rt.onPostCommitFiberRoot(nt,e)}catch(e){}i=!0}return i}finally{vt=r,Pc.transition=t}}return!1}function Ru(e,t,n){e=Uo(e,t=ga(0,t=fa(n,t),1),1),t=nu(),null!==e&&(gt(e,1,t),ou(e,t))}function xu(e,t,n){if(3===e.tag)Ru(e,e,n);else for(;null!==t;){if(3===t.tag){Ru(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Gc||!Gc.has(r))){t=Uo(t,e=ya(t,e=fa(n,e),1),1),e=nu(),null!==t&&(gt(t,1,e),ou(t,e));break}}t=t.return}}function Iu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=nu(),e.pingedLanes|=e.suspendedLanes&n,Nc===e&&(Tc&n)===n&&(4===Uc||3===Uc&&(130023424&Tc)===Tc&&500>Ye()-$c?pu(e,0):Bc|=n),ou(e,t)}function Cu(e,t){0===t&&(0==(1&e.mode)?t=1:(t=ct,0==(130023424&(ct<<=1))&&(ct=4194304)));var n=nu();null!==(e=No(e,t))&&(gt(e,t,n),ou(e,n))}function Pu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cu(e,n)}function ku(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,o=e.memoizedState;null!==o&&(r=o.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(n(314))}null!==i&&i.delete(t),Cu(e,r)}function Nu(e,t){return qe(e,t)}function Au(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tu(e,t,n,r){return new Au(e,t,n,r)}function Mu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Lu(e,t){var n=e.alternate;return null===n?((n=Tu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Uu(e,t,r,i,o,s){var a=2;if(i=e,"function"==typeof e)Mu(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case b:return ju(r.children,o,s,t);case E:a=8,o|=8;break;case S:return(e=Tu(12,r,t,2|o)).elementType=S,e.lanes=s,e;case I:return(e=Tu(13,r,t,o)).elementType=I,e.lanes=s,e;case C:return(e=Tu(19,r,t,o)).elementType=C,e.lanes=s,e;case N:return Du(r,o,s,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case O:a=10;break e;case R:a=9;break e;case x:a=11;break e;case P:a=14;break e;case k:a=16,i=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Tu(a,r,t,o)).elementType=e,t.type=i,t.lanes=s,t}function ju(e,t,n,r){return(e=Tu(7,e,r,t)).lanes=n,e}function Du(e,t,n,r){return(e=Tu(22,e,r,t)).elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function zu(e,t,n){return(e=Tu(6,e,null,t)).lanes=n,e}function Bu(e,t,n){return(t=Tu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pt(0),this.expirationTimes=pt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hu(e,t,n,r,i,o,s,a,c){return e=new Fu(e,t,n,a,c),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Tu(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},To(o),e}function $u(e){if(!e)return Ci;e:{if(Be(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ti(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(Ti(r))return Ui(e,r,t)}return t}function Vu(e,t,n,r,i,o,s,a,c){return(e=Hu(n,r,!0,e,0,o,0,a,c)).context=$u(null),n=e.current,(o=Lo(r=nu(),i=ru(n))).callback=null!=t?t:null,Uo(n,o,i),e.current.lanes=i,gt(e,i,r),ou(e,r),e}function qu(e,t,n,r){var i=t.current,o=nu(),s=ru(i);return n=$u(n),null===t.context?t.context=n:t.pendingContext=n,(t=Lo(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Uo(i,t,s))&&(iu(e,i,s,o),jo(e,i,s)),s}function Wu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Ku(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Gu(e,t){Ku(e,t),(e=e.alternate)&&Ku(e,t)}Rc=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||ki.current)wa=!0;else{if(0==(e.lanes&r)&&0==(128&t.flags))return wa=!1,function(e,t,n){switch(t.tag){case 3:Na(t),go();break;case 5:as(t);break;case 1:Ti(t.type)&&ji(t);break;case 4:os(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ii(_o,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ii(us,1&us.current),t.flags|=128,null):0!=(n&t.child.childLanes)?za(e,t,n):(Ii(us,1&us.current),null!==(e=Wa(e,t,n))?e.sibling:null);Ii(us,1&us.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return Va(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ii(us,us.current),r)break;return null;case 22:case 23:return t.lanes=0,xa(e,t,n)}return Wa(e,t,n)}(e,t,r);wa=0!=(131072&e.flags)}else wa=!1,oo&&0!=(1048576&t.flags)&&eo(t,Ki,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;qa(e,t),e=t.pendingProps;var o=Ai(t,Pi.current);xo(t,r),o=Rs(null,t,i,e,o,r);var s=xs();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ti(i)?(s=!0,ji(t)):s=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,To(t),o.updater=$o,t.stateNode=o,o._reactInternals=t,Ko(t,i,e,r),t=ka(null,t,i,!0,s,r)):(t.tag=0,oo&&s&&to(t),Ea(null,t,o,r),t=t.child),t;case 16:i=t.elementType;e:{switch(qa(e,t),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Mu(e)?1:0;if(null!=e){if((e=e.$$typeof)===x)return 11;if(e===P)return 14}return 2}(i),e=mo(i,e),o){case 0:t=Ca(null,t,i,e,r);break e;case 1:t=Pa(null,t,i,e,r);break e;case 11:t=Sa(null,t,i,e,r);break e;case 14:t=Oa(null,t,i,mo(i.type,e),r);break e}throw Error(n(306,i,""))}return t;case 0:return i=t.type,o=t.pendingProps,Ca(e,t,i,o=t.elementType===i?o:mo(i,o),r);case 1:return i=t.type,o=t.pendingProps,Pa(e,t,i,o=t.elementType===i?o:mo(i,o),r);case 3:e:{if(Na(t),null===e)throw Error(n(387));i=t.pendingProps,o=(s=t.memoizedState).element,Mo(e,t),zo(t,i,null,r);var a=t.memoizedState;if(i=a.element,s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Aa(e,t,i,r,o=fa(Error(n(423)),t));break e}if(i!==o){t=Aa(e,t,i,r,o=fa(Error(n(424)),t));break e}for(io=li(t.stateNode.containerInfo.firstChild),ro=t,oo=!0,so=null,r=Zo(t,null,i,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(go(),i===o){t=Wa(e,t,r);break e}Ea(e,t,i,r)}t=t.child}return t;case 5:return as(t),null===e&&lo(t),i=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,a=o.children,ri(i,o)?a=null:null!==s&&ri(i,s)&&(t.flags|=32),Ia(e,t),Ea(e,t,a,r),t.child;case 6:return null===e&&lo(t),null;case 13:return za(e,t,r);case 4:return os(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=Xo(t,null,i,r):Ea(e,t,i,r),t.child;case 11:return i=t.type,o=t.pendingProps,Sa(e,t,i,o=t.elementType===i?o:mo(i,o),r);case 7:return Ea(e,t,t.pendingProps,r),t.child;case 8:case 12:return Ea(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,o=t.pendingProps,s=t.memoizedProps,a=o.value,Ii(_o,i._currentValue),i._currentValue=a,null!==s)if(cr(s.value,a)){if(s.children===o.children&&!ki.current){t=Wa(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){a=s.child;for(var u=c.firstContext;null!==u;){if(u.context===i){if(1===s.tag){(u=Lo(-1,r&-r)).tag=2;var l=s.updateQueue;if(null!==l){var f=(l=l.shared).pending;null===f?u.next=u:(u.next=f.next,f.next=u),l.pending=u}}s.lanes|=r,null!==(u=s.alternate)&&(u.lanes|=r),Ro(s.return,r,t),c.lanes|=r;break}u=u.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(n(341));a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),Ro(a,r,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}Ea(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps.children,xo(t,r),i=i(o=Io(o)),t.flags|=1,Ea(e,t,i,r),t.child;case 14:return o=mo(i=t.type,t.pendingProps),Oa(e,t,i,o=mo(i.type,o),r);case 15:return Ra(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:mo(i,o),qa(e,t),t.tag=1,Ti(i)?(e=!0,ji(t)):e=!1,xo(t,r),qo(t,i,o),Ko(t,i,o,r),ka(null,t,i,!0,e,r);case 19:return Va(e,t,r);case 22:return xa(e,t,r)}throw Error(n(156,t.tag))};var Yu="function"==typeof reportError?reportError:function(e){console.error(e)};function Qu(e){this._internalRoot=e}function Ju(e){this._internalRoot=e}function Xu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function el(){}function tl(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if("function"==typeof i){var a=i;i=function(){var e=Wu(s);a.call(e)}}qu(t,s,e,i)}else s=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=Wu(s);o.call(e)}}var s=Vu(t,r,e,0,null,!1,0,"",el);return e._reactRootContainer=s,e[gi]=s.current,$r(8===e.nodeType?e.parentNode:e),hu(),s}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var a=r;r=function(){var e=Wu(c);a.call(e)}}var c=Hu(e,0,!1,null,0,!1,0,"",el);return e._reactRootContainer=c,e[gi]=c.current,$r(8===e.nodeType?e.parentNode:e),hu((function(){qu(t,c,n,r)})),c}(n,t,e,i,r);return Wu(s)}Ju.prototype.render=Qu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));qu(e,t,null,null)},Ju.prototype.unmount=Qu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;hu((function(){qu(null,e,null,null)})),t[gi]=null}},Ju.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mt.length&&0!==t&&t<Mt[n].priority;n++);Mt.splice(n,0,e),0===n&&Dt(e)}},_t=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ut(t.pendingLanes);0!==n&&(yt(t,1|n),ou(t,Ye()),0==(6&kc)&&(Vc=Ye()+500,$i()))}break;case 13:hu((function(){var t=No(e,1);if(null!==t){var n=nu();iu(t,e,1,n)}})),Gu(e,1)}},bt=function(e){if(13===e.tag){var t=No(e,134217728);if(null!==t)iu(t,e,134217728,nu());Gu(e,134217728)}},wt=function(e){if(13===e.tag){var t=ru(e),n=No(e,t);if(null!==n)iu(n,e,t,nu());Gu(e,t)}},Et=function(){return vt},St=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}},be=function(e,t,r){switch(t){case"input":if(Q(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var o=Ei(i);if(!o)throw Error(n(90));q(i),Q(i,o)}}}break;case"textarea":re(e,r);break;case"select":null!=(t=r.value)&&ee(e,!!r.multiple,t,!1)}},xe=fu,Ie=hu;var nl={usingClientEntryPoint:!1,Events:[bi,wi,Ei,Oe,Re,fu]},rl={findFiberByHostInstance:_i,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},il={bundleType:rl.bundleType,version:rl.version,rendererPackageName:rl.rendererPackageName,rendererConfig:rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:v.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$e(e))?null:e.stateNode},findFiberByHostInstance:rl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ol.isDisabled&&ol.supportsFiber)try{nt=ol.inject(il),rt=ol}catch(ce){}}return It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nl,It.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xu(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},It.createRoot=function(e,t){if(!Xu(e))throw Error(n(299));var r=!1,i="",o=Yu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Hu(e,1,!1,null,0,r,0,i,o),e[gi]=t.current,$r(8===e.nodeType?e.parentNode:e),new Qu(t)},It.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=$e(t))?null:e.stateNode},It.flushSync=function(e){return hu(e)},It.hydrate=function(e,t,r){if(!Zu(t))throw Error(n(200));return tl(null,e,t,!0,r)},It.hydrateRoot=function(e,t,r){if(!Xu(e))throw Error(n(405));var i=null!=r&&r.hydratedSources||null,o=!1,s="",a=Yu;if(null!=r&&(!0===r.unstable_strictMode&&(o=!0),void 0!==r.identifierPrefix&&(s=r.identifierPrefix),void 0!==r.onRecoverableError&&(a=r.onRecoverableError)),t=Vu(t,null,e,1,null!=r?r:null,o,0,s,a),e[gi]=t.current,$r(e),i)for(e=0;e<i.length;e++)o=(o=(r=i[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Ju(t)},It.render=function(e,t,r){if(!Zu(t))throw Error(n(200));return tl(null,e,t,!1,r)},It.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(n(40));return!!e._reactRootContainer&&(hu((function(){tl(null,null,e,!1,(function(){e._reactRootContainer=null,e[gi]=null}))})),!0)},It.unstable_batchedUpdates=fu,It.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Zu(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return tl(e,t,r,!1,i)},It.version="18.2.0-next-9e3b772b8-20220608",It}!function(e){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=Nt()}(xt);var At=xt.exports;Rt=At.createRoot,At.hydrateRoot;const Tt=rt.div`
|
181
|
+
*/function Pt(){if(Et)return Rt;Et=1;var e=w.exports,t=Ct();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(e,t){s(e,t),s(e+"Capture",t)}function s(e,t){for(i[e]=t,e=0;e<t.length;e++)r.add(t[e])}var a=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,l={},f={};function h(e,t,n,r,i,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var d={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){d[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];d[t]=new h(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){d[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){d[e]=new h(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){d[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){d[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){d[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){d[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){d[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var p=/[\-:]([a-z])/g;function g(e){return e[1].toUpperCase()}function y(e,t,n,r){var i=d.hasOwnProperty(t)?d[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!c.call(f,e)||!c.call(l,e)&&(u.test(e)?f[e]=!0:(l[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(p,g);d[t]=new h(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(p,g);d[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(p,g);d[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){d[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)})),d.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){d[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)}));var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,m=Symbol.for("react.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),R=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),A=Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=A&&e[A]||e["@@iterator"])?e:null}var M,L=Object.assign;function U(e){if(void 0===M)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var j=!1;function D(e,t){if(!e||j)return"";j=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a]){var c="\n"+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=s&&0<=a);break}}}finally{j=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?U(e):""}function z(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=D(e.type,!1);case 11:return e=D(e.type.render,!1);case 1:return e=D(e.type,!0);default:return""}}function B(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case b:return"Fragment";case _:return"Portal";case S:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case R:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case x:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case P:return null!==(t=e.displayName||null)?t:B(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return B(e(t))}catch(e){}}return null}function F(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return B(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function $(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function W(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function G(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Y(e,t){null!=(t=t.checked)&&y(e,"checked",t,!1)}function Q(e,t){Y(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?X(e,t.type,n):t.hasOwnProperty("defaultValue")&&X(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function X(e,t,n){"number"===t&&W(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Z=Array.isArray;function ee(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function te(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return L({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ne(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Z(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:H(r)}}function re(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ae,ce,ue=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ae=ae||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ae.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function le(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function de(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function pe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=de(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(fe).forEach((function(e){he.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]}))}));var ge=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ge[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var me=null;function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var be=null,we=null,Ee=null;function Se(e){if(e=bi(e)){if("function"!=typeof be)throw Error(n(280));var t=e.stateNode;t&&(t=Ei(t),be(e.stateNode,e.type,t))}}function Oe(e){we?Ee?Ee.push(e):Ee=[e]:we=e}function Re(){if(we){var e=we,t=Ee;if(Ee=we=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function xe(e,t){return e(t)}function Ie(){}var Ce=!1;function Pe(e,t,n){if(Ce)return e(t,n);Ce=!0;try{return xe(e,t,n)}finally{Ce=!1,(null!==we||null!==Ee)&&(Ie(),Re())}}function ke(e,t){var r=e.stateNode;if(null===r)return null;var i=Ei(r);if(null===i)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Ne=!1;if(a)try{var Ae={};Object.defineProperty(Ae,"passive",{get:function(){Ne=!0}}),window.addEventListener("test",Ae,Ae),window.removeEventListener("test",Ae,Ae)}catch(ce){Ne=!1}function Te(e,t,n,r,i,o,s,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var Me=!1,Le=null,Ue=!1,je=null,De={onError:function(e){Me=!0,Le=e}};function ze(e,t,n,r,i,o,s,a,c){Me=!1,Le=null,Te.apply(De,arguments)}function Be(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Fe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(Be(e)!==e)throw Error(n(188))}function $e(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Be(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,i=t;;){var o=r.return;if(null===o)break;var s=o.alternate;if(null===s){if(null!==(i=o.return)){r=i;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===r)return He(o),e;if(s===i)return He(o),t;s=s.sibling}throw Error(n(188))}if(r.return!==i.return)r=o,i=s;else{for(var a=!1,c=o.child;c;){if(c===r){a=!0,r=o,i=s;break}if(c===i){a=!0,i=o,r=s;break}c=c.sibling}if(!a){for(c=s.child;c;){if(c===r){a=!0,r=s,i=o;break}if(c===i){a=!0,i=s,r=o;break}c=c.sibling}if(!a)throw Error(n(189))}}if(r.alternate!==i)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?Ve(e):null}function Ve(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ve(e);if(null!==t)return t;e=e.sibling}return null}var qe=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ke=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ye=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,et=t.unstable_LowPriority,tt=t.unstable_IdlePriority,nt=null,rt=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/st|0)|0},ot=Math.log,st=Math.LN2;var at=64,ct=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=268435455&n;if(0!==s){var a=s&~i;0!==a?r=ut(a):0!==(o&=s)&&(r=ut(o))}else 0!==(s=n&~i)?r=ut(s):0!==o&&(r=ut(o));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-it(t)),r|=e[n],t&=~i;return r}function ft(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ht(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function dt(){var e=at;return 0==(4194240&(at<<=1))&&(at=64),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var vt=0;function mt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var _t,bt,wt,St,Ot,xt=!1,It=[],Pt=null,kt=null,Nt=null,At=new Map,Tt=new Map,Mt=[],Lt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ut(e,t){switch(e){case"focusin":case"focusout":Pt=null;break;case"dragenter":case"dragleave":kt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":At.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tt.delete(t.pointerId)}}function jt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&(null!==(t=bi(t))&&bt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Dt(e){var t=_i(e.target);if(null!==t){var n=Be(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Fe(n)))return e.blockedOn=t,void Ot(e.priority,(function(){wt(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function zt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=bi(n))&&bt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);me=r,n.target.dispatchEvent(r),me=null,t.shift()}return!0}function Bt(e,t,n){zt(e)&&n.delete(t)}function Ft(){xt=!1,null!==Pt&&zt(Pt)&&(Pt=null),null!==kt&&zt(kt)&&(kt=null),null!==Nt&&zt(Nt)&&(Nt=null),At.forEach(Bt),Tt.forEach(Bt)}function Ht(e,n){e.blockedOn===n&&(e.blockedOn=null,xt||(xt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ft)))}function $t(e){function t(t){return Ht(t,e)}if(0<It.length){Ht(It[0],e);for(var n=1;n<It.length;n++){var r=It[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Pt&&Ht(Pt,e),null!==kt&&Ht(kt,e),null!==Nt&&Ht(Nt,e),At.forEach(t),Tt.forEach(t),n=0;n<Mt.length;n++)(r=Mt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Mt.length&&null===(n=Mt[0]).blockedOn;)Dt(n),null===n.blockedOn&&Mt.shift()}var Vt=v.ReactCurrentBatchConfig,qt=!0;function Wt(e,t,n,r){var i=vt,o=Vt.transition;Vt.transition=null;try{vt=1,Gt(e,t,n,r)}finally{vt=i,Vt.transition=o}}function Kt(e,t,n,r){var i=vt,o=Vt.transition;Vt.transition=null;try{vt=4,Gt(e,t,n,r)}finally{vt=i,Vt.transition=o}}function Gt(e,t,n,r){if(qt){var i=Qt(e,t,n,r);if(null===i)qr(e,t,r,Yt,n),Ut(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Pt=jt(Pt,e,t,n,r,i),!0;case"dragenter":return kt=jt(kt,e,t,n,r,i),!0;case"mouseover":return Nt=jt(Nt,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return At.set(o,jt(At.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Tt.set(o,jt(Tt.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Ut(e,r),4&t&&-1<Lt.indexOf(e)){for(;null!==i;){var o=bi(i);if(null!==o&&_t(o),null===(o=Qt(e,t,n,r))&&qr(e,t,r,Yt,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else qr(e,t,r,null,n)}}var Yt=null;function Qt(e,t,n,r){if(Yt=null,null!==(e=_i(e=_e(r))))if(null===(t=Be(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Fe(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yt=e,null}function Jt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qe()){case Je:return 1;case Xe:return 4;case Ze:case et:return 16;case tt:return 536870912;default:return 16}default:return 16}}var Xt=null,Zt=null,en=null;function tn(){if(en)return en;var e,t,n=Zt,r=n.length,i="value"in Xt?Xt.value:Xt.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var s=r-e;for(t=1;t<=s&&n[r-t]===i[o-t];t++);return en=i.slice(e,1<t?1-t:void 0)}function nn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rn(){return!0}function on(){return!1}function sn(e){function t(t,n,r,i,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rn:on,this.isPropagationStopped=on,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var an,cn,un,ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=sn(ln),hn=L({},ln,{view:0,detail:0}),dn=sn(hn),pn=L({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(an=e.screenX-un.screenX,cn=e.screenY-un.screenY):cn=an=0,un=e),an)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=sn(pn),yn=sn(L({},pn,{dataTransfer:0})),vn=sn(L({},hn,{relatedTarget:0})),mn=sn(L({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),_n=L({},ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=sn(_n),wn=sn(L({},ln,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},On={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=On[e])&&!!t[e]}function xn(){return Rn}var In=L({},hn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=nn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xn,charCode:function(e){return"keypress"===e.type?nn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?nn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Cn=sn(In),Pn=sn(L({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=sn(L({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xn})),Nn=sn(L({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=L({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Tn=sn(An),Mn=[9,13,27,32],Ln=a&&"CompositionEvent"in window,Un=null;a&&"documentMode"in document&&(Un=document.documentMode);var jn=a&&"TextEvent"in window&&!Un,Dn=a&&(!Ln||Un&&8<Un&&11>=Un),zn=String.fromCharCode(32),Bn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var $n=!1;var Vn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function Wn(e,t,n,r){Oe(r),0<(t=Kr(t,"onChange")).length&&(n=new fn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Gn=null;function Yn(e){zr(e,0)}function Qn(e){if(q(wi(e)))return e}function Jn(e,t){if("change"===e)return t}var Xn=!1;if(a){var Zn;if(a){var er="oninput"in document;if(!er){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),er="function"==typeof tr.oninput}Zn=er}else Zn=!1;Xn=Zn&&(!document.documentMode||9<document.documentMode)}function nr(){Kn&&(Kn.detachEvent("onpropertychange",rr),Gn=Kn=null)}function rr(e){if("value"===e.propertyName&&Qn(Gn)){var t=[];Wn(t,Gn,e,_e(e)),Pe(Yn,t)}}function ir(e,t,n){"focusin"===e?(nr(),Gn=n,(Kn=t).attachEvent("onpropertychange",rr)):"focusout"===e&&nr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Gn)}function sr(e,t){if("click"===e)return Qn(t)}function ar(e,t){if("input"===e||"change"===e)return Qn(t)}var cr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ur(e,t){if(cr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!c.call(t,i)||!cr(e[i],t[i]))return!1}return!0}function lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fr(e,t){var n,r=lr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lr(r)}}function hr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dr(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=W((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function gr(e){var t=dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=fr(n,o);var s=fr(n,r);i&&s&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var yr=a&&"documentMode"in document&&11>=document.documentMode,vr=null,mr=null,_r=null,br=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==vr||vr!==W(r)||("selectionStart"in(r=vr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},_r&&ur(_r,r)||(_r=r,0<(r=Kr(mr,"onSelect")).length&&(t=new fn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:Er("Animation","AnimationEnd"),animationiteration:Er("Animation","AnimationIteration"),animationstart:Er("Animation","AnimationStart"),transitionend:Er("Transition","TransitionEnd")},Or={},Rr={};function xr(e){if(Or[e])return Or[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Rr)return Or[e]=n[t];return e}a&&(Rr=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var Ir=xr("animationend"),Cr=xr("animationiteration"),Pr=xr("animationstart"),kr=xr("transitionend"),Nr=new Map,Ar="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Tr(e,t){Nr.set(e,t),o(t,[e])}for(var Mr=0;Mr<Ar.length;Mr++){var Lr=Ar[Mr];Tr(Lr.toLowerCase(),"on"+(Lr[0].toUpperCase()+Lr.slice(1)))}Tr(Ir,"onAnimationEnd"),Tr(Cr,"onAnimationIteration"),Tr(Pr,"onAnimationStart"),Tr("dblclick","onDoubleClick"),Tr("focusin","onFocus"),Tr("focusout","onBlur"),Tr(kr,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ur="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),jr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ur));function Dr(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,i,o,s,a,c,u){if(ze.apply(this,arguments),Me){if(!Me)throw Error(n(198));var l=Le;Me=!1,Le=null,Ue||(Ue=!0,je=l)}}(i,t,void 0,e),e.currentTarget=null}function zr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==o&&i.isPropagationStopped())break e;Dr(i,a,u),o=c}else for(s=0;s<r.length;s++){if(c=(a=r[s]).instance,u=a.currentTarget,a=a.listener,c!==o&&i.isPropagationStopped())break e;Dr(i,a,u),o=c}}}if(Ue)throw e=je,Ue=!1,je=null,e}function Br(e,t){var n=t[yi];void 0===n&&(n=t[yi]=new Set);var r=e+"__bubble";n.has(r)||(Vr(t,e,2,!1),n.add(r))}function Fr(e,t,n){var r=0;t&&(r|=4),Vr(n,e,r,t)}var Hr="_reactListening"+Math.random().toString(36).slice(2);function $r(e){if(!e[Hr]){e[Hr]=!0,r.forEach((function(t){"selectionchange"!==t&&(jr.has(t)||Fr(t,!1,e),Fr(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Hr]||(t[Hr]=!0,Fr("selectionchange",!1,t))}}function Vr(e,t,n,r){switch(Jt(t)){case 1:var i=Wt;break;case 4:i=Kt;break;default:i=Gt}n=i.bind(null,t,n,e),i=void 0,!Ne||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function qr(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===s)for(s=r.return;null!==s;){var c=s.tag;if((3===c||4===c)&&((c=s.stateNode.containerInfo)===i||8===c.nodeType&&c.parentNode===i))return;s=s.return}for(;null!==a;){if(null===(s=_i(a)))return;if(5===(c=s.tag)||6===c){r=o=s;continue e}a=a.parentNode}}r=r.return}Pe((function(){var r=o,i=_e(n),s=[];e:{var a=Nr.get(e);if(void 0!==a){var c=fn,u=e;switch(e){case"keypress":if(0===nn(n))break e;case"keydown":case"keyup":c=Cn;break;case"focusin":u="focus",c=vn;break;case"focusout":u="blur",c=vn;break;case"beforeblur":case"afterblur":c=vn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=kn;break;case Ir:case Cr:case Pr:c=mn;break;case kr:c=Nn;break;case"scroll":c=dn;break;case"wheel":c=Tn;break;case"copy":case"cut":case"paste":c=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=Pn}var l=0!=(4&t),f=!l&&"scroll"===e,h=l?null!==a?a+"Capture":null:a;l=[];for(var d,p=r;null!==p;){var g=(d=p).stateNode;if(5===d.tag&&null!==g&&(d=g,null!==h&&(null!=(g=ke(p,h))&&l.push(Wr(p,g,d)))),f)break;p=p.return}0<l.length&&(a=new c(a,u,null,n,i),s.push({event:a,listeners:l}))}}if(0==(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===me||!(u=n.relatedTarget||n.fromElement)||!_i(u)&&!u[gi])&&(c||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?_i(u):null)&&(u!==(f=Be(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(c=null,u=r),c!==u)){if(l=gn,g="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(l=Pn,g="onPointerLeave",h="onPointerEnter",p="pointer"),f=null==c?a:wi(c),d=null==u?a:wi(u),(a=new l(g,p+"leave",c,n,i)).target=f,a.relatedTarget=d,g=null,_i(i)===r&&((l=new l(h,p+"enter",u,n,i)).target=d,l.relatedTarget=f,g=l),f=g,c&&u)e:{for(h=u,p=0,d=l=c;d;d=Gr(d))p++;for(d=0,g=h;g;g=Gr(g))d++;for(;0<p-d;)l=Gr(l),p--;for(;0<d-p;)h=Gr(h),d--;for(;p--;){if(l===h||null!==h&&l===h.alternate)break e;l=Gr(l),h=Gr(h)}l=null}else l=null;null!==c&&Yr(s,a,c,l,!1),null!==u&&null!==f&&Yr(s,f,u,l,!0)}if("select"===(c=(a=r?wi(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===c&&"file"===a.type)var y=Jn;else if(qn(a))if(Xn)y=ar;else{y=or;var v=ir}else(c=a.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(y=sr);switch(y&&(y=y(e,r))?Wn(s,y,n,i):(v&&v(e,a,r),"focusout"===e&&(v=a._wrapperState)&&v.controlled&&"number"===a.type&&X(a,"number",a.value)),v=r?wi(r):window,e){case"focusin":(qn(v)||"true"===v.contentEditable)&&(vr=v,mr=r,_r=null);break;case"focusout":_r=mr=vr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,wr(s,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":wr(s,n,i)}var m;if(Ln)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else $n?Fn(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(Dn&&"ko"!==n.locale&&($n||"onCompositionStart"!==_?"onCompositionEnd"===_&&$n&&(m=tn()):(Zt="value"in(Xt=i)?Xt.value:Xt.textContent,$n=!0)),0<(v=Kr(r,_)).length&&(_=new wn(_,e,null,n,i),s.push({event:_,listeners:v}),m?_.data=m:null!==(m=Hn(n))&&(_.data=m))),(m=jn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(Bn=!0,zn);case"textInput":return(e=t.data)===zn&&Bn?null:e;default:return null}}(e,n):function(e,t){if($n)return"compositionend"===e||!Ln&&Fn(e,t)?(e=tn(),en=Zt=Xt=null,$n=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Kr(r,"onBeforeInput")).length&&(i=new wn("onBeforeInput","beforeinput",null,n,i),s.push({event:i,listeners:r}),i.data=m))}zr(s,t)}))}function Wr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=ke(e,n))&&r.unshift(Wr(e,o,i)),null!=(o=ke(e,t))&&r.push(Wr(e,o,i))),e=e.return}return r}function Gr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Yr(e,t,n,r,i){for(var o=t._reactName,s=[];null!==n&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(null!==c&&c===r)break;5===a.tag&&null!==u&&(a=u,i?null!=(c=ke(n,o))&&s.unshift(Wr(n,c,a)):i||null!=(c=ke(n,o))&&s.push(Wr(n,c,a))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var Qr=/\r\n?/g,Jr=/\u0000|\uFFFD/g;function Xr(e){return("string"==typeof e?e:""+e).replace(Qr,"\n").replace(Jr,"")}function Zr(e,t,r){if(t=Xr(t),Xr(e)!==t&&r)throw Error(n(425))}function ei(){}var ti=null,ni=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ii="function"==typeof setTimeout?setTimeout:void 0,oi="function"==typeof clearTimeout?clearTimeout:void 0,si="function"==typeof Promise?Promise:void 0,ai="function"==typeof queueMicrotask?queueMicrotask:void 0!==si?function(e){return si.resolve(null).then(e).catch(ci)}:ii;function ci(e){setTimeout((function(){throw e}))}function ui(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void $t(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);$t(t)}function li(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function fi(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var hi=Math.random().toString(36).slice(2),di="__reactFiber$"+hi,pi="__reactProps$"+hi,gi="__reactContainer$"+hi,yi="__reactEvents$"+hi,vi="__reactListeners$"+hi,mi="__reactHandles$"+hi;function _i(e){var t=e[di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gi]||n[di]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=fi(e);null!==e;){if(n=e[di])return n;e=fi(e)}return t}n=(e=n).parentNode}return null}function bi(e){return!(e=e[di]||e[gi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function Ei(e){return e[pi]||null}var Si=[],Oi=-1;function Ri(e){return{current:e}}function xi(e){0>Oi||(e.current=Si[Oi],Si[Oi]=null,Oi--)}function Ii(e,t){Oi++,Si[Oi]=e.current,e.current=t}var Ci={},Pi=Ri(Ci),ki=Ri(!1),Ni=Ci;function Ai(e,t){var n=e.type.contextTypes;if(!n)return Ci;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ti(e){return null!=(e=e.childContextTypes)}function Mi(){xi(ki),xi(Pi)}function Li(e,t,r){if(Pi.current!==Ci)throw Error(n(168));Ii(Pi,t),Ii(ki,r)}function Ui(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,"function"!=typeof i.getChildContext)return r;for(var o in i=i.getChildContext())if(!(o in t))throw Error(n(108,F(e)||"Unknown",o));return L({},r,i)}function ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ci,Ni=Pi.current,Ii(Pi,e),Ii(ki,ki.current),!0}function Di(e,t,r){var i=e.stateNode;if(!i)throw Error(n(169));r?(e=Ui(e,t,Ni),i.__reactInternalMemoizedMergedChildContext=e,xi(ki),xi(Pi),Ii(Pi,e)):xi(ki),Ii(ki,r)}var zi=null,Bi=!1,Fi=!1;function Hi(e){null===zi?zi=[e]:zi.push(e)}function $i(){if(!Fi&&null!==zi){Fi=!0;var e=0,t=vt;try{var n=zi;for(vt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}zi=null,Bi=!1}catch(t){throw null!==zi&&(zi=zi.slice(e+1)),qe(Je,$i),t}finally{vt=t,Fi=!1}}return null}var Vi=[],qi=0,Wi=null,Ki=0,Gi=[],Yi=0,Qi=null,Ji=1,Xi="";function Zi(e,t){Vi[qi++]=Ki,Vi[qi++]=Wi,Wi=e,Ki=t}function eo(e,t,n){Gi[Yi++]=Ji,Gi[Yi++]=Xi,Gi[Yi++]=Qi,Qi=e;var r=Ji;e=Xi;var i=32-it(r)-1;r&=~(1<<i),n+=1;var o=32-it(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Ji=1<<32-it(t)+i|n<<i|r,Xi=o+e}else Ji=1<<o|n<<i|r,Xi=e}function to(e){null!==e.return&&(Zi(e,1),eo(e,1,0))}function no(e){for(;e===Wi;)Wi=Vi[--qi],Vi[qi]=null,Ki=Vi[--qi],Vi[qi]=null;for(;e===Qi;)Qi=Gi[--Yi],Gi[Yi]=null,Xi=Gi[--Yi],Gi[Yi]=null,Ji=Gi[--Yi],Gi[Yi]=null}var ro=null,io=null,oo=!1,so=null;function ao(e,t){var n=Tu(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function co(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ro=e,io=li(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ro=e,io=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Qi?{id:Ji,overflow:Xi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Tu(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ro=e,io=null,!0);default:return!1}}function uo(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function lo(e){if(oo){var t=io;if(t){var r=t;if(!co(e,t)){if(uo(e))throw Error(n(418));t=li(r.nextSibling);var i=ro;t&&co(e,t)?ao(i,r):(e.flags=-4097&e.flags|2,oo=!1,ro=e)}}else{if(uo(e))throw Error(n(418));e.flags=-4097&e.flags|2,oo=!1,ro=e}}}function fo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ro=e}function ho(e){if(e!==ro)return!1;if(!oo)return fo(e),oo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=io)){if(uo(e))throw po(),Error(n(418));for(;t;)ao(e,t),t=li(t.nextSibling)}if(fo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){io=li(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}io=null}}else io=ro?li(e.stateNode.nextSibling):null;return!0}function po(){for(var e=io;e;)e=li(e.nextSibling)}function go(){io=ro=null,oo=!1}function yo(e){null===so?so=[e]:so.push(e)}var vo=v.ReactCurrentBatchConfig;function mo(e,t){if(e&&e.defaultProps){for(var n in t=L({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var _o=Ri(null),bo=null,wo=null,Eo=null;function So(){Eo=wo=bo=null}function Oo(e){var t=_o.current;xi(_o),e._currentValue=t}function Ro(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xo(e,t){bo=e,Eo=wo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(wa=!0),e.firstContext=null)}function Io(e){var t=e._currentValue;if(Eo!==e)if(e={context:e,memoizedValue:t,next:null},null===wo){if(null===bo)throw Error(n(308));wo=e,bo.dependencies={lanes:0,firstContext:e}}else wo=wo.next=e;return t}var Co=null;function Po(e){null===Co?Co=[e]:Co.push(e)}function ko(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Po(t)):(n.next=i.next,i.next=n),t.interleaved=n,No(e,r)}function No(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ao=!1;function To(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Lo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uo(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&kc)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,No(e,n)}return null===(i=r.interleaved)?(t.next=t,Po(r)):(t.next=i.next,i.next=t),r.interleaved=t,No(e,n)}function jo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}function Do(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function zo(e,t,n,r){var i=e.updateQueue;Ao=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var c=a,u=c.next;c.next=null,null===s?o=u:s.next=u,s=c;var l=e.alternate;null!==l&&((a=(l=l.updateQueue).lastBaseUpdate)!==s&&(null===a?l.firstBaseUpdate=u:a.next=u,l.lastBaseUpdate=c))}if(null!==o){var f=i.baseState;for(s=0,l=u=c=null,a=o;;){var h=a.lane,d=a.eventTime;if((r&h)===h){null!==l&&(l=l.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,g=a;switch(h=t,d=n,g.tag){case 1:if("function"==typeof(p=g.payload)){f=p.call(d,f,h);break e}f=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(h="function"==typeof(p=g.payload)?p.call(d,f,h):p))break e;f=L({},f,h);break e;case 2:Ao=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[a]:h.push(a))}else d={eventTime:d,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===l?(u=l=d,c=f):l=l.next=d,s|=h;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(h=a).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===l&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=l,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);Dc|=s,e.lanes=s,e.memoizedState=f}}function Bo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],o=i.callback;if(null!==o){if(i.callback=null,i=r,"function"!=typeof o)throw Error(n(191,o));o.call(i)}}}var Fo=(new e.Component).refs;function Ho(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:L({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var $o={isMounted:function(e){return!!(e=e._reactInternals)&&Be(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=nu(),i=ru(e),o=Lo(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=Uo(e,o,i))&&(iu(t,e,i,r),jo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=nu(),i=ru(e),o=Lo(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Uo(e,o,i))&&(iu(t,e,i,r),jo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nu(),r=ru(e),i=Lo(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=Uo(e,i,r))&&(iu(t,e,r,n),jo(t,e,r))}};function Vo(e,t,n,r,i,o,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,s):!t.prototype||!t.prototype.isPureReactComponent||(!ur(n,r)||!ur(i,o))}function qo(e,t,n){var r=!1,i=Ci,o=t.contextType;return"object"==typeof o&&null!==o?o=Io(o):(i=Ti(t)?Ni:Pi.current,o=(r=null!=(r=t.contextTypes))?Ai(e,i):Ci),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=$o,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Wo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&$o.enqueueReplaceState(t,t.state,null)}function Ko(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Fo,To(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=Io(o):(o=Ti(t)?Ni:Pi.current,i.context=Ai(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Ho(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&$o.enqueueReplaceState(i,i.state,null),zo(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function Go(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var i=r.stateNode}if(!i)throw Error(n(147,e));var o=i,s=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=o.refs;t===Fo&&(t=o.refs={}),null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function Yo(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qo(e){return(0,e._init)(e._payload)}function Jo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Lu(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=zu(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function u(e,t,n,r){var i=n.type;return i===b?f(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===k&&Qo(i)===t.type)?((r=o(t,n.props)).ref=Go(e,t,n),r.return=e,r):((r=Uu(n.type,n.key,n.props,null,e.mode,r)).ref=Go(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Bu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=ju(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=zu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case m:return(n=Uu(t.type,t.key,t.props,null,e.mode,n)).ref=Go(e,null,t),n.return=e,n;case _:return(t=Bu(t,e.mode,n)).return=e,t;case k:return h(e,(0,t._init)(t._payload),n)}if(Z(t)||T(t))return(t=ju(t,e.mode,n,null)).return=e,t;Yo(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:c(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case m:return n.key===i?u(e,t,n,r):null;case _:return n.key===i?l(e,t,n,r):null;case k:return d(e,t,(i=n._init)(n._payload),r)}if(Z(n)||T(n))return null!==i?null:f(e,t,n,r,null);Yo(e,n)}return null}function p(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return c(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case m:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case _:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case k:return p(e,t,n,(0,r._init)(r._payload),i)}if(Z(r)||T(r))return f(t,e=e.get(n)||null,r,i,null);Yo(t,r)}return null}function g(n,o,a,c){for(var u=null,l=null,f=o,g=o=0,y=null;null!==f&&g<a.length;g++){f.index>g?(y=f,f=null):y=f.sibling;var v=d(n,f,a[g],c);if(null===v){null===f&&(f=y);break}e&&f&&null===v.alternate&&t(n,f),o=s(v,o,g),null===l?u=v:l.sibling=v,l=v,f=y}if(g===a.length)return r(n,f),oo&&Zi(n,g),u;if(null===f){for(;g<a.length;g++)null!==(f=h(n,a[g],c))&&(o=s(f,o,g),null===l?u=f:l.sibling=f,l=f);return oo&&Zi(n,g),u}for(f=i(n,f);g<a.length;g++)null!==(y=p(f,n,g,a[g],c))&&(e&&null!==y.alternate&&f.delete(null===y.key?g:y.key),o=s(y,o,g),null===l?u=y:l.sibling=y,l=y);return e&&f.forEach((function(e){return t(n,e)})),oo&&Zi(n,g),u}function y(o,a,c,u){var l=T(c);if("function"!=typeof l)throw Error(n(150));if(null==(c=l.call(c)))throw Error(n(151));for(var f=l=null,g=a,y=a=0,v=null,m=c.next();null!==g&&!m.done;y++,m=c.next()){g.index>y?(v=g,g=null):v=g.sibling;var _=d(o,g,m.value,u);if(null===_){null===g&&(g=v);break}e&&g&&null===_.alternate&&t(o,g),a=s(_,a,y),null===f?l=_:f.sibling=_,f=_,g=v}if(m.done)return r(o,g),oo&&Zi(o,y),l;if(null===g){for(;!m.done;y++,m=c.next())null!==(m=h(o,m.value,u))&&(a=s(m,a,y),null===f?l=m:f.sibling=m,f=m);return oo&&Zi(o,y),l}for(g=i(o,g);!m.done;y++,m=c.next())null!==(m=p(g,o,y,m.value,u))&&(e&&null!==m.alternate&&g.delete(null===m.key?y:m.key),a=s(m,a,y),null===f?l=m:f.sibling=m,f=m);return e&&g.forEach((function(e){return t(o,e)})),oo&&Zi(o,y),l}return function e(n,i,s,c){if("object"==typeof s&&null!==s&&s.type===b&&null===s.key&&(s=s.props.children),"object"==typeof s&&null!==s){switch(s.$$typeof){case m:e:{for(var u=s.key,l=i;null!==l;){if(l.key===u){if((u=s.type)===b){if(7===l.tag){r(n,l.sibling),(i=o(l,s.props.children)).return=n,n=i;break e}}else if(l.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===k&&Qo(u)===l.type){r(n,l.sibling),(i=o(l,s.props)).ref=Go(n,l,s),i.return=n,n=i;break e}r(n,l);break}t(n,l),l=l.sibling}s.type===b?((i=ju(s.props.children,n.mode,c,s.key)).return=n,n=i):((c=Uu(s.type,s.key,s.props,null,n.mode,c)).ref=Go(n,i,s),c.return=n,n=c)}return a(n);case _:e:{for(l=s.key;null!==i;){if(i.key===l){if(4===i.tag&&i.stateNode.containerInfo===s.containerInfo&&i.stateNode.implementation===s.implementation){r(n,i.sibling),(i=o(i,s.children||[])).return=n,n=i;break e}r(n,i);break}t(n,i),i=i.sibling}(i=Bu(s,n.mode,c)).return=n,n=i}return a(n);case k:return e(n,i,(l=s._init)(s._payload),c)}if(Z(s))return g(n,i,s,c);if(T(s))return y(n,i,s,c);Yo(n,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==i&&6===i.tag?(r(n,i.sibling),(i=o(i,s)).return=n,n=i):(r(n,i),(i=zu(s,n.mode,c)).return=n,n=i),a(n)):r(n,i)}}var Xo=Jo(!0),Zo=Jo(!1),es={},ts=Ri(es),ns=Ri(es),rs=Ri(es);function is(e){if(e===es)throw Error(n(174));return e}function os(e,t){switch(Ii(rs,t),Ii(ns,e),Ii(ts,es),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:se(null,"");break;default:t=se(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}xi(ts),Ii(ts,t)}function ss(){xi(ts),xi(ns),xi(rs)}function as(e){is(rs.current);var t=is(ts.current),n=se(t,e.type);t!==n&&(Ii(ns,e),Ii(ts,n))}function cs(e){ns.current===e&&(xi(ts),xi(ns))}var us=Ri(0);function ls(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fs=[];function hs(){for(var e=0;e<fs.length;e++)fs[e]._workInProgressVersionPrimary=null;fs.length=0}var ds=v.ReactCurrentDispatcher,ps=v.ReactCurrentBatchConfig,gs=0,ys=null,vs=null,ms=null,_s=!1,bs=!1,ws=0,Es=0;function Ss(){throw Error(n(321))}function Os(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function Rs(e,t,r,i,o,s){if(gs=s,ys=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ds.current=null===e||null===e.memoizedState?ca:ua,e=r(i,o),bs){s=0;do{if(bs=!1,ws=0,25<=s)throw Error(n(301));s+=1,ms=vs=null,t.updateQueue=null,ds.current=la,e=r(i,o)}while(bs)}if(ds.current=aa,t=null!==vs&&null!==vs.next,gs=0,ms=vs=ys=null,_s=!1,t)throw Error(n(300));return e}function xs(){var e=0!==ws;return ws=0,e}function Is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ms?ys.memoizedState=ms=e:ms=ms.next=e,ms}function Cs(){if(null===vs){var e=ys.alternate;e=null!==e?e.memoizedState:null}else e=vs.next;var t=null===ms?ys.memoizedState:ms.next;if(null!==t)ms=t,vs=e;else{if(null===e)throw Error(n(310));e={memoizedState:(vs=e).memoizedState,baseState:vs.baseState,baseQueue:vs.baseQueue,queue:vs.queue,next:null},null===ms?ys.memoizedState=ms=e:ms=ms.next=e}return ms}function Ps(e,t){return"function"==typeof t?t(e):t}function ks(e){var t=Cs(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=vs,o=i.baseQueue,s=r.pending;if(null!==s){if(null!==o){var a=o.next;o.next=s.next,s.next=a}i.baseQueue=o=s,r.pending=null}if(null!==o){s=o.next,i=i.baseState;var c=a=null,u=null,l=s;do{var f=l.lane;if((gs&f)===f)null!==u&&(u=u.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),i=l.hasEagerState?l.eagerState:e(i,l.action);else{var h={lane:f,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};null===u?(c=u=h,a=i):u=u.next=h,ys.lanes|=f,Dc|=f}l=l.next}while(null!==l&&l!==s);null===u?a=i:u.next=c,cr(i,t.memoizedState)||(wa=!0),t.memoizedState=i,t.baseState=a,t.baseQueue=u,r.lastRenderedState=i}if(null!==(e=r.interleaved)){o=e;do{s=o.lane,ys.lanes|=s,Dc|=s,o=o.next}while(o!==e)}else null===o&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ns(e){var t=Cs(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=r.dispatch,o=r.pending,s=t.memoizedState;if(null!==o){r.pending=null;var a=o=o.next;do{s=e(s,a.action),a=a.next}while(a!==o);cr(s,t.memoizedState)||(wa=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),r.lastRenderedState=s}return[s,i]}function As(){}function Ts(e,t){var r=ys,i=Cs(),o=t(),s=!cr(i.memoizedState,o);if(s&&(i.memoizedState=o,wa=!0),i=i.queue,qs(Us.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||null!==ms&&1&ms.memoizedState.tag){if(r.flags|=2048,Bs(9,Ls.bind(null,r,i,o,t),void 0,null),null===Nc)throw Error(n(349));0!=(30&gs)||Ms(r,t,o)}return o}function Ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ys.updateQueue)?(t={lastEffect:null,stores:null},ys.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ls(e,t,n,r){t.value=n,t.getSnapshot=r,js(t)&&Ds(e)}function Us(e,t,n){return n((function(){js(t)&&Ds(e)}))}function js(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cr(e,n)}catch(e){return!0}}function Ds(e){var t=No(e,1);null!==t&&iu(t,e,1,-1)}function zs(e){var t=Is();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:e},t.queue=e,e=e.dispatch=ra.bind(null,ys,e),[t.memoizedState,e]}function Bs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ys.updateQueue)?(t={lastEffect:null,stores:null},ys.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return Cs().memoizedState}function Hs(e,t,n,r){var i=Is();ys.flags|=e,i.memoizedState=Bs(1|t,n,void 0,void 0===r?null:r)}function $s(e,t,n,r){var i=Cs();r=void 0===r?null:r;var o=void 0;if(null!==vs){var s=vs.memoizedState;if(o=s.destroy,null!==r&&Os(r,s.deps))return void(i.memoizedState=Bs(t,n,o,r))}ys.flags|=e,i.memoizedState=Bs(1|t,n,o,r)}function Vs(e,t){return Hs(8390656,8,e,t)}function qs(e,t){return $s(2048,8,e,t)}function Ws(e,t){return $s(4,2,e,t)}function Ks(e,t){return $s(4,4,e,t)}function Gs(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ys(e,t,n){return n=null!=n?n.concat([e]):null,$s(4,4,Gs.bind(null,t,e),n)}function Qs(){}function Js(e,t){var n=Cs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Os(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=Cs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Os(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Zs(e,t,n){return 0==(21&gs)?(e.baseState&&(e.baseState=!1,wa=!0),e.memoizedState=n):(cr(n,t)||(n=dt(),ys.lanes|=n,Dc|=n,e.baseState=!0),t)}function ea(e,t){var n=vt;vt=0!==n&&4>n?n:4,e(!0);var r=ps.transition;ps.transition={};try{e(!1),t()}finally{vt=n,ps.transition=r}}function ta(){return Cs().memoizedState}function na(e,t,n){var r=ru(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ia(e))oa(t,n);else if(null!==(n=ko(e,t,n,r))){iu(n,e,r,nu()),sa(n,t,r)}}function ra(e,t,n){var r=ru(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ia(e))oa(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,cr(a,s)){var c=t.interleaved;return null===c?(i.next=i,Po(t)):(i.next=c.next,c.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=ko(e,t,i,r))&&(iu(n,e,r,i=nu()),sa(n,t,r))}}function ia(e){var t=e.alternate;return e===ys||null!==t&&t===ys}function oa(e,t){bs=_s=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sa(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}var aa={readContext:Io,useCallback:Ss,useContext:Ss,useEffect:Ss,useImperativeHandle:Ss,useInsertionEffect:Ss,useLayoutEffect:Ss,useMemo:Ss,useReducer:Ss,useRef:Ss,useState:Ss,useDebugValue:Ss,useDeferredValue:Ss,useTransition:Ss,useMutableSource:Ss,useSyncExternalStore:Ss,useId:Ss,unstable_isNewReconciler:!1},ca={readContext:Io,useCallback:function(e,t){return Is().memoizedState=[e,void 0===t?null:t],e},useContext:Io,useEffect:Vs,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Hs(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Hs(4,2,e,t)},useMemo:function(e,t){var n=Is();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Is();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=na.bind(null,ys,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Is().memoizedState=e},useState:zs,useDebugValue:Qs,useDeferredValue:function(e){return Is().memoizedState=e},useTransition:function(){var e=zs(!1),t=e[0];return e=ea.bind(null,e[1]),Is().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ys,o=Is();if(oo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Nc)throw Error(n(349));0!=(30&gs)||Ms(i,t,r)}o.memoizedState=r;var s={value:r,getSnapshot:t};return o.queue=s,Vs(Us.bind(null,i,s,e),[e]),i.flags|=2048,Bs(9,Ls.bind(null,i,s,r,t),void 0,null),r},useId:function(){var e=Is(),t=Nc.identifierPrefix;if(oo){var n=Xi;t=":"+t+"R"+(n=(Ji&~(1<<32-it(Ji)-1)).toString(32)+n),0<(n=ws++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Es++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ua={readContext:Io,useCallback:Js,useContext:Io,useEffect:qs,useImperativeHandle:Ys,useInsertionEffect:Ws,useLayoutEffect:Ks,useMemo:Xs,useReducer:ks,useRef:Fs,useState:function(){return ks(Ps)},useDebugValue:Qs,useDeferredValue:function(e){return Zs(Cs(),vs.memoizedState,e)},useTransition:function(){return[ks(Ps)[0],Cs().memoizedState]},useMutableSource:As,useSyncExternalStore:Ts,useId:ta,unstable_isNewReconciler:!1},la={readContext:Io,useCallback:Js,useContext:Io,useEffect:qs,useImperativeHandle:Ys,useInsertionEffect:Ws,useLayoutEffect:Ks,useMemo:Xs,useReducer:Ns,useRef:Fs,useState:function(){return Ns(Ps)},useDebugValue:Qs,useDeferredValue:function(e){var t=Cs();return null===vs?t.memoizedState=e:Zs(t,vs.memoizedState,e)},useTransition:function(){return[Ns(Ps)[0],Cs().memoizedState]},useMutableSource:As,useSyncExternalStore:Ts,useId:ta,unstable_isNewReconciler:!1};function fa(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function ha(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function da(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var pa="function"==typeof WeakMap?WeakMap:Map;function ga(e,t,n){(n=Lo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Wc||(Wc=!0,Kc=r),da(0,t)},n}function ya(e,t,n){(n=Lo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){da(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){da(0,t),"function"!=typeof r&&(null===Gc?Gc=new Set([this]):Gc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function va(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new pa;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Iu.bind(null,e,t,n),t.then(e,e))}function ma(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function _a(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Lo(-1,1)).tag=2,Uo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var ba=v.ReactCurrentOwner,wa=!1;function Ea(e,t,n,r){t.child=null===e?Zo(t,null,n,r):Xo(t,e.child,n,r)}function Sa(e,t,n,r,i){n=n.render;var o=t.ref;return xo(t,i),r=Rs(e,t,n,r,o,i),n=xs(),null===e||wa?(oo&&n&&to(t),t.flags|=1,Ea(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wa(e,t,i))}function Oa(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||Mu(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Uu(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ra(e,t,o,r,i))}if(o=e.child,0==(e.lanes&i)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:ur)(s,r)&&e.ref===t.ref)return Wa(e,t,i)}return t.flags|=1,(e=Lu(o,r)).ref=t.ref,e.return=t,t.child=e}function Ra(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(ur(o,r)&&e.ref===t.ref){if(wa=!1,t.pendingProps=r=o,0==(e.lanes&i))return t.lanes=e.lanes,Wa(e,t,i);0!=(131072&e.flags)&&(wa=!0)}}return Ca(e,t,n,r,i)}function xa(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Lc,Mc),Mc|=n;else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ii(Lc,Mc),Mc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ii(Lc,Mc),Mc|=r}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ii(Lc,Mc),Mc|=r;return Ea(e,t,i,n),t.child}function Ia(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ca(e,t,n,r,i){var o=Ti(n)?Ni:Pi.current;return o=Ai(t,o),xo(t,i),n=Rs(e,t,n,r,o,i),r=xs(),null===e||wa?(oo&&r&&to(t),t.flags|=1,Ea(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wa(e,t,i))}function Pa(e,t,n,r,i){if(Ti(n)){var o=!0;ji(t)}else o=!1;if(xo(t,i),null===t.stateNode)qa(e,t),qo(t,n,r),Ko(t,n,r,i),r=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,u=n.contextType;"object"==typeof u&&null!==u?u=Io(u):u=Ai(t,u=Ti(n)?Ni:Pi.current);var l=n.getDerivedStateFromProps,f="function"==typeof l||"function"==typeof s.getSnapshotBeforeUpdate;f||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==r||c!==u)&&Wo(t,s,r,u),Ao=!1;var h=t.memoizedState;s.state=h,zo(t,r,s,i),c=t.memoizedState,a!==r||h!==c||ki.current||Ao?("function"==typeof l&&(Ho(t,n,l,r),c=t.memoizedState),(a=Ao||Vo(t,n,a,r,h,c,u))?(f||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=a):("function"==typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Mo(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:mo(t.type,a),s.props=u,f=t.pendingProps,h=s.context,"object"==typeof(c=n.contextType)&&null!==c?c=Io(c):c=Ai(t,c=Ti(n)?Ni:Pi.current);var d=n.getDerivedStateFromProps;(l="function"==typeof d||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==f||h!==c)&&Wo(t,s,r,c),Ao=!1,h=t.memoizedState,s.state=h,zo(t,r,s,i);var p=t.memoizedState;a!==f||h!==p||ki.current||Ao?("function"==typeof d&&(Ho(t,n,d,r),p=t.memoizedState),(u=Ao||Vo(t,n,u,r,h,p,c)||!1)?(l||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,p,c),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,p,c)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=c,r=u):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ka(e,t,n,r,o,i)}function ka(e,t,n,r,i,o){Ia(e,t);var s=0!=(128&t.flags);if(!r&&!s)return i&&Di(t,n,!1),Wa(e,t,o);r=t.stateNode,ba.current=t;var a=s&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&s?(t.child=Xo(t,e.child,null,o),t.child=Xo(t,null,a,o)):Ea(e,t,a,o),t.memoizedState=r.state,i&&Di(t,n,!0),t.child}function Na(e){var t=e.stateNode;t.pendingContext?Li(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Li(0,t.context,!1),os(e,t.containerInfo)}function Aa(e,t,n,r,i){return go(),yo(i),t.flags|=256,Ea(e,t,n,r),t.child}var Ta,Ma,La,Ua,ja={dehydrated:null,treeContext:null,retryLane:0};function Da(e){return{baseLanes:e,cachePool:null,transitions:null}}function za(e,t,r){var i,o=t.pendingProps,s=us.current,a=!1,c=0!=(128&t.flags);if((i=c)||(i=(null===e||null!==e.memoizedState)&&0!=(2&s)),i?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Ii(us,1&s),null===e)return lo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(c=o.children,e=o.fallback,a?(o=t.mode,a=t.child,c={mode:"hidden",children:c},0==(1&o)&&null!==a?(a.childLanes=0,a.pendingProps=c):a=Du(c,o,0,null),e=ju(e,o,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Da(r),t.memoizedState=ja,e):Ba(t,c));if(null!==(s=e.memoizedState)&&null!==(i=s.dehydrated))return function(e,t,r,i,o,s,a){if(r)return 256&t.flags?(t.flags&=-257,Fa(e,t,a,i=ha(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,o=t.mode,i=Du({mode:"visible",children:i.children},o,0,null),(s=ju(s,o,a,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!=(1&t.mode)&&Xo(t,e.child,null,a),t.child.memoizedState=Da(a),t.memoizedState=ja,s);if(0==(1&t.mode))return Fa(e,t,a,null);if("$!"===o.data){if(i=o.nextSibling&&o.nextSibling.dataset)var c=i.dgst;return i=c,Fa(e,t,a,i=ha(s=Error(n(419)),i,void 0))}if(c=0!=(a&e.childLanes),wa||c){if(null!==(i=Nc)){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(i.suspendedLanes|a))?0:o)&&o!==s.retryLane&&(s.retryLane=o,No(e,o),iu(i,e,o,-1))}return vu(),Fa(e,t,a,i=ha(Error(n(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Pu.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,io=li(o.nextSibling),ro=t,oo=!0,so=null,null!==e&&(Gi[Yi++]=Ji,Gi[Yi++]=Xi,Gi[Yi++]=Qi,Ji=e.id,Xi=e.overflow,Qi=t),t=Ba(t,i.children),t.flags|=4096,t)}(e,t,c,o,i,s,r);if(a){a=o.fallback,c=t.mode,i=(s=e.child).sibling;var u={mode:"hidden",children:o.children};return 0==(1&c)&&t.child!==s?((o=t.child).childLanes=0,o.pendingProps=u,t.deletions=null):(o=Lu(s,u)).subtreeFlags=14680064&s.subtreeFlags,null!==i?a=Lu(i,a):(a=ju(a,c,r,null)).flags|=2,a.return=t,o.return=t,o.sibling=a,t.child=o,o=a,a=t.child,c=null===(c=e.child.memoizedState)?Da(r):{baseLanes:c.baseLanes|r,cachePool:null,transitions:c.transitions},a.memoizedState=c,a.childLanes=e.childLanes&~r,t.memoizedState=ja,o}return e=(a=e.child).sibling,o=Lu(a,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=r),o.return=t,o.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=o,t.memoizedState=null,o}function Ba(e,t){return(t=Du({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fa(e,t,n,r){return null!==r&&yo(r),Xo(t,e.child,null,n),(e=Ba(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ha(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ro(e.return,t,n)}function $a(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Va(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Ea(e,t,r.children,n),0!=(2&(r=us.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ha(e,n,t);else if(19===e.tag)Ha(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ii(us,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===ls(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$a(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ls(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$a(t,!0,n,null,o);break;case"together":$a(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qa(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wa(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Dc|=t.lanes,0==(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Lu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Lu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Ka(e,t){if(!oo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ga(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ya(e,t,r){var o=t.pendingProps;switch(no(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ga(t),null;case 1:case 17:return Ti(t.type)&&Mi(),Ga(t),null;case 3:return o=t.stateNode,ss(),xi(ki),xi(Pi),hs(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(ho(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==so&&(cu(so),so=null))),Ma(e,t),Ga(t),null;case 5:cs(t);var s=is(rs.current);if(r=t.type,null!==e&&null!=t.stateNode)La(e,t,r,o,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(null===t.stateNode)throw Error(n(166));return Ga(t),null}if(e=is(ts.current),ho(t)){o=t.stateNode,r=t.type;var a=t.memoizedProps;switch(o[di]=t,o[pi]=a,e=0!=(1&t.mode),r){case"dialog":Br("cancel",o),Br("close",o);break;case"iframe":case"object":case"embed":Br("load",o);break;case"video":case"audio":for(s=0;s<Ur.length;s++)Br(Ur[s],o);break;case"source":Br("error",o);break;case"img":case"image":case"link":Br("error",o),Br("load",o);break;case"details":Br("toggle",o);break;case"input":G(o,a),Br("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!a.multiple},Br("invalid",o);break;case"textarea":ne(o,a),Br("invalid",o)}for(var c in ye(r,a),s=null,a)if(a.hasOwnProperty(c)){var u=a[c];"children"===c?"string"==typeof u?o.textContent!==u&&(!0!==a.suppressHydrationWarning&&Zr(o.textContent,u,e),s=["children",u]):"number"==typeof u&&o.textContent!==""+u&&(!0!==a.suppressHydrationWarning&&Zr(o.textContent,u,e),s=["children",""+u]):i.hasOwnProperty(c)&&null!=u&&"onScroll"===c&&Br("scroll",o)}switch(r){case"input":V(o),J(o,a,!0);break;case"textarea":V(o),ie(o);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(o.onclick=ei)}o=s,t.updateQueue=o,null!==o&&(t.flags|=4)}else{c=9===s.nodeType?s:s.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof o.is?e=c.createElement(r,{is:o.is}):(e=c.createElement(r),"select"===r&&(c=e,o.multiple?c.multiple=!0:o.size&&(c.size=o.size))):e=c.createElementNS(e,r),e[di]=t,e[pi]=o,Ta(e,t,!1,!1),t.stateNode=e;e:{switch(c=ve(r,o),r){case"dialog":Br("cancel",e),Br("close",e),s=o;break;case"iframe":case"object":case"embed":Br("load",e),s=o;break;case"video":case"audio":for(s=0;s<Ur.length;s++)Br(Ur[s],e);s=o;break;case"source":Br("error",e),s=o;break;case"img":case"image":case"link":Br("error",e),Br("load",e),s=o;break;case"details":Br("toggle",e),s=o;break;case"input":G(e,o),s=K(e,o),Br("invalid",e);break;case"option":default:s=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},s=L({},o,{value:void 0}),Br("invalid",e);break;case"textarea":ne(e,o),s=te(e,o),Br("invalid",e)}for(a in ye(r,s),u=s)if(u.hasOwnProperty(a)){var l=u[a];"style"===a?pe(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&ue(e,l):"children"===a?"string"==typeof l?("textarea"!==r||""!==l)&&le(e,l):"number"==typeof l&&le(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(i.hasOwnProperty(a)?null!=l&&"onScroll"===a&&Br("scroll",e):null!=l&&y(e,a,l,c))}switch(r){case"input":V(e),J(e,o,!1);break;case"textarea":V(e),ie(e);break;case"option":null!=o.value&&e.setAttribute("value",""+H(o.value));break;case"select":e.multiple=!!o.multiple,null!=(a=o.value)?ee(e,!!o.multiple,a,!1):null!=o.defaultValue&&ee(e,!!o.multiple,o.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=ei)}switch(r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ga(t),null;case 6:if(e&&null!=t.stateNode)Ua(e,t,e.memoizedProps,o);else{if("string"!=typeof o&&null===t.stateNode)throw Error(n(166));if(r=is(rs.current),is(ts.current),ho(t)){if(o=t.stateNode,r=t.memoizedProps,o[di]=t,(a=o.nodeValue!==r)&&null!==(e=ro))switch(e.tag){case 3:Zr(o.nodeValue,r,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zr(o.nodeValue,r,0!=(1&e.mode))}a&&(t.flags|=4)}else(o=(9===r.nodeType?r:r.ownerDocument).createTextNode(o))[di]=t,t.stateNode=o}return Ga(t),null;case 13:if(xi(us),o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(oo&&null!==io&&0!=(1&t.mode)&&0==(128&t.flags))po(),go(),t.flags|=98560,a=!1;else if(a=ho(t),null!==o&&null!==o.dehydrated){if(null===e){if(!a)throw Error(n(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(n(317));a[di]=t}else go(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ga(t),a=!1}else null!==so&&(cu(so),so=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=r,t):((o=null!==o)!==(null!==e&&null!==e.memoizedState)&&o&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&us.current)?0===Uc&&(Uc=3):vu())),null!==t.updateQueue&&(t.flags|=4),Ga(t),null);case 4:return ss(),Ma(e,t),null===e&&$r(t.stateNode.containerInfo),Ga(t),null;case 10:return Oo(t.type._context),Ga(t),null;case 19:if(xi(us),null===(a=t.memoizedState))return Ga(t),null;if(o=0!=(128&t.flags),null===(c=a.rendering))if(o)Ka(a,!1);else{if(0!==Uc||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(c=ls(e))){for(t.flags|=128,Ka(a,!1),null!==(o=c.updateQueue)&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=r,r=t.child;null!==r;)e=o,(a=r).flags&=14680066,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ii(us,1&us.current|2),t.child}e=e.sibling}null!==a.tail&&Ye()>Vc&&(t.flags|=128,o=!0,Ka(a,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=ls(c))){if(t.flags|=128,o=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Ka(a,!0),null===a.tail&&"hidden"===a.tailMode&&!c.alternate&&!oo)return Ga(t),null}else 2*Ye()-a.renderingStartTime>Vc&&1073741824!==r&&(t.flags|=128,o=!0,Ka(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(null!==(r=a.last)?r.sibling=c:t.child=c,a.last=c)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ye(),t.sibling=null,r=us.current,Ii(us,o?1&r|2:1&r),t):(Ga(t),null);case 22:case 23:return du(),o=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==o&&(t.flags|=8192),o&&0!=(1&t.mode)?0!=(1073741824&Mc)&&(Ga(t),6&t.subtreeFlags&&(t.flags|=8192)):Ga(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Qa(e,t){switch(no(t),t.tag){case 1:return Ti(t.type)&&Mi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ss(),xi(ki),xi(Pi),hs(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return cs(t),null;case 13:if(xi(us),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return xi(us),null;case 4:return ss(),null;case 10:return Oo(t.type._context),null;case 22:case 23:return du(),null;default:return null}}Ta=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ma=function(){},La=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,is(ts.current);var s,a=null;switch(n){case"input":o=K(e,o),r=K(e,r),a=[];break;case"select":o=L({},o,{value:void 0}),r=L({},r,{value:void 0}),a=[];break;case"textarea":o=te(e,o),r=te(e,r),a=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=ei)}for(l in ye(n,r),n=null,o)if(!r.hasOwnProperty(l)&&o.hasOwnProperty(l)&&null!=o[l])if("style"===l){var c=o[l];for(s in c)c.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(i.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in r){var u=r[l];if(c=null!=o?o[l]:void 0,r.hasOwnProperty(l)&&u!==c&&(null!=u||null!=c))if("style"===l)if(c){for(s in c)!c.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&c[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(a||(a=[]),a.push(l,n)),n=u;else"dangerouslySetInnerHTML"===l?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(a=a||[]).push(l,u)):"children"===l?"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(l,""+u):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(i.hasOwnProperty(l)?(null!=u&&"onScroll"===l&&Br("scroll",e),a||c===u||(a=[])):(a=a||[]).push(l,u))}n&&(a=a||[]).push("style",n);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Ua=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ja=!1,Xa=!1,Za="function"==typeof WeakSet?WeakSet:Set,ec=null;function tc(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){xu(e,t,n)}else n.current=null}function nc(e,t,n){try{n()}catch(n){xu(e,t,n)}}var rc=!1;function ic(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&nc(t,n,o)}i=i.next}while(i!==r)}}function oc(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sc(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function ac(e){var t=e.alternate;null!==t&&(e.alternate=null,ac(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[di],delete t[pi],delete t[yi],delete t[vi],delete t[mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cc(e){return 5===e.tag||3===e.tag||4===e.tag}function uc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function lc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=ei));else if(4!==r&&null!==(e=e.child))for(lc(e,t,n),e=e.sibling;null!==e;)lc(e,t,n),e=e.sibling}function fc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(fc(e,t,n),e=e.sibling;null!==e;)fc(e,t,n),e=e.sibling}var hc=null,dc=!1;function pc(e,t,n){for(n=n.child;null!==n;)gc(e,t,n),n=n.sibling}function gc(e,t,n){if(rt&&"function"==typeof rt.onCommitFiberUnmount)try{rt.onCommitFiberUnmount(nt,n)}catch(e){}switch(n.tag){case 5:Xa||tc(n,t);case 6:var r=hc,i=dc;hc=null,pc(e,t,n),dc=i,null!==(hc=r)&&(dc?(e=hc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):hc.removeChild(n.stateNode));break;case 18:null!==hc&&(dc?(e=hc,n=n.stateNode,8===e.nodeType?ui(e.parentNode,n):1===e.nodeType&&ui(e,n),$t(e)):ui(hc,n.stateNode));break;case 4:r=hc,i=dc,hc=n.stateNode.containerInfo,dc=!0,pc(e,t,n),hc=r,dc=i;break;case 0:case 11:case 14:case 15:if(!Xa&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!=(2&o)||0!=(4&o))&&nc(n,t,s),i=i.next}while(i!==r)}pc(e,t,n);break;case 1:if(!Xa&&(tc(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){xu(n,t,e)}pc(e,t,n);break;case 21:pc(e,t,n);break;case 22:1&n.mode?(Xa=(r=Xa)||null!==n.memoizedState,pc(e,t,n),Xa=r):pc(e,t,n);break;default:pc(e,t,n)}}function yc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Za),t.forEach((function(t){var r=ku.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function vc(e,t){var r=t.deletions;if(null!==r)for(var i=0;i<r.length;i++){var o=r[i];try{var s=e,a=t,c=a;e:for(;null!==c;){switch(c.tag){case 5:hc=c.stateNode,dc=!1;break e;case 3:case 4:hc=c.stateNode.containerInfo,dc=!0;break e}c=c.return}if(null===hc)throw Error(n(160));gc(s,a,o),hc=null,dc=!1;var u=o.alternate;null!==u&&(u.return=null),o.return=null}catch(e){xu(o,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)mc(t,e),t=t.sibling}function mc(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vc(t,e),_c(e),4&i){try{ic(3,e,e.return),oc(3,e)}catch(t){xu(e,e.return,t)}try{ic(5,e,e.return)}catch(t){xu(e,e.return,t)}}break;case 1:vc(t,e),_c(e),512&i&&null!==r&&tc(r,r.return);break;case 5:if(vc(t,e),_c(e),512&i&&null!==r&&tc(r,r.return),32&e.flags){var o=e.stateNode;try{le(o,"")}catch(t){xu(e,e.return,t)}}if(4&i&&null!=(o=e.stateNode)){var s=e.memoizedProps,a=null!==r?r.memoizedProps:s,c=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===c&&"radio"===s.type&&null!=s.name&&Y(o,s),ve(c,a);var l=ve(c,s);for(a=0;a<u.length;a+=2){var f=u[a],h=u[a+1];"style"===f?pe(o,h):"dangerouslySetInnerHTML"===f?ue(o,h):"children"===f?le(o,h):y(o,f,h,l)}switch(c){case"input":Q(o,s);break;case"textarea":re(o,s);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var p=s.value;null!=p?ee(o,!!s.multiple,p,!1):d!==!!s.multiple&&(null!=s.defaultValue?ee(o,!!s.multiple,s.defaultValue,!0):ee(o,!!s.multiple,s.multiple?[]:"",!1))}o[pi]=s}catch(t){xu(e,e.return,t)}}break;case 6:if(vc(t,e),_c(e),4&i){if(null===e.stateNode)throw Error(n(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(t){xu(e,e.return,t)}}break;case 3:if(vc(t,e),_c(e),4&i&&null!==r&&r.memoizedState.isDehydrated)try{$t(t.containerInfo)}catch(t){xu(e,e.return,t)}break;case 4:default:vc(t,e),_c(e);break;case 13:vc(t,e),_c(e),8192&(o=e.child).flags&&(s=null!==o.memoizedState,o.stateNode.isHidden=s,!s||null!==o.alternate&&null!==o.alternate.memoizedState||($c=Ye())),4&i&&yc(e);break;case 22:if(f=null!==r&&null!==r.memoizedState,1&e.mode?(Xa=(l=Xa)||f,vc(t,e),Xa=l):vc(t,e),_c(e),8192&i){if(l=null!==e.memoizedState,(e.stateNode.isHidden=l)&&!f&&0!=(1&e.mode))for(ec=e,f=e.child;null!==f;){for(h=ec=f;null!==ec;){switch(p=(d=ec).child,d.tag){case 0:case 11:case 14:case 15:ic(4,d,d.return);break;case 1:tc(d,d.return);var g=d.stateNode;if("function"==typeof g.componentWillUnmount){i=d,r=d.return;try{t=i,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){xu(i,r,e)}}break;case 5:tc(d,d.return);break;case 22:if(null!==d.memoizedState){Sc(h);continue}}null!==p?(p.return=d,ec=p):Sc(h)}f=f.sibling}e:for(f=null,h=e;;){if(5===h.tag){if(null===f){f=h;try{o=h.stateNode,l?"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none":(c=h.stateNode,a=null!=(u=h.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,c.style.display=de("display",a))}catch(t){xu(e,e.return,t)}}}else if(6===h.tag){if(null===f)try{h.stateNode.nodeValue=l?"":h.memoizedProps}catch(t){xu(e,e.return,t)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:vc(t,e),_c(e),4&i&&yc(e);case 21:}}function _c(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(cc(r)){var i=r;break e}r=r.return}throw Error(n(160))}switch(i.tag){case 5:var o=i.stateNode;32&i.flags&&(le(o,""),i.flags&=-33),fc(e,uc(e),o);break;case 3:case 4:var s=i.stateNode.containerInfo;lc(e,uc(e),s);break;default:throw Error(n(161))}}catch(t){xu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bc(e,t,n){ec=e,wc(e)}function wc(e,t,n){for(var r=0!=(1&e.mode);null!==ec;){var i=ec,o=i.child;if(22===i.tag&&r){var s=null!==i.memoizedState||Ja;if(!s){var a=i.alternate,c=null!==a&&null!==a.memoizedState||Xa;a=Ja;var u=Xa;if(Ja=s,(Xa=c)&&!u)for(ec=i;null!==ec;)c=(s=ec).child,22===s.tag&&null!==s.memoizedState?Oc(i):null!==c?(c.return=s,ec=c):Oc(i);for(;null!==o;)ec=o,wc(o),o=o.sibling;ec=i,Ja=a,Xa=u}Ec(e)}else 0!=(8772&i.subtreeFlags)&&null!==o?(o.return=i,ec=o):Ec(e)}}function Ec(e){for(;null!==ec;){var t=ec;if(0!=(8772&t.flags)){var r=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Xa||oc(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Xa)if(null===r)i.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:mo(t.type,r.memoizedProps);i.componentDidUpdate(o,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Bo(t,s,i);break;case 3:var a=t.updateQueue;if(null!==a){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Bo(t,a,r)}break;case 5:var c=t.stateNode;if(null===r&&4&t.flags){r=c;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var l=t.alternate;if(null!==l){var f=l.memoizedState;if(null!==f){var h=f.dehydrated;null!==h&&$t(h)}}}break;default:throw Error(n(163))}Xa||512&t.flags&&sc(t)}catch(e){xu(t,t.return,e)}}if(t===e){ec=null;break}if(null!==(r=t.sibling)){r.return=t.return,ec=r;break}ec=t.return}}function Sc(e){for(;null!==ec;){var t=ec;if(t===e){ec=null;break}var n=t.sibling;if(null!==n){n.return=t.return,ec=n;break}ec=t.return}}function Oc(e){for(;null!==ec;){var t=ec;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{oc(4,t)}catch(e){xu(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){xu(t,i,e)}}var o=t.return;try{sc(t)}catch(e){xu(t,o,e)}break;case 5:var s=t.return;try{sc(t)}catch(e){xu(t,s,e)}}}catch(e){xu(t,t.return,e)}if(t===e){ec=null;break}var a=t.sibling;if(null!==a){a.return=t.return,ec=a;break}ec=t.return}}var Rc,xc=Math.ceil,Ic=v.ReactCurrentDispatcher,Cc=v.ReactCurrentOwner,Pc=v.ReactCurrentBatchConfig,kc=0,Nc=null,Ac=null,Tc=0,Mc=0,Lc=Ri(0),Uc=0,jc=null,Dc=0,zc=0,Bc=0,Fc=null,Hc=null,$c=0,Vc=1/0,qc=null,Wc=!1,Kc=null,Gc=null,Yc=!1,Qc=null,Jc=0,Xc=0,Zc=null,eu=-1,tu=0;function nu(){return 0!=(6&kc)?Ye():-1!==eu?eu:eu=Ye()}function ru(e){return 0==(1&e.mode)?1:0!=(2&kc)&&0!==Tc?Tc&-Tc:null!==vo.transition?(0===tu&&(tu=dt()),tu):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Jt(e.type)}function iu(e,t,r,i){if(50<Xc)throw Xc=0,Zc=null,Error(n(185));gt(e,r,i),0!=(2&kc)&&e===Nc||(e===Nc&&(0==(2&kc)&&(zc|=r),4===Uc&&uu(e,Tc)),ou(e,i),1===r&&0===kc&&0==(1&t.mode)&&(Vc=Ye()+500,Bi&&$i()))}function ou(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-it(o),a=1<<s,c=i[s];-1===c?0!=(a&n)&&0==(a&r)||(i[s]=ft(a,t)):c<=t&&(e.expiredLanes|=a),o&=~a}}(e,t);var r=lt(e,e===Nc?Tc:0);if(0===r)null!==n&&We(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&We(n),1===t)0===e.tag?function(e){Bi=!0,Hi(e)}(lu.bind(null,e)):Hi(lu.bind(null,e)),ai((function(){0==(6&kc)&&$i()})),n=null;else{switch(mt(r)){case 1:n=Je;break;case 4:n=Xe;break;case 16:default:n=Ze;break;case 536870912:n=tt}n=Nu(n,su.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function su(e,t){if(eu=-1,tu=0,0!=(6&kc))throw Error(n(327));var r=e.callbackNode;if(Ou()&&e.callbackNode!==r)return null;var i=lt(e,e===Nc?Tc:0);if(0===i)return null;if(0!=(30&i)||0!=(i&e.expiredLanes)||t)t=mu(e,i);else{t=i;var o=kc;kc|=2;var s=yu();for(Nc===e&&Tc===t||(qc=null,Vc=Ye()+500,pu(e,t));;)try{bu();break}catch(t){gu(e,t)}So(),Ic.current=s,kc=o,null!==Ac?t=0:(Nc=null,Tc=0,t=Uc)}if(0!==t){if(2===t&&(0!==(o=ht(e))&&(i=o,t=au(e,o))),1===t)throw r=jc,pu(e,0),uu(e,i),ou(e,Ye()),r;if(6===t)uu(e,i);else{if(o=e.current.alternate,0==(30&i)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!cr(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=mu(e,i))&&(0!==(s=ht(e))&&(i=s,t=au(e,s))),1===t))throw r=jc,pu(e,0),uu(e,i),ou(e,Ye()),r;switch(e.finishedWork=o,e.finishedLanes=i,t){case 0:case 1:throw Error(n(345));case 2:case 5:Su(e,Hc,qc);break;case 3:if(uu(e,i),(130023424&i)===i&&10<(t=$c+500-Ye())){if(0!==lt(e,0))break;if(((o=e.suspendedLanes)&i)!==i){nu(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ii(Su.bind(null,e,Hc,qc),t);break}Su(e,Hc,qc);break;case 4:if(uu(e,i),(4194240&i)===i)break;for(t=e.eventTimes,o=-1;0<i;){var a=31-it(i);s=1<<a,(a=t[a])>o&&(o=a),i&=~s}if(i=o,10<(i=(120>(i=Ye()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xc(i/1960))-i)){e.timeoutHandle=ii(Su.bind(null,e,Hc,qc),i);break}Su(e,Hc,qc);break;default:throw Error(n(329))}}}return ou(e,Ye()),e.callbackNode===r?su.bind(null,e):null}function au(e,t){var n=Fc;return e.current.memoizedState.isDehydrated&&(pu(e,t).flags|=256),2!==(e=mu(e,t))&&(t=Hc,Hc=n,null!==t&&cu(t)),e}function cu(e){null===Hc?Hc=e:Hc.push.apply(Hc,e)}function uu(e,t){for(t&=~Bc,t&=~zc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),r=1<<n;e[n]=-1,t&=~r}}function lu(e){if(0!=(6&kc))throw Error(n(327));Ou();var t=lt(e,0);if(0==(1&t))return ou(e,Ye()),null;var r=mu(e,t);if(0!==e.tag&&2===r){var i=ht(e);0!==i&&(t=i,r=au(e,i))}if(1===r)throw r=jc,pu(e,0),uu(e,t),ou(e,Ye()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Su(e,Hc,qc),ou(e,Ye()),null}function fu(e,t){var n=kc;kc|=1;try{return e(t)}finally{0===(kc=n)&&(Vc=Ye()+500,Bi&&$i())}}function hu(e){null!==Qc&&0===Qc.tag&&0==(6&kc)&&Ou();var t=kc;kc|=1;var n=Pc.transition,r=vt;try{if(Pc.transition=null,vt=1,e)return e()}finally{vt=r,Pc.transition=n,0==(6&(kc=t))&&$i()}}function du(){Mc=Lc.current,xi(Lc)}function pu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oi(n)),null!==Ac)for(n=Ac.return;null!==n;){var r=n;switch(no(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Mi();break;case 3:ss(),xi(ki),xi(Pi),hs();break;case 5:cs(r);break;case 4:ss();break;case 13:case 19:xi(us);break;case 10:Oo(r.type._context);break;case 22:case 23:du()}n=n.return}if(Nc=e,Ac=e=Lu(e.current,null),Tc=Mc=t,Uc=0,jc=null,Bc=zc=Dc=0,Hc=Fc=null,null!==Co){for(t=0;t<Co.length;t++)if(null!==(r=(n=Co[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var s=o.next;o.next=i,r.next=s}n.pending=r}Co=null}return e}function gu(e,t){for(;;){var r=Ac;try{if(So(),ds.current=aa,_s){for(var i=ys.memoizedState;null!==i;){var o=i.queue;null!==o&&(o.pending=null),i=i.next}_s=!1}if(gs=0,ms=vs=ys=null,bs=!1,ws=0,Cc.current=null,null===r||null===r.return){Uc=1,jc=t,Ac=null;break}e:{var s=e,a=r.return,c=r,u=t;if(t=Tc,c.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var l=u,f=c,h=f.tag;if(0==(1&f.mode)&&(0===h||11===h||15===h)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=ma(a);if(null!==p){p.flags&=-257,_a(p,a,c,0,t),1&p.mode&&va(s,l,t),u=l;var g=(t=p).updateQueue;if(null===g){var y=new Set;y.add(u),t.updateQueue=y}else g.add(u);break e}if(0==(1&t)){va(s,l,t),vu();break e}u=Error(n(426))}else if(oo&&1&c.mode){var v=ma(a);if(null!==v){0==(65536&v.flags)&&(v.flags|=256),_a(v,a,c,0,t),yo(fa(u,c));break e}}s=u=fa(u,c),4!==Uc&&(Uc=2),null===Fc?Fc=[s]:Fc.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,Do(s,ga(0,u,t));break e;case 1:c=u;var m=s.type,_=s.stateNode;if(0==(128&s.flags)&&("function"==typeof m.getDerivedStateFromError||null!==_&&"function"==typeof _.componentDidCatch&&(null===Gc||!Gc.has(_)))){s.flags|=65536,t&=-t,s.lanes|=t,Do(s,ya(s,c,t));break e}}s=s.return}while(null!==s)}Eu(r)}catch(e){t=e,Ac===r&&null!==r&&(Ac=r=r.return);continue}break}}function yu(){var e=Ic.current;return Ic.current=aa,null===e?aa:e}function vu(){0!==Uc&&3!==Uc&&2!==Uc||(Uc=4),null===Nc||0==(268435455&Dc)&&0==(268435455&zc)||uu(Nc,Tc)}function mu(e,t){var r=kc;kc|=2;var i=yu();for(Nc===e&&Tc===t||(qc=null,pu(e,t));;)try{_u();break}catch(t){gu(e,t)}if(So(),kc=r,Ic.current=i,null!==Ac)throw Error(n(261));return Nc=null,Tc=0,Uc}function _u(){for(;null!==Ac;)wu(Ac)}function bu(){for(;null!==Ac&&!Ke();)wu(Ac)}function wu(e){var t=Rc(e.alternate,e,Mc);e.memoizedProps=e.pendingProps,null===t?Eu(e):Ac=t,Cc.current=null}function Eu(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=Ya(n,t,Mc)))return void(Ac=n)}else{if(null!==(n=Qa(n,t)))return n.flags&=32767,void(Ac=n);if(null===e)return Uc=6,void(Ac=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Ac=t);Ac=t=e}while(null!==t);0===Uc&&(Uc=5)}function Su(e,t,r){var i=vt,o=Pc.transition;try{Pc.transition=null,vt=1,function(e,t,r,i){do{Ou()}while(null!==Qc);if(0!=(6&kc))throw Error(n(327));r=e.finishedWork;var o=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-it(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,s),e===Nc&&(Ac=Nc=null,Tc=0),0==(2064&r.subtreeFlags)&&0==(2064&r.flags)||Yc||(Yc=!0,Nu(Ze,(function(){return Ou(),null}))),s=0!=(15990&r.flags),0!=(15990&r.subtreeFlags)||s){s=Pc.transition,Pc.transition=null;var a=vt;vt=1;var c=kc;kc|=4,Cc.current=null,function(e,t){if(ti=qt,pr(e=dr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(i&&0!==i.rangeCount){r=i.anchorNode;var o=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{r.nodeType,s.nodeType}catch(e){r=null;break e}var a=0,c=-1,u=-1,l=0,f=0,h=e,d=null;t:for(;;){for(var p;h!==r||0!==o&&3!==h.nodeType||(c=a+o),h!==s||0!==i&&3!==h.nodeType||(u=a+i),3===h.nodeType&&(a+=h.nodeValue.length),null!==(p=h.firstChild);)d=h,h=p;for(;;){if(h===e)break t;if(d===r&&++l===o&&(c=a),d===s&&++f===i&&(u=a),null!==(p=h.nextSibling))break;d=(h=d).parentNode}h=p}r=-1===c||-1===u?null:{start:c,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(ni={focusedElem:e,selectionRange:r},qt=!1,ec=t;null!==ec;)if(e=(t=ec).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ec=e;else for(;null!==ec;){t=ec;try{var g=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var y=g.memoizedProps,v=g.memoizedState,m=t.stateNode,_=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:mo(t.type,y),v);m.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(n(163))}}catch(e){xu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ec=e;break}ec=t.return}g=rc,rc=!1}(e,r),mc(r,e),gr(ni),qt=!!ti,ni=ti=null,e.current=r,bc(r),Ge(),kc=c,vt=a,Pc.transition=s}else e.current=r;if(Yc&&(Yc=!1,Qc=e,Jc=o),s=e.pendingLanes,0===s&&(Gc=null),function(e){if(rt&&"function"==typeof rt.onCommitFiberRoot)try{rt.onCommitFiberRoot(nt,e,void 0,128==(128&e.current.flags))}catch(e){}}(r.stateNode),ou(e,Ye()),null!==t)for(i=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],i(o.value,{componentStack:o.stack,digest:o.digest});if(Wc)throw Wc=!1,e=Kc,Kc=null,e;0!=(1&Jc)&&0!==e.tag&&Ou(),s=e.pendingLanes,0!=(1&s)?e===Zc?Xc++:(Xc=0,Zc=e):Xc=0,$i()}(e,t,r,i)}finally{Pc.transition=o,vt=i}return null}function Ou(){if(null!==Qc){var e=mt(Jc),t=Pc.transition,r=vt;try{if(Pc.transition=null,vt=16>e?16:e,null===Qc)var i=!1;else{if(e=Qc,Qc=null,Jc=0,0!=(6&kc))throw Error(n(331));var o=kc;for(kc|=4,ec=e.current;null!==ec;){var s=ec,a=s.child;if(0!=(16&ec.flags)){var c=s.deletions;if(null!==c){for(var u=0;u<c.length;u++){var l=c[u];for(ec=l;null!==ec;){var f=ec;switch(f.tag){case 0:case 11:case 15:ic(8,f,s)}var h=f.child;if(null!==h)h.return=f,ec=h;else for(;null!==ec;){var d=(f=ec).sibling,p=f.return;if(ac(f),f===l){ec=null;break}if(null!==d){d.return=p,ec=d;break}ec=p}}}var g=s.alternate;if(null!==g){var y=g.child;if(null!==y){g.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(null!==y)}}ec=s}}if(0!=(2064&s.subtreeFlags)&&null!==a)a.return=s,ec=a;else e:for(;null!==ec;){if(0!=(2048&(s=ec).flags))switch(s.tag){case 0:case 11:case 15:ic(9,s,s.return)}var m=s.sibling;if(null!==m){m.return=s.return,ec=m;break e}ec=s.return}}var _=e.current;for(ec=_;null!==ec;){var b=(a=ec).child;if(0!=(2064&a.subtreeFlags)&&null!==b)b.return=a,ec=b;else e:for(a=_;null!==ec;){if(0!=(2048&(c=ec).flags))try{switch(c.tag){case 0:case 11:case 15:oc(9,c)}}catch(e){xu(c,c.return,e)}if(c===a){ec=null;break e}var w=c.sibling;if(null!==w){w.return=c.return,ec=w;break e}ec=c.return}}if(kc=o,$i(),rt&&"function"==typeof rt.onPostCommitFiberRoot)try{rt.onPostCommitFiberRoot(nt,e)}catch(e){}i=!0}return i}finally{vt=r,Pc.transition=t}}return!1}function Ru(e,t,n){e=Uo(e,t=ga(0,t=fa(n,t),1),1),t=nu(),null!==e&&(gt(e,1,t),ou(e,t))}function xu(e,t,n){if(3===e.tag)Ru(e,e,n);else for(;null!==t;){if(3===t.tag){Ru(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Gc||!Gc.has(r))){t=Uo(t,e=ya(t,e=fa(n,e),1),1),e=nu(),null!==t&&(gt(t,1,e),ou(t,e));break}}t=t.return}}function Iu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=nu(),e.pingedLanes|=e.suspendedLanes&n,Nc===e&&(Tc&n)===n&&(4===Uc||3===Uc&&(130023424&Tc)===Tc&&500>Ye()-$c?pu(e,0):Bc|=n),ou(e,t)}function Cu(e,t){0===t&&(0==(1&e.mode)?t=1:(t=ct,0==(130023424&(ct<<=1))&&(ct=4194304)));var n=nu();null!==(e=No(e,t))&&(gt(e,t,n),ou(e,n))}function Pu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cu(e,n)}function ku(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,o=e.memoizedState;null!==o&&(r=o.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(n(314))}null!==i&&i.delete(t),Cu(e,r)}function Nu(e,t){return qe(e,t)}function Au(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tu(e,t,n,r){return new Au(e,t,n,r)}function Mu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Lu(e,t){var n=e.alternate;return null===n?((n=Tu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Uu(e,t,r,i,o,s){var a=2;if(i=e,"function"==typeof e)Mu(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case b:return ju(r.children,o,s,t);case E:a=8,o|=8;break;case S:return(e=Tu(12,r,t,2|o)).elementType=S,e.lanes=s,e;case I:return(e=Tu(13,r,t,o)).elementType=I,e.lanes=s,e;case C:return(e=Tu(19,r,t,o)).elementType=C,e.lanes=s,e;case N:return Du(r,o,s,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case O:a=10;break e;case R:a=9;break e;case x:a=11;break e;case P:a=14;break e;case k:a=16,i=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Tu(a,r,t,o)).elementType=e,t.type=i,t.lanes=s,t}function ju(e,t,n,r){return(e=Tu(7,e,r,t)).lanes=n,e}function Du(e,t,n,r){return(e=Tu(22,e,r,t)).elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function zu(e,t,n){return(e=Tu(6,e,null,t)).lanes=n,e}function Bu(e,t,n){return(t=Tu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pt(0),this.expirationTimes=pt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hu(e,t,n,r,i,o,s,a,c){return e=new Fu(e,t,n,a,c),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Tu(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},To(o),e}function $u(e){if(!e)return Ci;e:{if(Be(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ti(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(Ti(r))return Ui(e,r,t)}return t}function Vu(e,t,n,r,i,o,s,a,c){return(e=Hu(n,r,!0,e,0,o,0,a,c)).context=$u(null),n=e.current,(o=Lo(r=nu(),i=ru(n))).callback=null!=t?t:null,Uo(n,o,i),e.current.lanes=i,gt(e,i,r),ou(e,r),e}function qu(e,t,n,r){var i=t.current,o=nu(),s=ru(i);return n=$u(n),null===t.context?t.context=n:t.pendingContext=n,(t=Lo(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Uo(i,t,s))&&(iu(e,i,s,o),jo(e,i,s)),s}function Wu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Ku(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Gu(e,t){Ku(e,t),(e=e.alternate)&&Ku(e,t)}Rc=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||ki.current)wa=!0;else{if(0==(e.lanes&r)&&0==(128&t.flags))return wa=!1,function(e,t,n){switch(t.tag){case 3:Na(t),go();break;case 5:as(t);break;case 1:Ti(t.type)&&ji(t);break;case 4:os(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ii(_o,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ii(us,1&us.current),t.flags|=128,null):0!=(n&t.child.childLanes)?za(e,t,n):(Ii(us,1&us.current),null!==(e=Wa(e,t,n))?e.sibling:null);Ii(us,1&us.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return Va(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ii(us,us.current),r)break;return null;case 22:case 23:return t.lanes=0,xa(e,t,n)}return Wa(e,t,n)}(e,t,r);wa=0!=(131072&e.flags)}else wa=!1,oo&&0!=(1048576&t.flags)&&eo(t,Ki,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;qa(e,t),e=t.pendingProps;var o=Ai(t,Pi.current);xo(t,r),o=Rs(null,t,i,e,o,r);var s=xs();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ti(i)?(s=!0,ji(t)):s=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,To(t),o.updater=$o,t.stateNode=o,o._reactInternals=t,Ko(t,i,e,r),t=ka(null,t,i,!0,s,r)):(t.tag=0,oo&&s&&to(t),Ea(null,t,o,r),t=t.child),t;case 16:i=t.elementType;e:{switch(qa(e,t),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Mu(e)?1:0;if(null!=e){if((e=e.$$typeof)===x)return 11;if(e===P)return 14}return 2}(i),e=mo(i,e),o){case 0:t=Ca(null,t,i,e,r);break e;case 1:t=Pa(null,t,i,e,r);break e;case 11:t=Sa(null,t,i,e,r);break e;case 14:t=Oa(null,t,i,mo(i.type,e),r);break e}throw Error(n(306,i,""))}return t;case 0:return i=t.type,o=t.pendingProps,Ca(e,t,i,o=t.elementType===i?o:mo(i,o),r);case 1:return i=t.type,o=t.pendingProps,Pa(e,t,i,o=t.elementType===i?o:mo(i,o),r);case 3:e:{if(Na(t),null===e)throw Error(n(387));i=t.pendingProps,o=(s=t.memoizedState).element,Mo(e,t),zo(t,i,null,r);var a=t.memoizedState;if(i=a.element,s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Aa(e,t,i,r,o=fa(Error(n(423)),t));break e}if(i!==o){t=Aa(e,t,i,r,o=fa(Error(n(424)),t));break e}for(io=li(t.stateNode.containerInfo.firstChild),ro=t,oo=!0,so=null,r=Zo(t,null,i,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(go(),i===o){t=Wa(e,t,r);break e}Ea(e,t,i,r)}t=t.child}return t;case 5:return as(t),null===e&&lo(t),i=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,a=o.children,ri(i,o)?a=null:null!==s&&ri(i,s)&&(t.flags|=32),Ia(e,t),Ea(e,t,a,r),t.child;case 6:return null===e&&lo(t),null;case 13:return za(e,t,r);case 4:return os(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=Xo(t,null,i,r):Ea(e,t,i,r),t.child;case 11:return i=t.type,o=t.pendingProps,Sa(e,t,i,o=t.elementType===i?o:mo(i,o),r);case 7:return Ea(e,t,t.pendingProps,r),t.child;case 8:case 12:return Ea(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,o=t.pendingProps,s=t.memoizedProps,a=o.value,Ii(_o,i._currentValue),i._currentValue=a,null!==s)if(cr(s.value,a)){if(s.children===o.children&&!ki.current){t=Wa(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){a=s.child;for(var u=c.firstContext;null!==u;){if(u.context===i){if(1===s.tag){(u=Lo(-1,r&-r)).tag=2;var l=s.updateQueue;if(null!==l){var f=(l=l.shared).pending;null===f?u.next=u:(u.next=f.next,f.next=u),l.pending=u}}s.lanes|=r,null!==(u=s.alternate)&&(u.lanes|=r),Ro(s.return,r,t),c.lanes|=r;break}u=u.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(n(341));a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),Ro(a,r,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}Ea(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps.children,xo(t,r),i=i(o=Io(o)),t.flags|=1,Ea(e,t,i,r),t.child;case 14:return o=mo(i=t.type,t.pendingProps),Oa(e,t,i,o=mo(i.type,o),r);case 15:return Ra(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:mo(i,o),qa(e,t),t.tag=1,Ti(i)?(e=!0,ji(t)):e=!1,xo(t,r),qo(t,i,o),Ko(t,i,o,r),ka(null,t,i,!0,e,r);case 19:return Va(e,t,r);case 22:return xa(e,t,r)}throw Error(n(156,t.tag))};var Yu="function"==typeof reportError?reportError:function(e){console.error(e)};function Qu(e){this._internalRoot=e}function Ju(e){this._internalRoot=e}function Xu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function el(){}function tl(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if("function"==typeof i){var a=i;i=function(){var e=Wu(s);a.call(e)}}qu(t,s,e,i)}else s=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=Wu(s);o.call(e)}}var s=Vu(t,r,e,0,null,!1,0,"",el);return e._reactRootContainer=s,e[gi]=s.current,$r(8===e.nodeType?e.parentNode:e),hu(),s}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var a=r;r=function(){var e=Wu(c);a.call(e)}}var c=Hu(e,0,!1,null,0,!1,0,"",el);return e._reactRootContainer=c,e[gi]=c.current,$r(8===e.nodeType?e.parentNode:e),hu((function(){qu(t,c,n,r)})),c}(n,t,e,i,r);return Wu(s)}Ju.prototype.render=Qu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));qu(e,t,null,null)},Ju.prototype.unmount=Qu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;hu((function(){qu(null,e,null,null)})),t[gi]=null}},Ju.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mt.length&&0!==t&&t<Mt[n].priority;n++);Mt.splice(n,0,e),0===n&&Dt(e)}},_t=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ut(t.pendingLanes);0!==n&&(yt(t,1|n),ou(t,Ye()),0==(6&kc)&&(Vc=Ye()+500,$i()))}break;case 13:hu((function(){var t=No(e,1);if(null!==t){var n=nu();iu(t,e,1,n)}})),Gu(e,1)}},bt=function(e){if(13===e.tag){var t=No(e,134217728);if(null!==t)iu(t,e,134217728,nu());Gu(e,134217728)}},wt=function(e){if(13===e.tag){var t=ru(e),n=No(e,t);if(null!==n)iu(n,e,t,nu());Gu(e,t)}},St=function(){return vt},Ot=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}},be=function(e,t,r){switch(t){case"input":if(Q(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var o=Ei(i);if(!o)throw Error(n(90));q(i),Q(i,o)}}}break;case"textarea":re(e,r);break;case"select":null!=(t=r.value)&&ee(e,!!r.multiple,t,!1)}},xe=fu,Ie=hu;var nl={usingClientEntryPoint:!1,Events:[bi,wi,Ei,Oe,Re,fu]},rl={findFiberByHostInstance:_i,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},il={bundleType:rl.bundleType,version:rl.version,rendererPackageName:rl.rendererPackageName,rendererConfig:rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:v.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$e(e))?null:e.stateNode},findFiberByHostInstance:rl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ol.isDisabled&&ol.supportsFiber)try{nt=ol.inject(il),rt=ol}catch(ce){}}return Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nl,Rt.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xu(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},Rt.createRoot=function(e,t){if(!Xu(e))throw Error(n(299));var r=!1,i="",o=Yu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Hu(e,1,!1,null,0,r,0,i,o),e[gi]=t.current,$r(8===e.nodeType?e.parentNode:e),new Qu(t)},Rt.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=$e(t))?null:e.stateNode},Rt.flushSync=function(e){return hu(e)},Rt.hydrate=function(e,t,r){if(!Zu(t))throw Error(n(200));return tl(null,e,t,!0,r)},Rt.hydrateRoot=function(e,t,r){if(!Xu(e))throw Error(n(405));var i=null!=r&&r.hydratedSources||null,o=!1,s="",a=Yu;if(null!=r&&(!0===r.unstable_strictMode&&(o=!0),void 0!==r.identifierPrefix&&(s=r.identifierPrefix),void 0!==r.onRecoverableError&&(a=r.onRecoverableError)),t=Vu(t,null,e,1,null!=r?r:null,o,0,s,a),e[gi]=t.current,$r(e),i)for(e=0;e<i.length;e++)o=(o=(r=i[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Ju(t)},Rt.render=function(e,t,r){if(!Zu(t))throw Error(n(200));return tl(null,e,t,!1,r)},Rt.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(n(40));return!!e._reactRootContainer&&(hu((function(){tl(null,null,e,!1,(function(){e._reactRootContainer=null,e[gi]=null}))})),!0)},Rt.unstable_batchedUpdates=fu,Rt.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Zu(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return tl(e,t,r,!1,i)},Rt.version="18.2.0-next-9e3b772b8-20220608",Rt}!function(e){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=Pt()}(Ot);var kt=Ot.exports;St=kt.createRoot,kt.hydrateRoot;const Nt=rt.div`
|
182
182
|
display: flex;
|
183
183
|
flex-direction: row;
|
184
184
|
align-items: center;
|
@@ -190,12 +190,12 @@ t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?i-1:0,h=
|
|
190
190
|
height: 48px;
|
191
191
|
margin-right: 12px;
|
192
192
|
}
|
193
|
-
`;const Mt=n("ExtensionInstallModal"),Lt=({onClose:e=(()=>{})})=>{Mt("initializing");return _.exports.jsx(wt,Object.assign({onClose:e},{children:_.exports.jsx(_.exports.Fragment,{children:_.exports.jsxs(dt,{children:[_.exports.jsx(pt,{children:"With Ledger Extension, you can:"}),_.exports.jsxs(Tt,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='48' height='48' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='48' height='48' rx='24' fill='%23252333'/%3e%3cpath d='M16.56 32.4h16.8V19.2h-15V21h13.2v9.6h-15c-.12 0-.12 0-.12-.12V17.52c0-.12 0-.12.12-.12h14.88c-.048-1.056-.864-1.8-1.92-1.8H16.56c-1.104 0-1.92.816-1.92 1.92v12.96c0 1.104.816 1.92 1.92 1.92Zm10.488-6.48a1.28 1.28 0 0 0 1.272 1.272c.696 0 1.248-.6 1.248-1.272a1.24 1.24 0 0 0-1.248-1.248c-.72 0-1.272.552-1.272 1.248Z' fill='%23BBB0FF'/%3e%3c/svg%3e"}),"Connect your Ledger directly to any dApp on Ethereum and Polygon"]}),_.exports.jsxs(Tt,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='48' height='48' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='48' height='48' rx='24' fill='%23252333'/%3e%3cpath d='M24 33.84c6.24-2.472 9.36-6.408 9.36-11.712v-5.04c-2.664-1.92-5.904-2.928-9.36-2.928-3.456 0-6.696 1.008-9.36 2.928v5.04c0 5.304 3.12 9.24 9.36 11.712Zm-7.44-11.712V18c2.232-1.392 4.632-2.04 7.44-2.04 2.808 0 5.208.648 7.44 2.04v4.128c0 4.512-2.232 7.512-7.44 9.744-5.208-2.232-7.44-5.232-7.44-9.744Zm3.36 1.176 3.36 3.384L28.944 21 27.6 19.656l-4.32 4.296-2.016-1.992-1.344 1.344Z' fill='%23BBB0FF'/%3e%3c/svg%3e"}),"Get warnings about risky transactions before signing them."]}),_.exports.jsx(yt,Object.assign({variant:"primary",onClick:()=>{window.open("https://apps.apple.com/app/ledger-extension-browse-web3/id1627727841?pt=516048&ct=ledger_button&mt=8","_blank")}},{children:"Install Ledger Extension"}))]})})}))};var Ut,jt,Dt=Object.defineProperty,zt=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,Ht=(e,t,n)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;(e=>{const t=class{constructor(e,n,r,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,n,i=1,s=40,c=-1,u=!0){if(!(t.MIN_VERSION<=i&&i<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let l,f;for(l=i;;l++){const r=8*t.getNumDataCodewords(l,n),i=a.getTotalBits(e,l);if(i<=r){f=i;break}if(l>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=8*t.getNumDataCodewords(l,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(l),h);for(const e of t.getData())h.push(e)}o(h.length==f);const d=8*t.getNumDataCodewords(l,n);o(h.length<=d),r(0,Math.min(4,d-h.length),h),r(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<d;e^=253)r(e,8,h);let p=[];for(;8*p.length<h.length;)p.push(0);return h.forEach(((e,t)=>p[t>>>3]|=e<<7-(7&t))),new t(l,n,p,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(r,e));this.setFunctionModule(8,7,i(r,6)),this.setFunctionModule(8,8,i(r,7)),this.setFunctionModule(7,8,i(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),c=i-a%i,u=Math.floor(a/i);let l=[];const f=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<i;n++){let i=e.slice(r,r+u-s+(n<c?0:1));r+=i.length;const o=t.reedSolomonComputeRemainder(i,f);n<c&&i.push(0),l.push(i.concat(o))}let h=[];for(let e=0;e<l[0].length;e++)l.forEach(((t,n)=>{(e!=u-s||n>=c)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const i of e){const e=i^r.shift();r.push(0),n.forEach(((n,i)=>r[i]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const s=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);r(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(i,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(Ut||(Ut={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})((jt=Ut||(Ut={})).QrCode||(jt.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Ut||(Ut={}));var $t=Ut,Vt={L:$t.QrCode.Ecc.LOW,M:$t.QrCode.Ecc.MEDIUM,Q:$t.QrCode.Ecc.QUARTILE,H:$t.QrCode.Ecc.HIGH},qt=128,Wt="L",Kt="#FFFFFF",Gt="#000000",Yt=!1,Qt=4,Jt=.1;
|
193
|
+
`;const At=n("ExtensionInstallModal"),Tt=({onClose:e=(()=>{})})=>{At("initializing");return _.exports.jsx(_t,Object.assign({onClose:e},{children:_.exports.jsx(_.exports.Fragment,{children:_.exports.jsxs(dt,{children:[_.exports.jsx(pt,{children:"With Ledger Extension, you can:"}),_.exports.jsxs(Nt,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='48' height='48' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='48' height='48' rx='24' fill='%23252333'/%3e%3cpath d='M16.56 32.4h16.8V19.2h-15V21h13.2v9.6h-15c-.12 0-.12 0-.12-.12V17.52c0-.12 0-.12.12-.12h14.88c-.048-1.056-.864-1.8-1.92-1.8H16.56c-1.104 0-1.92.816-1.92 1.92v12.96c0 1.104.816 1.92 1.92 1.92Zm10.488-6.48a1.28 1.28 0 0 0 1.272 1.272c.696 0 1.248-.6 1.248-1.272a1.24 1.24 0 0 0-1.248-1.248c-.72 0-1.272.552-1.272 1.248Z' fill='%23BBB0FF'/%3e%3c/svg%3e"}),"Connect your Ledger directly to any dApp on Ethereum and Polygon"]}),_.exports.jsxs(Nt,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='48' height='48' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='48' height='48' rx='24' fill='%23252333'/%3e%3cpath d='M24 33.84c6.24-2.472 9.36-6.408 9.36-11.712v-5.04c-2.664-1.92-5.904-2.928-9.36-2.928-3.456 0-6.696 1.008-9.36 2.928v5.04c0 5.304 3.12 9.24 9.36 11.712Zm-7.44-11.712V18c2.232-1.392 4.632-2.04 7.44-2.04 2.808 0 5.208.648 7.44 2.04v4.128c0 4.512-2.232 7.512-7.44 9.744-5.208-2.232-7.44-5.232-7.44-9.744Zm3.36 1.176 3.36 3.384L28.944 21 27.6 19.656l-4.32 4.296-2.016-1.992-1.344 1.344Z' fill='%23BBB0FF'/%3e%3c/svg%3e"}),"Get warnings about risky transactions before signing them."]}),_.exports.jsx(yt,Object.assign({variant:"primary",onClick:()=>{window.open("https://apps.apple.com/app/ledger-extension-browse-web3/id1627727841?pt=516048&ct=ledger_button&mt=8","_blank")}},{children:"Install Ledger Extension"}))]})})}))};var Mt,Lt,Ut=Object.defineProperty,jt=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,Bt=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;(e=>{const t=class{constructor(e,n,r,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,n,i=1,s=40,c=-1,u=!0){if(!(t.MIN_VERSION<=i&&i<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let l,f;for(l=i;;l++){const r=8*t.getNumDataCodewords(l,n),i=a.getTotalBits(e,l);if(i<=r){f=i;break}if(l>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=8*t.getNumDataCodewords(l,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(l),h);for(const e of t.getData())h.push(e)}o(h.length==f);const d=8*t.getNumDataCodewords(l,n);o(h.length<=d),r(0,Math.min(4,d-h.length),h),r(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<d;e^=253)r(e,8,h);let p=[];for(;8*p.length<h.length;)p.push(0);return h.forEach(((e,t)=>p[t>>>3]|=e<<7-(7&t))),new t(l,n,p,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(r,e));this.setFunctionModule(8,7,i(r,6)),this.setFunctionModule(8,8,i(r,7)),this.setFunctionModule(7,8,i(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),c=i-a%i,u=Math.floor(a/i);let l=[];const f=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<i;n++){let i=e.slice(r,r+u-s+(n<c?0:1));r+=i.length;const o=t.reedSolomonComputeRemainder(i,f);n<c&&i.push(0),l.push(i.concat(o))}let h=[];for(let e=0;e<l[0].length;e++)l.forEach(((t,n)=>{(e!=u-s||n>=c)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const i of e){const e=i^r.shift();r.push(0),n.forEach(((n,i)=>r[i]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const s=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);r(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(i,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(Mt||(Mt={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})((Lt=Mt||(Mt={})).QrCode||(Lt.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Mt||(Mt={}));var Ft=Mt,Ht={L:Ft.QrCode.Ecc.LOW,M:Ft.QrCode.Ecc.MEDIUM,Q:Ft.QrCode.Ecc.QUARTILE,H:Ft.QrCode.Ecc.HIGH},$t=128,Vt="L",qt="#FFFFFF",Wt="#000000",Kt=!1,Gt=4,Yt=.1;
|
194
194
|
/**
|
195
195
|
* @license qrcode.react
|
196
196
|
* Copyright (c) Paul O'Shannessy
|
197
197
|
* SPDX-License-Identifier: ISC
|
198
|
-
*/!function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}}();const
|
198
|
+
*/!function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}}();const Qt=rt((function(e){const t=e,{value:n,size:r=$t,level:i=Vt,bgColor:o=qt,fgColor:s=Wt,includeMargin:a=Kt,imageSettings:c}=t,u=((e,t)=>{var n={};for(var r in e)Dt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&jt)for(var r of jt(e))t.indexOf(r)<0&&zt.call(e,r)&&(n[r]=e[r]);return n})(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let l=Ft.QrCode.encodeText(n,Ht[i]).getModules();const f=a?Gt:0,h=l.length+2*f,d=function(e,t,n,r){if(null==r)return null;const i=n?Gt:0,o=e.length+2*i,s=Math.floor(t*Yt),a=o/t,c=(r.width||s)*a,u=(r.height||s)*a,l=null==r.x?e.length/2-c/2:r.x*a,f=null==r.y?e.length/2-u/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(f);h={x:e,y:t,w:Math.ceil(c+l-e),h:Math.ceil(u+f-t)}}return{x:l,y:f,h:u,w:c,excavation:h}}(l,r,a,c);let p=null;var g,y;null!=c&&null!=d&&(null!=d.excavation&&(g=l,y=d.excavation,l=g.slice().map(((e,t)=>t<y.y||t>=y.y+y.h?e:e.map(((e,t)=>(t<y.x||t>=y.x+y.w)&&e))))),p=R.createElement("image",{xlinkHref:c.src,height:d.h,width:d.w,x:d.x+f,y:d.y+f,preserveAspectRatio:"none"}));const v=function(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}(l,f);return R.createElement("svg",((e,t)=>{for(var n in t||(t={}))Dt.call(t,n)&&Bt(e,n,t[n]);if(jt)for(var n of jt(t))zt.call(t,n)&&Bt(e,n,t[n]);return e})({height:r,width:r,viewBox:`0 0 ${h} ${h}`},u),R.createElement("path",{fill:o,d:`M0,0 h${h}v${h}H0z`,shapeRendering:"crispEdges"}),R.createElement("path",{fill:s,d:v,shapeRendering:"crispEdges"}),p)}))`
|
199
199
|
box-sizing: border-box;
|
200
200
|
flex-grow: 0;
|
201
201
|
flex-shrink: 0;
|
@@ -210,11 +210,11 @@ t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?i-1:0,h=
|
|
210
210
|
width: 200px;
|
211
211
|
height: 200px;
|
212
212
|
}
|
213
|
-
`,
|
213
|
+
`,Jt=rt.div`
|
214
214
|
margin: 1rem 0;
|
215
215
|
border-top: none;
|
216
216
|
padding-top: 0;
|
217
|
-
`,
|
217
|
+
`,Xt=n("UseLedgerLiveModal");let Zt=e=>{},en=e=>{Xt("setModalUri",e),Zt(e)};const tn=({isDesktop:e=!1,uri:t="",onClose:n=(()=>{})})=>{Xt("initializing",{isDesktop:e,uri:t});const[r,i]=w.exports.useState(t);Zt=i;const o=w.exports.useRef(),s=o.current;t!==s&&t!==r&&i(t),w.exports.useEffect((()=>{o.current=t}));const a=w.exports.useCallback((()=>(Xt("loading Ledger Live, ",r),window.location.href=`ledgerlive://wc?uri=${encodeURIComponent(r)}`,mt(!1),!1)),[r]),c=w.exports.useCallback((()=>(window.open("https://www.ledger.com/ledger-live"),!1)),[]);return _.exports.jsx(_t,Object.assign({onClose:n},{children:_.exports.jsxs(dt,Object.assign({textAlign:"center"},{children:[_.exports.jsx(pt,{children:"Connect with Ledger Live"}),e&&""!==r&&_.exports.jsxs(_.exports.Fragment,{children:[_.exports.jsx(gt,{children:"Scan for Ledger Live mobile"}),_.exports.jsx(Jt,{children:_.exports.jsx(Qt,{value:r,size:310})}),_.exports.jsx(gt,Object.assign({noMargin:!0},{children:"or"})),_.exports.jsx(yt,Object.assign({variant:"primary",onClick:a},{children:"Connect with Ledger Live desktop"}))]}),!e&&""!==r&&_.exports.jsx(yt,Object.assign({variant:"primary",onClick:a,extraMargin:!0},{children:"Connect with Ledger Live mobile"})),_.exports.jsxs(gt,{children:["Don't have Ledger Live for ",e?"desktop":"mobile","?"]}),_.exports.jsx(gt,Object.assign({noMargin:!0},{children:_.exports.jsx(vt,Object.assign({onClick:c},{children:"Install it"}))}))]}))}))},nn=rt.div`
|
218
218
|
margin: 1.4rem 0;
|
219
219
|
display: flex;
|
220
220
|
flex-direction: column;
|
@@ -222,7 +222,7 @@ t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?i-1:0,h=
|
|
222
222
|
align-items: start;
|
223
223
|
font-size: 1rem;
|
224
224
|
gap: 12px 20px;
|
225
|
-
`,
|
225
|
+
`,rn=rt.div`
|
226
226
|
display: flex;
|
227
227
|
flex-direction: row;
|
228
228
|
align-items: center;
|
@@ -233,7 +233,7 @@ t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?i-1:0,h=
|
|
233
233
|
height: 24px;
|
234
234
|
margin-right: 8px;
|
235
235
|
}
|
236
|
-
`;const an=n("PlatformNotSupportedModal"),cn=()=>(an("initializing"),_.exports.jsx(wt,{children:_.exports.jsx(_.exports.Fragment,{children:_.exports.jsxs(dt,{children:[_.exports.jsx(pt,{children:"Sorry, we don't support this platform just yet."}),_.exports.jsxs(gt,{children:["We're working hard to expand our coverage.",_.exports.jsx("br",{}),"Until we get there, you can try Ledger Connect on:"]}),_.exports.jsx(on,{children:_.exports.jsxs(sn,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='250.076' height='248.707' viewBox='0 0 66.166 65.804'%3e%3cdefs%3e%3clinearGradient id='b'%3e%3cstop style='stop-color:%2306c2e7%3bstop-opacity:1' offset='0'/%3e%3cstop offset='.25' style='stop-color:%230db8ec%3bstop-opacity:1'/%3e%3cstop offset='.5' style='stop-color:%2312aef1%3bstop-opacity:1'/%3e%3cstop style='stop-color:%231f86f9%3bstop-opacity:1' offset='.75'/%3e%3cstop style='stop-color:%23107ddd%3bstop-opacity:1' offset='1'/%3e%3c/linearGradient%3e%3clinearGradient id='a'%3e%3cstop style='stop-color:%23bdbdbd%3bstop-opacity:1' offset='0'/%3e%3cstop style='stop-color:white%3bstop-opacity:1' offset='1'/%3e%3c/linearGradient%3e%3clinearGradient xlink:href='%23a' id='d' x1='412.975' y1='237.608' x2='412.975' y2='59.392' gradientUnits='userSpaceOnUse' gradientTransform='matrix(.35154 0 0 .35154 206.79 159.773)'/%3e%3cfilter style='color-interpolation-filters:sRGB' id='f' x='-.021' width='1.042' y='-.022' height='1.045'%3e%3cfeGaussianBlur stdDeviation='.958'/%3e%3c/filter%3e%3cfilter style='color-interpolation-filters:sRGB' id='c' x='-.048' width='1.096' y='-.048' height='1.096'%3e%3cfeGaussianBlur stdDeviation='3.564'/%3e%3c/filter%3e%3cradialGradient xlink:href='%23b' id='e' cx='413.061' cy='136.818' fx='413.061' fy='136.818' r='82.125' gradientUnits='userSpaceOnUse' gradientTransform='matrix(.38143 0 0 .38143 194.545 155.58)'/%3e%3c/defs%3e%3cpath transform='matrix(.33865 0 0 .3261 -106.77 -14.478)' style='opacity:.52999998%3bfill:black%3bfill-opacity:1%3bstroke:none%3bstroke-width:2.93077397%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill%3bfilter:url(%23c)' d='M502.083 148.5a89.108 89.108 0 0 1-89.108 89.108 89.108 89.108 0 0 1-89.108-89.108 89.108 89.108 0 0 1 89.108-89.108 89.108 89.108 0 0 1 89.108 89.108Z'/%3e%3cpath d='M383.294 211.977a31.325 31.325 0 0 1-31.325 31.325 31.325 31.325 0 0 1-31.326-31.325 31.325 31.325 0 0 1 31.326-31.325 31.325 31.325 0 0 1 31.325 31.325z' style='opacity:1%3bfill:url(%23d)%3bfill-opacity:1%3bstroke:%23cdcdcd%3bstroke-width:.09301235%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' transform='translate(-318.886 -180.595)'/%3e%3cpath d='M380.84 211.977a28.87 28.87 0 0 1-28.871 28.87 28.87 28.87 0 0 1-28.871-28.87 28.87 28.87 0 0 1 28.87-28.87 28.87 28.87 0 0 1 28.871 28.87z' style='opacity:1%3bfill:url(%23e)%3bfill-opacity:1%3bstroke:none%3bstroke-width:.94955933%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' transform='translate(-318.886 -180.595)'/%3e%3cpath d='M351.969 184.612a.42.42 0 0 0-.421.42v4.856a.42.42 0 1 0 .841 0v-4.855a.42.42 0 0 0-.42-.421zm-2.754.174a.42.42 0 0 0-.46.463l.212 2.03a.42.42 0 1 0 .837-.087l-.212-2.03a.42.42 0 0 0-.377-.376zm5.526.002a.42.42 0 0 0-.377.375l-.213 2.03a.42.42 0 1 0 .837.089l.214-2.031a.42.42 0 0 0-.46-.463zm-8.355.408a.42.42 0 0 0-.41.508l1.006 4.75a.42.42 0 1 0 .824-.174l-1.006-4.75a.42.42 0 0 0-.414-.334zm11.184.004a.42.42 0 0 0-.414.333l-1.01 4.75a.42.42 0 1 0 .824.175l1.01-4.75a.42.42 0 0 0-.41-.508zm-13.883.757a.42.42 0 0 0-.437.55l.631 1.942a.42.42 0 1 0 .8-.26l-.63-1.942a.42.42 0 0 0-.364-.29zm16.567.001a.42.42 0 0 0-.364.29l-.631 1.942a.42.42 0 1 0 .8.26l.632-1.942a.42.42 0 0 0-.437-.55zm-19.237.976a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.973-4.437a.42.42 0 0 0-.392-.25zm21.937.015a.42.42 0 0 0-.393.25l-1.978 4.434a.42.42 0 1 0 .77.343l1.977-4.434a.42.42 0 0 0-.376-.593zm-24.415 1.296a.42.42 0 0 0-.394.63l1.021 1.77a.42.42 0 1 0 .73-.421l-1.022-1.769a.42.42 0 0 0-.335-.21zm26.859 0a.419.419 0 0 0-.335.21l-1.021 1.769a.42.42 0 1 0 .729.42l1.021-1.768a.42.42 0 0 0-.394-.63zm-29.265 1.5a.422.422 0 0 0-.326.669l2.85 3.93a.42.42 0 1 0 .682-.494l-2.851-3.93a.42.42 0 0 0-.355-.174zm31.701.022a.42.42 0 0 0-.355.174l-2.856 3.926a.42.42 0 1 0 .68.495l2.857-3.926a.42.42 0 0 0-.326-.669zm-33.852 1.783a.42.42 0 0 0-.335.702l1.367 1.518a.42.42 0 1 0 .626-.563l-1.367-1.518a.42.42 0 0 0-.29-.14zm35.976.003a.421.421 0 0 0-.291.139l-1.366 1.517a.42.42 0 1 0 .625.564l1.367-1.518a.42.42 0 0 0-.335-.702zm-38.037 1.977a.42.42 0 0 0-.26.733l3.609 3.249a.42.42 0 1 0 .563-.626l-3.608-3.248a.42.42 0 0 0-.304-.108zm40.108.014a.419.419 0 0 0-.304.108l-3.61 3.245a.42.42 0 1 0 .563.626l3.61-3.245a.42.42 0 0 0-.259-.734zm-41.822 2.19a.42.42 0 0 0-.262.762l1.652 1.2a.42.42 0 1 0 .495-.681l-1.652-1.2a.42.42 0 0 0-.233-.081zm43.535.015a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .494.681l1.653-1.2a.42.42 0 0 0-.261-.76zm-45.137 2.336a.42.42 0 0 0-.18.785l4.204 2.427a.42.42 0 1 0 .42-.729l-4.204-2.427a.42.42 0 0 0-.24-.056zm46.727 0a.417.417 0 0 0-.24.056l-4.204 2.427a.42.42 0 1 0 .42.73l4.205-2.428a.42.42 0 0 0-.18-.785zm-47.938 2.506a.42.42 0 0 0-.18.805l1.865.833a.42.42 0 1 0 .343-.77l-1.865-.831a.42.42 0 0 0-.163-.037zm49.158.017a.42.42 0 0 0-.164.037l-1.866.83a.42.42 0 1 0 .343.77l1.866-.831a.42.42 0 0 0-.18-.806zm-50.238 2.602a.42.42 0 0 0-.094.82l4.616 1.504a.42.42 0 1 0 .26-.8l-4.615-1.504a.421.421 0 0 0-.167-.02zm51.315.018a.408.408 0 0 0-.166.02l-4.618 1.5a.42.42 0 1 0 .26.801l4.618-1.5a.42.42 0 0 0-.094-.82zm-51.987 2.732a.42.42 0 0 0-.09.833l1.997.424a.42.42 0 1 0 .175-.823l-1.997-.425a.413.413 0 0 0-.085-.009zm52.654.004a.518.518 0 0 0-.084.009l-1.998.424a.42.42 0 1 0 .175.823l1.997-.424a.42.42 0 0 0-.09-.833zm-53.163 2.761a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .088-.837l-4.828-.51a.432.432 0 0 0-.085 0zm53.676.037a.386.386 0 0 0-.086 0l-4.828.504a.42.42 0 1 0 .087.837l4.829-.504a.42.42 0 0 0-.002-.837zm-53.758 2.794a.42.42 0 1 0 0 .842h2.042a.42.42 0 1 0 0-.842zm51.793 0a.42.42 0 1 0 0 .842h2.042a.42.42 0 1 0 0-.842zm-46.803 2.295a.384.384 0 0 0-.086 0l-4.829.504a.42.42 0 1 0 .088.838l4.829-.504a.42.42 0 0 0-.002-.838zm43.853.03a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .089-.837l-4.829-.51a.434.434 0 0 0-.085-.001zm-46.26 2.844a.43.43 0 0 0-.085.009l-1.998.424a.42.42 0 1 0 .175.823l1.998-.424a.42.42 0 0 0-.09-.833zm48.669.004a.42.42 0 0 0-.09.833l1.998.424a.42.42 0 1 0 .175-.824l-1.998-.424a.413.413 0 0 0-.085-.01zm-45.305 1.657a.408.408 0 0 0-.167.02l-4.617 1.5a.42.42 0 1 0 .26.801l4.618-1.5a.42.42 0 0 0-.094-.82zm41.937.015a.42.42 0 0 0-.094.82l4.616 1.504a.42.42 0 1 0 .26-.8l-4.616-1.504a.421.421 0 0 0-.166-.02zm-43.7 3.273a.42.42 0 0 0-.163.036l-1.865.831a.42.42 0 1 0 .342.769l1.866-.83a.42.42 0 0 0-.18-.806zm45.46.016a.42.42 0 0 0-.18.805l1.865.832a.42.42 0 1 0 .343-.768l-1.865-.833a.42.42 0 0 0-.163-.036zm-41.827.912a.417.417 0 0 0-.24.056l-4.204 2.427a.42.42 0 1 0 .42.73l4.205-2.428a.42.42 0 0 0-.18-.785zm38.2 0a.42.42 0 0 0-.181.785l4.205 2.427a.42.42 0 1 0 .421-.729l-4.204-2.427a.42.42 0 0 0-.24-.056zm-39.248 3.562a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .494.682l1.653-1.2a.42.42 0 0 0-.261-.762zm40.287.015a.42.42 0 0 0-.262.762l1.653 1.2a.42.42 0 1 0 .495-.681l-1.653-1.2a.42.42 0 0 0-.233-.081zm-36.544.145a.418.418 0 0 0-.303.108l-3.611 3.245a.42.42 0 1 0 .563.626l3.61-3.245a.42.42 0 0 0-.259-.734zm32.8.011a.421.421 0 0 0-.259.734l3.608 3.248a.42.42 0 1 0 .564-.625l-3.609-3.249a.42.42 0 0 0-.303-.107zm-29.374 3.084a.42.42 0 0 0-.355.173l-2.857 3.927a.42.42 0 1 0 .681.495l2.856-3.926a.42.42 0 0 0-.325-.669zm25.936.018a.421.421 0 0 0-.327.668l2.851 3.93a.42.42 0 1 0 .682-.494l-2.851-3.93a.42.42 0 0 0-.355-.174zm-29.623.606a.421.421 0 0 0-.291.14l-1.366 1.517a.42.42 0 1 0 .625.563l1.367-1.517a.42.42 0 0 0-.335-.703zm33.33.002a.42.42 0 0 0-.335.702l1.367 1.518a.42.42 0 1 0 .626-.563l-1.367-1.518a.42.42 0 0 0-.29-.139zm-25.655 1.684a.419.419 0 0 0-.392.25l-1.978 4.433a.42.42 0 1 0 .769.343l1.978-4.434a.42.42 0 0 0-.377-.592zm17.956.012a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.973-4.437a.42.42 0 0 0-.392-.25zm-21.432 1.359a.419.419 0 0 0-.335.21l-1.02 1.768a.42.42 0 1 0 .728.421l1.021-1.769a.42.42 0 0 0-.394-.63zm24.935 0a.42.42 0 0 0-.394.63l1.02 1.77a.42.42 0 1 0 .73-.422l-1.021-1.769a.42.42 0 0 0-.335-.21zm-17.055.063a.42.42 0 0 0-.414.334l-1.009 4.749a.42.42 0 1 0 .823.175l1.01-4.75a.42.42 0 0 0-.41-.508zm9.16.003a.42.42 0 0 0-.41.508l1.006 4.75a.42.42 0 1 0 .824-.175l-1.006-4.75a.42.42 0 0 0-.414-.333zm-4.572.48a.42.42 0 0 0-.421.42v4.855a.42.42 0 1 0 .841 0v-4.855a.42.42 0 0 0-.42-.42zm-7.727 1.568a.42.42 0 0 0-.364.29l-.632 1.942a.42.42 0 1 0 .801.26l.631-1.942a.42.42 0 0 0-.436-.55zm15.45 0a.42.42 0 0 0-.437.55l.631 1.943a.42.42 0 1 0 .801-.26l-.631-1.942a.42.42 0 0 0-.364-.29zm-10.366 1.083a.42.42 0 0 0-.377.375l-.213 2.03a.42.42 0 1 0 .837.088l.213-2.03a.42.42 0 0 0-.46-.463zm5.268.002a.42.42 0 0 0-.46.463l.211 2.03a.42.42 0 1 0 .837-.088l-.211-2.03a.42.42 0 0 0-.377-.375z' style='opacity:1%3bfill:%23f4f2f3%3bfill-opacity:1%3bstroke:none%3bstroke-width:.38088897%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' transform='translate(-318.886 -180.595)'/%3e%3cpath transform='matrix(.35154 0 0 .35154 -112.095 -20.822)' d='m469.096 100.607-65.51 38.061-41.42 65.207 60.595-44.882z' style='opacity:.40900005%3bfill:black%3bfill-opacity:1%3bstroke:none%3bstroke-width:1.5614785%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill%3bfilter:url(%23f)'/%3e%3cpath style='opacity:1%3bfill:%23ff5150%3bfill-opacity:1%3bstroke:none%3bstroke-width:1.01970422%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' d='m129.839 160.803-23.014-23.015 31.437-8.423z' transform='matrix(.64804 -.3317 -.36122 .63206 10.328 -23.732)'/%3e%3cpath transform='matrix(-.36122 .63206 .64804 -.3317 -20.923 6.11)' d='m129.839 160.803-23.014-23.015 31.437-8.423z' style='opacity:1%3bfill:%23f1f1f1%3bfill-opacity:1%3bstroke:none%3bstroke-width:1.01970422%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill'/%3e%3cpath style='opacity:.243%3bfill:black%3bstroke:none%3bstroke-width:.09301235px%3bstroke-linecap:butt%3bstroke-linejoin:miter%3bstroke-opacity:1' d='m331.853 231.185 23.416-15.752 16.815-22.665z' transform='translate(-318.886 -180.595)'/%3e%3c/svg%3e"}),"Safari on iOS"]})})]})})}));var un={exports:{}};!function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,c=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===a)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(n=null)&&s(t.prototype,n),r&&s(t,r),e}();t.default=a,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),o=c(n(94)),s=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(n[t]=s,r+=1)})),r>0){var s=Object.keys(n),c=a.default.find(s,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var f=this.satisfies(n[l]);if(void 0!==f)return f}}if(o>0){var h=Object.keys(i),d=a.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})}(un);var ln=p(un.exports);function fn(){const e=ln.getParser(window.navigator.userAgent),t=e.getOS(),n=e.getBrowser(),{type:r}=e.getPlatform();var i,o;return"isBrave"===(null===(o=null===(i=window.navigator.brave)||void 0===i?void 0:i.isBrave)||void 0===o?void 0:o.name)&&(n.name="Brave"),{type:r,os:t,browser:n}}let hn=null;function dn(e,t){if(!hn){const e=document.body,t=document.createElement("div");t.className="ledger-ck-modal",e.appendChild(t),hn=Rt(t)}if(hn&&e){let n;switch(e){case"UseLedgerLiveModal":n=_.exports.jsx(rn,Object.assign({},t));break;case"PlatformNotSupportedModal":n=_.exports.jsx(cn,{});break;case"ExtensionInstallModal":n=_.exports.jsx(Lt,Object.assign({},t))}hn.render(n)}bt(!0)}function pn(e){const t=fn(),n=(Po("getSupportResult"),ko);bo(),!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))&&n.isLedgerConnectSupported&&n.isChainIdSupported?dn("ExtensionInstallModal",{onClose:e.onClose}):dn("UseLedgerLiveModal",{isDesktop:"desktop"===t.type,uri:e.uri,onClose:e.onClose})}const gn=n("WalletConnectLegacy"),yn=r("WalletConnectLegacy");function vn(){return c(this,void 0,void 0,(function*(){gn("getWalletConnectLegacyProvider");try{const e=yield function(){return c(this,void 0,void 0,(function*(){gn("initWalletConnectLegacyProvider");const e=bo();return gn("walletConnectProviderOptions is",e),gn("created a new legacy provider instance"),new m({chainId:e.chainId,bridge:e.bridge,infuraId:e.infuraId,rpc:e.rpc,qrcode:!1})}))}();return function(e){function t(e){gn("connectHandler",e),bt(!1)}function n(t,r){gn("disconnectHandler",t,r),"undefined"!=typeof localStorage&&localStorage.removeItem("walletconnect"),e.removeListener("disconnect",n)}gn("assignWalletConnectLegacyProviderEvents"),e.on("connect",t),e.on("disconnect",n)}(e),e.request=function(e){gn("patchWalletConnectLegacyProviderRequest");const t=e.request.bind(e),n=bo();return function({method:r,params:i}){return c(this,void 0,void 0,(function*(){return"eth_requestAccounts"===r?(gn("calling patched",r,i),new Promise(((o,a)=>c(this,void 0,void 0,(function*(){try{if(!e.connected)return yield e.connector.createSession({chainId:n.chainId}),gn("created a new session"),pn({uri:e.connector.uri,onClose:()=>{yn("user rejected"),a(new s)}}),o(yield t({method:r,params:i}));gn("reusing existing session"),o(yield t({method:r,params:i}))}catch(e){return yn("error",e),a(e)}}))))):(gn("calling provider",r,i),yield t({method:r,params:i}))}))}}(e),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw yn("error",t),t}}))}var mn,_n={exports:{}},bn="object"==typeof Reflect?Reflect:null,wn=bn&&"function"==typeof bn.apply?bn.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};mn=bn&&"function"==typeof bn.ownKeys?bn.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var En=Number.isNaN||function(e){return e!=e};function Sn(){Sn.init.call(this)}_n.exports=Sn,_n.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}Tn(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&Tn(e,"error",t,n)}(e,i,{once:!0})}))},Sn.EventEmitter=Sn,Sn.prototype._events=void 0,Sn.prototype._eventsCount=0,Sn.prototype._maxListeners=void 0;var On=10;function Rn(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function xn(e){return void 0===e._maxListeners?Sn.defaultMaxListeners:e._maxListeners}function In(e,t,n,r){var i,o,s,a;if(Rn(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=xn(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function Cn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Pn(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=Cn.bind(r);return i.listener=n,r.wrapFn=i,i}function kn(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):An(i,i.length)}function Nn(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function An(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Tn(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(Sn,"defaultMaxListeners",{enumerable:!0,get:function(){return On},set:function(e){if("number"!=typeof e||e<0||En(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");On=e}}),Sn.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Sn.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||En(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},Sn.prototype.getMaxListeners=function(){return xn(this)},Sn.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)wn(a,this,t);else{var c=a.length,u=An(a,c);for(n=0;n<c;++n)wn(u[n],this,t)}return!0},Sn.prototype.addListener=function(e,t){return In(this,e,t,!1)},Sn.prototype.on=Sn.prototype.addListener,Sn.prototype.prependListener=function(e,t){return In(this,e,t,!0)},Sn.prototype.once=function(e,t){return Rn(t),this.on(e,Pn(this,e,t)),this},Sn.prototype.prependOnceListener=function(e,t){return Rn(t),this.prependListener(e,Pn(this,e,t)),this},Sn.prototype.removeListener=function(e,t){var n,r,i,o,s;if(Rn(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},Sn.prototype.off=Sn.prototype.removeListener,Sn.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},Sn.prototype.listeners=function(e){return kn(this,e,!0)},Sn.prototype.rawListeners=function(e){return kn(this,e,!1)},Sn.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Nn.call(e,t)},Sn.prototype.listenerCount=Nn,Sn.prototype.eventNames=function(){return this._eventsCount>0?mn(this._events):[]};var Mn={},Ln={},Un={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},e.add=function(e,t){return e+t|0},e.sub=function(e,t){return e-t|0},e.rotl=function(e,t){return e<<t|e>>>32-t},e.rotr=function(e,t){return e<<32-t|e>>>t},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}}(Un),Object.defineProperty(Ln,"__esModule",{value:!0});var jn=Un;function Dn(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function zn(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function Bn(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Fn(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Hn(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function $n(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function Vn(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function qn(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function Wn(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),Vn(e/4294967296>>>0,t,n),Vn(e>>>0,t,n+4),t}function Kn(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),qn(e>>>0,t,n),qn(e/4294967296>>>0,t,n+4),t}Ln.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},Ln.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},Ln.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},Ln.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},Ln.writeUint16BE=Dn,Ln.writeInt16BE=Dn,Ln.writeUint16LE=zn,Ln.writeInt16LE=zn,Ln.readInt32BE=Bn,Ln.readUint32BE=Fn,Ln.readInt32LE=Hn,Ln.readUint32LE=$n,Ln.writeUint32BE=Vn,Ln.writeInt32BE=Vn,Ln.writeUint32LE=qn,Ln.writeInt32LE=qn,Ln.readInt64BE=function(e,t){void 0===t&&(t=0);var n=Bn(e,t),r=Bn(e,t+4);return 4294967296*n+r-4294967296*(r>>31)},Ln.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*Fn(e,t)+Fn(e,t+4)},Ln.readInt64LE=function(e,t){void 0===t&&(t=0);var n=Hn(e,t);return 4294967296*Hn(e,t+4)+n-4294967296*(n>>31)},Ln.readUint64LE=function(e,t){void 0===t&&(t=0);var n=$n(e,t);return 4294967296*$n(e,t+4)+n},Ln.writeUint64BE=Wn,Ln.writeInt64BE=Wn,Ln.writeUint64LE=Kn,Ln.writeInt64LE=Kn,Ln.readUintBE=function(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,o=e/8+n-1;o>=n;o--)r+=t[o]*i,i*=256;return r},Ln.readUintLE=function(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,o=n;o<n+e/8;o++)r+=t[o]*i,i*=256;return r},Ln.writeUintBE=function(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!jn.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var i=1,o=e/8+r-1;o>=r;o--)n[o]=t/i&255,i*=256;return n},Ln.writeUintLE=function(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!jn.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var i=1,o=r;o<r+e/8;o++)n[o]=t/i&255,i*=256;return n},Ln.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},Ln.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},Ln.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},Ln.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},Ln.writeFloat32BE=function(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e),t},Ln.writeFloat32LE=function(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),t},Ln.writeFloat64BE=function(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e),t},Ln.writeFloat64LE=function(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),t};var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e},Object.defineProperty(Mn,"__esModule",{value:!0});var Yn=Ln,Qn=Gn,Jn=20;function Xn(e,t,n){for(var r=1634760805,i=857760878,o=2036477234,s=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],u=n[11]<<24|n[10]<<16|n[9]<<8|n[8],l=n[15]<<24|n[14]<<16|n[13]<<8|n[12],f=n[19]<<24|n[18]<<16|n[17]<<8|n[16],h=n[23]<<24|n[22]<<16|n[21]<<8|n[20],d=n[27]<<24|n[26]<<16|n[25]<<8|n[24],p=n[31]<<24|n[30]<<16|n[29]<<8|n[28],g=t[3]<<24|t[2]<<16|t[1]<<8|t[0],y=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=r,b=i,w=o,E=s,S=a,O=c,R=u,x=l,I=f,C=h,P=d,k=p,N=g,A=y,T=v,M=m,L=0;L<Jn;L+=2)S=(S^=I=I+(N=(N^=_=_+S|0)>>>16|N<<16)|0)>>>20|S<<12,O=(O^=C=C+(A=(A^=b=b+O|0)>>>16|A<<16)|0)>>>20|O<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>16|T<<16)|0)>>>20|R<<12,x=(x^=k=k+(M=(M^=E=E+x|0)>>>16|M<<16)|0)>>>20|x<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>24|T<<8)|0)>>>25|R<<7,x=(x^=k=k+(M=(M^=E=E+x|0)>>>24|M<<8)|0)>>>25|x<<7,O=(O^=C=C+(A=(A^=b=b+O|0)>>>24|A<<8)|0)>>>25|O<<7,S=(S^=I=I+(N=(N^=_=_+S|0)>>>24|N<<8)|0)>>>25|S<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>16|M<<16)|0)>>>20|O<<12,R=(R^=k=k+(N=(N^=b=b+R|0)>>>16|N<<16)|0)>>>20|R<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>16|A<<16)|0)>>>20|x<<12,S=(S^=C=C+(T=(T^=E=E+S|0)>>>16|T<<16)|0)>>>20|S<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>24|A<<8)|0)>>>25|x<<7,S=(S^=C=C+(T=(T^=E=E+S|0)>>>24|T<<8)|0)>>>25|S<<7,R=(R^=k=k+(N=(N^=b=b+R|0)>>>24|N<<8)|0)>>>25|R<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>24|M<<8)|0)>>>25|O<<7;Yn.writeUint32LE(_+r|0,e,0),Yn.writeUint32LE(b+i|0,e,4),Yn.writeUint32LE(w+o|0,e,8),Yn.writeUint32LE(E+s|0,e,12),Yn.writeUint32LE(S+a|0,e,16),Yn.writeUint32LE(O+c|0,e,20),Yn.writeUint32LE(R+u|0,e,24),Yn.writeUint32LE(x+l|0,e,28),Yn.writeUint32LE(I+f|0,e,32),Yn.writeUint32LE(C+h|0,e,36),Yn.writeUint32LE(P+d|0,e,40),Yn.writeUint32LE(k+p|0,e,44),Yn.writeUint32LE(N+g|0,e,48),Yn.writeUint32LE(A+y|0,e,52),Yn.writeUint32LE(T+v|0,e,56),Yn.writeUint32LE(M+m|0,e,60)}function Zn(e,t,n,r,i){if(void 0===i&&(i=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(r.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(0===i){if(8!==t.length&&12!==t.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=(o=new Uint8Array(16)).length-t.length,o.set(t,s)}else{if(16!==t.length)throw new Error("ChaCha nonce with counter must be 16 bytes");o=t,s=i}for(var a=new Uint8Array(64),c=0;c<n.length;c+=64){Xn(a,o,e);for(var u=c;u<c+64&&u<n.length;u++)r[u]=n[u]^a[u-c];er(o,0,s)}return Qn.wipe(a),0===i&&Qn.wipe(o),r}function er(e,t,n){for(var r=1;n--;)r=r+(255&e[t])|0,e[t]=255&r,r>>>=8,t++;if(r>0)throw new Error("ChaCha: counter overflow")}Mn.streamXOR=Zn,Mn.stream=function(e,t,n,r){return void 0===r&&(r=0),Qn.wipe(n),Zn(e,t,n,n,r)};var tr={},nr={};function rr(e,t){if(e.length!==t.length)return 0;for(var n=0,r=0;r<e.length;r++)n|=e[r]^t[r];return 1&n-1>>>8}Object.defineProperty(nr,"__esModule",{value:!0}),nr.select=function(e,t,n){return~(e-1)&t|e-1&n},nr.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},nr.compare=rr,nr.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==rr(e,t)},function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=nr,n=Gn;e.DIGEST_LENGTH=16;var r=function(){function t(t){this.digestLength=e.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 n=t[0]|t[1]<<8;this._r[0]=8191&n;var r=t[2]|t[3]<<8;this._r[1]=8191&(n>>>13|r<<3);var i=t[4]|t[5]<<8;this._r[2]=7939&(r>>>10|i<<6);var o=t[6]|t[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=t[8]|t[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var u=t[14]|t[15]<<8;this._r[8]=8191&(c>>>8|u<<8),this._r[9]=u>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(e,t,n){for(var r=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],u=this._h[5],l=this._h[6],f=this._h[7],h=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],y=this._r[2],v=this._r[3],m=this._r[4],_=this._r[5],b=this._r[6],w=this._r[7],E=this._r[8],S=this._r[9];n>=16;){var O=e[t+0]|e[t+1]<<8;i+=8191&O;var R=e[t+2]|e[t+3]<<8;o+=8191&(O>>>13|R<<3);var x=e[t+4]|e[t+5]<<8;s+=8191&(R>>>10|x<<6);var I=e[t+6]|e[t+7]<<8;a+=8191&(x>>>7|I<<9);var C=e[t+8]|e[t+9]<<8;c+=8191&(I>>>4|C<<12),u+=C>>>1&8191;var P=e[t+10]|e[t+11]<<8;l+=8191&(C>>>14|P<<2);var k=e[t+12]|e[t+13]<<8;f+=8191&(P>>>11|k<<5);var N=e[t+14]|e[t+15]<<8,A=0,T=A;T+=i*p,T+=o*(5*S),T+=s*(5*E),T+=a*(5*w),A=(T+=c*(5*b))>>>13,T&=8191,T+=u*(5*_),T+=l*(5*m),T+=f*(5*v),T+=(h+=8191&(k>>>8|N<<8))*(5*y);var M=A+=(T+=(d+=N>>>5|r)*(5*g))>>>13;M+=i*g,M+=o*p,M+=s*(5*S),M+=a*(5*E),A=(M+=c*(5*w))>>>13,M&=8191,M+=u*(5*b),M+=l*(5*_),M+=f*(5*m),M+=h*(5*v),A+=(M+=d*(5*y))>>>13,M&=8191;var L=A;L+=i*y,L+=o*g,L+=s*p,L+=a*(5*S),A=(L+=c*(5*E))>>>13,L&=8191,L+=u*(5*w),L+=l*(5*b),L+=f*(5*_),L+=h*(5*m);var U=A+=(L+=d*(5*v))>>>13;U+=i*v,U+=o*y,U+=s*g,U+=a*p,A=(U+=c*(5*S))>>>13,U&=8191,U+=u*(5*E),U+=l*(5*w),U+=f*(5*b),U+=h*(5*_);var j=A+=(U+=d*(5*m))>>>13;j+=i*m,j+=o*v,j+=s*y,j+=a*g,A=(j+=c*p)>>>13,j&=8191,j+=u*(5*S),j+=l*(5*E),j+=f*(5*w),j+=h*(5*b);var D=A+=(j+=d*(5*_))>>>13;D+=i*_,D+=o*m,D+=s*v,D+=a*y,A=(D+=c*g)>>>13,D&=8191,D+=u*p,D+=l*(5*S),D+=f*(5*E),D+=h*(5*w);var z=A+=(D+=d*(5*b))>>>13;z+=i*b,z+=o*_,z+=s*m,z+=a*v,A=(z+=c*y)>>>13,z&=8191,z+=u*g,z+=l*p,z+=f*(5*S),z+=h*(5*E);var B=A+=(z+=d*(5*w))>>>13;B+=i*w,B+=o*b,B+=s*_,B+=a*m,A=(B+=c*v)>>>13,B&=8191,B+=u*y,B+=l*g,B+=f*p,B+=h*(5*S);var F=A+=(B+=d*(5*E))>>>13;F+=i*E,F+=o*w,F+=s*b,F+=a*_,A=(F+=c*m)>>>13,F&=8191,F+=u*v,F+=l*y,F+=f*g,F+=h*p;var H=A+=(F+=d*(5*S))>>>13;H+=i*S,H+=o*E,H+=s*w,H+=a*b,A=(H+=c*_)>>>13,H&=8191,H+=u*m,H+=l*v,H+=f*y,H+=h*g,i=T=8191&(A=(A=((A+=(H+=d*p)>>>13)<<2)+A|0)+(T&=8191)|0),o=M+=A>>>=13,s=L&=8191,a=U&=8191,c=j&=8191,u=D&=8191,l=z&=8191,f=B&=8191,h=F&=8191,d=H&=8191,t+=16,n-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=u,this._h[6]=l,this._h[7]=f,this._h[8]=h,this._h[9]=d},t.prototype.finish=function(e,t){void 0===t&&(t=0);var n,r,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(n=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=n,n=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*n,n=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=n,n=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=n,s[0]=this._h[0]+5,n=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+n,n=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,r=(1^n)-1,o=0;o<10;o++)s[o]&=r;for(r=~r,o=0;o<10;o++)this._h[o]=this._h[o]&r|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var t,n=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[n+i];if(r-=t,n+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(r>=16&&(t=r-r%16,this._blocks(e,n,t),n+=t,r-=t),r){for(i=0;i<r;i++)this._buffer[this._leftover+i]=e[n+i];this._leftover+=r}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();e.Poly1305=r,e.oneTimeAuth=function(e,t){var n=new r(e);n.update(t);var i=n.digest();return n.clean(),i},e.equal=function(n,r){return n.length===e.DIGEST_LENGTH&&r.length===e.DIGEST_LENGTH&&t.equal(n,r)}}(tr),function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Mn,n=tr,r=Gn,i=Ln,o=nr;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var s=new Uint8Array(16),a=function(){function a(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return a.prototype.seal=function(e,n,i,o){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);t.stream(this._key,s,a,4);var c,u=n.length+this.tagLength;if(o){if(o.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");c=o}else c=new Uint8Array(u);return t.streamXOR(this._key,s,n,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),i),r.wipe(s),c},a.prototype.open=function(e,n,i,s){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(n.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);t.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,n.subarray(0,n.length-this.tagLength),i),!o.equal(u,n.subarray(n.length-this.tagLength,n.length)))return null;var l,f=n.length-this.tagLength;if(s){if(s.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");l=s}else l=new Uint8Array(f);return t.streamXOR(this._key,a,n.subarray(0,n.length-this.tagLength),l,4),r.wipe(a),l},a.prototype.clean=function(){return r.wipe(this._key),this},a.prototype._authenticate=function(e,t,o,a){var c=new n.Poly1305(t);a&&(c.update(a),a.length%16>0&&c.update(s.subarray(a.length%16))),c.update(o),o.length%16>0&&c.update(s.subarray(o.length%16));var u=new Uint8Array(8);a&&i.writeUint64LE(a.length,u),c.update(u),i.writeUint64LE(o.length,u),c.update(u);for(var l=c.digest(),f=0;f<l.length;f++)e[f]=l[f];c.clean(),r.wipe(l),r.wipe(u)},a}();e.ChaCha20Poly1305=a}({});var ir={},or={},sr={};Object.defineProperty(sr,"__esModule",{value:!0}),sr.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState},Object.defineProperty(or,"__esModule",{value:!0});var ar=sr,cr=nr,ur=Gn,lr=function(){function e(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);for(var r=0;r<n.length;r++)n[r]^=54;this._inner.update(n);for(r=0;r<n.length;r++)n[r]^=106;this._outer.update(n),ar.isSerializableHash(this._inner)&&ar.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),ur.wipe(n)}return e.prototype.reset=function(){if(!ar.isSerializableHash(this._inner)||!ar.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},e.prototype.clean=function(){ar.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),ar.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.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)},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!ar.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!ar.isSerializableHash(this._inner)||!ar.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},e.prototype.cleanSavedState=function(e){if(!ar.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();or.HMAC=lr,or.hmac=function(e,t,n){var r=new lr(e,t);r.update(n);var i=r.digest();return r.clean(),i},or.equal=cr.equal,Object.defineProperty(ir,"__esModule",{value:!0});var fr=or,hr=Gn,dr=function(){function e(e,t,n,r){void 0===n&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=r;var i=fr.hmac(this._hash,n,t);this._hmac=new fr.HMAC(e,i),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)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},e.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),hr.wipe(this._buffer),hr.wipe(this._counter),this._bufpos=0},e}();ir.HKDF=dr;var pr={},gr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.BrowserRandomSource=void 0;function vr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}yr.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(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 t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}};var mr={},_r=g(Object.freeze({__proto__:null,default:{}}));Object.defineProperty(mr,"__esModule",{value:!0}),mr.NodeRandomSource=void 0;const br=Gn;mr.NodeRandomSource=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,void 0!==vr){const e=_r;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 t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let e=0;e<n.length;e++)n[e]=t[e];return(0,br.wipe)(t),n}},Object.defineProperty(gr,"__esModule",{value:!0}),gr.SystemRandomSource=void 0;const wr=yr,Er=mr;gr.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new wr.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new Er.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=gr,n=Ln,r=Gn;function i(t,n=e.defaultRandomSource){return n.randomBytes(t)}e.defaultRandomSource=new t.SystemRandomSource,e.randomBytes=i,e.randomUint32=function(t=e.defaultRandomSource){const o=i(4,t),s=(0,n.readUint32LE)(o);return(0,r.wipe)(o),s};const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(t,n=o,s=e.defaultRandomSource){if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");let a="";const c=n.length,u=256-256%c;for(;t>0;){const e=i(Math.ceil(256*t/u),s);for(let r=0;r<e.length&&t>0;r++){const i=e[r];i<u&&(a+=n.charAt(i%c),t--)}(0,r.wipe)(e)}return a}e.randomString=s,e.randomStringForEntropy=function(t,n=o,r=e.defaultRandomSource){return s(Math.ceil(t/(Math.log(n.length)/Math.LN2)),n,r)}}(pr);!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ln,n=Gn;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var r=function(){function r(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 r.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},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=o(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var n=this._bytesHashed,r=this._bufferLength,i=n/536870912|0,s=n<<3,a=n%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/4;c++)t.writeUint32BE(this._state[c],e,4*c);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();e.SHA256=r;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(e,n,r,o,s){for(;s>=64;){for(var a=n[0],c=n[1],u=n[2],l=n[3],f=n[4],h=n[5],d=n[6],p=n[7],g=0;g<16;g++){var y=o+4*g;e[g]=t.readUint32BE(r,y)}for(g=16;g<64;g++){var v=e[g-2],m=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,_=((v=e[g-15])>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;e[g]=(m+e[g-7]|0)+(_+e[g-16]|0)}for(g=0;g<64;g++){m=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&h^~f&d)|0)+(p+(i[g]+e[g]|0)|0)|0,_=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&u^c&u)|0;p=d,d=h,h=f,f=l+m|0,l=u,u=c,c=a,a=m+_|0}n[0]+=a,n[1]+=c,n[2]+=u,n[3]+=l,n[4]+=f,n[5]+=h,n[6]+=d,n[7]+=p,o+=64,s-=64}return o}e.hash=function(e){var t=new r;t.update(e);var n=t.digest();return t.clean(),n}}({});!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=pr,n=Gn;function r(e){const t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;const i=new Uint8Array(32);i[0]=9;const o=r([56129,1]);function s(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function a(e,t,n){const r=~(n-1);for(let n=0;n<16;n++){const i=r&(e[n]^t[n]);e[n]^=i,t[n]^=i}}function c(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function u(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function l(e,t,n){let r,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,g=0,y=0,v=0,m=0,_=0,b=0,w=0,E=0,S=0,O=0,R=0,x=0,I=0,C=0,P=0,k=0,N=0,A=0,T=0,M=0,L=0,U=n[0],j=n[1],D=n[2],z=n[3],B=n[4],F=n[5],H=n[6],$=n[7],V=n[8],q=n[9],W=n[10],K=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];r=t[0],o+=r*U,s+=r*j,a+=r*D,c+=r*z,u+=r*B,l+=r*F,f+=r*H,h+=r*$,d+=r*V,p+=r*q,g+=r*W,y+=r*K,v+=r*G,m+=r*Y,_+=r*Q,b+=r*J,r=t[1],s+=r*U,a+=r*j,c+=r*D,u+=r*z,l+=r*B,f+=r*F,h+=r*H,d+=r*$,p+=r*V,g+=r*q,y+=r*W,v+=r*K,m+=r*G,_+=r*Y,b+=r*Q,w+=r*J,r=t[2],a+=r*U,c+=r*j,u+=r*D,l+=r*z,f+=r*B,h+=r*F,d+=r*H,p+=r*$,g+=r*V,y+=r*q,v+=r*W,m+=r*K,_+=r*G,b+=r*Y,w+=r*Q,E+=r*J,r=t[3],c+=r*U,u+=r*j,l+=r*D,f+=r*z,h+=r*B,d+=r*F,p+=r*H,g+=r*$,y+=r*V,v+=r*q,m+=r*W,_+=r*K,b+=r*G,w+=r*Y,E+=r*Q,S+=r*J,r=t[4],u+=r*U,l+=r*j,f+=r*D,h+=r*z,d+=r*B,p+=r*F,g+=r*H,y+=r*$,v+=r*V,m+=r*q,_+=r*W,b+=r*K,w+=r*G,E+=r*Y,S+=r*Q,O+=r*J,r=t[5],l+=r*U,f+=r*j,h+=r*D,d+=r*z,p+=r*B,g+=r*F,y+=r*H,v+=r*$,m+=r*V,_+=r*q,b+=r*W,w+=r*K,E+=r*G,S+=r*Y,O+=r*Q,R+=r*J,r=t[6],f+=r*U,h+=r*j,d+=r*D,p+=r*z,g+=r*B,y+=r*F,v+=r*H,m+=r*$,_+=r*V,b+=r*q,w+=r*W,E+=r*K,S+=r*G,O+=r*Y,R+=r*Q,x+=r*J,r=t[7],h+=r*U,d+=r*j,p+=r*D,g+=r*z,y+=r*B,v+=r*F,m+=r*H,_+=r*$,b+=r*V,w+=r*q,E+=r*W,S+=r*K,O+=r*G,R+=r*Y,x+=r*Q,I+=r*J,r=t[8],d+=r*U,p+=r*j,g+=r*D,y+=r*z,v+=r*B,m+=r*F,_+=r*H,b+=r*$,w+=r*V,E+=r*q,S+=r*W,O+=r*K,R+=r*G,x+=r*Y,I+=r*Q,C+=r*J,r=t[9],p+=r*U,g+=r*j,y+=r*D,v+=r*z,m+=r*B,_+=r*F,b+=r*H,w+=r*$,E+=r*V,S+=r*q,O+=r*W,R+=r*K,x+=r*G,I+=r*Y,C+=r*Q,P+=r*J,r=t[10],g+=r*U,y+=r*j,v+=r*D,m+=r*z,_+=r*B,b+=r*F,w+=r*H,E+=r*$,S+=r*V,O+=r*q,R+=r*W,x+=r*K,I+=r*G,C+=r*Y,P+=r*Q,k+=r*J,r=t[11],y+=r*U,v+=r*j,m+=r*D,_+=r*z,b+=r*B,w+=r*F,E+=r*H,S+=r*$,O+=r*V,R+=r*q,x+=r*W,I+=r*K,C+=r*G,P+=r*Y,k+=r*Q,N+=r*J,r=t[12],v+=r*U,m+=r*j,_+=r*D,b+=r*z,w+=r*B,E+=r*F,S+=r*H,O+=r*$,R+=r*V,x+=r*q,I+=r*W,C+=r*K,P+=r*G,k+=r*Y,N+=r*Q,A+=r*J,r=t[13],m+=r*U,_+=r*j,b+=r*D,w+=r*z,E+=r*B,S+=r*F,O+=r*H,R+=r*$,x+=r*V,I+=r*q,C+=r*W,P+=r*K,k+=r*G,N+=r*Y,A+=r*Q,T+=r*J,r=t[14],_+=r*U,b+=r*j,w+=r*D,E+=r*z,S+=r*B,O+=r*F,R+=r*H,x+=r*$,I+=r*V,C+=r*q,P+=r*W,k+=r*K,N+=r*G,A+=r*Y,T+=r*Q,M+=r*J,r=t[15],b+=r*U,w+=r*j,E+=r*D,S+=r*z,O+=r*B,R+=r*F,x+=r*H,I+=r*$,C+=r*V,P+=r*q,k+=r*W,N+=r*K,A+=r*G,T+=r*Y,M+=r*Q,L+=r*J,o+=38*w,s+=38*E,a+=38*S,c+=38*O,u+=38*R,l+=38*x,f+=38*I,h+=38*C,d+=38*P,p+=38*k,g+=38*N,y+=38*A,v+=38*T,m+=38*M,_+=38*L,i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=_,e[15]=b}function f(e,t){l(e,t,t)}function h(e,t){const n=new Uint8Array(32),i=new Float64Array(80),h=r(),d=r(),p=r(),g=r(),y=r(),v=r();for(let t=0;t<31;t++)n[t]=e[t];n[31]=127&e[31]|64,n[0]&=248,function(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}(i,t);for(let e=0;e<16;e++)d[e]=i[e];h[0]=g[0]=1;for(let e=254;e>=0;--e){const t=n[e>>>3]>>>(7&e)&1;a(h,d,t),a(p,g,t),c(y,h,p),u(h,h,p),c(p,d,g),u(d,d,g),f(g,y),f(v,h),l(h,p,h),l(p,d,y),c(y,h,p),u(h,h,p),f(d,h),u(p,g,v),l(h,p,o),c(h,h,g),l(p,p,h),l(h,g,v),l(g,d,i),f(d,y),a(h,d,t),a(p,g,t)}for(let e=0;e<16;e++)i[e+16]=h[e],i[e+32]=p[e],i[e+48]=d[e],i[e+64]=g[e];const m=i.subarray(32),_=i.subarray(16);!function(e,t){const n=r();for(let e=0;e<16;e++)n[e]=t[e];for(let e=253;e>=0;e--)f(n,n),2!==e&&4!==e&&l(n,n,t);for(let t=0;t<16;t++)e[t]=n[t]}(m,m),l(_,_,m);const b=new Uint8Array(32);return function(e,t){const n=r(),i=r();for(let e=0;e<16;e++)i[e]=t[e];s(i),s(i),s(i);for(let e=0;e<2;e++){n[0]=i[0]-65517;for(let e=1;e<15;e++)n[e]=i[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=i[15]-32767-(n[14]>>16&1);const e=n[15]>>16&1;n[14]&=65535,a(i,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}(b,_),b}function d(e){return h(e,i)}function p(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const n=new Uint8Array(t);return{publicKey:d(n),secretKey:n}}e.scalarMult=h,e.scalarMultBase=d,e.generateKeyPairFromSeed=p,e.generateKeyPair=function(e){const r=(0,t.randomBytes)(32,e),i=p(r);return(0,n.wipe)(r),i},e.sharedKey=function(t,n,r=!1){if(t.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(n.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const i=h(t,n);if(r){let e=0;for(let t=0;t<i.length;t++)e|=i[t];if(0===e)throw new Error("X25519: invalid shared key")}return i}}({});var Sr=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==n[s])throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*s[h]>>>0,s[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(r+(o-d)),g=r;d!==o;)p[g++]=s[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var f=t[i],h=0,d=s-1;(0!==f||h<r)&&-1!==d;d--,h++)f+=256*u[d]>>>0,u[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=h,i++}for(var p=s-r;p!==s&&0===u[p];)p++;for(var g=c.repeat(n);p<s;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:f,decode:function(e){var n=f(e);if(n)return n;throw new Error(`Non-${t} character`)}}},Or=Sr;const Rr=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class xr{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Ir{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return Pr(this,e)}}class Cr{constructor(e){this.decoders=e}or(e){return Pr(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 Pr=(e,t)=>new Cr({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class kr{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new xr(e,t,n),this.decoder=new Ir(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Nr=({name:e,prefix:t,encode:n,decode:r})=>new kr(e,t,n,r),Ar=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:i}=Or(n,t);return Nr({prefix:e,name:t,encode:r,decode:e=>Rr(i(e))})},Tr=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Nr({prefix:t,name:e,encode:e=>((e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let o="",s=0,a=0;for(let r=0;r<e.length;++r)for(a=a<<8|e[r],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o})(e,r,n),decode:t=>((e,t,n,r)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*n/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${r} character`);c=c<<n|o,a+=n,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,r,n,e)});Nr({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});Tr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});Tr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});Ar({prefix:"9",name:"base10",alphabet:"0123456789"});Tr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Tr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});Tr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Tr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Tr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Tr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Tr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Tr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Tr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Tr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Tr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});Ar({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ar({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});Ar({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ar({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});Tr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Tr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Tr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Tr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});const Mr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Lr=Mr.reduce(((e,t,n)=>(e[n]=t,e)),[]),Ur=Mr.reduce(((e,t,n)=>(e[t.codePointAt(0)]=n,e)),[]);Nr({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+=Lr[t]),"")},decode:function(e){const t=[];for(const n of e){const e=Ur[n.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}});var jr=function e(t,n,r){n=n||[];var i=r=r||0;for(;t>=Br;)n[r++]=255&t|Dr,t/=128;for(;t&zr;)n[r++]=255&t|Dr,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},Dr=128,zr=-128,Br=Math.pow(2,31);var Fr=function e(t,n){var r,i=0,o=0,s=n=n||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");r=t[s++],i+=o<28?(r&$r)<<o:(r&$r)*Math.pow(2,o),o+=7}while(r>=Hr);return e.bytes=s-n,i},Hr=128,$r=127;var Vr=Math.pow(2,7),qr=Math.pow(2,14),Wr=Math.pow(2,21),Kr=Math.pow(2,28),Gr=Math.pow(2,35),Yr=Math.pow(2,42),Qr=Math.pow(2,49),Jr=Math.pow(2,56),Xr=Math.pow(2,63),Zr={encode:jr,decode:Fr,encodingLength:function(e){return e<Vr?1:e<qr?2:e<Wr?3:e<Kr?4:e<Gr?5:e<Yr?6:e<Qr?7:e<Jr?8:e<Xr?9:10}};const ei=(e,t,n=0)=>(Zr.encode(e,t,n),t),ti=e=>Zr.encodingLength(e),ni=(e,t)=>{const n=t.byteLength,r=ti(e),i=r+ti(n),o=new Uint8Array(i+n);return ei(e,o,0),ei(n,o,r),o.set(t,i),new ri(e,n,t,o)};class ri{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const ii=({name:e,code:t,encode:n})=>new oi(e,t,n);class oi{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?ni(this.code,t):t.then((e=>ni(this.code,e)))}throw Error("Unknown type, must be binary type")}}const si=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));ii({name:"sha2-256",code:18,encode:si("SHA-256")}),ii({name:"sha2-512",code:19,encode:si("SHA-512")});new TextEncoder,new TextDecoder;var ai=function(e,t){return ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ai(e,t)};
|
236
|
+
`;const on=n("PlatformNotSupportedModal"),sn=()=>(on("initializing"),_.exports.jsx(_t,{children:_.exports.jsx(_.exports.Fragment,{children:_.exports.jsxs(dt,{children:[_.exports.jsx(pt,{children:"Sorry, we don't support this platform just yet."}),_.exports.jsxs(gt,{children:["We're working hard to expand our coverage.",_.exports.jsx("br",{}),"Until we get there, you can try Ledger Connect on:"]}),_.exports.jsx(nn,{children:_.exports.jsxs(rn,{children:[_.exports.jsx("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='250.076' height='248.707' viewBox='0 0 66.166 65.804'%3e%3cdefs%3e%3clinearGradient id='b'%3e%3cstop style='stop-color:%2306c2e7%3bstop-opacity:1' offset='0'/%3e%3cstop offset='.25' style='stop-color:%230db8ec%3bstop-opacity:1'/%3e%3cstop offset='.5' style='stop-color:%2312aef1%3bstop-opacity:1'/%3e%3cstop style='stop-color:%231f86f9%3bstop-opacity:1' offset='.75'/%3e%3cstop style='stop-color:%23107ddd%3bstop-opacity:1' offset='1'/%3e%3c/linearGradient%3e%3clinearGradient id='a'%3e%3cstop style='stop-color:%23bdbdbd%3bstop-opacity:1' offset='0'/%3e%3cstop style='stop-color:white%3bstop-opacity:1' offset='1'/%3e%3c/linearGradient%3e%3clinearGradient xlink:href='%23a' id='d' x1='412.975' y1='237.608' x2='412.975' y2='59.392' gradientUnits='userSpaceOnUse' gradientTransform='matrix(.35154 0 0 .35154 206.79 159.773)'/%3e%3cfilter style='color-interpolation-filters:sRGB' id='f' x='-.021' width='1.042' y='-.022' height='1.045'%3e%3cfeGaussianBlur stdDeviation='.958'/%3e%3c/filter%3e%3cfilter style='color-interpolation-filters:sRGB' id='c' x='-.048' width='1.096' y='-.048' height='1.096'%3e%3cfeGaussianBlur stdDeviation='3.564'/%3e%3c/filter%3e%3cradialGradient xlink:href='%23b' id='e' cx='413.061' cy='136.818' fx='413.061' fy='136.818' r='82.125' gradientUnits='userSpaceOnUse' gradientTransform='matrix(.38143 0 0 .38143 194.545 155.58)'/%3e%3c/defs%3e%3cpath transform='matrix(.33865 0 0 .3261 -106.77 -14.478)' style='opacity:.52999998%3bfill:black%3bfill-opacity:1%3bstroke:none%3bstroke-width:2.93077397%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill%3bfilter:url(%23c)' d='M502.083 148.5a89.108 89.108 0 0 1-89.108 89.108 89.108 89.108 0 0 1-89.108-89.108 89.108 89.108 0 0 1 89.108-89.108 89.108 89.108 0 0 1 89.108 89.108Z'/%3e%3cpath d='M383.294 211.977a31.325 31.325 0 0 1-31.325 31.325 31.325 31.325 0 0 1-31.326-31.325 31.325 31.325 0 0 1 31.326-31.325 31.325 31.325 0 0 1 31.325 31.325z' style='opacity:1%3bfill:url(%23d)%3bfill-opacity:1%3bstroke:%23cdcdcd%3bstroke-width:.09301235%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' transform='translate(-318.886 -180.595)'/%3e%3cpath d='M380.84 211.977a28.87 28.87 0 0 1-28.871 28.87 28.87 28.87 0 0 1-28.871-28.87 28.87 28.87 0 0 1 28.87-28.87 28.87 28.87 0 0 1 28.871 28.87z' style='opacity:1%3bfill:url(%23e)%3bfill-opacity:1%3bstroke:none%3bstroke-width:.94955933%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' transform='translate(-318.886 -180.595)'/%3e%3cpath d='M351.969 184.612a.42.42 0 0 0-.421.42v4.856a.42.42 0 1 0 .841 0v-4.855a.42.42 0 0 0-.42-.421zm-2.754.174a.42.42 0 0 0-.46.463l.212 2.03a.42.42 0 1 0 .837-.087l-.212-2.03a.42.42 0 0 0-.377-.376zm5.526.002a.42.42 0 0 0-.377.375l-.213 2.03a.42.42 0 1 0 .837.089l.214-2.031a.42.42 0 0 0-.46-.463zm-8.355.408a.42.42 0 0 0-.41.508l1.006 4.75a.42.42 0 1 0 .824-.174l-1.006-4.75a.42.42 0 0 0-.414-.334zm11.184.004a.42.42 0 0 0-.414.333l-1.01 4.75a.42.42 0 1 0 .824.175l1.01-4.75a.42.42 0 0 0-.41-.508zm-13.883.757a.42.42 0 0 0-.437.55l.631 1.942a.42.42 0 1 0 .8-.26l-.63-1.942a.42.42 0 0 0-.364-.29zm16.567.001a.42.42 0 0 0-.364.29l-.631 1.942a.42.42 0 1 0 .8.26l.632-1.942a.42.42 0 0 0-.437-.55zm-19.237.976a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.973-4.437a.42.42 0 0 0-.392-.25zm21.937.015a.42.42 0 0 0-.393.25l-1.978 4.434a.42.42 0 1 0 .77.343l1.977-4.434a.42.42 0 0 0-.376-.593zm-24.415 1.296a.42.42 0 0 0-.394.63l1.021 1.77a.42.42 0 1 0 .73-.421l-1.022-1.769a.42.42 0 0 0-.335-.21zm26.859 0a.419.419 0 0 0-.335.21l-1.021 1.769a.42.42 0 1 0 .729.42l1.021-1.768a.42.42 0 0 0-.394-.63zm-29.265 1.5a.422.422 0 0 0-.326.669l2.85 3.93a.42.42 0 1 0 .682-.494l-2.851-3.93a.42.42 0 0 0-.355-.174zm31.701.022a.42.42 0 0 0-.355.174l-2.856 3.926a.42.42 0 1 0 .68.495l2.857-3.926a.42.42 0 0 0-.326-.669zm-33.852 1.783a.42.42 0 0 0-.335.702l1.367 1.518a.42.42 0 1 0 .626-.563l-1.367-1.518a.42.42 0 0 0-.29-.14zm35.976.003a.421.421 0 0 0-.291.139l-1.366 1.517a.42.42 0 1 0 .625.564l1.367-1.518a.42.42 0 0 0-.335-.702zm-38.037 1.977a.42.42 0 0 0-.26.733l3.609 3.249a.42.42 0 1 0 .563-.626l-3.608-3.248a.42.42 0 0 0-.304-.108zm40.108.014a.419.419 0 0 0-.304.108l-3.61 3.245a.42.42 0 1 0 .563.626l3.61-3.245a.42.42 0 0 0-.259-.734zm-41.822 2.19a.42.42 0 0 0-.262.762l1.652 1.2a.42.42 0 1 0 .495-.681l-1.652-1.2a.42.42 0 0 0-.233-.081zm43.535.015a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .494.681l1.653-1.2a.42.42 0 0 0-.261-.76zm-45.137 2.336a.42.42 0 0 0-.18.785l4.204 2.427a.42.42 0 1 0 .42-.729l-4.204-2.427a.42.42 0 0 0-.24-.056zm46.727 0a.417.417 0 0 0-.24.056l-4.204 2.427a.42.42 0 1 0 .42.73l4.205-2.428a.42.42 0 0 0-.18-.785zm-47.938 2.506a.42.42 0 0 0-.18.805l1.865.833a.42.42 0 1 0 .343-.77l-1.865-.831a.42.42 0 0 0-.163-.037zm49.158.017a.42.42 0 0 0-.164.037l-1.866.83a.42.42 0 1 0 .343.77l1.866-.831a.42.42 0 0 0-.18-.806zm-50.238 2.602a.42.42 0 0 0-.094.82l4.616 1.504a.42.42 0 1 0 .26-.8l-4.615-1.504a.421.421 0 0 0-.167-.02zm51.315.018a.408.408 0 0 0-.166.02l-4.618 1.5a.42.42 0 1 0 .26.801l4.618-1.5a.42.42 0 0 0-.094-.82zm-51.987 2.732a.42.42 0 0 0-.09.833l1.997.424a.42.42 0 1 0 .175-.823l-1.997-.425a.413.413 0 0 0-.085-.009zm52.654.004a.518.518 0 0 0-.084.009l-1.998.424a.42.42 0 1 0 .175.823l1.997-.424a.42.42 0 0 0-.09-.833zm-53.163 2.761a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .088-.837l-4.828-.51a.432.432 0 0 0-.085 0zm53.676.037a.386.386 0 0 0-.086 0l-4.828.504a.42.42 0 1 0 .087.837l4.829-.504a.42.42 0 0 0-.002-.837zm-53.758 2.794a.42.42 0 1 0 0 .842h2.042a.42.42 0 1 0 0-.842zm51.793 0a.42.42 0 1 0 0 .842h2.042a.42.42 0 1 0 0-.842zm-46.803 2.295a.384.384 0 0 0-.086 0l-4.829.504a.42.42 0 1 0 .088.838l4.829-.504a.42.42 0 0 0-.002-.838zm43.853.03a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .089-.837l-4.829-.51a.434.434 0 0 0-.085-.001zm-46.26 2.844a.43.43 0 0 0-.085.009l-1.998.424a.42.42 0 1 0 .175.823l1.998-.424a.42.42 0 0 0-.09-.833zm48.669.004a.42.42 0 0 0-.09.833l1.998.424a.42.42 0 1 0 .175-.824l-1.998-.424a.413.413 0 0 0-.085-.01zm-45.305 1.657a.408.408 0 0 0-.167.02l-4.617 1.5a.42.42 0 1 0 .26.801l4.618-1.5a.42.42 0 0 0-.094-.82zm41.937.015a.42.42 0 0 0-.094.82l4.616 1.504a.42.42 0 1 0 .26-.8l-4.616-1.504a.421.421 0 0 0-.166-.02zm-43.7 3.273a.42.42 0 0 0-.163.036l-1.865.831a.42.42 0 1 0 .342.769l1.866-.83a.42.42 0 0 0-.18-.806zm45.46.016a.42.42 0 0 0-.18.805l1.865.832a.42.42 0 1 0 .343-.768l-1.865-.833a.42.42 0 0 0-.163-.036zm-41.827.912a.417.417 0 0 0-.24.056l-4.204 2.427a.42.42 0 1 0 .42.73l4.205-2.428a.42.42 0 0 0-.18-.785zm38.2 0a.42.42 0 0 0-.181.785l4.205 2.427a.42.42 0 1 0 .421-.729l-4.204-2.427a.42.42 0 0 0-.24-.056zm-39.248 3.562a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .494.682l1.653-1.2a.42.42 0 0 0-.261-.762zm40.287.015a.42.42 0 0 0-.262.762l1.653 1.2a.42.42 0 1 0 .495-.681l-1.653-1.2a.42.42 0 0 0-.233-.081zm-36.544.145a.418.418 0 0 0-.303.108l-3.611 3.245a.42.42 0 1 0 .563.626l3.61-3.245a.42.42 0 0 0-.259-.734zm32.8.011a.421.421 0 0 0-.259.734l3.608 3.248a.42.42 0 1 0 .564-.625l-3.609-3.249a.42.42 0 0 0-.303-.107zm-29.374 3.084a.42.42 0 0 0-.355.173l-2.857 3.927a.42.42 0 1 0 .681.495l2.856-3.926a.42.42 0 0 0-.325-.669zm25.936.018a.421.421 0 0 0-.327.668l2.851 3.93a.42.42 0 1 0 .682-.494l-2.851-3.93a.42.42 0 0 0-.355-.174zm-29.623.606a.421.421 0 0 0-.291.14l-1.366 1.517a.42.42 0 1 0 .625.563l1.367-1.517a.42.42 0 0 0-.335-.703zm33.33.002a.42.42 0 0 0-.335.702l1.367 1.518a.42.42 0 1 0 .626-.563l-1.367-1.518a.42.42 0 0 0-.29-.139zm-25.655 1.684a.419.419 0 0 0-.392.25l-1.978 4.433a.42.42 0 1 0 .769.343l1.978-4.434a.42.42 0 0 0-.377-.592zm17.956.012a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.973-4.437a.42.42 0 0 0-.392-.25zm-21.432 1.359a.419.419 0 0 0-.335.21l-1.02 1.768a.42.42 0 1 0 .728.421l1.021-1.769a.42.42 0 0 0-.394-.63zm24.935 0a.42.42 0 0 0-.394.63l1.02 1.77a.42.42 0 1 0 .73-.422l-1.021-1.769a.42.42 0 0 0-.335-.21zm-17.055.063a.42.42 0 0 0-.414.334l-1.009 4.749a.42.42 0 1 0 .823.175l1.01-4.75a.42.42 0 0 0-.41-.508zm9.16.003a.42.42 0 0 0-.41.508l1.006 4.75a.42.42 0 1 0 .824-.175l-1.006-4.75a.42.42 0 0 0-.414-.333zm-4.572.48a.42.42 0 0 0-.421.42v4.855a.42.42 0 1 0 .841 0v-4.855a.42.42 0 0 0-.42-.42zm-7.727 1.568a.42.42 0 0 0-.364.29l-.632 1.942a.42.42 0 1 0 .801.26l.631-1.942a.42.42 0 0 0-.436-.55zm15.45 0a.42.42 0 0 0-.437.55l.631 1.943a.42.42 0 1 0 .801-.26l-.631-1.942a.42.42 0 0 0-.364-.29zm-10.366 1.083a.42.42 0 0 0-.377.375l-.213 2.03a.42.42 0 1 0 .837.088l.213-2.03a.42.42 0 0 0-.46-.463zm5.268.002a.42.42 0 0 0-.46.463l.211 2.03a.42.42 0 1 0 .837-.088l-.211-2.03a.42.42 0 0 0-.377-.375z' style='opacity:1%3bfill:%23f4f2f3%3bfill-opacity:1%3bstroke:none%3bstroke-width:.38088897%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' transform='translate(-318.886 -180.595)'/%3e%3cpath transform='matrix(.35154 0 0 .35154 -112.095 -20.822)' d='m469.096 100.607-65.51 38.061-41.42 65.207 60.595-44.882z' style='opacity:.40900005%3bfill:black%3bfill-opacity:1%3bstroke:none%3bstroke-width:1.5614785%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill%3bfilter:url(%23f)'/%3e%3cpath style='opacity:1%3bfill:%23ff5150%3bfill-opacity:1%3bstroke:none%3bstroke-width:1.01970422%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill' d='m129.839 160.803-23.014-23.015 31.437-8.423z' transform='matrix(.64804 -.3317 -.36122 .63206 10.328 -23.732)'/%3e%3cpath transform='matrix(-.36122 .63206 .64804 -.3317 -20.923 6.11)' d='m129.839 160.803-23.014-23.015 31.437-8.423z' style='opacity:1%3bfill:%23f1f1f1%3bfill-opacity:1%3bstroke:none%3bstroke-width:1.01970422%3bstroke-linecap:round%3bstroke-linejoin:round%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-dashoffset:0%3bstroke-opacity:1%3bpaint-order:markers stroke fill'/%3e%3cpath style='opacity:.243%3bfill:black%3bstroke:none%3bstroke-width:.09301235px%3bstroke-linecap:butt%3bstroke-linejoin:miter%3bstroke-opacity:1' d='m331.853 231.185 23.416-15.752 16.815-22.665z' transform='translate(-318.886 -180.595)'/%3e%3c/svg%3e"}),"Safari on iOS"]})})]})})}));var an={exports:{}};!function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,c=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===a)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(n=null)&&s(t.prototype,n),r&&s(t,r),e}();t.default=a,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),o=c(n(94)),s=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(n[t]=s,r+=1)})),r>0){var s=Object.keys(n),c=a.default.find(s,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var f=this.satisfies(n[l]);if(void 0!==f)return f}}if(o>0){var h=Object.keys(i),d=a.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})}(an);var cn=p(an.exports);function un(){const e=cn.getParser(window.navigator.userAgent),t=e.getOS(),n=e.getBrowser(),{type:r}=e.getPlatform();var i,o;return"isBrave"===(null===(o=null===(i=window.navigator.brave)||void 0===i?void 0:i.isBrave)||void 0===o?void 0:o.name)&&(n.name="Brave"),{type:r,os:t,browser:n}}let ln=null;function fn(e,t){if(!ln){const e=document.body,t=document.createElement("div");t.className="ledger-ck-modal",e.appendChild(t),ln=St(t)}if(ln&&e){let n;switch(e){case"UseLedgerLiveModal":n=_.exports.jsx(tn,Object.assign({},t));break;case"PlatformNotSupportedModal":n=_.exports.jsx(sn,{});break;case"ExtensionInstallModal":n=_.exports.jsx(Tt,Object.assign({},t))}ln.render(n)}mt(!0)}function hn(e){const t=un(),n=(Ro("getSupportResult"),xo);yo(),!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))&&n.isLedgerConnectSupported&&n.isChainIdSupported?fn("ExtensionInstallModal",{onClose:e.onClose}):fn("UseLedgerLiveModal",{isDesktop:"desktop"===t.type,uri:e.uri,onClose:e.onClose})}const dn=n("WalletConnectLegacy"),pn=r("WalletConnectLegacy");function gn(){return c(this,void 0,void 0,(function*(){dn("getWalletConnectLegacyProvider");try{const e=yield function(){return c(this,void 0,void 0,(function*(){dn("initWalletConnectLegacyProvider");const e=yo();return dn("walletConnectProviderOptions is",e),dn("created a new legacy provider instance"),new m({chainId:e.chainId,bridge:e.bridge,infuraId:e.infuraId,rpc:e.rpc,qrcode:!1})}))}();return function(e){function t(e){dn("connectHandler",e),mt(!1)}function n(t,r){dn("disconnectHandler",t,r),"undefined"!=typeof localStorage&&localStorage.removeItem("walletconnect"),e.removeListener("disconnect",n)}dn("assignWalletConnectLegacyProviderEvents"),e.on("connect",t),e.on("disconnect",n)}(e),e.request=function(e){dn("patchWalletConnectLegacyProviderRequest");const t=e.request.bind(e),n=yo();return function({method:r,params:i}){return c(this,void 0,void 0,(function*(){return"eth_requestAccounts"===r?(dn("calling patched",r,i),new Promise(((o,a)=>c(this,void 0,void 0,(function*(){try{if(!e.connected)return yield e.connector.createSession({chainId:n.chainId}),dn("created a new session"),hn({uri:e.connector.uri,onClose:()=>{pn("user rejected"),a(new s)}}),o(yield t({method:r,params:i}));dn("reusing existing session"),o(yield t({method:r,params:i}))}catch(e){return pn("error",e),a(e)}}))))):(dn("calling provider",r,i),yield t({method:r,params:i}))}))}}(e),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw pn("error",t),t}}))}var yn,vn={exports:{}},mn="object"==typeof Reflect?Reflect:null,_n=mn&&"function"==typeof mn.apply?mn.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};yn=mn&&"function"==typeof mn.ownKeys?mn.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var bn=Number.isNaN||function(e){return e!=e};function wn(){wn.init.call(this)}vn.exports=wn,vn.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}Nn(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&Nn(e,"error",t,n)}(e,i,{once:!0})}))},wn.EventEmitter=wn,wn.prototype._events=void 0,wn.prototype._eventsCount=0,wn.prototype._maxListeners=void 0;var En=10;function Sn(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function On(e){return void 0===e._maxListeners?wn.defaultMaxListeners:e._maxListeners}function Rn(e,t,n,r){var i,o,s,a;if(Sn(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=On(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function xn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function In(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=xn.bind(r);return i.listener=n,r.wrapFn=i,i}function Cn(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):kn(i,i.length)}function Pn(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function kn(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Nn(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(wn,"defaultMaxListeners",{enumerable:!0,get:function(){return En},set:function(e){if("number"!=typeof e||e<0||bn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");En=e}}),wn.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},wn.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||bn(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},wn.prototype.getMaxListeners=function(){return On(this)},wn.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)_n(a,this,t);else{var c=a.length,u=kn(a,c);for(n=0;n<c;++n)_n(u[n],this,t)}return!0},wn.prototype.addListener=function(e,t){return Rn(this,e,t,!1)},wn.prototype.on=wn.prototype.addListener,wn.prototype.prependListener=function(e,t){return Rn(this,e,t,!0)},wn.prototype.once=function(e,t){return Sn(t),this.on(e,In(this,e,t)),this},wn.prototype.prependOnceListener=function(e,t){return Sn(t),this.prependListener(e,In(this,e,t)),this},wn.prototype.removeListener=function(e,t){var n,r,i,o,s;if(Sn(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},wn.prototype.off=wn.prototype.removeListener,wn.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},wn.prototype.listeners=function(e){return Cn(this,e,!0)},wn.prototype.rawListeners=function(e){return Cn(this,e,!1)},wn.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Pn.call(e,t)},wn.prototype.listenerCount=Pn,wn.prototype.eventNames=function(){return this._eventsCount>0?yn(this._events):[]};var An={},Tn={},Mn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},e.add=function(e,t){return e+t|0},e.sub=function(e,t){return e-t|0},e.rotl=function(e,t){return e<<t|e>>>32-t},e.rotr=function(e,t){return e<<32-t|e>>>t},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}}(Mn),Object.defineProperty(Tn,"__esModule",{value:!0});var Ln=Mn;function Un(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function jn(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function Dn(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function zn(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Bn(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Fn(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function Hn(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function $n(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function Vn(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),Hn(e/4294967296>>>0,t,n),Hn(e>>>0,t,n+4),t}function qn(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),$n(e>>>0,t,n),$n(e/4294967296>>>0,t,n+4),t}Tn.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},Tn.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},Tn.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},Tn.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},Tn.writeUint16BE=Un,Tn.writeInt16BE=Un,Tn.writeUint16LE=jn,Tn.writeInt16LE=jn,Tn.readInt32BE=Dn,Tn.readUint32BE=zn,Tn.readInt32LE=Bn,Tn.readUint32LE=Fn,Tn.writeUint32BE=Hn,Tn.writeInt32BE=Hn,Tn.writeUint32LE=$n,Tn.writeInt32LE=$n,Tn.readInt64BE=function(e,t){void 0===t&&(t=0);var n=Dn(e,t),r=Dn(e,t+4);return 4294967296*n+r-4294967296*(r>>31)},Tn.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*zn(e,t)+zn(e,t+4)},Tn.readInt64LE=function(e,t){void 0===t&&(t=0);var n=Bn(e,t);return 4294967296*Bn(e,t+4)+n-4294967296*(n>>31)},Tn.readUint64LE=function(e,t){void 0===t&&(t=0);var n=Fn(e,t);return 4294967296*Fn(e,t+4)+n},Tn.writeUint64BE=Vn,Tn.writeInt64BE=Vn,Tn.writeUint64LE=qn,Tn.writeInt64LE=qn,Tn.readUintBE=function(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,o=e/8+n-1;o>=n;o--)r+=t[o]*i,i*=256;return r},Tn.readUintLE=function(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,o=n;o<n+e/8;o++)r+=t[o]*i,i*=256;return r},Tn.writeUintBE=function(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Ln.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var i=1,o=e/8+r-1;o>=r;o--)n[o]=t/i&255,i*=256;return n},Tn.writeUintLE=function(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Ln.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var i=1,o=r;o<r+e/8;o++)n[o]=t/i&255,i*=256;return n},Tn.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},Tn.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},Tn.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},Tn.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},Tn.writeFloat32BE=function(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e),t},Tn.writeFloat32LE=function(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),t},Tn.writeFloat64BE=function(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e),t},Tn.writeFloat64LE=function(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),t};var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e},Object.defineProperty(An,"__esModule",{value:!0});var Kn=Tn,Gn=Wn,Yn=20;function Qn(e,t,n){for(var r=1634760805,i=857760878,o=2036477234,s=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],u=n[11]<<24|n[10]<<16|n[9]<<8|n[8],l=n[15]<<24|n[14]<<16|n[13]<<8|n[12],f=n[19]<<24|n[18]<<16|n[17]<<8|n[16],h=n[23]<<24|n[22]<<16|n[21]<<8|n[20],d=n[27]<<24|n[26]<<16|n[25]<<8|n[24],p=n[31]<<24|n[30]<<16|n[29]<<8|n[28],g=t[3]<<24|t[2]<<16|t[1]<<8|t[0],y=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=r,b=i,w=o,E=s,S=a,O=c,R=u,x=l,I=f,C=h,P=d,k=p,N=g,A=y,T=v,M=m,L=0;L<Yn;L+=2)S=(S^=I=I+(N=(N^=_=_+S|0)>>>16|N<<16)|0)>>>20|S<<12,O=(O^=C=C+(A=(A^=b=b+O|0)>>>16|A<<16)|0)>>>20|O<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>16|T<<16)|0)>>>20|R<<12,x=(x^=k=k+(M=(M^=E=E+x|0)>>>16|M<<16)|0)>>>20|x<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>24|T<<8)|0)>>>25|R<<7,x=(x^=k=k+(M=(M^=E=E+x|0)>>>24|M<<8)|0)>>>25|x<<7,O=(O^=C=C+(A=(A^=b=b+O|0)>>>24|A<<8)|0)>>>25|O<<7,S=(S^=I=I+(N=(N^=_=_+S|0)>>>24|N<<8)|0)>>>25|S<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>16|M<<16)|0)>>>20|O<<12,R=(R^=k=k+(N=(N^=b=b+R|0)>>>16|N<<16)|0)>>>20|R<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>16|A<<16)|0)>>>20|x<<12,S=(S^=C=C+(T=(T^=E=E+S|0)>>>16|T<<16)|0)>>>20|S<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>24|A<<8)|0)>>>25|x<<7,S=(S^=C=C+(T=(T^=E=E+S|0)>>>24|T<<8)|0)>>>25|S<<7,R=(R^=k=k+(N=(N^=b=b+R|0)>>>24|N<<8)|0)>>>25|R<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>24|M<<8)|0)>>>25|O<<7;Kn.writeUint32LE(_+r|0,e,0),Kn.writeUint32LE(b+i|0,e,4),Kn.writeUint32LE(w+o|0,e,8),Kn.writeUint32LE(E+s|0,e,12),Kn.writeUint32LE(S+a|0,e,16),Kn.writeUint32LE(O+c|0,e,20),Kn.writeUint32LE(R+u|0,e,24),Kn.writeUint32LE(x+l|0,e,28),Kn.writeUint32LE(I+f|0,e,32),Kn.writeUint32LE(C+h|0,e,36),Kn.writeUint32LE(P+d|0,e,40),Kn.writeUint32LE(k+p|0,e,44),Kn.writeUint32LE(N+g|0,e,48),Kn.writeUint32LE(A+y|0,e,52),Kn.writeUint32LE(T+v|0,e,56),Kn.writeUint32LE(M+m|0,e,60)}function Jn(e,t,n,r,i){if(void 0===i&&(i=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(r.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(0===i){if(8!==t.length&&12!==t.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=(o=new Uint8Array(16)).length-t.length,o.set(t,s)}else{if(16!==t.length)throw new Error("ChaCha nonce with counter must be 16 bytes");o=t,s=i}for(var a=new Uint8Array(64),c=0;c<n.length;c+=64){Qn(a,o,e);for(var u=c;u<c+64&&u<n.length;u++)r[u]=n[u]^a[u-c];Xn(o,0,s)}return Gn.wipe(a),0===i&&Gn.wipe(o),r}function Xn(e,t,n){for(var r=1;n--;)r=r+(255&e[t])|0,e[t]=255&r,r>>>=8,t++;if(r>0)throw new Error("ChaCha: counter overflow")}An.streamXOR=Jn,An.stream=function(e,t,n,r){return void 0===r&&(r=0),Gn.wipe(n),Jn(e,t,n,n,r)};var Zn={},er={};function tr(e,t){if(e.length!==t.length)return 0;for(var n=0,r=0;r<e.length;r++)n|=e[r]^t[r];return 1&n-1>>>8}Object.defineProperty(er,"__esModule",{value:!0}),er.select=function(e,t,n){return~(e-1)&t|e-1&n},er.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},er.compare=tr,er.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==tr(e,t)},function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=er,n=Wn;e.DIGEST_LENGTH=16;var r=function(){function t(t){this.digestLength=e.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 n=t[0]|t[1]<<8;this._r[0]=8191&n;var r=t[2]|t[3]<<8;this._r[1]=8191&(n>>>13|r<<3);var i=t[4]|t[5]<<8;this._r[2]=7939&(r>>>10|i<<6);var o=t[6]|t[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=t[8]|t[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var u=t[14]|t[15]<<8;this._r[8]=8191&(c>>>8|u<<8),this._r[9]=u>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(e,t,n){for(var r=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],u=this._h[5],l=this._h[6],f=this._h[7],h=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],y=this._r[2],v=this._r[3],m=this._r[4],_=this._r[5],b=this._r[6],w=this._r[7],E=this._r[8],S=this._r[9];n>=16;){var O=e[t+0]|e[t+1]<<8;i+=8191&O;var R=e[t+2]|e[t+3]<<8;o+=8191&(O>>>13|R<<3);var x=e[t+4]|e[t+5]<<8;s+=8191&(R>>>10|x<<6);var I=e[t+6]|e[t+7]<<8;a+=8191&(x>>>7|I<<9);var C=e[t+8]|e[t+9]<<8;c+=8191&(I>>>4|C<<12),u+=C>>>1&8191;var P=e[t+10]|e[t+11]<<8;l+=8191&(C>>>14|P<<2);var k=e[t+12]|e[t+13]<<8;f+=8191&(P>>>11|k<<5);var N=e[t+14]|e[t+15]<<8,A=0,T=A;T+=i*p,T+=o*(5*S),T+=s*(5*E),T+=a*(5*w),A=(T+=c*(5*b))>>>13,T&=8191,T+=u*(5*_),T+=l*(5*m),T+=f*(5*v),T+=(h+=8191&(k>>>8|N<<8))*(5*y);var M=A+=(T+=(d+=N>>>5|r)*(5*g))>>>13;M+=i*g,M+=o*p,M+=s*(5*S),M+=a*(5*E),A=(M+=c*(5*w))>>>13,M&=8191,M+=u*(5*b),M+=l*(5*_),M+=f*(5*m),M+=h*(5*v),A+=(M+=d*(5*y))>>>13,M&=8191;var L=A;L+=i*y,L+=o*g,L+=s*p,L+=a*(5*S),A=(L+=c*(5*E))>>>13,L&=8191,L+=u*(5*w),L+=l*(5*b),L+=f*(5*_),L+=h*(5*m);var U=A+=(L+=d*(5*v))>>>13;U+=i*v,U+=o*y,U+=s*g,U+=a*p,A=(U+=c*(5*S))>>>13,U&=8191,U+=u*(5*E),U+=l*(5*w),U+=f*(5*b),U+=h*(5*_);var j=A+=(U+=d*(5*m))>>>13;j+=i*m,j+=o*v,j+=s*y,j+=a*g,A=(j+=c*p)>>>13,j&=8191,j+=u*(5*S),j+=l*(5*E),j+=f*(5*w),j+=h*(5*b);var D=A+=(j+=d*(5*_))>>>13;D+=i*_,D+=o*m,D+=s*v,D+=a*y,A=(D+=c*g)>>>13,D&=8191,D+=u*p,D+=l*(5*S),D+=f*(5*E),D+=h*(5*w);var z=A+=(D+=d*(5*b))>>>13;z+=i*b,z+=o*_,z+=s*m,z+=a*v,A=(z+=c*y)>>>13,z&=8191,z+=u*g,z+=l*p,z+=f*(5*S),z+=h*(5*E);var B=A+=(z+=d*(5*w))>>>13;B+=i*w,B+=o*b,B+=s*_,B+=a*m,A=(B+=c*v)>>>13,B&=8191,B+=u*y,B+=l*g,B+=f*p,B+=h*(5*S);var F=A+=(B+=d*(5*E))>>>13;F+=i*E,F+=o*w,F+=s*b,F+=a*_,A=(F+=c*m)>>>13,F&=8191,F+=u*v,F+=l*y,F+=f*g,F+=h*p;var H=A+=(F+=d*(5*S))>>>13;H+=i*S,H+=o*E,H+=s*w,H+=a*b,A=(H+=c*_)>>>13,H&=8191,H+=u*m,H+=l*v,H+=f*y,H+=h*g,i=T=8191&(A=(A=((A+=(H+=d*p)>>>13)<<2)+A|0)+(T&=8191)|0),o=M+=A>>>=13,s=L&=8191,a=U&=8191,c=j&=8191,u=D&=8191,l=z&=8191,f=B&=8191,h=F&=8191,d=H&=8191,t+=16,n-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=u,this._h[6]=l,this._h[7]=f,this._h[8]=h,this._h[9]=d},t.prototype.finish=function(e,t){void 0===t&&(t=0);var n,r,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(n=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=n,n=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*n,n=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=n,n=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=n,s[0]=this._h[0]+5,n=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+n,n=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,r=(1^n)-1,o=0;o<10;o++)s[o]&=r;for(r=~r,o=0;o<10;o++)this._h[o]=this._h[o]&r|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var t,n=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[n+i];if(r-=t,n+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(r>=16&&(t=r-r%16,this._blocks(e,n,t),n+=t,r-=t),r){for(i=0;i<r;i++)this._buffer[this._leftover+i]=e[n+i];this._leftover+=r}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();e.Poly1305=r,e.oneTimeAuth=function(e,t){var n=new r(e);n.update(t);var i=n.digest();return n.clean(),i},e.equal=function(n,r){return n.length===e.DIGEST_LENGTH&&r.length===e.DIGEST_LENGTH&&t.equal(n,r)}}(Zn),function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=An,n=Zn,r=Wn,i=Tn,o=er;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var s=new Uint8Array(16),a=function(){function a(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return a.prototype.seal=function(e,n,i,o){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);t.stream(this._key,s,a,4);var c,u=n.length+this.tagLength;if(o){if(o.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");c=o}else c=new Uint8Array(u);return t.streamXOR(this._key,s,n,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),i),r.wipe(s),c},a.prototype.open=function(e,n,i,s){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(n.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);t.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,n.subarray(0,n.length-this.tagLength),i),!o.equal(u,n.subarray(n.length-this.tagLength,n.length)))return null;var l,f=n.length-this.tagLength;if(s){if(s.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");l=s}else l=new Uint8Array(f);return t.streamXOR(this._key,a,n.subarray(0,n.length-this.tagLength),l,4),r.wipe(a),l},a.prototype.clean=function(){return r.wipe(this._key),this},a.prototype._authenticate=function(e,t,o,a){var c=new n.Poly1305(t);a&&(c.update(a),a.length%16>0&&c.update(s.subarray(a.length%16))),c.update(o),o.length%16>0&&c.update(s.subarray(o.length%16));var u=new Uint8Array(8);a&&i.writeUint64LE(a.length,u),c.update(u),i.writeUint64LE(o.length,u),c.update(u);for(var l=c.digest(),f=0;f<l.length;f++)e[f]=l[f];c.clean(),r.wipe(l),r.wipe(u)},a}();e.ChaCha20Poly1305=a}({});var nr={},rr={},ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState},Object.defineProperty(rr,"__esModule",{value:!0});var or=ir,sr=er,ar=Wn,cr=function(){function e(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);for(var r=0;r<n.length;r++)n[r]^=54;this._inner.update(n);for(r=0;r<n.length;r++)n[r]^=106;this._outer.update(n),or.isSerializableHash(this._inner)&&or.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),ar.wipe(n)}return e.prototype.reset=function(){if(!or.isSerializableHash(this._inner)||!or.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},e.prototype.clean=function(){or.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),or.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.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)},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!or.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!or.isSerializableHash(this._inner)||!or.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},e.prototype.cleanSavedState=function(e){if(!or.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();rr.HMAC=cr,rr.hmac=function(e,t,n){var r=new cr(e,t);r.update(n);var i=r.digest();return r.clean(),i},rr.equal=sr.equal,Object.defineProperty(nr,"__esModule",{value:!0});var ur=rr,lr=Wn,fr=function(){function e(e,t,n,r){void 0===n&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=r;var i=ur.hmac(this._hash,n,t);this._hmac=new ur.HMAC(e,i),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)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},e.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),lr.wipe(this._buffer),lr.wipe(this._counter),this._bufpos=0},e}();nr.HKDF=fr;var hr={},dr={},pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.BrowserRandomSource=void 0;function gr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}pr.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(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 t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}};var yr={},vr=g(Object.freeze({__proto__:null,default:{}}));Object.defineProperty(yr,"__esModule",{value:!0}),yr.NodeRandomSource=void 0;const mr=Wn;yr.NodeRandomSource=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,void 0!==gr){const e=vr;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 t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let e=0;e<n.length;e++)n[e]=t[e];return(0,mr.wipe)(t),n}},Object.defineProperty(dr,"__esModule",{value:!0}),dr.SystemRandomSource=void 0;const _r=pr,br=yr;dr.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new _r.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new br.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=dr,n=Tn,r=Wn;function i(t,n=e.defaultRandomSource){return n.randomBytes(t)}e.defaultRandomSource=new t.SystemRandomSource,e.randomBytes=i,e.randomUint32=function(t=e.defaultRandomSource){const o=i(4,t),s=(0,n.readUint32LE)(o);return(0,r.wipe)(o),s};const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(t,n=o,s=e.defaultRandomSource){if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");let a="";const c=n.length,u=256-256%c;for(;t>0;){const e=i(Math.ceil(256*t/u),s);for(let r=0;r<e.length&&t>0;r++){const i=e[r];i<u&&(a+=n.charAt(i%c),t--)}(0,r.wipe)(e)}return a}e.randomString=s,e.randomStringForEntropy=function(t,n=o,r=e.defaultRandomSource){return s(Math.ceil(t/(Math.log(n.length)/Math.LN2)),n,r)}}(hr);!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Tn,n=Wn;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var r=function(){function r(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 r.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},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=o(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var n=this._bytesHashed,r=this._bufferLength,i=n/536870912|0,s=n<<3,a=n%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/4;c++)t.writeUint32BE(this._state[c],e,4*c);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();e.SHA256=r;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(e,n,r,o,s){for(;s>=64;){for(var a=n[0],c=n[1],u=n[2],l=n[3],f=n[4],h=n[5],d=n[6],p=n[7],g=0;g<16;g++){var y=o+4*g;e[g]=t.readUint32BE(r,y)}for(g=16;g<64;g++){var v=e[g-2],m=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,_=((v=e[g-15])>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;e[g]=(m+e[g-7]|0)+(_+e[g-16]|0)}for(g=0;g<64;g++){m=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&h^~f&d)|0)+(p+(i[g]+e[g]|0)|0)|0,_=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&u^c&u)|0;p=d,d=h,h=f,f=l+m|0,l=u,u=c,c=a,a=m+_|0}n[0]+=a,n[1]+=c,n[2]+=u,n[3]+=l,n[4]+=f,n[5]+=h,n[6]+=d,n[7]+=p,o+=64,s-=64}return o}e.hash=function(e){var t=new r;t.update(e);var n=t.digest();return t.clean(),n}}({});!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=hr,n=Wn;function r(e){const t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;const i=new Uint8Array(32);i[0]=9;const o=r([56129,1]);function s(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function a(e,t,n){const r=~(n-1);for(let n=0;n<16;n++){const i=r&(e[n]^t[n]);e[n]^=i,t[n]^=i}}function c(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function u(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function l(e,t,n){let r,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,g=0,y=0,v=0,m=0,_=0,b=0,w=0,E=0,S=0,O=0,R=0,x=0,I=0,C=0,P=0,k=0,N=0,A=0,T=0,M=0,L=0,U=n[0],j=n[1],D=n[2],z=n[3],B=n[4],F=n[5],H=n[6],$=n[7],V=n[8],q=n[9],W=n[10],K=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];r=t[0],o+=r*U,s+=r*j,a+=r*D,c+=r*z,u+=r*B,l+=r*F,f+=r*H,h+=r*$,d+=r*V,p+=r*q,g+=r*W,y+=r*K,v+=r*G,m+=r*Y,_+=r*Q,b+=r*J,r=t[1],s+=r*U,a+=r*j,c+=r*D,u+=r*z,l+=r*B,f+=r*F,h+=r*H,d+=r*$,p+=r*V,g+=r*q,y+=r*W,v+=r*K,m+=r*G,_+=r*Y,b+=r*Q,w+=r*J,r=t[2],a+=r*U,c+=r*j,u+=r*D,l+=r*z,f+=r*B,h+=r*F,d+=r*H,p+=r*$,g+=r*V,y+=r*q,v+=r*W,m+=r*K,_+=r*G,b+=r*Y,w+=r*Q,E+=r*J,r=t[3],c+=r*U,u+=r*j,l+=r*D,f+=r*z,h+=r*B,d+=r*F,p+=r*H,g+=r*$,y+=r*V,v+=r*q,m+=r*W,_+=r*K,b+=r*G,w+=r*Y,E+=r*Q,S+=r*J,r=t[4],u+=r*U,l+=r*j,f+=r*D,h+=r*z,d+=r*B,p+=r*F,g+=r*H,y+=r*$,v+=r*V,m+=r*q,_+=r*W,b+=r*K,w+=r*G,E+=r*Y,S+=r*Q,O+=r*J,r=t[5],l+=r*U,f+=r*j,h+=r*D,d+=r*z,p+=r*B,g+=r*F,y+=r*H,v+=r*$,m+=r*V,_+=r*q,b+=r*W,w+=r*K,E+=r*G,S+=r*Y,O+=r*Q,R+=r*J,r=t[6],f+=r*U,h+=r*j,d+=r*D,p+=r*z,g+=r*B,y+=r*F,v+=r*H,m+=r*$,_+=r*V,b+=r*q,w+=r*W,E+=r*K,S+=r*G,O+=r*Y,R+=r*Q,x+=r*J,r=t[7],h+=r*U,d+=r*j,p+=r*D,g+=r*z,y+=r*B,v+=r*F,m+=r*H,_+=r*$,b+=r*V,w+=r*q,E+=r*W,S+=r*K,O+=r*G,R+=r*Y,x+=r*Q,I+=r*J,r=t[8],d+=r*U,p+=r*j,g+=r*D,y+=r*z,v+=r*B,m+=r*F,_+=r*H,b+=r*$,w+=r*V,E+=r*q,S+=r*W,O+=r*K,R+=r*G,x+=r*Y,I+=r*Q,C+=r*J,r=t[9],p+=r*U,g+=r*j,y+=r*D,v+=r*z,m+=r*B,_+=r*F,b+=r*H,w+=r*$,E+=r*V,S+=r*q,O+=r*W,R+=r*K,x+=r*G,I+=r*Y,C+=r*Q,P+=r*J,r=t[10],g+=r*U,y+=r*j,v+=r*D,m+=r*z,_+=r*B,b+=r*F,w+=r*H,E+=r*$,S+=r*V,O+=r*q,R+=r*W,x+=r*K,I+=r*G,C+=r*Y,P+=r*Q,k+=r*J,r=t[11],y+=r*U,v+=r*j,m+=r*D,_+=r*z,b+=r*B,w+=r*F,E+=r*H,S+=r*$,O+=r*V,R+=r*q,x+=r*W,I+=r*K,C+=r*G,P+=r*Y,k+=r*Q,N+=r*J,r=t[12],v+=r*U,m+=r*j,_+=r*D,b+=r*z,w+=r*B,E+=r*F,S+=r*H,O+=r*$,R+=r*V,x+=r*q,I+=r*W,C+=r*K,P+=r*G,k+=r*Y,N+=r*Q,A+=r*J,r=t[13],m+=r*U,_+=r*j,b+=r*D,w+=r*z,E+=r*B,S+=r*F,O+=r*H,R+=r*$,x+=r*V,I+=r*q,C+=r*W,P+=r*K,k+=r*G,N+=r*Y,A+=r*Q,T+=r*J,r=t[14],_+=r*U,b+=r*j,w+=r*D,E+=r*z,S+=r*B,O+=r*F,R+=r*H,x+=r*$,I+=r*V,C+=r*q,P+=r*W,k+=r*K,N+=r*G,A+=r*Y,T+=r*Q,M+=r*J,r=t[15],b+=r*U,w+=r*j,E+=r*D,S+=r*z,O+=r*B,R+=r*F,x+=r*H,I+=r*$,C+=r*V,P+=r*q,k+=r*W,N+=r*K,A+=r*G,T+=r*Y,M+=r*Q,L+=r*J,o+=38*w,s+=38*E,a+=38*S,c+=38*O,u+=38*R,l+=38*x,f+=38*I,h+=38*C,d+=38*P,p+=38*k,g+=38*N,y+=38*A,v+=38*T,m+=38*M,_+=38*L,i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=_,e[15]=b}function f(e,t){l(e,t,t)}function h(e,t){const n=new Uint8Array(32),i=new Float64Array(80),h=r(),d=r(),p=r(),g=r(),y=r(),v=r();for(let t=0;t<31;t++)n[t]=e[t];n[31]=127&e[31]|64,n[0]&=248,function(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}(i,t);for(let e=0;e<16;e++)d[e]=i[e];h[0]=g[0]=1;for(let e=254;e>=0;--e){const t=n[e>>>3]>>>(7&e)&1;a(h,d,t),a(p,g,t),c(y,h,p),u(h,h,p),c(p,d,g),u(d,d,g),f(g,y),f(v,h),l(h,p,h),l(p,d,y),c(y,h,p),u(h,h,p),f(d,h),u(p,g,v),l(h,p,o),c(h,h,g),l(p,p,h),l(h,g,v),l(g,d,i),f(d,y),a(h,d,t),a(p,g,t)}for(let e=0;e<16;e++)i[e+16]=h[e],i[e+32]=p[e],i[e+48]=d[e],i[e+64]=g[e];const m=i.subarray(32),_=i.subarray(16);!function(e,t){const n=r();for(let e=0;e<16;e++)n[e]=t[e];for(let e=253;e>=0;e--)f(n,n),2!==e&&4!==e&&l(n,n,t);for(let t=0;t<16;t++)e[t]=n[t]}(m,m),l(_,_,m);const b=new Uint8Array(32);return function(e,t){const n=r(),i=r();for(let e=0;e<16;e++)i[e]=t[e];s(i),s(i),s(i);for(let e=0;e<2;e++){n[0]=i[0]-65517;for(let e=1;e<15;e++)n[e]=i[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=i[15]-32767-(n[14]>>16&1);const e=n[15]>>16&1;n[14]&=65535,a(i,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}(b,_),b}function d(e){return h(e,i)}function p(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const n=new Uint8Array(t);return{publicKey:d(n),secretKey:n}}e.scalarMult=h,e.scalarMultBase=d,e.generateKeyPairFromSeed=p,e.generateKeyPair=function(e){const r=(0,t.randomBytes)(32,e),i=p(r);return(0,n.wipe)(r),i},e.sharedKey=function(t,n,r=!1){if(t.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(n.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const i=h(t,n);if(r){let e=0;for(let t=0;t<i.length;t++)e|=i[t];if(0===e)throw new Error("X25519: invalid shared key")}return i}}({});var wr=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==n[s])throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*s[h]>>>0,s[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(r+(o-d)),g=r;d!==o;)p[g++]=s[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var f=t[i],h=0,d=s-1;(0!==f||h<r)&&-1!==d;d--,h++)f+=256*u[d]>>>0,u[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=h,i++}for(var p=s-r;p!==s&&0===u[p];)p++;for(var g=c.repeat(n);p<s;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:f,decode:function(e){var n=f(e);if(n)return n;throw new Error(`Non-${t} character`)}}},Er=wr;const Sr=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class Or{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Rr{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return Ir(this,e)}}class xr{constructor(e){this.decoders=e}or(e){return Ir(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 Ir=(e,t)=>new xr({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Cr{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Or(e,t,n),this.decoder=new Rr(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Pr=({name:e,prefix:t,encode:n,decode:r})=>new Cr(e,t,n,r),kr=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:i}=Er(n,t);return Pr({prefix:e,name:t,encode:r,decode:e=>Sr(i(e))})},Nr=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Pr({prefix:t,name:e,encode:e=>((e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let o="",s=0,a=0;for(let r=0;r<e.length;++r)for(a=a<<8|e[r],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o})(e,r,n),decode:t=>((e,t,n,r)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*n/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${r} character`);c=c<<n|o,a+=n,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,r,n,e)});Pr({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});Nr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});Nr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});kr({prefix:"9",name:"base10",alphabet:"0123456789"});Nr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Nr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});Nr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Nr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Nr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Nr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Nr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Nr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Nr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Nr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});kr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),kr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});kr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),kr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});Nr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Nr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Nr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Nr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});const Ar=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Tr=Ar.reduce(((e,t,n)=>(e[n]=t,e)),[]),Mr=Ar.reduce(((e,t,n)=>(e[t.codePointAt(0)]=n,e)),[]);Pr({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+=Tr[t]),"")},decode:function(e){const t=[];for(const n of e){const e=Mr[n.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}});var Lr=function e(t,n,r){n=n||[];var i=r=r||0;for(;t>=Dr;)n[r++]=255&t|Ur,t/=128;for(;t&jr;)n[r++]=255&t|Ur,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},Ur=128,jr=-128,Dr=Math.pow(2,31);var zr=function e(t,n){var r,i=0,o=0,s=n=n||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");r=t[s++],i+=o<28?(r&Fr)<<o:(r&Fr)*Math.pow(2,o),o+=7}while(r>=Br);return e.bytes=s-n,i},Br=128,Fr=127;var Hr=Math.pow(2,7),$r=Math.pow(2,14),Vr=Math.pow(2,21),qr=Math.pow(2,28),Wr=Math.pow(2,35),Kr=Math.pow(2,42),Gr=Math.pow(2,49),Yr=Math.pow(2,56),Qr=Math.pow(2,63),Jr={encode:Lr,decode:zr,encodingLength:function(e){return e<Hr?1:e<$r?2:e<Vr?3:e<qr?4:e<Wr?5:e<Kr?6:e<Gr?7:e<Yr?8:e<Qr?9:10}};const Xr=(e,t,n=0)=>(Jr.encode(e,t,n),t),Zr=e=>Jr.encodingLength(e),ei=(e,t)=>{const n=t.byteLength,r=Zr(e),i=r+Zr(n),o=new Uint8Array(i+n);return Xr(e,o,0),Xr(n,o,r),o.set(t,i),new ti(e,n,t,o)};class ti{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const ni=({name:e,code:t,encode:n})=>new ri(e,t,n);class ri{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?ei(this.code,t):t.then((e=>ei(this.code,e)))}throw Error("Unknown type, must be binary type")}}const ii=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));ni({name:"sha2-256",code:18,encode:ii("SHA-256")}),ni({name:"sha2-512",code:19,encode:ii("SHA-512")});new TextEncoder,new TextDecoder;var oi=function(e,t){return oi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},oi(e,t)};
|
237
237
|
/*! *****************************************************************************
|
238
238
|
Copyright (c) Microsoft Corporation.
|
239
239
|
|
@@ -247,7 +247,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
247
247
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
248
248
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
249
249
|
PERFORMANCE OF THIS SOFTWARE.
|
250
|
-
***************************************************************************** */var ci=function(){return ci=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ci.apply(this,arguments)};function ui(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function li(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function fi(e){return this instanceof fi?(this.v=e,this):new fi(e)}var hi,di=Object.freeze({__proto__:null,__extends:function(e,t){function n(){this.constructor=e}ai(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return ci},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},__decorate:function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},__createBinding:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},__exportStar:function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])},__values:ui,__read:li,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(li(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r},__await:fi,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof fi?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:fi(e[r](t)),done:"return"===r}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=ui(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}}),pi=g(di),gi={},yi={};var vi,mi={},_i={},bi={};var wi,Ei,Si,Oi,Ri={};function xi(){return Ei||(Ei=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=pi;t.__exportStar((vi||(vi=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.ONE_THOUSAND=bi.ONE_HUNDRED=void 0,bi.ONE_HUNDRED=100,bi.ONE_THOUSAND=1e3),bi),e),t.__exportStar((wi||(wi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=5*e.ONE_MINUTE,e.TEN_MINUTES=10*e.ONE_MINUTE,e.THIRTY_MINUTES=30*e.ONE_MINUTE,e.SIXTY_MINUTES=60*e.ONE_MINUTE,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=3*e.ONE_HOUR,e.SIX_HOURS=6*e.ONE_HOUR,e.TWELVE_HOURS=12*e.ONE_HOUR,e.TWENTY_FOUR_HOURS=24*e.ONE_HOUR,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=3*e.ONE_DAY,e.FIVE_DAYS=5*e.ONE_DAY,e.SEVEN_DAYS=7*e.ONE_DAY,e.THIRTY_DAYS=30*e.ONE_DAY,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=2*e.ONE_WEEK,e.THREE_WEEKS=3*e.ONE_WEEK,e.FOUR_WEEKS=4*e.ONE_WEEK,e.ONE_YEAR=365*e.ONE_DAY}(Ri)),Ri),e)}(_i)),_i}function Ii(){return Oi||(Oi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=pi;t.__exportStar((hi||(hi=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.delay=void 0,yi.delay=function(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}),yi),e),t.__exportStar(function(){if(Si)return mi;Si=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.fromMiliseconds=mi.toMiliseconds=void 0;const e=xi();return mi.toMiliseconds=function(t){return t*e.ONE_THOUSAND},mi.fromMiliseconds=function(t){return Math.floor(t/e.ONE_THOUSAND)},mi}(),e)}(gi)),gi}var Ci,Pi={};var ki,Ni,Ai={},Ti={};function Mi(){return Ni||(Ni=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});pi.__exportStar((ki||(ki=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.IWatch=void 0,Ti.IWatch=class{}),Ti),e)}(Ai)),Ai}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=pi;t.__exportStar(Ii(),e),t.__exportStar(function(){if(Ci)return Pi;Ci=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const n=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:n})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}return Pi.Watch=e,Pi.default=e,Pi}(),e),t.__exportStar(Mi(),e),t.__exportStar(xi(),e)}({});var Li={};function Ui(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function ji(e){const t=Ui(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(Li,"__esModule",{value:!0}),Li.getLocalStorage=Li.getLocalStorageOrThrow=Li.getCrypto=Li.getCryptoOrThrow=Li.getLocation=Li.getLocationOrThrow=Li.getNavigator=Li.getNavigatorOrThrow=Li.getDocument=Li.getDocumentOrThrow=Li.getFromWindowOrThrow=Li.getFromWindow=void 0,Li.getFromWindow=Ui,Li.getFromWindowOrThrow=ji,Li.getDocumentOrThrow=function(){return ji("document")},Li.getDocument=function(){return Ui("document")},Li.getNavigatorOrThrow=function(){return ji("navigator")},Li.getNavigator=function(){return Ui("navigator")},Li.getLocationOrThrow=function(){return ji("location")},Li.getLocation=function(){return Ui("location")},Li.getCryptoOrThrow=function(){return ji("crypto")},Li.getCrypto=function(){return Ui("crypto")},Li.getLocalStorageOrThrow=function(){return ji("localStorage")},Li.getLocalStorage=function(){return Ui("localStorage")};var Di={};Object.defineProperty(Di,"__esModule",{value:!0}),Di.getWindowMetadata=void 0;const zi=Li;Di.getWindowMetadata=function(){let e,t;try{e=zi.getDocumentOrThrow(),t=zi.getLocationOrThrow()}catch(e){return null}function n(...t){const n=e.getElementsByTagName("meta");for(let e=0;e<n.length;e++){const r=n[e],i=["itemprop","property","name"].map((e=>r.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=r.getAttribute("content");if(e)return e}}return""}const r=function(){let t=n("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:n("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const n=e.getElementsByTagName("link"),r=[];for(let e=0;e<n.length;e++){const i=n[e],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let n=t.protocol+"//"+t.host;if(0===e.indexOf("/"))n+=e;else{const r=t.pathname.split("/");r.pop();n+=r.join("/")+"/"+e}r.push(n)}else if(0===e.indexOf("//")){const n=t.protocol+e;r.push(n)}else r.push(e)}}return r}(),name:r}};var Bi=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),Fi="%[a-f0-9]{2}",Hi=new RegExp("("+Fi+")|([^%]+?)","gi"),$i=new RegExp("("+Fi+")+","gi");function Vi(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Vi(n),Vi(r))}function qi(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(Hi)||[],n=1;n<t.length;n++)t=(e=Vi(t,n).join("")).match(Hi)||[];return e}}var Wi=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=$i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var r=qi(n[0]);r!==n[0]&&(t[n[0]]=r)}n=$i.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),o=0;o<i.length;o++){var s=i[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}},Ki=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]},Gi=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),o=0;o<r.length;o++){var s=r[o],a=e[s];(i?-1!==t.indexOf(s):t(s,a,e))&&(n[s]=a)}return n};!function(e){const t=Bi,n=Wi,r=Ki,i=Gi,o=Symbol("encodeFragmentIdentifier");function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function c(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function f(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&c(n,e).includes(e.arrayFormatSeparator);n=o?c(n,e):n;const s=i||o?n.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===n?n:c(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n?c(n,e):n);const o=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>c(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const o of e.split("&")){if(""===o)continue;let[e,s]=r(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:c(s,t),n(c(e,t),s,i)}for(const e of Object.keys(i)){const n=i[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=h(n[e],t);else i[e]=h(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const n=i[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=u(n):e[t]=n,e}),Object.create(null))}e.extract=f,e.parse=d,e.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),"[",i,"]"].join("")]:[...n,[a(t,e),"[",a(i,e),"]=",a(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),"[]"].join("")]:[...n,[a(t,e),"[]=",a(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),":list="].join("")]:[...n,[a(t,e),":list=",a(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[a(n,e),t,a(i,e)].join("")]:[[r,a(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,a(t,e)]:[...n,[a(t,e),"=",a(r,e)].join("")]}}(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((n=>{const i=e[n];return void 0===i?"":null===i?a(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?a(n,t)+"[]":i.reduce(r(n),[]).join("&"):a(n,t)+"="+a(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:d(f(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:c(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[o]:!0},n);const r=l(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),c=Object.assign(s,t.query);let u=e.stringify(c,n);u&&(u=`?${u}`);let f=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(t.url);return t.fragmentIdentifier&&(f=`#${n[o]?a(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${u}${f}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[o]:!1},r);const{url:s,query:a,fragmentIdentifier:c}=e.parseUrl(t,r);return e.stringifyUrl({url:s,query:i(a,n),fragmentIdentifier:c},r)},e.exclude=(t,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}}({});const Yi={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}};function Qi(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}var Ji,Xi,Zi={exports:{}};!function(e,t){!function(e){var t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof d<"u"?d:typeof self<"u"?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var i,o={exports:{}},s="object"==typeof Reflect?Reflect:null,a=s&&"function"==typeof s.apply?s.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function c(e){console&&console.warn&&console.warn(e)}i=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var u=Number.isNaN||function(e){return e!=e};function l(){l.init.call(this)}o.exports=l,o.exports.once=S,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var f=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function p(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function g(e,t,n,r){var i,o,s;if(h(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=p(e))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,c(a)}return e}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=y.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?E(i):b(i,i.length)}function _(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function w(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function E(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function S(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}R(e,t,o,{once:!0}),"error"!==t&&O(e,i,{once:!0})}))}function O(e,t,n){"function"==typeof e.on&&R(e,"error",t,n)}function R(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(e){if("number"!=typeof e||e<0||u(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");f=e}}),l.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||u(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},l.prototype.getMaxListeners=function(){return p(this)},l.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)a(c,this,t);else{var u=c.length,l=b(c,u);for(n=0;n<u;++n)a(l[n],this,t)}return!0},l.prototype.addListener=function(e,t){return g(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return g(this,e,t,!0)},l.prototype.once=function(e,t){return h(t),this.on(e,v(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,v(this,e,t)),this},l.prototype.removeListener=function(e,t){var n,r,i,o,s;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():w(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},l.prototype.listeners=function(e){return m(this,e,!0)},l.prototype.rawListeners=function(e){return m(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},l.prototype.listenerCount=_,l.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};var x={},I=function(e,t){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};
|
250
|
+
***************************************************************************** */var si=function(){return si=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},si.apply(this,arguments)};function ai(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ci(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ui(e){return this instanceof ui?(this.v=e,this):new ui(e)}var li,fi=Object.freeze({__proto__:null,__extends:function(e,t){function n(){this.constructor=e}oi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return si},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},__decorate:function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},__createBinding:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},__exportStar:function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])},__values:ai,__read:ci,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ci(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r},__await:ui,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof ui?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:ui(e[r](t)),done:"return"===r}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=ai(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}}),hi=g(fi),di={},pi={};var gi,yi={},vi={},mi={};var _i,bi,wi,Ei,Si={};function Oi(){return bi||(bi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=hi;t.__exportStar((gi||(gi=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.ONE_THOUSAND=mi.ONE_HUNDRED=void 0,mi.ONE_HUNDRED=100,mi.ONE_THOUSAND=1e3),mi),e),t.__exportStar((_i||(_i=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=5*e.ONE_MINUTE,e.TEN_MINUTES=10*e.ONE_MINUTE,e.THIRTY_MINUTES=30*e.ONE_MINUTE,e.SIXTY_MINUTES=60*e.ONE_MINUTE,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=3*e.ONE_HOUR,e.SIX_HOURS=6*e.ONE_HOUR,e.TWELVE_HOURS=12*e.ONE_HOUR,e.TWENTY_FOUR_HOURS=24*e.ONE_HOUR,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=3*e.ONE_DAY,e.FIVE_DAYS=5*e.ONE_DAY,e.SEVEN_DAYS=7*e.ONE_DAY,e.THIRTY_DAYS=30*e.ONE_DAY,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=2*e.ONE_WEEK,e.THREE_WEEKS=3*e.ONE_WEEK,e.FOUR_WEEKS=4*e.ONE_WEEK,e.ONE_YEAR=365*e.ONE_DAY}(Si)),Si),e)}(vi)),vi}function Ri(){return Ei||(Ei=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=hi;t.__exportStar((li||(li=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.delay=void 0,pi.delay=function(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}),pi),e),t.__exportStar(function(){if(wi)return yi;wi=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.fromMiliseconds=yi.toMiliseconds=void 0;const e=Oi();return yi.toMiliseconds=function(t){return t*e.ONE_THOUSAND},yi.fromMiliseconds=function(t){return Math.floor(t/e.ONE_THOUSAND)},yi}(),e)}(di)),di}var xi,Ii={};var Ci,Pi,ki={},Ni={};function Ai(){return Pi||(Pi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});hi.__exportStar((Ci||(Ci=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.IWatch=void 0,Ni.IWatch=class{}),Ni),e)}(ki)),ki}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=hi;t.__exportStar(Ri(),e),t.__exportStar(function(){if(xi)return Ii;xi=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const n=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:n})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}return Ii.Watch=e,Ii.default=e,Ii}(),e),t.__exportStar(Ai(),e),t.__exportStar(Oi(),e)}({});var Ti={};function Mi(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function Li(e){const t=Mi(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.getLocalStorage=Ti.getLocalStorageOrThrow=Ti.getCrypto=Ti.getCryptoOrThrow=Ti.getLocation=Ti.getLocationOrThrow=Ti.getNavigator=Ti.getNavigatorOrThrow=Ti.getDocument=Ti.getDocumentOrThrow=Ti.getFromWindowOrThrow=Ti.getFromWindow=void 0,Ti.getFromWindow=Mi,Ti.getFromWindowOrThrow=Li,Ti.getDocumentOrThrow=function(){return Li("document")},Ti.getDocument=function(){return Mi("document")},Ti.getNavigatorOrThrow=function(){return Li("navigator")},Ti.getNavigator=function(){return Mi("navigator")},Ti.getLocationOrThrow=function(){return Li("location")},Ti.getLocation=function(){return Mi("location")},Ti.getCryptoOrThrow=function(){return Li("crypto")},Ti.getCrypto=function(){return Mi("crypto")},Ti.getLocalStorageOrThrow=function(){return Li("localStorage")},Ti.getLocalStorage=function(){return Mi("localStorage")};var Ui={};Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.getWindowMetadata=void 0;const ji=Ti;Ui.getWindowMetadata=function(){let e,t;try{e=ji.getDocumentOrThrow(),t=ji.getLocationOrThrow()}catch(e){return null}function n(...t){const n=e.getElementsByTagName("meta");for(let e=0;e<n.length;e++){const r=n[e],i=["itemprop","property","name"].map((e=>r.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=r.getAttribute("content");if(e)return e}}return""}const r=function(){let t=n("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:n("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const n=e.getElementsByTagName("link"),r=[];for(let e=0;e<n.length;e++){const i=n[e],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let n=t.protocol+"//"+t.host;if(0===e.indexOf("/"))n+=e;else{const r=t.pathname.split("/");r.pop();n+=r.join("/")+"/"+e}r.push(n)}else if(0===e.indexOf("//")){const n=t.protocol+e;r.push(n)}else r.push(e)}}return r}(),name:r}};var Di=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),zi="%[a-f0-9]{2}",Bi=new RegExp("("+zi+")|([^%]+?)","gi"),Fi=new RegExp("("+zi+")+","gi");function Hi(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Hi(n),Hi(r))}function $i(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(Bi)||[],n=1;n<t.length;n++)t=(e=Hi(t,n).join("")).match(Bi)||[];return e}}var Vi=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=Fi.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var r=$i(n[0]);r!==n[0]&&(t[n[0]]=r)}n=Fi.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),o=0;o<i.length;o++){var s=i[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}},qi=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]},Wi=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),o=0;o<r.length;o++){var s=r[o],a=e[s];(i?-1!==t.indexOf(s):t(s,a,e))&&(n[s]=a)}return n};!function(e){const t=Di,n=Vi,r=qi,i=Wi,o=Symbol("encodeFragmentIdentifier");function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function c(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function f(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&c(n,e).includes(e.arrayFormatSeparator);n=o?c(n,e):n;const s=i||o?n.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===n?n:c(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n?c(n,e):n);const o=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>c(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const o of e.split("&")){if(""===o)continue;let[e,s]=r(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:c(s,t),n(c(e,t),s,i)}for(const e of Object.keys(i)){const n=i[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=h(n[e],t);else i[e]=h(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const n=i[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=u(n):e[t]=n,e}),Object.create(null))}e.extract=f,e.parse=d,e.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),"[",i,"]"].join("")]:[...n,[a(t,e),"[",a(i,e),"]=",a(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),"[]"].join("")]:[...n,[a(t,e),"[]=",a(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),":list="].join("")]:[...n,[a(t,e),":list=",a(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[a(n,e),t,a(i,e)].join("")]:[[r,a(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,a(t,e)]:[...n,[a(t,e),"=",a(r,e)].join("")]}}(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((n=>{const i=e[n];return void 0===i?"":null===i?a(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?a(n,t)+"[]":i.reduce(r(n),[]).join("&"):a(n,t)+"="+a(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:d(f(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:c(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[o]:!0},n);const r=l(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),c=Object.assign(s,t.query);let u=e.stringify(c,n);u&&(u=`?${u}`);let f=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(t.url);return t.fragmentIdentifier&&(f=`#${n[o]?a(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${u}${f}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[o]:!1},r);const{url:s,query:a,fragmentIdentifier:c}=e.parseUrl(t,r);return e.stringifyUrl({url:s,query:i(a,n),fragmentIdentifier:c},r)},e.exclude=(t,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}}({});const Ki={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}};function Gi(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}var Yi,Qi,Ji={exports:{}};!function(e,t){!function(e){var t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof d<"u"?d:typeof self<"u"?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var i,o={exports:{}},s="object"==typeof Reflect?Reflect:null,a=s&&"function"==typeof s.apply?s.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function c(e){console&&console.warn&&console.warn(e)}i=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var u=Number.isNaN||function(e){return e!=e};function l(){l.init.call(this)}o.exports=l,o.exports.once=S,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var f=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function p(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function g(e,t,n,r){var i,o,s;if(h(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=p(e))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,c(a)}return e}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=y.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?E(i):b(i,i.length)}function _(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function w(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function E(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function S(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}R(e,t,o,{once:!0}),"error"!==t&&O(e,i,{once:!0})}))}function O(e,t,n){"function"==typeof e.on&&R(e,"error",t,n)}function R(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(e){if("number"!=typeof e||e<0||u(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");f=e}}),l.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||u(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},l.prototype.getMaxListeners=function(){return p(this)},l.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)a(c,this,t);else{var u=c.length,l=b(c,u);for(n=0;n<u;++n)a(l[n],this,t)}return!0},l.prototype.addListener=function(e,t){return g(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return g(this,e,t,!0)},l.prototype.once=function(e,t){return h(t),this.on(e,v(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,v(this,e,t)),this},l.prototype.removeListener=function(e,t){var n,r,i,o,s;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():w(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},l.prototype.listeners=function(e){return m(this,e,!0)},l.prototype.rawListeners=function(e){return m(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},l.prototype.listenerCount=_,l.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};var x={},I=function(e,t){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};
|
251
251
|
/*! *****************************************************************************
|
252
252
|
Copyright (c) Microsoft Corporation.
|
253
253
|
|
@@ -303,7 +303,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
303
303
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
304
304
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
305
305
|
PERFORMANCE OF THIS SOFTWARE.
|
306
|
-
***************************************************************************** */function ln(e,t){function n(){this.constructor=e}un(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var fn=function(){return fn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fn.apply(this,arguments)};function hn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function dn(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function pn(e,t){return function(n,r){t(n,r,e)}}function gn(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function yn(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):i(e.value).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function vn(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function mn(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function _n(e,t){for(var n in e)"default"!==n&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function bn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function wn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function En(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wn(arguments[t]));return e}function Sn(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function On(e){return this instanceof On?(this.v=e,this):new On(e)}function Rn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{c(i[e](t))}catch(e){f(o[0][3],e)}}function c(e){e.value instanceof On?Promise.resolve(e.value.v).then(u,l):f(o[0][2],e)}function u(e){a("next",e)}function l(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function xn(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:On(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function In(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof bn?bn(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){i(r,o,(t=e[n](t)).done,t.value)}))}}function i(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}}function Cn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Pn(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function kn(e){return e&&e.__esModule?e:{default:e}}function Nn(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function An(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var Tn,Mn,Ln,Un,jn=r(Object.freeze({__proto__:null,__extends:ln,get __assign(){return fn},__rest:hn,__decorate:dn,__param:pn,__metadata:gn,__awaiter:yn,__generator:vn,__createBinding:mn,__exportStar:_n,__values:bn,__read:wn,__spread:En,__spreadArrays:Sn,__await:On,__asyncGenerator:Rn,__asyncDelegator:xn,__asyncValues:In,__makeTemplateObject:Cn,__importStar:Pn,__importDefault:kn,__classPrivateFieldGet:Nn,__classPrivateFieldSet:An}));function Dn(){if(Mn)return Tn;function e(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}function t(t,n,r){var i=r&&r.stringify||e,o=1;if("object"==typeof t&&null!==t){var s=n.length+o;if(1===s)return t;var a=new Array(s);a[0]=i(t);for(var c=1;c<s;c++)a[c]=i(n[c]);return a.join(" ")}if("string"!=typeof t)return t;var u=n.length;if(0===u)return t;for(var l="",f=1-o,h=-1,d=t&&t.length||0,p=0;p<d;){if(37===t.charCodeAt(p)&&p+1<d){switch(h=h>-1?h:0,t.charCodeAt(p+1)){case 100:case 102:if(f>=u||null==n[f])break;h<p&&(l+=t.slice(h,p)),l+=Number(n[f]),h=p+2,p++;break;case 105:if(f>=u||null==n[f])break;h<p&&(l+=t.slice(h,p)),l+=Math.floor(Number(n[f])),h=p+2,p++;break;case 79:case 111:case 106:if(f>=u||void 0===n[f])break;h<p&&(l+=t.slice(h,p));var g=typeof n[f];if("string"===g){l+="'"+n[f]+"'",h=p+2,p++;break}if("function"===g){l+=n[f].name||"<anonymous>",h=p+2,p++;break}l+=i(n[f]),h=p+2,p++;break;case 115:if(f>=u)break;h<p&&(l+=t.slice(h,p)),l+=String(n[f]),h=p+2,p++;break;case 37:h<p&&(l+=t.slice(h,p)),l+="%",h=p+2,p++,f--}++f}++p}return-1===h?t:(h<d&&(l+=t.slice(h)),l)}return Mn=1,Tn=t}function zn(){if(Un)return Ln;Un=1;const e=Dn();Ln=i;const t=w().console||{},n={mapHttpRequest:p,mapHttpResponse:p,wrapRequestSerializer:g,wrapResponseSerializer:g,wrapErrorSerializer:g,req:p,res:p,err:h};function r(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}function i(e){(e=e||{}).browser=e.browser||{};const n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");const s=e.browser.write||t;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},l=r(e.browser.serialize,a);let h=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);const p=["error","fatal","warn","info","debug","trace"];"function"==typeof s&&(s.error=s.fatal=s.warn=s.info=s.debug=s.trace=s),!1===e.enabled&&(e.level="silent");const g=e.level||"info",v=Object.create(s);v.log||(v.log=y),Object.defineProperty(v,"levelVal",{get:_}),Object.defineProperty(v,"level",{get:b,set:w});const m={transmit:n,serialize:l,asObject:e.browser.asObject,levels:p,timestamp:d(e)};function _(){return"silent"===this.level?1/0:this.levels.values[this.level]}function b(){return this._level}function w(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(m,v,"error","log"),o(m,v,"fatal","error"),o(m,v,"warn","error"),o(m,v,"info","log"),o(m,v,"debug","log"),o(m,v,"trace","log")}function E(t,r){if(!t)throw new Error("missing bindings for child Pino");r=r||{},l&&t.serializers&&(r.serializers=t.serializers);const i=r.serializers;if(l&&i){var o=Object.assign({},a,i),s=!0===e.browser.serialize?Object.keys(o):l;delete t.serializers,c([t],s,o,this._stdErrSerialize)}function h(e){this._childLevel=1+(0|e._childLevel),this.error=u(e,t,"error"),this.fatal=u(e,t,"fatal"),this.warn=u(e,t,"warn"),this.info=u(e,t,"info"),this.debug=u(e,t,"debug"),this.trace=u(e,t,"trace"),o&&(this.serializers=o,this._serialize=s),n&&(this._logEvent=f([].concat(e._logEvent.bindings,t)))}return h.prototype=this,new h(this)}return v.levels=i.levels,v.level=g,v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=y,v.serializers=a,v._serialize=l,v._stdErrSerialize=h,v.child=E,n&&(v._logEvent=f()),v}function o(e,n,r,i){const o=Object.getPrototypeOf(n);n[r]=n.levelVal>n.levels.values[r]?y:o[r]?o[r]:t[r]||t[i]||y,s(e,n,r)}function s(e,n,r){!e.transmit&&n[r]===y||(n[r]=function(o){return function(){const s=e.timestamp(),u=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var h=0;h<u.length;h++)u[h]=arguments[h];if(e.serialize&&!e.asObject&&c(u,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?o.call(f,a(this,r,u,s)):o.apply(f,u),e.transmit){const t=e.transmit.level||n.level,o=i.levels.values[t],a=i.levels.values[r];if(a<o)return;l(this,{ts:s,methodLevel:r,methodValue:a,transmitLevel:t,transmitValue:i.levels.values[e.transmit.level||n.level],send:e.transmit.send,val:n.levelVal},u)}}}(n[r]))}function a(t,n,r,o){t._serialize&&c(r,t._serialize,t.serializers,t._stdErrSerialize);const s=r.slice();let a=s[0];const u={};o&&(u.time=o),u.level=i.levels.values[n];let l=1+(0|t._childLevel);if(l<1&&(l=1),null!==a&&"object"==typeof a){for(;l--&&"object"==typeof s[0];)Object.assign(u,s.shift());a=s.length?e(s.shift(),s):void 0}else"string"==typeof a&&(a=e(s.shift(),s));return void 0!==a&&(u.msg=a),u}function c(e,t,n,r){for(const o in e)if(r&&e[o]instanceof Error)e[o]=i.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o]))for(const r in e[o])t&&t.indexOf(r)>-1&&r in n&&(e[o][r]=n[r](e[o][r]))}function u(e,t,n){return function(){const r=new Array(1+arguments.length);r[0]=t;for(var i=1;i<r.length;i++)r[i]=arguments[i-1];return e[n].apply(this,r)}}function l(e,t,n){const r=t.send,i=t.ts,o=t.methodLevel,s=t.methodValue,a=t.val,u=e._logEvent.bindings;c(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=n.filter((function(e){return-1===u.indexOf(e)})),e._logEvent.level.label=o,e._logEvent.level.value=s,r(o,e._logEvent,a),e._logEvent=f(u)}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function d(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?v:m}function p(){return{}}function g(e){return e}function y(){}function v(){return!1}function m(){return Date.now()}function _(){return Math.round(Date.now()/1e3)}function b(){return new Date(Date.now()).toISOString()}function w(){function e(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 e(self)||e(window)||e(this)||{}}}return i.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"}},i.stdSerializers=n,i.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:m,unixTime:_,isoTime:b}),Ln}var Bn,Fn={};function Hn(){return Bn||(Bn=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.PINO_CUSTOM_CONTEXT_KEY=Fn.PINO_LOGGER_DEFAULTS=void 0,Fn.PINO_LOGGER_DEFAULTS={level:"info"},Fn.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Fn}var $n,Vn={};function qn(){if($n)return Vn;$n=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.generateChildLogger=Vn.formatChildLoggerContext=Vn.getLoggerContext=Vn.setBrowserLoggerContext=Vn.getBrowserLoggerContext=Vn.getDefaultLoggerOptions=void 0;const e=Hn();function t(t){return Object.assign(Object.assign({},t),{level:t?.level||e.PINO_LOGGER_DEFAULTS.level})}function n(t,n=e.PINO_CUSTOM_CONTEXT_KEY){return t[n]||""}function r(t,n,r=e.PINO_CUSTOM_CONTEXT_KEY){return t[r]=n,t}function i(t,r=e.PINO_CUSTOM_CONTEXT_KEY){let i="";return i=typeof t.bindings>"u"?n(t,r):t.bindings().context||"",i}function o(t,n,r=e.PINO_CUSTOM_CONTEXT_KEY){const o=i(t,r);return o.trim()?`${o}/${n}`:n}function s(t,n,i=e.PINO_CUSTOM_CONTEXT_KEY){const s=o(t,n,i);return r(t.child({context:s}),s,i)}return Vn.getDefaultLoggerOptions=t,Vn.getBrowserLoggerContext=n,Vn.setBrowserLoggerContext=r,Vn.getLoggerContext=i,Vn.formatChildLoggerContext=o,Vn.generateChildLogger=s,Vn}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pino=void 0;const t=jn,n=t.__importDefault(zn());Object.defineProperty(e,"pino",{enumerable:!0,get:function(){return n.default}}),t.__exportStar(Hn(),e),t.__exportStar(qn(),e)}(cn);class Wn extends Kt{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Kn extends Kt{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class Gn{constructor(e,t){this.logger=e,this.core=t}}class Yn extends Kt{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Qn extends Kt{constructor(e){super()}}class Jn{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}}class Xn extends Kt{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Zn extends Kt{constructor(e,t){super(),this.core=e,this.logger=t}}class er{constructor(e,t){this.projectId=e,this.logger=t}}class tr{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class nr{constructor(e){this.client=e}}const rr=e=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString()+"n":t)),ir=e=>{const t=/([\[:])?(\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,n=e.replace(t,'$1"$2n"$3');return JSON.parse(n,((e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t))};function or(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return ir(e)}catch{return e}}function sr(e){return"string"==typeof e?e:rr(e)||""}var ar={},cr={},ur={},lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.BrowserRandomSource=void 0;const fr=65536;class hr{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(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 t=new Uint8Array(e);for(let e=0;e<t.length;e+=fr)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,fr)));return t}}function dr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}lr.BrowserRandomSource=hr;var pr={},gr={};function yr(e){for(var t=0;t<e.length;t++)e[t]=0;return e}Object.defineProperty(gr,"__esModule",{value:!0}),gr.wipe=yr;var vr={},mr=r(Object.freeze({__proto__:null,default:vr}));Object.defineProperty(pr,"__esModule",{value:!0}),pr.NodeRandomSource=void 0;const _r=gr;class br{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof dr<"u"){const e=mr;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 t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let e=0;e<n.length;e++)n[e]=t[e];return(0,_r.wipe)(t),n}}pr.NodeRandomSource=br,Object.defineProperty(ur,"__esModule",{value:!0}),ur.SystemRandomSource=void 0;const wr=lr,Er=pr;class Sr{constructor(){return this.isAvailable=!1,this.name="",this._source=new wr.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new Er.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}ur.SystemRandomSource=Sr;var Or={},Rr={};(function(e){function t(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0}function n(e,t){return e+t|0}function r(e,t){return e-t|0}function i(e,t){return e<<t|e>>>32-t}function o(e,t){return e<<32-t|e>>>t}function s(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||t,e.add=n,e.sub=r,e.rotl=i,e.rotr=o,e.isInteger=Number.isInteger||s,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}})(Rr),Object.defineProperty(Or,"__esModule",{value:!0});var xr=Rr;function Ir(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}function Cr(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0}function Pr(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16}function kr(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0}function Nr(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function Ar(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function Tr(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Mr(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Lr(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Ur(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function jr(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function Dr(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function zr(e,t){void 0===t&&(t=0);var n=Tr(e,t),r=Tr(e,t+4);return 4294967296*n+r-4294967296*(r>>31)}function Br(e,t){return void 0===t&&(t=0),4294967296*Mr(e,t)+Mr(e,t+4)}function Fr(e,t){void 0===t&&(t=0);var n=Lr(e,t);return 4294967296*Lr(e,t+4)+n-4294967296*(n>>31)}function Hr(e,t){void 0===t&&(t=0);var n=Ur(e,t);return 4294967296*Ur(e,t+4)+n}function $r(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),jr(e/4294967296>>>0,t,n),jr(e>>>0,t,n+4),t}function Vr(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),Dr(e>>>0,t,n),Dr(e/4294967296>>>0,t,n+4),t}function qr(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,o=e/8+n-1;o>=n;o--)r+=t[o]*i,i*=256;return r}function Wr(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,o=n;o<n+e/8;o++)r+=t[o]*i,i*=256;return r}function Kr(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!xr.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var i=1,o=e/8+r-1;o>=r;o--)n[o]=t/i&255,i*=256;return n}function Gr(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!xr.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var i=1,o=r;o<r+e/8;o++)n[o]=t/i&255,i*=256;return n}function Yr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)}function Qr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)}function Jr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)}function Xr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)}function Zr(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e),t}function ei(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),t}function ti(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e),t}function ni(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),t}Or.readInt16BE=Ir,Or.readUint16BE=Cr,Or.readInt16LE=Pr,Or.readUint16LE=kr,Or.writeUint16BE=Nr,Or.writeInt16BE=Nr,Or.writeUint16LE=Ar,Or.writeInt16LE=Ar,Or.readInt32BE=Tr,Or.readUint32BE=Mr,Or.readInt32LE=Lr,Or.readUint32LE=Ur,Or.writeUint32BE=jr,Or.writeInt32BE=jr,Or.writeUint32LE=Dr,Or.writeInt32LE=Dr,Or.readInt64BE=zr,Or.readUint64BE=Br,Or.readInt64LE=Fr,Or.readUint64LE=Hr,Or.writeUint64BE=$r,Or.writeInt64BE=$r,Or.writeUint64LE=Vr,Or.writeInt64LE=Vr,Or.readUintBE=qr,Or.readUintLE=Wr,Or.writeUintBE=Kr,Or.writeUintLE=Gr,Or.readFloat32BE=Yr,Or.readFloat32LE=Qr,Or.readFloat64BE=Jr,Or.readFloat64LE=Xr,Or.writeFloat32BE=Zr,Or.writeFloat32LE=ei,Or.writeFloat64BE=ti,Or.writeFloat64LE=ni,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=ur,n=Or,r=gr;function i(t,n=e.defaultRandomSource){return n.randomBytes(t)}function o(t=e.defaultRandomSource){const o=i(4,t),s=(0,n.readUint32LE)(o);return(0,r.wipe)(o),s}e.defaultRandomSource=new t.SystemRandomSource,e.randomBytes=i,e.randomUint32=o;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(t,n=s,o=e.defaultRandomSource){if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");let a="";const c=n.length,u=256-256%c;for(;t>0;){const e=i(Math.ceil(256*t/u),o);for(let r=0;r<e.length&&t>0;r++){const i=e[r];i<u&&(a+=n.charAt(i%c),t--)}(0,r.wipe)(e)}return a}function c(t,n=s,r=e.defaultRandomSource){return a(Math.ceil(t/(Math.log(n.length)/Math.LN2)),n,r)}e.randomString=a,e.randomStringForEntropy=c}(cr);var ri={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Or,n=gr;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var r=function(){function r(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 r.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},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},r.prototype.update=function(t,n){if(void 0===n&&(n=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var r=0;if(this._bytesHashed+=n,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&n>0;)this._buffer[this._bufferLength++]=t[r++],n--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(n>=this.blockSize&&(r=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,t,r,n),n%=this.blockSize);n>0;)this._buffer[this._bufferLength++]=t[r++],n--;return this},r.prototype.finish=function(e){if(!this._finished){var n=this._bytesHashed,r=this._bufferLength,i=n/536870912|0,s=n<<3,a=n%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/8;c++)t.writeUint32BE(this._stateHi[c],e,8*c),t.writeUint32BE(this._stateLo[c],e,8*c+4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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}},r.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){n.wipe(e.stateHi),n.wipe(e.stateLo),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();e.SHA512=r;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(e,n,r,o,s,a,c){for(var u,l,f,h,d,p,g,y,v=r[0],m=r[1],_=r[2],b=r[3],w=r[4],E=r[5],S=r[6],O=r[7],R=o[0],x=o[1],I=o[2],C=o[3],P=o[4],k=o[5],N=o[6],A=o[7];c>=128;){for(var T=0;T<16;T++){var M=8*T+a;e[T]=t.readUint32BE(s,M),n[T]=t.readUint32BE(s,M+4)}for(T=0;T<80;T++){var L=v,U=m,j=_,D=b,z=w,B=E,F=S,H=O,$=R,V=x,q=I,W=C,K=P,G=k,Y=N,Q=A;if(d=65535&(l=A),p=l>>>16,g=65535&(u=O),y=u>>>16,d+=65535&(l=(P>>>14|w<<18)^(P>>>18|w<<14)^(w>>>9|P<<23)),p+=l>>>16,g+=65535&(u=(w>>>14|P<<18)^(w>>>18|P<<14)^(P>>>9|w<<23)),y+=u>>>16,d+=65535&(l=P&k^~P&N),p+=l>>>16,g+=65535&(u=w&E^~w&S),y+=u>>>16,u=i[2*T],d+=65535&(l=i[2*T+1]),p+=l>>>16,g+=65535&u,y+=u>>>16,u=e[T%16],p+=(l=n[T%16])>>>16,g+=65535&u,y+=u>>>16,g+=(p+=(d+=65535&l)>>>16)>>>16,d=65535&(l=h=65535&d|p<<16),p=l>>>16,g=65535&(u=f=65535&g|(y+=g>>>16)<<16),y=u>>>16,d+=65535&(l=(R>>>28|v<<4)^(v>>>2|R<<30)^(v>>>7|R<<25)),p+=l>>>16,g+=65535&(u=(v>>>28|R<<4)^(R>>>2|v<<30)^(R>>>7|v<<25)),y+=u>>>16,p+=(l=R&x^R&I^x&I)>>>16,g+=65535&(u=v&m^v&_^m&_),y+=u>>>16,H=65535&(g+=(p+=(d+=65535&l)>>>16)>>>16)|(y+=g>>>16)<<16,Q=65535&d|p<<16,d=65535&(l=W),p=l>>>16,g=65535&(u=D),y=u>>>16,p+=(l=h)>>>16,g+=65535&(u=f),y+=u>>>16,m=L,_=U,b=j,w=D=65535&(g+=(p+=(d+=65535&l)>>>16)>>>16)|(y+=g>>>16)<<16,E=z,S=B,O=F,v=H,x=$,I=V,C=q,P=W=65535&d|p<<16,k=K,N=G,A=Y,R=Q,T%16==15)for(M=0;M<16;M++)u=e[M],d=65535&(l=n[M]),p=l>>>16,g=65535&u,y=u>>>16,u=e[(M+9)%16],d+=65535&(l=n[(M+9)%16]),p+=l>>>16,g+=65535&u,y+=u>>>16,f=e[(M+1)%16],d+=65535&(l=((h=n[(M+1)%16])>>>1|f<<31)^(h>>>8|f<<24)^(h>>>7|f<<25)),p+=l>>>16,g+=65535&(u=(f>>>1|h<<31)^(f>>>8|h<<24)^f>>>7),y+=u>>>16,f=e[(M+14)%16],p+=(l=((h=n[(M+14)%16])>>>19|f<<13)^(f>>>29|h<<3)^(h>>>6|f<<26))>>>16,g+=65535&(u=(f>>>19|h<<13)^(h>>>29|f<<3)^f>>>6),y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,e[M]=65535&g|y<<16,n[M]=65535&d|p<<16}d=65535&(l=R),p=l>>>16,g=65535&(u=v),y=u>>>16,u=r[0],p+=(l=o[0])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[0]=v=65535&g|y<<16,o[0]=R=65535&d|p<<16,d=65535&(l=x),p=l>>>16,g=65535&(u=m),y=u>>>16,u=r[1],p+=(l=o[1])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[1]=m=65535&g|y<<16,o[1]=x=65535&d|p<<16,d=65535&(l=I),p=l>>>16,g=65535&(u=_),y=u>>>16,u=r[2],p+=(l=o[2])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[2]=_=65535&g|y<<16,o[2]=I=65535&d|p<<16,d=65535&(l=C),p=l>>>16,g=65535&(u=b),y=u>>>16,u=r[3],p+=(l=o[3])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[3]=b=65535&g|y<<16,o[3]=C=65535&d|p<<16,d=65535&(l=P),p=l>>>16,g=65535&(u=w),y=u>>>16,u=r[4],p+=(l=o[4])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[4]=w=65535&g|y<<16,o[4]=P=65535&d|p<<16,d=65535&(l=k),p=l>>>16,g=65535&(u=E),y=u>>>16,u=r[5],p+=(l=o[5])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[5]=E=65535&g|y<<16,o[5]=k=65535&d|p<<16,d=65535&(l=N),p=l>>>16,g=65535&(u=S),y=u>>>16,u=r[6],p+=(l=o[6])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[6]=S=65535&g|y<<16,o[6]=N=65535&d|p<<16,d=65535&(l=A),p=l>>>16,g=65535&(u=O),y=u>>>16,u=r[7],p+=(l=o[7])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[7]=O=65535&g|y<<16,o[7]=A=65535&d|p<<16,a+=128,c-=128}return a}function s(e){var t=new r;t.update(e);var n=t.digest();return t.clean(),n}e.hash=s})(ri),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const t=cr,n=ri,r=gr;function i(e){const t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32,new Uint8Array(32)[0]=9;const o=i(),s=i([1]),a=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(e,t){for(let n=0;n<16;n++)e[n]=0|t[n]}function d(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function p(e,t,n){const r=~(n-1);for(let n=0;n<16;n++){const i=r&(e[n]^t[n]);e[n]^=i,t[n]^=i}}function g(e,t){const n=i(),r=i();for(let e=0;e<16;e++)r[e]=t[e];d(r),d(r),d(r);for(let e=0;e<2;e++){n[0]=r[0]-65517;for(let e=1;e<15;e++)n[e]=r[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);const e=n[15]>>16&1;n[14]&=65535,p(r,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&r[t],e[2*t+1]=r[t]>>8}function y(e,t){let n=0;for(let r=0;r<32;r++)n|=e[r]^t[r];return(1&n-1>>>8)-1}function v(e,t){const n=new Uint8Array(32),r=new Uint8Array(32);return g(n,e),g(r,t),y(n,r)}function m(e){const t=new Uint8Array(32);return g(t,e),1&t[0]}function _(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function b(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function w(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function E(e,t,n){let r,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,g=0,y=0,v=0,m=0,_=0,b=0,w=0,E=0,S=0,O=0,R=0,x=0,I=0,C=0,P=0,k=0,N=0,A=0,T=0,M=0,L=0,U=n[0],j=n[1],D=n[2],z=n[3],B=n[4],F=n[5],H=n[6],$=n[7],V=n[8],q=n[9],W=n[10],K=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];r=t[0],o+=r*U,s+=r*j,a+=r*D,c+=r*z,u+=r*B,l+=r*F,f+=r*H,h+=r*$,d+=r*V,p+=r*q,g+=r*W,y+=r*K,v+=r*G,m+=r*Y,_+=r*Q,b+=r*J,r=t[1],s+=r*U,a+=r*j,c+=r*D,u+=r*z,l+=r*B,f+=r*F,h+=r*H,d+=r*$,p+=r*V,g+=r*q,y+=r*W,v+=r*K,m+=r*G,_+=r*Y,b+=r*Q,w+=r*J,r=t[2],a+=r*U,c+=r*j,u+=r*D,l+=r*z,f+=r*B,h+=r*F,d+=r*H,p+=r*$,g+=r*V,y+=r*q,v+=r*W,m+=r*K,_+=r*G,b+=r*Y,w+=r*Q,E+=r*J,r=t[3],c+=r*U,u+=r*j,l+=r*D,f+=r*z,h+=r*B,d+=r*F,p+=r*H,g+=r*$,y+=r*V,v+=r*q,m+=r*W,_+=r*K,b+=r*G,w+=r*Y,E+=r*Q,S+=r*J,r=t[4],u+=r*U,l+=r*j,f+=r*D,h+=r*z,d+=r*B,p+=r*F,g+=r*H,y+=r*$,v+=r*V,m+=r*q,_+=r*W,b+=r*K,w+=r*G,E+=r*Y,S+=r*Q,O+=r*J,r=t[5],l+=r*U,f+=r*j,h+=r*D,d+=r*z,p+=r*B,g+=r*F,y+=r*H,v+=r*$,m+=r*V,_+=r*q,b+=r*W,w+=r*K,E+=r*G,S+=r*Y,O+=r*Q,R+=r*J,r=t[6],f+=r*U,h+=r*j,d+=r*D,p+=r*z,g+=r*B,y+=r*F,v+=r*H,m+=r*$,_+=r*V,b+=r*q,w+=r*W,E+=r*K,S+=r*G,O+=r*Y,R+=r*Q,x+=r*J,r=t[7],h+=r*U,d+=r*j,p+=r*D,g+=r*z,y+=r*B,v+=r*F,m+=r*H,_+=r*$,b+=r*V,w+=r*q,E+=r*W,S+=r*K,O+=r*G,R+=r*Y,x+=r*Q,I+=r*J,r=t[8],d+=r*U,p+=r*j,g+=r*D,y+=r*z,v+=r*B,m+=r*F,_+=r*H,b+=r*$,w+=r*V,E+=r*q,S+=r*W,O+=r*K,R+=r*G,x+=r*Y,I+=r*Q,C+=r*J,r=t[9],p+=r*U,g+=r*j,y+=r*D,v+=r*z,m+=r*B,_+=r*F,b+=r*H,w+=r*$,E+=r*V,S+=r*q,O+=r*W,R+=r*K,x+=r*G,I+=r*Y,C+=r*Q,P+=r*J,r=t[10],g+=r*U,y+=r*j,v+=r*D,m+=r*z,_+=r*B,b+=r*F,w+=r*H,E+=r*$,S+=r*V,O+=r*q,R+=r*W,x+=r*K,I+=r*G,C+=r*Y,P+=r*Q,k+=r*J,r=t[11],y+=r*U,v+=r*j,m+=r*D,_+=r*z,b+=r*B,w+=r*F,E+=r*H,S+=r*$,O+=r*V,R+=r*q,x+=r*W,I+=r*K,C+=r*G,P+=r*Y,k+=r*Q,N+=r*J,r=t[12],v+=r*U,m+=r*j,_+=r*D,b+=r*z,w+=r*B,E+=r*F,S+=r*H,O+=r*$,R+=r*V,x+=r*q,I+=r*W,C+=r*K,P+=r*G,k+=r*Y,N+=r*Q,A+=r*J,r=t[13],m+=r*U,_+=r*j,b+=r*D,w+=r*z,E+=r*B,S+=r*F,O+=r*H,R+=r*$,x+=r*V,I+=r*q,C+=r*W,P+=r*K,k+=r*G,N+=r*Y,A+=r*Q,T+=r*J,r=t[14],_+=r*U,b+=r*j,w+=r*D,E+=r*z,S+=r*B,O+=r*F,R+=r*H,x+=r*$,I+=r*V,C+=r*q,P+=r*W,k+=r*K,N+=r*G,A+=r*Y,T+=r*Q,M+=r*J,r=t[15],b+=r*U,w+=r*j,E+=r*D,S+=r*z,O+=r*B,R+=r*F,x+=r*H,I+=r*$,C+=r*V,P+=r*q,k+=r*W,N+=r*K,A+=r*G,T+=r*Y,M+=r*Q,L+=r*J,o+=38*w,s+=38*E,a+=38*S,c+=38*O,u+=38*R,l+=38*x,f+=38*I,h+=38*C,d+=38*P,p+=38*k,g+=38*N,y+=38*A,v+=38*T,m+=38*M,_+=38*L,i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=_,e[15]=b}function S(e,t){E(e,t,t)}function O(e,t){const n=i();let r;for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)S(n,n),2!==r&&4!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function R(e,t){const n=i();let r;for(r=0;r<16;r++)n[r]=t[r];for(r=250;r>=0;r--)S(n,n),1!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function x(e,t){const n=i(),r=i(),o=i(),s=i(),a=i(),u=i(),l=i(),f=i(),h=i();w(n,e[1],e[0]),w(h,t[1],t[0]),E(n,n,h),b(r,e[0],e[1]),b(h,t[0],t[1]),E(r,r,h),E(o,e[3],t[3]),E(o,o,c),E(s,e[2],t[2]),b(s,s,s),w(a,r,n),w(u,s,o),b(l,s,o),b(f,r,n),E(e[0],a,u),E(e[1],f,l),E(e[2],l,u),E(e[3],a,f)}function I(e,t,n){for(let r=0;r<4;r++)p(e[r],t[r],n)}function C(e,t){const n=i(),r=i(),o=i();O(o,t[2]),E(n,t[0],o),E(r,t[1],o),g(e,r),e[31]^=m(n)<<7}function P(e,t,n){h(e[0],o),h(e[1],s),h(e[2],s),h(e[3],o);for(let r=255;r>=0;--r){const i=n[r/8|0]>>(7&r)&1;I(e,t,i),x(t,e),x(e,e),I(e,t,i)}}function k(e,t){const n=[i(),i(),i(),i()];h(n[0],u),h(n[1],l),h(n[2],s),E(n[3],u,l),P(e,n,t)}function N(t){if(t.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const r=(0,n.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const o=new Uint8Array(32),s=[i(),i(),i(),i()];k(s,r),C(o,s);const a=new Uint8Array(64);return a.set(t),a.set(o,32),{publicKey:o,secretKey:a}}function A(e){const n=(0,t.randomBytes)(32,e),i=N(n);return(0,r.wipe)(n),i}function T(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(t.subarray(32))}e.generateKeyPairFromSeed=N,e.generateKeyPair=A,e.extractPublicKeyFromSecretKey=T;const M=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 L(e,t){let n,r,i,o;for(r=63;r>=32;--r){for(n=0,i=r-32,o=r-12;i<o;++i)t[i]+=n-16*t[r]*M[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=256*n;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*M[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*M[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function U(e){const t=new Float64Array(64);for(let n=0;n<64;n++)t[n]=e[n];for(let t=0;t<64;t++)e[t]=0;L(e,t)}function j(e,t){const r=new Float64Array(64),o=[i(),i(),i(),i()],s=(0,n.hash)(e.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;const a=new Uint8Array(64);a.set(s.subarray(32),32);const c=new n.SHA512;c.update(a.subarray(32)),c.update(t);const u=c.digest();c.clean(),U(u),k(o,u),C(a,o),c.reset(),c.update(a.subarray(0,32)),c.update(e.subarray(32)),c.update(t);const l=c.digest();U(l);for(let e=0;e<32;e++)r[e]=u[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=l[e]*s[t];return L(a.subarray(32),r),a}function D(e,t){const n=i(),r=i(),c=i(),u=i(),l=i(),d=i(),p=i();return h(e[2],s),_(e[1],t),S(c,e[1]),E(u,c,a),w(c,c,e[2]),b(u,e[2],u),S(l,u),S(d,l),E(p,d,l),E(n,p,c),E(n,n,u),R(n,n),E(n,n,c),E(n,n,u),E(n,n,u),E(e[0],n,u),S(r,e[0]),E(r,r,u),v(r,c)&&E(e[0],e[0],f),S(r,e[0]),E(r,r,u),v(r,c)?-1:(m(e[0])===t[31]>>7&&w(e[0],o,e[0]),E(e[3],e[0],e[1]),0)}function z(t,r,o){const s=new Uint8Array(32),a=[i(),i(),i(),i()],c=[i(),i(),i(),i()];if(o.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(D(c,t))return!1;const u=new n.SHA512;u.update(o.subarray(0,32)),u.update(t),u.update(r);const l=u.digest();return U(l),P(a,c,l),k(c,o.subarray(32)),x(a,c),C(s,a),!y(o,s)}function B(e){let t=[i(),i(),i(),i()];if(D(t,e))throw new Error("Ed25519: invalid public key");let n=i(),r=i(),o=t[1];b(n,s,o),w(r,s,o),O(r,r),E(n,n,r);let a=new Uint8Array(32);return g(a,n),a}function F(e){const t=(0,n.hash)(e.subarray(0,32));t[0]&=248,t[31]&=127,t[31]|=64;const i=new Uint8Array(t.subarray(0,32));return(0,r.wipe)(t),i}e.sign=j,e.verify=z,e.convertPublicKeyToX25519=B,e.convertSecretKeyToX25519=F}(ar);const ii="EdDSA",oi="JWT",si=".",ai="base64url",ci="utf8",ui="utf8",li=":",fi="did",hi="key",di="base58btc",pi="z",gi="K36",yi=32;function vi(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function mi(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?vi(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function _i(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const n=mi(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return vi(n)}function bi(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==n[s])throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var f=t[i],h=0,d=s-1;(0!==f||h<r)&&-1!==d;d--,h++)f+=256*u[d]>>>0,u[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=h,i++}for(var p=s-r;p!==s&&0===u[p];)p++;for(var g=c.repeat(n);p<s;++p)g+=e.charAt(u[p]);return g}function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*s[h]>>>0,s[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(r+(o-d)),g=r;d!==o;)p[g++]=s[d++];return p}}}function d(e){var n=h(e);if(n)return n;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:d}}var wi=bi;const Ei=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Si=e=>(new TextEncoder).encode(e),Oi=e=>(new TextDecoder).decode(e);class Ri{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xi{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return Ci(this,e)}}class Ii{constructor(e){this.decoders=e}or(e){return Ci(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 Ci=(e,t)=>new Ii({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Pi{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Ri(e,t,n),this.decoder=new xi(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ki=({name:e,prefix:t,encode:n,decode:r})=>new Pi(e,t,n,r),Ni=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:i}=wi(n,t);return ki({prefix:e,name:t,encode:r,decode:e=>Ei(i(e))})},Ai=(e,t,n,r)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*n/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${r} character`);c=c<<n|o,a+=n,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},Ti=(e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let o="",s=0,a=0;for(let r=0;r<e.length;++r)for(a=a<<8|e[r],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o},Mi=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>ki({prefix:t,name:e,encode:e=>Ti(e,r,n),decode:t=>Ai(t,r,n,e)}),Li=ki({prefix:"\0",name:"identity",encode:e=>Oi(e),decode:e=>Si(e)});var Ui=Object.freeze({__proto__:null,identity:Li});const ji=Mi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Di=Object.freeze({__proto__:null,base2:ji});const zi=Mi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Bi=Object.freeze({__proto__:null,base8:zi});const Fi=Ni({prefix:"9",name:"base10",alphabet:"0123456789"});var Hi=Object.freeze({__proto__:null,base10:Fi});const $i=Mi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Vi=Mi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qi=Object.freeze({__proto__:null,base16:$i,base16upper:Vi});const Wi=Mi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ki=Mi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gi=Mi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Yi=Mi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Qi=Mi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zi=Mi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),eo=Mi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),to=Mi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),no=Mi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ro=Object.freeze({__proto__:null,base32:Wi,base32upper:Ki,base32pad:Gi,base32padupper:Yi,base32hex:Qi,base32hexupper:Zi,base32hexpad:eo,base32hexpadupper:to,base32z:no});const io=Ni({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),oo=Ni({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var so=Object.freeze({__proto__:null,base36:io,base36upper:oo});const ao=Ni({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),co=Ni({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var uo=Object.freeze({__proto__:null,base58btc:ao,base58flickr:co});const lo=Mi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),fo=Mi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ho=Mi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),po=Mi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var go=Object.freeze({__proto__:null,base64:lo,base64pad:fo,base64url:ho,base64urlpad:po});const yo=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),vo=yo.reduce(((e,t,n)=>(e[n]=t,e)),[]),mo=yo.reduce(((e,t,n)=>(e[t.codePointAt(0)]=n,e)),[]);function _o(e){return e.reduce(((e,t)=>e+=vo[t]),"")}function bo(e){const t=[];for(const n of e){const e=mo[n.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}const wo=ki({prefix:"🚀",name:"base256emoji",encode:_o,decode:bo});var Eo=Object.freeze({__proto__:null,base256emoji:wo}),So=Io,Oo=128,Ro=-128,xo=Math.pow(2,31);function Io(e,t,n){t=t||[];for(var r=n=n||0;e>=xo;)t[n++]=255&e|Oo,e/=128;for(;e&Ro;)t[n++]=255&e|Oo,e>>>=7;return t[n]=0|e,Io.bytes=n-r+1,t}var Co=No,Po=128,ko=127;function No(e,t){var n,r=0,i=0,o=t=t||0,s=e.length;do{if(o>=s)throw No.bytes=0,new RangeError("Could not decode varint");n=e[o++],r+=i<28?(n&ko)<<i:(n&ko)*Math.pow(2,i),i+=7}while(n>=Po);return No.bytes=o-t,r}var Ao=Math.pow(2,7),To=Math.pow(2,14),Mo=Math.pow(2,21),Lo=Math.pow(2,28),Uo=Math.pow(2,35),jo=Math.pow(2,42),Do=Math.pow(2,49),zo=Math.pow(2,56),Bo=Math.pow(2,63),Fo={encode:So,decode:Co,encodingLength:function(e){return e<Ao?1:e<To?2:e<Mo?3:e<Lo?4:e<Uo?5:e<jo?6:e<Do?7:e<zo?8:e<Bo?9:10}},Ho=Fo;const $o=(e,t,n=0)=>(Ho.encode(e,t,n),t),Vo=e=>Ho.encodingLength(e),qo=(e,t)=>{const n=t.byteLength,r=Vo(e),i=r+Vo(n),o=new Uint8Array(i+n);return $o(e,o,0),$o(n,o,r),o.set(t,i),new Wo(e,n,t,o)};class Wo{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const Ko=({name:e,code:t,encode:n})=>new Go(e,t,n);class Go{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?qo(this.code,t):t.then((e=>qo(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Yo=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Qo=Ko({name:"sha2-256",code:18,encode:Yo("SHA-256")}),Jo=Ko({name:"sha2-512",code:19,encode:Yo("SHA-512")});Object.freeze({__proto__:null,sha256:Qo,sha512:Jo});const Xo=0,Zo="identity",es=Ei;Object.freeze({__proto__:null,identity:{code:Xo,name:Zo,encode:es,digest:e=>qo(Xo,es(e))}}),new TextEncoder,new TextDecoder;const ts={...Ui,...Di,...Bi,...Hi,...qi,...ro,...so,...uo,...go,...Eo};function ns(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}const rs=ns("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),is=ns("ascii","a",(e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}),(e=>{const t=mi((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t})),os={utf8:rs,"utf-8":rs,hex:ts.base16,latin1:is,ascii:is,binary:is,...ts};function ss(e,t="utf8"){const n=os[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}function as(e,t="utf8"){const n=os[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode(`${n.prefix}${e}`):vi(globalThis.Buffer.from(e,"utf-8"))}function cs(e){return ss(as(sr(e),ci),ai)}function us(e){const t=as(gi,di),n=pi+ss(_i([t,e]),di);return[fi,hi,n].join(li)}function ls(e){return ss(e,ai)}function fs(e){return as([cs(e.header),cs(e.payload)].join(si),ui)}function hs(e){return[cs(e.header),cs(e.payload),ls(e.signature)].join(si)}function ds(e=cr.randomBytes(yi)){return ar.generateKeyPairFromSeed(e)}async function ps(e,t,n,r,i=We.fromMiliseconds(Date.now())){const o={alg:ii,typ:oi},s={iss:us(r.publicKey),sub:e,aud:t,iat:i,exp:i+n},a=fs({header:o,payload:s});return hs({header:o,payload:s,signature:ar.sign(r.secretKey,a)})}var gs={},ys={};Object.defineProperty(ys,"__esModule",{value:!0});var vs=Or,ms=gr,_s=20;function bs(e,t,n){for(var r=1634760805,i=857760878,o=2036477234,s=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],u=n[11]<<24|n[10]<<16|n[9]<<8|n[8],l=n[15]<<24|n[14]<<16|n[13]<<8|n[12],f=n[19]<<24|n[18]<<16|n[17]<<8|n[16],h=n[23]<<24|n[22]<<16|n[21]<<8|n[20],d=n[27]<<24|n[26]<<16|n[25]<<8|n[24],p=n[31]<<24|n[30]<<16|n[29]<<8|n[28],g=t[3]<<24|t[2]<<16|t[1]<<8|t[0],y=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=r,b=i,w=o,E=s,S=a,O=c,R=u,x=l,I=f,C=h,P=d,k=p,N=g,A=y,T=v,M=m,L=0;L<_s;L+=2)S=(S^=I=I+(N=(N^=_=_+S|0)>>>16|N<<16)|0)>>>20|S<<12,O=(O^=C=C+(A=(A^=b=b+O|0)>>>16|A<<16)|0)>>>20|O<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>16|T<<16)|0)>>>20|R<<12,x=(x^=k=k+(M=(M^=E=E+x|0)>>>16|M<<16)|0)>>>20|x<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>24|T<<8)|0)>>>25|R<<7,x=(x^=k=k+(M=(M^=E=E+x|0)>>>24|M<<8)|0)>>>25|x<<7,O=(O^=C=C+(A=(A^=b=b+O|0)>>>24|A<<8)|0)>>>25|O<<7,S=(S^=I=I+(N=(N^=_=_+S|0)>>>24|N<<8)|0)>>>25|S<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>16|M<<16)|0)>>>20|O<<12,R=(R^=k=k+(N=(N^=b=b+R|0)>>>16|N<<16)|0)>>>20|R<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>16|A<<16)|0)>>>20|x<<12,S=(S^=C=C+(T=(T^=E=E+S|0)>>>16|T<<16)|0)>>>20|S<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>24|A<<8)|0)>>>25|x<<7,S=(S^=C=C+(T=(T^=E=E+S|0)>>>24|T<<8)|0)>>>25|S<<7,R=(R^=k=k+(N=(N^=b=b+R|0)>>>24|N<<8)|0)>>>25|R<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>24|M<<8)|0)>>>25|O<<7;vs.writeUint32LE(_+r|0,e,0),vs.writeUint32LE(b+i|0,e,4),vs.writeUint32LE(w+o|0,e,8),vs.writeUint32LE(E+s|0,e,12),vs.writeUint32LE(S+a|0,e,16),vs.writeUint32LE(O+c|0,e,20),vs.writeUint32LE(R+u|0,e,24),vs.writeUint32LE(x+l|0,e,28),vs.writeUint32LE(I+f|0,e,32),vs.writeUint32LE(C+h|0,e,36),vs.writeUint32LE(P+d|0,e,40),vs.writeUint32LE(k+p|0,e,44),vs.writeUint32LE(N+g|0,e,48),vs.writeUint32LE(A+y|0,e,52),vs.writeUint32LE(T+v|0,e,56),vs.writeUint32LE(M+m|0,e,60)}function ws(e,t,n,r,i){if(void 0===i&&(i=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(r.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(0===i){if(8!==t.length&&12!==t.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=(o=new Uint8Array(16)).length-t.length,o.set(t,s)}else{if(16!==t.length)throw new Error("ChaCha nonce with counter must be 16 bytes");o=t,s=i}for(var a=new Uint8Array(64),c=0;c<n.length;c+=64){bs(a,o,e);for(var u=c;u<c+64&&u<n.length;u++)r[u]=n[u]^a[u-c];Ss(o,0,s)}return ms.wipe(a),0===i&&ms.wipe(o),r}function Es(e,t,n,r){return void 0===r&&(r=0),ms.wipe(n),ws(e,t,n,n,r)}function Ss(e,t,n){for(var r=1;n--;)r=r+(255&e[t])|0,e[t]=255&r,r>>>=8,t++;if(r>0)throw new Error("ChaCha: counter overflow")}ys.streamXOR=ws,ys.stream=Es;var Os={},Rs={};function xs(e,t,n){return~(e-1)&t|e-1&n}function Is(e,t){return(0|e)-(0|t)-1>>>31&1}function Cs(e,t){if(e.length!==t.length)return 0;for(var n=0,r=0;r<e.length;r++)n|=e[r]^t[r];return 1&n-1>>>8}function Ps(e,t){return 0!==e.length&&0!==t.length&&0!==Cs(e,t)}Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.select=xs,Rs.lessOrEqual=Is,Rs.compare=Cs,Rs.equal=Ps,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Rs,n=gr;e.DIGEST_LENGTH=16;var r=function(){function t(t){this.digestLength=e.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 n=t[0]|t[1]<<8;this._r[0]=8191&n;var r=t[2]|t[3]<<8;this._r[1]=8191&(n>>>13|r<<3);var i=t[4]|t[5]<<8;this._r[2]=7939&(r>>>10|i<<6);var o=t[6]|t[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=t[8]|t[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var u=t[14]|t[15]<<8;this._r[8]=8191&(c>>>8|u<<8),this._r[9]=u>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(e,t,n){for(var r=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],u=this._h[5],l=this._h[6],f=this._h[7],h=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],y=this._r[2],v=this._r[3],m=this._r[4],_=this._r[5],b=this._r[6],w=this._r[7],E=this._r[8],S=this._r[9];n>=16;){var O=e[t+0]|e[t+1]<<8;i+=8191&O;var R=e[t+2]|e[t+3]<<8;o+=8191&(O>>>13|R<<3);var x=e[t+4]|e[t+5]<<8;s+=8191&(R>>>10|x<<6);var I=e[t+6]|e[t+7]<<8;a+=8191&(x>>>7|I<<9);var C=e[t+8]|e[t+9]<<8;c+=8191&(I>>>4|C<<12),u+=C>>>1&8191;var P=e[t+10]|e[t+11]<<8;l+=8191&(C>>>14|P<<2);var k=e[t+12]|e[t+13]<<8;f+=8191&(P>>>11|k<<5);var N=e[t+14]|e[t+15]<<8,A=0,T=A;T+=i*p,T+=o*(5*S),T+=s*(5*E),T+=a*(5*w),A=(T+=c*(5*b))>>>13,T&=8191,T+=u*(5*_),T+=l*(5*m),T+=f*(5*v),T+=(h+=8191&(k>>>8|N<<8))*(5*y);var M=A+=(T+=(d+=N>>>5|r)*(5*g))>>>13;M+=i*g,M+=o*p,M+=s*(5*S),M+=a*(5*E),A=(M+=c*(5*w))>>>13,M&=8191,M+=u*(5*b),M+=l*(5*_),M+=f*(5*m),M+=h*(5*v),A+=(M+=d*(5*y))>>>13,M&=8191;var L=A;L+=i*y,L+=o*g,L+=s*p,L+=a*(5*S),A=(L+=c*(5*E))>>>13,L&=8191,L+=u*(5*w),L+=l*(5*b),L+=f*(5*_),L+=h*(5*m);var U=A+=(L+=d*(5*v))>>>13;U+=i*v,U+=o*y,U+=s*g,U+=a*p,A=(U+=c*(5*S))>>>13,U&=8191,U+=u*(5*E),U+=l*(5*w),U+=f*(5*b),U+=h*(5*_);var j=A+=(U+=d*(5*m))>>>13;j+=i*m,j+=o*v,j+=s*y,j+=a*g,A=(j+=c*p)>>>13,j&=8191,j+=u*(5*S),j+=l*(5*E),j+=f*(5*w),j+=h*(5*b);var D=A+=(j+=d*(5*_))>>>13;D+=i*_,D+=o*m,D+=s*v,D+=a*y,A=(D+=c*g)>>>13,D&=8191,D+=u*p,D+=l*(5*S),D+=f*(5*E),D+=h*(5*w);var z=A+=(D+=d*(5*b))>>>13;z+=i*b,z+=o*_,z+=s*m,z+=a*v,A=(z+=c*y)>>>13,z&=8191,z+=u*g,z+=l*p,z+=f*(5*S),z+=h*(5*E);var B=A+=(z+=d*(5*w))>>>13;B+=i*w,B+=o*b,B+=s*_,B+=a*m,A=(B+=c*v)>>>13,B&=8191,B+=u*y,B+=l*g,B+=f*p,B+=h*(5*S);var F=A+=(B+=d*(5*E))>>>13;F+=i*E,F+=o*w,F+=s*b,F+=a*_,A=(F+=c*m)>>>13,F&=8191,F+=u*v,F+=l*y,F+=f*g,F+=h*p;var H=A+=(F+=d*(5*S))>>>13;H+=i*S,H+=o*E,H+=s*w,H+=a*b,A=(H+=c*_)>>>13,H&=8191,H+=u*m,H+=l*v,H+=f*y,H+=h*g,i=T=8191&(A=(A=((A+=(H+=d*p)>>>13)<<2)+A|0)+(T&=8191)|0),o=M+=A>>>=13,s=L&=8191,a=U&=8191,c=j&=8191,u=D&=8191,l=z&=8191,f=B&=8191,h=F&=8191,d=H&=8191,t+=16,n-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=u,this._h[6]=l,this._h[7]=f,this._h[8]=h,this._h[9]=d},t.prototype.finish=function(e,t){void 0===t&&(t=0);var n,r,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(n=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=n,n=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*n,n=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=n,n=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=n,s[0]=this._h[0]+5,n=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+n,n=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,r=(1^n)-1,o=0;o<10;o++)s[o]&=r;for(r=~r,o=0;o<10;o++)this._h[o]=this._h[o]&r|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var t,n=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[n+i];if(r-=t,n+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(r>=16&&(t=r-r%16,this._blocks(e,n,t),n+=t,r-=t),r){for(i=0;i<r;i++)this._buffer[this._leftover+i]=e[n+i];this._leftover+=r}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();function i(e,t){var n=new r(e);n.update(t);var i=n.digest();return n.clean(),i}function o(n,r){return n.length===e.DIGEST_LENGTH&&r.length===e.DIGEST_LENGTH&&t.equal(n,r)}e.Poly1305=r,e.oneTimeAuth=i,e.equal=o}(Os),function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ys,n=Os,r=gr,i=Or,o=Rs;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var s=new Uint8Array(16),a=function(){function a(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return a.prototype.seal=function(e,n,i,o){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);t.stream(this._key,s,a,4);var c,u=n.length+this.tagLength;if(o){if(o.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");c=o}else c=new Uint8Array(u);return t.streamXOR(this._key,s,n,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),i),r.wipe(s),c},a.prototype.open=function(e,n,i,s){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(n.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);t.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,n.subarray(0,n.length-this.tagLength),i),!o.equal(u,n.subarray(n.length-this.tagLength,n.length)))return null;var l,f=n.length-this.tagLength;if(s){if(s.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");l=s}else l=new Uint8Array(f);return t.streamXOR(this._key,a,n.subarray(0,n.length-this.tagLength),l,4),r.wipe(a),l},a.prototype.clean=function(){return r.wipe(this._key),this},a.prototype._authenticate=function(e,t,o,a){var c=new n.Poly1305(t);a&&(c.update(a),a.length%16>0&&c.update(s.subarray(a.length%16))),c.update(o),o.length%16>0&&c.update(s.subarray(o.length%16));var u=new Uint8Array(8);a&&i.writeUint64LE(a.length,u),c.update(u),i.writeUint64LE(o.length,u),c.update(u);for(var l=c.digest(),f=0;f<l.length;f++)e[f]=l[f];c.clean(),r.wipe(l),r.wipe(u)},a}();e.ChaCha20Poly1305=a}(gs);var ks={},Ns={},As={};function Ts(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}Object.defineProperty(As,"__esModule",{value:!0}),As.isSerializableHash=Ts,Object.defineProperty(Ns,"__esModule",{value:!0});var Ms=As,Ls=Rs,Us=gr,js=function(){function e(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);for(var r=0;r<n.length;r++)n[r]^=54;for(this._inner.update(n),r=0;r<n.length;r++)n[r]^=106;this._outer.update(n),Ms.isSerializableHash(this._inner)&&Ms.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Us.wipe(n)}return e.prototype.reset=function(){if(!Ms.isSerializableHash(this._inner)||!Ms.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},e.prototype.clean=function(){Ms.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ms.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.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)},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!Ms.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!Ms.isSerializableHash(this._inner)||!Ms.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},e.prototype.cleanSavedState=function(e){if(!Ms.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();function Ds(e,t,n){var r=new js(e,t);r.update(n);var i=r.digest();return r.clean(),i}Ns.HMAC=js,Ns.hmac=Ds,Ns.equal=Ls.equal,Object.defineProperty(ks,"__esModule",{value:!0});var zs=Ns,Bs=gr,Fs=function(){function e(e,t,n,r){void 0===n&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=r;var i=zs.hmac(this._hash,n,t);this._hmac=new zs.HMAC(e,i),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)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},e.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),Bs.wipe(this._buffer),Bs.wipe(this._counter),this._bufpos=0},e}(),Hs=ks.HKDF=Fs,$s={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Or,n=gr;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var r=function(){function r(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 r.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},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=o(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var n=this._bytesHashed,r=this._bufferLength,i=n/536870912|0,s=n<<3,a=n%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/4;c++)t.writeUint32BE(this._state[c],e,4*c);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();e.SHA256=r;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(e,n,r,o,s){for(;s>=64;){for(var a=n[0],c=n[1],u=n[2],l=n[3],f=n[4],h=n[5],d=n[6],p=n[7],g=0;g<16;g++){var y=o+4*g;e[g]=t.readUint32BE(r,y)}for(g=16;g<64;g++){var v=e[g-2],m=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,_=((v=e[g-15])>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;e[g]=(m+e[g-7]|0)+(_+e[g-16]|0)}for(g=0;g<64;g++)m=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&h^~f&d)|0)+(p+(i[g]+e[g]|0)|0)|0,_=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&u^c&u)|0,p=d,d=h,h=f,f=l+m|0,l=u,u=c,c=a,a=m+_|0;n[0]+=a,n[1]+=c,n[2]+=u,n[3]+=l,n[4]+=f,n[5]+=h,n[6]+=d,n[7]+=p,o+=64,s-=64}return o}function s(e){var t=new r;t.update(e);var n=t.digest();return t.clean(),n}e.hash=s}($s);var Vs={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=cr,n=gr;function r(e){const t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;const i=new Uint8Array(32);i[0]=9;const o=r([56129,1]);function s(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function a(e,t,n){const r=~(n-1);for(let n=0;n<16;n++){const i=r&(e[n]^t[n]);e[n]^=i,t[n]^=i}}function c(e,t){const n=r(),i=r();for(let e=0;e<16;e++)i[e]=t[e];s(i),s(i),s(i);for(let e=0;e<2;e++){n[0]=i[0]-65517;for(let e=1;e<15;e++)n[e]=i[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=i[15]-32767-(n[14]>>16&1);const e=n[15]>>16&1;n[14]&=65535,a(i,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}function u(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function l(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function f(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function h(e,t,n){let r,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,g=0,y=0,v=0,m=0,_=0,b=0,w=0,E=0,S=0,O=0,R=0,x=0,I=0,C=0,P=0,k=0,N=0,A=0,T=0,M=0,L=0,U=n[0],j=n[1],D=n[2],z=n[3],B=n[4],F=n[5],H=n[6],$=n[7],V=n[8],q=n[9],W=n[10],K=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];r=t[0],o+=r*U,s+=r*j,a+=r*D,c+=r*z,u+=r*B,l+=r*F,f+=r*H,h+=r*$,d+=r*V,p+=r*q,g+=r*W,y+=r*K,v+=r*G,m+=r*Y,_+=r*Q,b+=r*J,r=t[1],s+=r*U,a+=r*j,c+=r*D,u+=r*z,l+=r*B,f+=r*F,h+=r*H,d+=r*$,p+=r*V,g+=r*q,y+=r*W,v+=r*K,m+=r*G,_+=r*Y,b+=r*Q,w+=r*J,r=t[2],a+=r*U,c+=r*j,u+=r*D,l+=r*z,f+=r*B,h+=r*F,d+=r*H,p+=r*$,g+=r*V,y+=r*q,v+=r*W,m+=r*K,_+=r*G,b+=r*Y,w+=r*Q,E+=r*J,r=t[3],c+=r*U,u+=r*j,l+=r*D,f+=r*z,h+=r*B,d+=r*F,p+=r*H,g+=r*$,y+=r*V,v+=r*q,m+=r*W,_+=r*K,b+=r*G,w+=r*Y,E+=r*Q,S+=r*J,r=t[4],u+=r*U,l+=r*j,f+=r*D,h+=r*z,d+=r*B,p+=r*F,g+=r*H,y+=r*$,v+=r*V,m+=r*q,_+=r*W,b+=r*K,w+=r*G,E+=r*Y,S+=r*Q,O+=r*J,r=t[5],l+=r*U,f+=r*j,h+=r*D,d+=r*z,p+=r*B,g+=r*F,y+=r*H,v+=r*$,m+=r*V,_+=r*q,b+=r*W,w+=r*K,E+=r*G,S+=r*Y,O+=r*Q,R+=r*J,r=t[6],f+=r*U,h+=r*j,d+=r*D,p+=r*z,g+=r*B,y+=r*F,v+=r*H,m+=r*$,_+=r*V,b+=r*q,w+=r*W,E+=r*K,S+=r*G,O+=r*Y,R+=r*Q,x+=r*J,r=t[7],h+=r*U,d+=r*j,p+=r*D,g+=r*z,y+=r*B,v+=r*F,m+=r*H,_+=r*$,b+=r*V,w+=r*q,E+=r*W,S+=r*K,O+=r*G,R+=r*Y,x+=r*Q,I+=r*J,r=t[8],d+=r*U,p+=r*j,g+=r*D,y+=r*z,v+=r*B,m+=r*F,_+=r*H,b+=r*$,w+=r*V,E+=r*q,S+=r*W,O+=r*K,R+=r*G,x+=r*Y,I+=r*Q,C+=r*J,r=t[9],p+=r*U,g+=r*j,y+=r*D,v+=r*z,m+=r*B,_+=r*F,b+=r*H,w+=r*$,E+=r*V,S+=r*q,O+=r*W,R+=r*K,x+=r*G,I+=r*Y,C+=r*Q,P+=r*J,r=t[10],g+=r*U,y+=r*j,v+=r*D,m+=r*z,_+=r*B,b+=r*F,w+=r*H,E+=r*$,S+=r*V,O+=r*q,R+=r*W,x+=r*K,I+=r*G,C+=r*Y,P+=r*Q,k+=r*J,r=t[11],y+=r*U,v+=r*j,m+=r*D,_+=r*z,b+=r*B,w+=r*F,E+=r*H,S+=r*$,O+=r*V,R+=r*q,x+=r*W,I+=r*K,C+=r*G,P+=r*Y,k+=r*Q,N+=r*J,r=t[12],v+=r*U,m+=r*j,_+=r*D,b+=r*z,w+=r*B,E+=r*F,S+=r*H,O+=r*$,R+=r*V,x+=r*q,I+=r*W,C+=r*K,P+=r*G,k+=r*Y,N+=r*Q,A+=r*J,r=t[13],m+=r*U,_+=r*j,b+=r*D,w+=r*z,E+=r*B,S+=r*F,O+=r*H,R+=r*$,x+=r*V,I+=r*q,C+=r*W,P+=r*K,k+=r*G,N+=r*Y,A+=r*Q,T+=r*J,r=t[14],_+=r*U,b+=r*j,w+=r*D,E+=r*z,S+=r*B,O+=r*F,R+=r*H,x+=r*$,I+=r*V,C+=r*q,P+=r*W,k+=r*K,N+=r*G,A+=r*Y,T+=r*Q,M+=r*J,r=t[15],b+=r*U,w+=r*j,E+=r*D,S+=r*z,O+=r*B,R+=r*F,x+=r*H,I+=r*$,C+=r*V,P+=r*q,k+=r*W,N+=r*K,A+=r*G,T+=r*Y,M+=r*Q,L+=r*J,o+=38*w,s+=38*E,a+=38*S,c+=38*O,u+=38*R,l+=38*x,f+=38*I,h+=38*C,d+=38*P,p+=38*k,g+=38*N,y+=38*A,v+=38*T,m+=38*M,_+=38*L,i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=_,e[15]=b}function d(e,t){h(e,t,t)}function p(e,t){const n=r();for(let e=0;e<16;e++)n[e]=t[e];for(let e=253;e>=0;e--)d(n,n),2!==e&&4!==e&&h(n,n,t);for(let t=0;t<16;t++)e[t]=n[t]}function g(e,t){const n=new Uint8Array(32),i=new Float64Array(80),s=r(),g=r(),y=r(),v=r(),m=r(),_=r();for(let t=0;t<31;t++)n[t]=e[t];n[31]=127&e[31]|64,n[0]&=248,u(i,t);for(let e=0;e<16;e++)g[e]=i[e];s[0]=v[0]=1;for(let e=254;e>=0;--e){const t=n[e>>>3]>>>(7&e)&1;a(s,g,t),a(y,v,t),l(m,s,y),f(s,s,y),l(y,g,v),f(g,g,v),d(v,m),d(_,s),h(s,y,s),h(y,g,m),l(m,s,y),f(s,s,y),d(g,s),f(y,v,_),h(s,y,o),l(s,s,v),h(y,y,s),h(s,v,_),h(v,g,i),d(g,m),a(s,g,t),a(y,v,t)}for(let e=0;e<16;e++)i[e+16]=s[e],i[e+32]=y[e],i[e+48]=g[e],i[e+64]=v[e];const b=i.subarray(32),w=i.subarray(16);p(b,b),h(w,w,b);const E=new Uint8Array(32);return c(E,w),E}function y(e){return g(e,i)}function v(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const n=new Uint8Array(t);return{publicKey:y(n),secretKey:n}}function m(e){const r=(0,t.randomBytes)(32,e),i=v(r);return(0,n.wipe)(r),i}function _(t,n,r=!1){if(t.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(n.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const i=g(t,n);if(r){let e=0;for(let t=0;t<i.length;t++)e|=i[t];if(0===e)throw new Error("X25519: invalid shared key")}return i}e.scalarMult=g,e.scalarMultBase=y,e.generateKeyPairFromSeed=v,e.generateKeyPair=m,e.sharedKey=_}(Vs);var qs=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Ws=function(){function e(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return e}(),Ks=function(){function e(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return e}(),Gs=function(){function e(e,t,n,r){this.name=e,this.version=t,this.os=n,this.bot=r,this.type="bot-device"}return e}(),Ys=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Qs=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Js=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xs=3,Zs=[["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",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],ea=[["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 ta(e){return e?ra(e):typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product?new Qs:typeof navigator<"u"?ra(navigator.userAgent):oa()}function na(e){return""!==e&&Zs.reduce((function(t,n){var r=n[0],i=n[1];if(t)return t;var o=i.exec(e);return!!o&&[r,o]}),!1)}function ra(e){var t=na(e);if(!t)return null;var n=t[0],r=t[1];if("searchbot"===n)return new Ys;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<Xs&&(i=qs(qs([],i,!0),sa(Xs-i.length),!0)):i=[];var o=i.join("."),s=ia(e),a=Js.exec(e);return a&&a[1]?new Gs(n,o,s,a[1]):new Ws(n,o,s)}function ia(e){for(var t=0,n=ea.length;t<n;t++){var r=ea[t],i=r[0];if(r[1].exec(e))return i}return null}function oa(){return typeof process<"u"&&process.version?new Ks(process.version.slice(1)):null}function sa(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}var aa={};function ca(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}function ua(e){const t=ca(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}function la(){return ua("document")}function fa(){return ca("document")}Object.defineProperty(aa,"__esModule",{value:!0}),aa.getLocalStorage=aa.getLocalStorageOrThrow=aa.getCrypto=aa.getCryptoOrThrow=ma=aa.getLocation=aa.getLocationOrThrow=ga=aa.getNavigator=aa.getNavigatorOrThrow=ha=aa.getDocument=aa.getDocumentOrThrow=aa.getFromWindowOrThrow=aa.getFromWindow=void 0,aa.getFromWindow=ca,aa.getFromWindowOrThrow=ua,aa.getDocumentOrThrow=la;var ha=aa.getDocument=fa;function da(){return ua("navigator")}function pa(){return ca("navigator")}aa.getNavigatorOrThrow=da;var ga=aa.getNavigator=pa;function ya(){return ua("location")}function va(){return ca("location")}aa.getLocationOrThrow=ya;var ma=aa.getLocation=va;function _a(){return ua("crypto")}function ba(){return ca("crypto")}function wa(){return ua("localStorage")}function Ea(){return ca("localStorage")}aa.getCryptoOrThrow=_a,aa.getCrypto=ba,aa.getLocalStorageOrThrow=wa,aa.getLocalStorage=Ea;var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});var Oa=Sa.getWindowMetadata=void 0;const Ra=aa;function xa(){let e,t;try{e=Ra.getDocumentOrThrow(),t=Ra.getLocationOrThrow()}catch{return null}function n(){const n=e.getElementsByTagName("link"),r=[];for(let e=0;e<n.length;e++){const i=n[e],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let n=t.protocol+"//"+t.host;if(0===e.indexOf("/"))n+=e;else{const r=t.pathname.split("/");r.pop(),n+=r.join("/")+"/"+e}r.push(n)}else if(0===e.indexOf("//")){const n=t.protocol+e;r.push(n)}else r.push(e)}}return r}function r(...t){const n=e.getElementsByTagName("meta");for(let e=0;e<n.length;e++){const r=n[e],i=["itemprop","property","name"].map((e=>r.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=r.getAttribute("content");if(e)return e}}return""}function i(){let t=r("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}function o(){return r("description","og:description","twitter:description","keywords")}const s=i();return{description:o(),url:t.origin,icons:n(),name:s}}Oa=Sa.getWindowMetadata=xa;var Ia={},Ca=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),Pa="%[a-f0-9]{2}",ka=new RegExp("("+Pa+")|([^%]+?)","gi"),Na=new RegExp("("+Pa+")+","gi");function Aa(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Aa(n),Aa(r))}function Ta(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(ka)||[],n=1;n<t.length;n++)t=(e=Aa(t,n).join("")).match(ka)||[];return e}}function Ma(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=Na.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{var r=Ta(n[0]);r!==n[0]&&(t[n[0]]=r)}n=Na.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),o=0;o<i.length;o++){var s=i[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}var La=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Ma(e)}},Ua=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]},ja=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),o=0;o<r.length;o++){var s=r[o],a=e[s];(i?-1!==t.indexOf(s):t(s,a,e))&&(n[s]=a)}return n};!function(e){const t=Ca,n=La,r=Ua,i=ja,o=e=>null==e,s=Symbol("encodeFragmentIdentifier");function a(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",i,"]"].join("")]:[...n,[l(t,e),"[",l(i,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[l(n,e),t,l(i,e)].join("")]:[[r,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}function c(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&f(n,e).includes(e.arrayFormatSeparator);n=o?f(n,e):n;const s=i||o?n.split(e.arrayFormatSeparator).map((t=>f(t,e))):null===n?n:f(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n&&f(n,e));const o=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>f(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}function u(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function f(e,t){return t.decode?n(e):e}function h(e){return Array.isArray(e)?e.sort():"object"==typeof e?h(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}function g(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function y(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function v(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=c(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const o of e.split("&")){if(""===o)continue;let[e,s]=r(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:f(s,t),n(f(e,t),s,i)}for(const e of Object.keys(i)){const n=i[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=y(n[e],t);else i[e]=y(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const n=i[t];return n&&"object"==typeof n&&!Array.isArray(n)?e[t]=h(n):e[t]=n,e}),Object.create(null))}e.extract=g,e.parse=v,e.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&o(e[n])||t.skipEmptyString&&""===e[n],r=a(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map((n=>{const i=e[n];return void 0===i?"":null===i?l(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":i.reduce(r(n),[]).join("&"):l(n,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:v(g(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:f(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=d(t.url).split("?")[0]||"",i=e.extract(t.url),o=e.parse(i,{sort:!1}),a=Object.assign(o,t.query);let c=e.stringify(a,n);c&&(c=`?${c}`);let u=p(t.url);return t.fragmentIdentifier&&(u=`#${n[s]?l(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${c}${u}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:a,fragmentIdentifier:c}=e.parseUrl(t,r);return e.stringifyUrl({url:o,query:i(a,n),fragmentIdentifier:c},r)},e.exclude=(t,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}}(Ia);const Da={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function za(e,t){return e.includes(":")?[e]:t.chains||[]}const Ba="base10",Fa="base16",Ha="base64pad",$a="utf8",Va=0,qa=1,Wa=0,Ka=1,Ga=12,Ya=32;function Qa(){const e=Vs.generateKeyPair();return{privateKey:ss(e.secretKey,Fa),publicKey:ss(e.publicKey,Fa)}}function Ja(){return ss(cr.randomBytes(Ya),Fa)}function Xa(e,t){const n=Vs.sharedKey(as(e,Fa),as(t,Fa));return ss(new Hs($s.SHA256,n).expand(Ya),Fa)}function Za(e){return ss($s.hash(as(e,Fa)),Fa)}function ec(e){return ss($s.hash(as(e,$a)),Fa)}function tc(e){return as(`${e}`,Ba)}function nc(e){return Number(ss(e,Ba))}function rc(e){const t=tc(typeof e.type<"u"?e.type:Va);if(nc(t)===qa&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof e.senderPublicKey<"u"?as(e.senderPublicKey,Fa):void 0,r=typeof e.iv<"u"?as(e.iv,Fa):cr.randomBytes(Ga);return oc({type:t,sealed:new gs.ChaCha20Poly1305(as(e.symKey,Fa)).seal(r,as(e.message,$a)),iv:r,senderPublicKey:n})}function ic(e){const t=new gs.ChaCha20Poly1305(as(e.symKey,Fa)),{sealed:n,iv:r}=sc(e.encoded),i=t.open(r,n);if(null===i)throw new Error("Failed to decrypt");return ss(i,$a)}function oc(e){if(nc(e.type)===qa){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ss(_i([e.type,e.senderPublicKey,e.iv,e.sealed]),Ha)}return ss(_i([e.type,e.iv,e.sealed]),Ha)}function sc(e){const t=as(e,Ha),n=t.slice(Wa,Ka),r=Ka;if(nc(n)===qa){const e=r+Ya,i=e+Ga,o=t.slice(r,e),s=t.slice(e,i);return{type:n,sealed:t.slice(i),iv:s,senderPublicKey:o}}const i=r+Ga,o=t.slice(r,i);return{type:n,sealed:t.slice(i),iv:o}}function ac(e,t){const n=sc(e);return cc({type:nc(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?ss(n.senderPublicKey,Fa):void 0,receiverPublicKey:t?.receiverPublicKey})}function cc(e){const t=e?.type||Va;if(t===qa){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function uc(e){return e.type===qa&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var lc=Object.defineProperty,fc=Object.getOwnPropertySymbols,hc=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable,pc=(e,t,n)=>t in e?lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gc=(e,t)=>{for(var n in t||(t={}))hc.call(t,n)&&pc(e,n,t[n]);if(fc)for(var n of fc(t))dc.call(t,n)&&pc(e,n,t[n]);return e};const yc="ReactNative",vc={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},mc="js";function _c(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function bc(){return!ha()&&!!ga()&&navigator.product===yc}function wc(){return!_c()&&!!ga()}function Ec(){return bc()?vc.reactNative:_c()?vc.node:wc()?vc.browser:vc.unknown}function Sc(e,t){let n=Ia.parse(e);return n=gc(gc({},n),t),e=Ia.stringify(n)}function Oc(){return Oa()||{name:"",description:"",url:"",icons:[""]}}function Rc(){const e=ta();if(null===e)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function xc(){var e;const t=Ec();return t===vc.browser?[t,(null==(e=ma())?void 0:e.host)||"unknown"].join(":"):t}function Ic(e,t,n){const r=Rc(),i=xc();return[[e,t].join("-"),[mc,n].join("-"),r,i].join("/")}function Cc({protocol:e,version:t,relayUrl:n,sdkVersion:r,auth:i,projectId:o,useOnCloseEvent:s}){const a=n.split("?"),c={auth:i,ua:Ic(e,t,r),projectId:o,useOnCloseEvent:s||void 0},u=Sc(a[1]||"",c);return a[0]+"?"+u}function Pc(e,t){return e.filter((e=>t.includes(e))).length===e.length}function kc(e){return Object.fromEntries(e.entries())}function Nc(e){return new Map(Object.entries(e))}function Ac(e=We.FIVE_MINUTES,t){const n=We.toMiliseconds(e||We.FIVE_MINUTES);let r,i,o;return{resolve:e=>{o&&r&&(clearTimeout(o),r(e))},reject:e=>{o&&i&&(clearTimeout(o),i(e))},done:()=>new Promise(((e,s)=>{o=setTimeout((()=>{s(new Error(t))}),n),r=e,i=s}))}}function Tc(e,t,n){return new Promise((async(r,i)=>{const o=setTimeout((()=>i(new Error(n))),t);try{r(await e)}catch(e){i(e)}clearTimeout(o)}))}function Mc(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function Lc(e){return Mc("topic",e)}function Uc(e){return Mc("id",e)}function jc(e){const[t,n]=e.split(":"),r={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof n)r.topic=n;else{if("id"!==t||!Number.isInteger(Number(n)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${n}`);r.id=Number(n)}return r}function Dc(e,t){return We.fromMiliseconds((t||Date.now())+We.toMiliseconds(e))}function zc(e){return Date.now()>=We.toMiliseconds(e)}function Bc(e,t){return`${e}${t?`:${t}`:""}`}function Fc(e=[],t=[]){return[...new Set([...e,...t])]}async function Hc({id:e,topic:t,wcDeepLink:n}){try{if(!n)return;const r="string"==typeof n?JSON.parse(n):n;let i=r?.href;if("string"!=typeof i)return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${e}&sessionTopic=${t}`,s=Ec();s===vc.browser?window.open(o,"_self","noreferrer noopener"):s===vc.reactNative&&typeof(null==d?void 0:d.Linking)<"u"&&await d.Linking.openURL(o)}catch(e){console.error(e)}}const $c="irn";function Vc(e){return e?.relay||{protocol:$c}}function qc(e){const t=Da[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Wc=Object.defineProperty,Kc=Object.getOwnPropertySymbols,Gc=Object.prototype.hasOwnProperty,Yc=Object.prototype.propertyIsEnumerable,Qc=(e,t,n)=>t in e?Wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jc=(e,t)=>{for(var n in t||(t={}))Gc.call(t,n)&&Qc(e,n,t[n]);if(Kc)for(var n of Kc(t))Yc.call(t,n)&&Qc(e,n,t[n]);return e};function Xc(e,t="-"){const n={},r="relay"+t;return Object.keys(e).forEach((t=>{if(t.startsWith(r)){const i=t.replace(r,""),o=e[t];n[i]=o}})),n}function Zc(e){const t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=e.substring(t+1,n).split("@"),o=typeof n<"u"?e.substring(n):"",s=Ia.parse(o);return{protocol:r,topic:eu(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:Xc(s)}}function eu(e){return e.startsWith("//")?e.substring(2):e}function tu(e,t="-"){const n="relay",r={};return Object.keys(e).forEach((i=>{const o=n+t+i;e[i]&&(r[o]=e[i])})),r}function nu(e){return`${e.protocol}:${e.topic}@${e.version}?`+Ia.stringify(Jc({symKey:e.symKey},tu(e.relay)))}function ru(e){const t=[];return e.forEach((e=>{const[n,r]=e.split(":");t.push(`${n}:${r}`)})),t}function iu(e){const t=[];return Object.values(e).forEach((e=>{t.push(...ru(e.accounts))})),t}function ou(e,t){const n=[];return Object.values(e).forEach((e=>{ru(e.accounts).includes(t)&&n.push(...e.methods)})),n}function su(e,t){const n=[];return Object.values(e).forEach((e=>{ru(e.accounts).includes(t)&&n.push(...e.events)})),n}function au(e,t){const n=Mu(e,t);if(n)throw new Error(n.message);const r={};for(const[t,n]of Object.entries(e))r[t]={methods:n.methods,events:n.events,chains:n.accounts.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))};return r}function cu(e){return e.includes(":")}function uu(e){return cu(e)?e.split(":")[0]:e}const lu={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}},fu={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 hu(e,t){const{message:n,code:r}=fu[e];return{message:t?`${n} ${t}`:n,code:r}}function du(e,t){const{message:n,code:r}=lu[e];return{message:t?`${n} ${t}`:n,code:r}}function pu(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function gu(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function yu(e){return typeof e>"u"}function vu(e,t){return!(!t||!yu(e))||"string"==typeof e&&!!e.trim().length}function mu(e,t){return!(!t||!yu(e))||"number"==typeof e&&!isNaN(e)}function _u(e,t){const{requiredNamespaces:n}=t,r=Object.keys(e.namespaces),i=Object.keys(n);let o=!0;return!!Pc(i,r)&&(r.forEach((t=>{const{accounts:r,methods:i,events:s}=e.namespaces[t],a=ru(r),c=n[t];Pc(za(t,c),a)&&Pc(c.methods,i)&&Pc(c.events,s)||(o=!1)})),o)}function bu(e){return!(!vu(e,!1)||!e.includes(":"))&&2===e.split(":").length}function wu(e){if(vu(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&bu(e)}}return!1}function Eu(e){if(vu(e,!1))try{return typeof new URL(e)<"u"}catch{return!1}return!1}function Su(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}function Ou(e){return e?.topic}function Ru(e,t){let n=null;return vu(e?.publicKey,!1)||(n=hu("MISSING_OR_INVALID",`${t} controller public key should be a string`)),n}function xu(e){let t=!0;return pu(e)?e.length&&(t=e.every((e=>vu(e,!1)))):t=!1,t}function Iu(e,t,n){let r=null;return pu(t)?t.forEach((t=>{r||(!bu(t)||!t.includes(e))&&(r=du("UNSUPPORTED_CHAINS",`${n}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):r=du("UNSUPPORTED_CHAINS",`${n}, chains ${t} should be an array of strings conforming to "namespace:chainId" format`),r}function Cu(e,t){let n=null;return Object.entries(e).forEach((([e,r])=>{if(n)return;const i=Iu(e,za(e,r),`${t} requiredNamespace`);i&&(n=i)})),n}function Pu(e,t){let n=null;return pu(e)?e.forEach((e=>{n||wu(e)||(n=du("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))})):n=du("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function ku(e,t){let n=null;return Object.values(e).forEach((e=>{if(n)return;const r=Pu(e?.accounts,`${t} namespace`);r&&(n=r)})),n}function Nu(e,t){let n=null;return xu(e?.methods)?xu(e?.events)||(n=du("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):n=du("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),n}function Au(e,t){let n=null;return Object.values(e).forEach((e=>{if(n)return;const r=Nu(e,`${t}, namespace`);r&&(n=r)})),n}function Tu(e,t,n){let r=null;if(e&&gu(e)){const n=Au(e,t);n&&(r=n);const i=Cu(e,t);i&&(r=i)}else r=hu("MISSING_OR_INVALID",`${t}, ${n} should be an object with data`);return r}function Mu(e,t){let n=null;if(e&&gu(e)){const r=Au(e,t);r&&(n=r);const i=ku(e,t);i&&(n=i)}else n=hu("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return n}function Lu(e){return vu(e.protocol,!0)}function Uu(e,t){let n=!1;return t&&!e?n=!0:e&&pu(e)&&e.length&&e.forEach((e=>{n=Lu(e)})),n}function ju(e){return"number"==typeof e}function Du(e){return typeof e<"u"&&null!==typeof e}function zu(e){return!!(e&&"object"==typeof e&&e.code&&mu(e.code,!1)&&e.message&&vu(e.message,!1))}function Bu(e){return!(yu(e)||!vu(e.method,!1))}function Fu(e){return!(yu(e)||yu(e.result)&&yu(e.error)||!mu(e.id,!1)||!vu(e.jsonrpc,!1))}function Hu(e){return!(yu(e)||!vu(e.name,!1))}function $u(e,t){return!(!bu(t)||!iu(e).includes(t))}function Vu(e,t,n){return!!vu(n,!1)&&ou(e,t).includes(n)}function qu(e,t,n){return!!vu(n,!1)&&su(e,t).includes(n)}function Wu(e,t,n){let r=null;const i=Ku(e),o=Yu(t),s=Object.keys(i),a=Object.keys(o),c=Gu(Object.keys(e)),u=Gu(Object.keys(t)),l=c.filter((e=>!u.includes(e)));return l.length&&(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces.\n Required: ${l.toString()}\n Received: ${Object.keys(t).toString()}`)),Pc(s,a)||(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach((e=>{if(!e.includes(":")||r)return;const i=ru(t[e].accounts);i.includes(e)||(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${i.toString()}`))})),s.forEach((e=>{r||(Pc(i[e].methods,o[e].methods)?Pc(i[e].events,o[e].events)||(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${e}`)):r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${e}`))})),r}function Ku(e){const t={};return Object.keys(e).forEach((n=>{var r;n.includes(":")?t[n]=e[n]:null==(r=e[n].chains)||r.forEach((r=>{t[r]={methods:e[n].methods,events:e[n].events}}))})),t}function Gu(e){return[...new Set(e.map((e=>e.includes(":")?e.split(":")[0]:e)))]}function Yu(e){const t={};return Object.keys(e).forEach((n=>{if(n.includes(":"))t[n]=e[n];else{const r=ru(e[n].accounts);r?.forEach((r=>{t[r]={accounts:e[n].accounts.filter((e=>e.includes(`${r}:`))),methods:e[n].methods,events:e[n].events}}))}})),t}function Qu(e,t){return mu(e,!1)&&e<=t.max&&e>=t.min}const Ju="INTERNAL_ERROR",Xu="SERVER_ERROR",Zu=[-32700,-32600,-32601,-32602,-32603],el={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[Ju]:{code:-32603,message:"Internal error"},[Xu]:{code:-32e3,message:"Server error"}},tl=Xu;function nl(e){return Zu.includes(e)}function rl(e){return Object.keys(el).includes(e)?el[e]:el[tl]}function il(e){return Object.values(el).find((t=>t.code===e))||el[tl]}function ol(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${t}`):e}var sl={},al=function(e,t){return(al=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};
|
306
|
+
***************************************************************************** */function ln(e,t){function n(){this.constructor=e}un(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var fn=function(){return fn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fn.apply(this,arguments)};function hn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function dn(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function pn(e,t){return function(n,r){t(n,r,e)}}function gn(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function yn(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):i(e.value).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function vn(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function mn(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function _n(e,t){for(var n in e)"default"!==n&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function bn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function wn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function En(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wn(arguments[t]));return e}function Sn(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function On(e){return this instanceof On?(this.v=e,this):new On(e)}function Rn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{c(i[e](t))}catch(e){f(o[0][3],e)}}function c(e){e.value instanceof On?Promise.resolve(e.value.v).then(u,l):f(o[0][2],e)}function u(e){a("next",e)}function l(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function xn(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:On(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function In(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof bn?bn(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){i(r,o,(t=e[n](t)).done,t.value)}))}}function i(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}}function Cn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Pn(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function kn(e){return e&&e.__esModule?e:{default:e}}function Nn(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function An(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var Tn,Mn,Ln,Un,jn=r(Object.freeze({__proto__:null,__extends:ln,get __assign(){return fn},__rest:hn,__decorate:dn,__param:pn,__metadata:gn,__awaiter:yn,__generator:vn,__createBinding:mn,__exportStar:_n,__values:bn,__read:wn,__spread:En,__spreadArrays:Sn,__await:On,__asyncGenerator:Rn,__asyncDelegator:xn,__asyncValues:In,__makeTemplateObject:Cn,__importStar:Pn,__importDefault:kn,__classPrivateFieldGet:Nn,__classPrivateFieldSet:An}));function Dn(){if(Mn)return Tn;function e(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}function t(t,n,r){var i=r&&r.stringify||e,o=1;if("object"==typeof t&&null!==t){var s=n.length+o;if(1===s)return t;var a=new Array(s);a[0]=i(t);for(var c=1;c<s;c++)a[c]=i(n[c]);return a.join(" ")}if("string"!=typeof t)return t;var u=n.length;if(0===u)return t;for(var l="",f=1-o,h=-1,d=t&&t.length||0,p=0;p<d;){if(37===t.charCodeAt(p)&&p+1<d){switch(h=h>-1?h:0,t.charCodeAt(p+1)){case 100:case 102:if(f>=u||null==n[f])break;h<p&&(l+=t.slice(h,p)),l+=Number(n[f]),h=p+2,p++;break;case 105:if(f>=u||null==n[f])break;h<p&&(l+=t.slice(h,p)),l+=Math.floor(Number(n[f])),h=p+2,p++;break;case 79:case 111:case 106:if(f>=u||void 0===n[f])break;h<p&&(l+=t.slice(h,p));var g=typeof n[f];if("string"===g){l+="'"+n[f]+"'",h=p+2,p++;break}if("function"===g){l+=n[f].name||"<anonymous>",h=p+2,p++;break}l+=i(n[f]),h=p+2,p++;break;case 115:if(f>=u)break;h<p&&(l+=t.slice(h,p)),l+=String(n[f]),h=p+2,p++;break;case 37:h<p&&(l+=t.slice(h,p)),l+="%",h=p+2,p++,f--}++f}++p}return-1===h?t:(h<d&&(l+=t.slice(h)),l)}return Mn=1,Tn=t}function zn(){if(Un)return Ln;Un=1;const e=Dn();Ln=i;const t=w().console||{},n={mapHttpRequest:p,mapHttpResponse:p,wrapRequestSerializer:g,wrapResponseSerializer:g,wrapErrorSerializer:g,req:p,res:p,err:h};function r(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}function i(e){(e=e||{}).browser=e.browser||{};const n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");const s=e.browser.write||t;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},l=r(e.browser.serialize,a);let h=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);const p=["error","fatal","warn","info","debug","trace"];"function"==typeof s&&(s.error=s.fatal=s.warn=s.info=s.debug=s.trace=s),!1===e.enabled&&(e.level="silent");const g=e.level||"info",v=Object.create(s);v.log||(v.log=y),Object.defineProperty(v,"levelVal",{get:_}),Object.defineProperty(v,"level",{get:b,set:w});const m={transmit:n,serialize:l,asObject:e.browser.asObject,levels:p,timestamp:d(e)};function _(){return"silent"===this.level?1/0:this.levels.values[this.level]}function b(){return this._level}function w(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(m,v,"error","log"),o(m,v,"fatal","error"),o(m,v,"warn","error"),o(m,v,"info","log"),o(m,v,"debug","log"),o(m,v,"trace","log")}function E(t,r){if(!t)throw new Error("missing bindings for child Pino");r=r||{},l&&t.serializers&&(r.serializers=t.serializers);const i=r.serializers;if(l&&i){var o=Object.assign({},a,i),s=!0===e.browser.serialize?Object.keys(o):l;delete t.serializers,c([t],s,o,this._stdErrSerialize)}function h(e){this._childLevel=1+(0|e._childLevel),this.error=u(e,t,"error"),this.fatal=u(e,t,"fatal"),this.warn=u(e,t,"warn"),this.info=u(e,t,"info"),this.debug=u(e,t,"debug"),this.trace=u(e,t,"trace"),o&&(this.serializers=o,this._serialize=s),n&&(this._logEvent=f([].concat(e._logEvent.bindings,t)))}return h.prototype=this,new h(this)}return v.levels=i.levels,v.level=g,v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=y,v.serializers=a,v._serialize=l,v._stdErrSerialize=h,v.child=E,n&&(v._logEvent=f()),v}function o(e,n,r,i){const o=Object.getPrototypeOf(n);n[r]=n.levelVal>n.levels.values[r]?y:o[r]?o[r]:t[r]||t[i]||y,s(e,n,r)}function s(e,n,r){!e.transmit&&n[r]===y||(n[r]=function(o){return function(){const s=e.timestamp(),u=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var h=0;h<u.length;h++)u[h]=arguments[h];if(e.serialize&&!e.asObject&&c(u,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?o.call(f,a(this,r,u,s)):o.apply(f,u),e.transmit){const t=e.transmit.level||n.level,o=i.levels.values[t],a=i.levels.values[r];if(a<o)return;l(this,{ts:s,methodLevel:r,methodValue:a,transmitLevel:t,transmitValue:i.levels.values[e.transmit.level||n.level],send:e.transmit.send,val:n.levelVal},u)}}}(n[r]))}function a(t,n,r,o){t._serialize&&c(r,t._serialize,t.serializers,t._stdErrSerialize);const s=r.slice();let a=s[0];const u={};o&&(u.time=o),u.level=i.levels.values[n];let l=1+(0|t._childLevel);if(l<1&&(l=1),null!==a&&"object"==typeof a){for(;l--&&"object"==typeof s[0];)Object.assign(u,s.shift());a=s.length?e(s.shift(),s):void 0}else"string"==typeof a&&(a=e(s.shift(),s));return void 0!==a&&(u.msg=a),u}function c(e,t,n,r){for(const o in e)if(r&&e[o]instanceof Error)e[o]=i.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o]))for(const r in e[o])t&&t.indexOf(r)>-1&&r in n&&(e[o][r]=n[r](e[o][r]))}function u(e,t,n){return function(){const r=new Array(1+arguments.length);r[0]=t;for(var i=1;i<r.length;i++)r[i]=arguments[i-1];return e[n].apply(this,r)}}function l(e,t,n){const r=t.send,i=t.ts,o=t.methodLevel,s=t.methodValue,a=t.val,u=e._logEvent.bindings;c(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=n.filter((function(e){return-1===u.indexOf(e)})),e._logEvent.level.label=o,e._logEvent.level.value=s,r(o,e._logEvent,a),e._logEvent=f(u)}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function d(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?v:m}function p(){return{}}function g(e){return e}function y(){}function v(){return!1}function m(){return Date.now()}function _(){return Math.round(Date.now()/1e3)}function b(){return new Date(Date.now()).toISOString()}function w(){function e(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 e(self)||e(window)||e(this)||{}}}return i.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"}},i.stdSerializers=n,i.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:m,unixTime:_,isoTime:b}),Ln}var Bn,Fn={};function Hn(){return Bn||(Bn=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.PINO_CUSTOM_CONTEXT_KEY=Fn.PINO_LOGGER_DEFAULTS=void 0,Fn.PINO_LOGGER_DEFAULTS={level:"info"},Fn.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Fn}var $n,Vn={};function qn(){if($n)return Vn;$n=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.generateChildLogger=Vn.formatChildLoggerContext=Vn.getLoggerContext=Vn.setBrowserLoggerContext=Vn.getBrowserLoggerContext=Vn.getDefaultLoggerOptions=void 0;const e=Hn();function t(t){return Object.assign(Object.assign({},t),{level:t?.level||e.PINO_LOGGER_DEFAULTS.level})}function n(t,n=e.PINO_CUSTOM_CONTEXT_KEY){return t[n]||""}function r(t,n,r=e.PINO_CUSTOM_CONTEXT_KEY){return t[r]=n,t}function i(t,r=e.PINO_CUSTOM_CONTEXT_KEY){let i="";return i=typeof t.bindings>"u"?n(t,r):t.bindings().context||"",i}function o(t,n,r=e.PINO_CUSTOM_CONTEXT_KEY){const o=i(t,r);return o.trim()?`${o}/${n}`:n}function s(t,n,i=e.PINO_CUSTOM_CONTEXT_KEY){const s=o(t,n,i);return r(t.child({context:s}),s,i)}return Vn.getDefaultLoggerOptions=t,Vn.getBrowserLoggerContext=n,Vn.setBrowserLoggerContext=r,Vn.getLoggerContext=i,Vn.formatChildLoggerContext=o,Vn.generateChildLogger=s,Vn}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pino=void 0;const t=jn,n=t.__importDefault(zn());Object.defineProperty(e,"pino",{enumerable:!0,get:function(){return n.default}}),t.__exportStar(Hn(),e),t.__exportStar(qn(),e)}(cn);class Wn extends Kt{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Kn extends Kt{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class Gn{constructor(e,t){this.logger=e,this.core=t}}class Yn extends Kt{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Qn extends Kt{constructor(e){super()}}class Jn{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}}class Xn extends Kt{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Zn extends Kt{constructor(e,t){super(),this.core=e,this.logger=t}}class er{constructor(e,t){this.projectId=e,this.logger=t}}class tr{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class nr{constructor(e){this.client=e}}const rr=e=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString()+"n":t)),ir=e=>{const t=/([\[:])?(\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,n=e.replace(t,'$1"$2n"$3');return JSON.parse(n,((e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t))};function or(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return ir(e)}catch{return e}}function sr(e){return"string"==typeof e?e:rr(e)||""}var ar={},cr={},ur={},lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.BrowserRandomSource=void 0;const fr=65536;class hr{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(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 t=new Uint8Array(e);for(let e=0;e<t.length;e+=fr)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,fr)));return t}}function dr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}lr.BrowserRandomSource=hr;var pr={},gr={};function yr(e){for(var t=0;t<e.length;t++)e[t]=0;return e}Object.defineProperty(gr,"__esModule",{value:!0}),gr.wipe=yr;var vr={},mr=r(Object.freeze({__proto__:null,default:vr}));Object.defineProperty(pr,"__esModule",{value:!0}),pr.NodeRandomSource=void 0;const _r=gr;class br{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof dr<"u"){const e=mr;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 t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let e=0;e<n.length;e++)n[e]=t[e];return(0,_r.wipe)(t),n}}pr.NodeRandomSource=br,Object.defineProperty(ur,"__esModule",{value:!0}),ur.SystemRandomSource=void 0;const wr=lr,Er=pr;class Sr{constructor(){return this.isAvailable=!1,this.name="",this._source=new wr.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new Er.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}ur.SystemRandomSource=Sr;var Or={},Rr={};(function(e){function t(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0}function n(e,t){return e+t|0}function r(e,t){return e-t|0}function i(e,t){return e<<t|e>>>32-t}function o(e,t){return e<<32-t|e>>>t}function s(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||t,e.add=n,e.sub=r,e.rotl=i,e.rotr=o,e.isInteger=Number.isInteger||s,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}})(Rr),Object.defineProperty(Or,"__esModule",{value:!0});var xr=Rr;function Ir(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}function Cr(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0}function Pr(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16}function kr(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0}function Nr(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function Ar(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function Tr(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Mr(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Lr(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Ur(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function jr(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function Dr(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function zr(e,t){void 0===t&&(t=0);var n=Tr(e,t),r=Tr(e,t+4);return 4294967296*n+r-4294967296*(r>>31)}function Br(e,t){return void 0===t&&(t=0),4294967296*Mr(e,t)+Mr(e,t+4)}function Fr(e,t){void 0===t&&(t=0);var n=Lr(e,t);return 4294967296*Lr(e,t+4)+n-4294967296*(n>>31)}function Hr(e,t){void 0===t&&(t=0);var n=Ur(e,t);return 4294967296*Ur(e,t+4)+n}function $r(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),jr(e/4294967296>>>0,t,n),jr(e>>>0,t,n+4),t}function Vr(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),Dr(e>>>0,t,n),Dr(e/4294967296>>>0,t,n+4),t}function qr(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,o=e/8+n-1;o>=n;o--)r+=t[o]*i,i*=256;return r}function Wr(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,o=n;o<n+e/8;o++)r+=t[o]*i,i*=256;return r}function Kr(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!xr.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var i=1,o=e/8+r-1;o>=r;o--)n[o]=t/i&255,i*=256;return n}function Gr(e,t,n,r){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===r&&(r=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!xr.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var i=1,o=r;o<r+e/8;o++)n[o]=t/i&255,i*=256;return n}function Yr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)}function Qr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)}function Jr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)}function Xr(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)}function Zr(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e),t}function ei(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),t}function ti(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e),t}function ni(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),t}Or.readInt16BE=Ir,Or.readUint16BE=Cr,Or.readInt16LE=Pr,Or.readUint16LE=kr,Or.writeUint16BE=Nr,Or.writeInt16BE=Nr,Or.writeUint16LE=Ar,Or.writeInt16LE=Ar,Or.readInt32BE=Tr,Or.readUint32BE=Mr,Or.readInt32LE=Lr,Or.readUint32LE=Ur,Or.writeUint32BE=jr,Or.writeInt32BE=jr,Or.writeUint32LE=Dr,Or.writeInt32LE=Dr,Or.readInt64BE=zr,Or.readUint64BE=Br,Or.readInt64LE=Fr,Or.readUint64LE=Hr,Or.writeUint64BE=$r,Or.writeInt64BE=$r,Or.writeUint64LE=Vr,Or.writeInt64LE=Vr,Or.readUintBE=qr,Or.readUintLE=Wr,Or.writeUintBE=Kr,Or.writeUintLE=Gr,Or.readFloat32BE=Yr,Or.readFloat32LE=Qr,Or.readFloat64BE=Jr,Or.readFloat64LE=Xr,Or.writeFloat32BE=Zr,Or.writeFloat32LE=ei,Or.writeFloat64BE=ti,Or.writeFloat64LE=ni,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=ur,n=Or,r=gr;function i(t,n=e.defaultRandomSource){return n.randomBytes(t)}function o(t=e.defaultRandomSource){const o=i(4,t),s=(0,n.readUint32LE)(o);return(0,r.wipe)(o),s}e.defaultRandomSource=new t.SystemRandomSource,e.randomBytes=i,e.randomUint32=o;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(t,n=s,o=e.defaultRandomSource){if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");let a="";const c=n.length,u=256-256%c;for(;t>0;){const e=i(Math.ceil(256*t/u),o);for(let r=0;r<e.length&&t>0;r++){const i=e[r];i<u&&(a+=n.charAt(i%c),t--)}(0,r.wipe)(e)}return a}function c(t,n=s,r=e.defaultRandomSource){return a(Math.ceil(t/(Math.log(n.length)/Math.LN2)),n,r)}e.randomString=a,e.randomStringForEntropy=c}(cr);var ri={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Or,n=gr;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var r=function(){function r(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 r.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},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},r.prototype.update=function(t,n){if(void 0===n&&(n=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var r=0;if(this._bytesHashed+=n,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&n>0;)this._buffer[this._bufferLength++]=t[r++],n--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(n>=this.blockSize&&(r=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,t,r,n),n%=this.blockSize);n>0;)this._buffer[this._bufferLength++]=t[r++],n--;return this},r.prototype.finish=function(e){if(!this._finished){var n=this._bytesHashed,r=this._bufferLength,i=n/536870912|0,s=n<<3,a=n%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/8;c++)t.writeUint32BE(this._stateHi[c],e,8*c),t.writeUint32BE(this._stateLo[c],e,8*c+4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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}},r.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){n.wipe(e.stateHi),n.wipe(e.stateLo),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();e.SHA512=r;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(e,n,r,o,s,a,c){for(var u,l,f,h,d,p,g,y,v=r[0],m=r[1],_=r[2],b=r[3],w=r[4],E=r[5],S=r[6],O=r[7],R=o[0],x=o[1],I=o[2],C=o[3],P=o[4],k=o[5],N=o[6],A=o[7];c>=128;){for(var T=0;T<16;T++){var M=8*T+a;e[T]=t.readUint32BE(s,M),n[T]=t.readUint32BE(s,M+4)}for(T=0;T<80;T++){var L=v,U=m,j=_,D=b,z=w,B=E,F=S,H=O,$=R,V=x,q=I,W=C,K=P,G=k,Y=N,Q=A;if(d=65535&(l=A),p=l>>>16,g=65535&(u=O),y=u>>>16,d+=65535&(l=(P>>>14|w<<18)^(P>>>18|w<<14)^(w>>>9|P<<23)),p+=l>>>16,g+=65535&(u=(w>>>14|P<<18)^(w>>>18|P<<14)^(P>>>9|w<<23)),y+=u>>>16,d+=65535&(l=P&k^~P&N),p+=l>>>16,g+=65535&(u=w&E^~w&S),y+=u>>>16,u=i[2*T],d+=65535&(l=i[2*T+1]),p+=l>>>16,g+=65535&u,y+=u>>>16,u=e[T%16],p+=(l=n[T%16])>>>16,g+=65535&u,y+=u>>>16,g+=(p+=(d+=65535&l)>>>16)>>>16,d=65535&(l=h=65535&d|p<<16),p=l>>>16,g=65535&(u=f=65535&g|(y+=g>>>16)<<16),y=u>>>16,d+=65535&(l=(R>>>28|v<<4)^(v>>>2|R<<30)^(v>>>7|R<<25)),p+=l>>>16,g+=65535&(u=(v>>>28|R<<4)^(R>>>2|v<<30)^(R>>>7|v<<25)),y+=u>>>16,p+=(l=R&x^R&I^x&I)>>>16,g+=65535&(u=v&m^v&_^m&_),y+=u>>>16,H=65535&(g+=(p+=(d+=65535&l)>>>16)>>>16)|(y+=g>>>16)<<16,Q=65535&d|p<<16,d=65535&(l=W),p=l>>>16,g=65535&(u=D),y=u>>>16,p+=(l=h)>>>16,g+=65535&(u=f),y+=u>>>16,m=L,_=U,b=j,w=D=65535&(g+=(p+=(d+=65535&l)>>>16)>>>16)|(y+=g>>>16)<<16,E=z,S=B,O=F,v=H,x=$,I=V,C=q,P=W=65535&d|p<<16,k=K,N=G,A=Y,R=Q,T%16==15)for(M=0;M<16;M++)u=e[M],d=65535&(l=n[M]),p=l>>>16,g=65535&u,y=u>>>16,u=e[(M+9)%16],d+=65535&(l=n[(M+9)%16]),p+=l>>>16,g+=65535&u,y+=u>>>16,f=e[(M+1)%16],d+=65535&(l=((h=n[(M+1)%16])>>>1|f<<31)^(h>>>8|f<<24)^(h>>>7|f<<25)),p+=l>>>16,g+=65535&(u=(f>>>1|h<<31)^(f>>>8|h<<24)^f>>>7),y+=u>>>16,f=e[(M+14)%16],p+=(l=((h=n[(M+14)%16])>>>19|f<<13)^(f>>>29|h<<3)^(h>>>6|f<<26))>>>16,g+=65535&(u=(f>>>19|h<<13)^(h>>>29|f<<3)^f>>>6),y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,e[M]=65535&g|y<<16,n[M]=65535&d|p<<16}d=65535&(l=R),p=l>>>16,g=65535&(u=v),y=u>>>16,u=r[0],p+=(l=o[0])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[0]=v=65535&g|y<<16,o[0]=R=65535&d|p<<16,d=65535&(l=x),p=l>>>16,g=65535&(u=m),y=u>>>16,u=r[1],p+=(l=o[1])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[1]=m=65535&g|y<<16,o[1]=x=65535&d|p<<16,d=65535&(l=I),p=l>>>16,g=65535&(u=_),y=u>>>16,u=r[2],p+=(l=o[2])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[2]=_=65535&g|y<<16,o[2]=I=65535&d|p<<16,d=65535&(l=C),p=l>>>16,g=65535&(u=b),y=u>>>16,u=r[3],p+=(l=o[3])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[3]=b=65535&g|y<<16,o[3]=C=65535&d|p<<16,d=65535&(l=P),p=l>>>16,g=65535&(u=w),y=u>>>16,u=r[4],p+=(l=o[4])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[4]=w=65535&g|y<<16,o[4]=P=65535&d|p<<16,d=65535&(l=k),p=l>>>16,g=65535&(u=E),y=u>>>16,u=r[5],p+=(l=o[5])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[5]=E=65535&g|y<<16,o[5]=k=65535&d|p<<16,d=65535&(l=N),p=l>>>16,g=65535&(u=S),y=u>>>16,u=r[6],p+=(l=o[6])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[6]=S=65535&g|y<<16,o[6]=N=65535&d|p<<16,d=65535&(l=A),p=l>>>16,g=65535&(u=O),y=u>>>16,u=r[7],p+=(l=o[7])>>>16,g+=65535&u,y+=u>>>16,y+=(g+=(p+=(d+=65535&l)>>>16)>>>16)>>>16,r[7]=O=65535&g|y<<16,o[7]=A=65535&d|p<<16,a+=128,c-=128}return a}function s(e){var t=new r;t.update(e);var n=t.digest();return t.clean(),n}e.hash=s})(ri),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const t=cr,n=ri,r=gr;function i(e){const t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32,new Uint8Array(32)[0]=9;const o=i(),s=i([1]),a=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(e,t){for(let n=0;n<16;n++)e[n]=0|t[n]}function d(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function p(e,t,n){const r=~(n-1);for(let n=0;n<16;n++){const i=r&(e[n]^t[n]);e[n]^=i,t[n]^=i}}function g(e,t){const n=i(),r=i();for(let e=0;e<16;e++)r[e]=t[e];d(r),d(r),d(r);for(let e=0;e<2;e++){n[0]=r[0]-65517;for(let e=1;e<15;e++)n[e]=r[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);const e=n[15]>>16&1;n[14]&=65535,p(r,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&r[t],e[2*t+1]=r[t]>>8}function y(e,t){let n=0;for(let r=0;r<32;r++)n|=e[r]^t[r];return(1&n-1>>>8)-1}function v(e,t){const n=new Uint8Array(32),r=new Uint8Array(32);return g(n,e),g(r,t),y(n,r)}function m(e){const t=new Uint8Array(32);return g(t,e),1&t[0]}function _(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function b(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function w(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function E(e,t,n){let r,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,g=0,y=0,v=0,m=0,_=0,b=0,w=0,E=0,S=0,O=0,R=0,x=0,I=0,C=0,P=0,k=0,N=0,A=0,T=0,M=0,L=0,U=n[0],j=n[1],D=n[2],z=n[3],B=n[4],F=n[5],H=n[6],$=n[7],V=n[8],q=n[9],W=n[10],K=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];r=t[0],o+=r*U,s+=r*j,a+=r*D,c+=r*z,u+=r*B,l+=r*F,f+=r*H,h+=r*$,d+=r*V,p+=r*q,g+=r*W,y+=r*K,v+=r*G,m+=r*Y,_+=r*Q,b+=r*J,r=t[1],s+=r*U,a+=r*j,c+=r*D,u+=r*z,l+=r*B,f+=r*F,h+=r*H,d+=r*$,p+=r*V,g+=r*q,y+=r*W,v+=r*K,m+=r*G,_+=r*Y,b+=r*Q,w+=r*J,r=t[2],a+=r*U,c+=r*j,u+=r*D,l+=r*z,f+=r*B,h+=r*F,d+=r*H,p+=r*$,g+=r*V,y+=r*q,v+=r*W,m+=r*K,_+=r*G,b+=r*Y,w+=r*Q,E+=r*J,r=t[3],c+=r*U,u+=r*j,l+=r*D,f+=r*z,h+=r*B,d+=r*F,p+=r*H,g+=r*$,y+=r*V,v+=r*q,m+=r*W,_+=r*K,b+=r*G,w+=r*Y,E+=r*Q,S+=r*J,r=t[4],u+=r*U,l+=r*j,f+=r*D,h+=r*z,d+=r*B,p+=r*F,g+=r*H,y+=r*$,v+=r*V,m+=r*q,_+=r*W,b+=r*K,w+=r*G,E+=r*Y,S+=r*Q,O+=r*J,r=t[5],l+=r*U,f+=r*j,h+=r*D,d+=r*z,p+=r*B,g+=r*F,y+=r*H,v+=r*$,m+=r*V,_+=r*q,b+=r*W,w+=r*K,E+=r*G,S+=r*Y,O+=r*Q,R+=r*J,r=t[6],f+=r*U,h+=r*j,d+=r*D,p+=r*z,g+=r*B,y+=r*F,v+=r*H,m+=r*$,_+=r*V,b+=r*q,w+=r*W,E+=r*K,S+=r*G,O+=r*Y,R+=r*Q,x+=r*J,r=t[7],h+=r*U,d+=r*j,p+=r*D,g+=r*z,y+=r*B,v+=r*F,m+=r*H,_+=r*$,b+=r*V,w+=r*q,E+=r*W,S+=r*K,O+=r*G,R+=r*Y,x+=r*Q,I+=r*J,r=t[8],d+=r*U,p+=r*j,g+=r*D,y+=r*z,v+=r*B,m+=r*F,_+=r*H,b+=r*$,w+=r*V,E+=r*q,S+=r*W,O+=r*K,R+=r*G,x+=r*Y,I+=r*Q,C+=r*J,r=t[9],p+=r*U,g+=r*j,y+=r*D,v+=r*z,m+=r*B,_+=r*F,b+=r*H,w+=r*$,E+=r*V,S+=r*q,O+=r*W,R+=r*K,x+=r*G,I+=r*Y,C+=r*Q,P+=r*J,r=t[10],g+=r*U,y+=r*j,v+=r*D,m+=r*z,_+=r*B,b+=r*F,w+=r*H,E+=r*$,S+=r*V,O+=r*q,R+=r*W,x+=r*K,I+=r*G,C+=r*Y,P+=r*Q,k+=r*J,r=t[11],y+=r*U,v+=r*j,m+=r*D,_+=r*z,b+=r*B,w+=r*F,E+=r*H,S+=r*$,O+=r*V,R+=r*q,x+=r*W,I+=r*K,C+=r*G,P+=r*Y,k+=r*Q,N+=r*J,r=t[12],v+=r*U,m+=r*j,_+=r*D,b+=r*z,w+=r*B,E+=r*F,S+=r*H,O+=r*$,R+=r*V,x+=r*q,I+=r*W,C+=r*K,P+=r*G,k+=r*Y,N+=r*Q,A+=r*J,r=t[13],m+=r*U,_+=r*j,b+=r*D,w+=r*z,E+=r*B,S+=r*F,O+=r*H,R+=r*$,x+=r*V,I+=r*q,C+=r*W,P+=r*K,k+=r*G,N+=r*Y,A+=r*Q,T+=r*J,r=t[14],_+=r*U,b+=r*j,w+=r*D,E+=r*z,S+=r*B,O+=r*F,R+=r*H,x+=r*$,I+=r*V,C+=r*q,P+=r*W,k+=r*K,N+=r*G,A+=r*Y,T+=r*Q,M+=r*J,r=t[15],b+=r*U,w+=r*j,E+=r*D,S+=r*z,O+=r*B,R+=r*F,x+=r*H,I+=r*$,C+=r*V,P+=r*q,k+=r*W,N+=r*K,A+=r*G,T+=r*Y,M+=r*Q,L+=r*J,o+=38*w,s+=38*E,a+=38*S,c+=38*O,u+=38*R,l+=38*x,f+=38*I,h+=38*C,d+=38*P,p+=38*k,g+=38*N,y+=38*A,v+=38*T,m+=38*M,_+=38*L,i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=_,e[15]=b}function S(e,t){E(e,t,t)}function O(e,t){const n=i();let r;for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)S(n,n),2!==r&&4!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function R(e,t){const n=i();let r;for(r=0;r<16;r++)n[r]=t[r];for(r=250;r>=0;r--)S(n,n),1!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function x(e,t){const n=i(),r=i(),o=i(),s=i(),a=i(),u=i(),l=i(),f=i(),h=i();w(n,e[1],e[0]),w(h,t[1],t[0]),E(n,n,h),b(r,e[0],e[1]),b(h,t[0],t[1]),E(r,r,h),E(o,e[3],t[3]),E(o,o,c),E(s,e[2],t[2]),b(s,s,s),w(a,r,n),w(u,s,o),b(l,s,o),b(f,r,n),E(e[0],a,u),E(e[1],f,l),E(e[2],l,u),E(e[3],a,f)}function I(e,t,n){for(let r=0;r<4;r++)p(e[r],t[r],n)}function C(e,t){const n=i(),r=i(),o=i();O(o,t[2]),E(n,t[0],o),E(r,t[1],o),g(e,r),e[31]^=m(n)<<7}function P(e,t,n){h(e[0],o),h(e[1],s),h(e[2],s),h(e[3],o);for(let r=255;r>=0;--r){const i=n[r/8|0]>>(7&r)&1;I(e,t,i),x(t,e),x(e,e),I(e,t,i)}}function k(e,t){const n=[i(),i(),i(),i()];h(n[0],u),h(n[1],l),h(n[2],s),E(n[3],u,l),P(e,n,t)}function N(t){if(t.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const r=(0,n.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const o=new Uint8Array(32),s=[i(),i(),i(),i()];k(s,r),C(o,s);const a=new Uint8Array(64);return a.set(t),a.set(o,32),{publicKey:o,secretKey:a}}function A(e){const n=(0,t.randomBytes)(32,e),i=N(n);return(0,r.wipe)(n),i}function T(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(t.subarray(32))}e.generateKeyPairFromSeed=N,e.generateKeyPair=A,e.extractPublicKeyFromSecretKey=T;const M=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 L(e,t){let n,r,i,o;for(r=63;r>=32;--r){for(n=0,i=r-32,o=r-12;i<o;++i)t[i]+=n-16*t[r]*M[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=256*n;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*M[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*M[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function U(e){const t=new Float64Array(64);for(let n=0;n<64;n++)t[n]=e[n];for(let t=0;t<64;t++)e[t]=0;L(e,t)}function j(e,t){const r=new Float64Array(64),o=[i(),i(),i(),i()],s=(0,n.hash)(e.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;const a=new Uint8Array(64);a.set(s.subarray(32),32);const c=new n.SHA512;c.update(a.subarray(32)),c.update(t);const u=c.digest();c.clean(),U(u),k(o,u),C(a,o),c.reset(),c.update(a.subarray(0,32)),c.update(e.subarray(32)),c.update(t);const l=c.digest();U(l);for(let e=0;e<32;e++)r[e]=u[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=l[e]*s[t];return L(a.subarray(32),r),a}function D(e,t){const n=i(),r=i(),c=i(),u=i(),l=i(),d=i(),p=i();return h(e[2],s),_(e[1],t),S(c,e[1]),E(u,c,a),w(c,c,e[2]),b(u,e[2],u),S(l,u),S(d,l),E(p,d,l),E(n,p,c),E(n,n,u),R(n,n),E(n,n,c),E(n,n,u),E(n,n,u),E(e[0],n,u),S(r,e[0]),E(r,r,u),v(r,c)&&E(e[0],e[0],f),S(r,e[0]),E(r,r,u),v(r,c)?-1:(m(e[0])===t[31]>>7&&w(e[0],o,e[0]),E(e[3],e[0],e[1]),0)}function z(t,r,o){const s=new Uint8Array(32),a=[i(),i(),i(),i()],c=[i(),i(),i(),i()];if(o.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(D(c,t))return!1;const u=new n.SHA512;u.update(o.subarray(0,32)),u.update(t),u.update(r);const l=u.digest();return U(l),P(a,c,l),k(c,o.subarray(32)),x(a,c),C(s,a),!y(o,s)}function B(e){let t=[i(),i(),i(),i()];if(D(t,e))throw new Error("Ed25519: invalid public key");let n=i(),r=i(),o=t[1];b(n,s,o),w(r,s,o),O(r,r),E(n,n,r);let a=new Uint8Array(32);return g(a,n),a}function F(e){const t=(0,n.hash)(e.subarray(0,32));t[0]&=248,t[31]&=127,t[31]|=64;const i=new Uint8Array(t.subarray(0,32));return(0,r.wipe)(t),i}e.sign=j,e.verify=z,e.convertPublicKeyToX25519=B,e.convertSecretKeyToX25519=F}(ar);const ii="EdDSA",oi="JWT",si=".",ai="base64url",ci="utf8",ui="utf8",li=":",fi="did",hi="key",di="base58btc",pi="z",gi="K36",yi=32;function vi(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function mi(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?vi(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function _i(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const n=mi(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return vi(n)}function bi(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==n[s])throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var f=t[i],h=0,d=s-1;(0!==f||h<r)&&-1!==d;d--,h++)f+=256*u[d]>>>0,u[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=h,i++}for(var p=s-r;p!==s&&0===u[p];)p++;for(var g=c.repeat(n);p<s;++p)g+=e.charAt(u[p]);return g}function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*s[h]>>>0,s[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(r+(o-d)),g=r;d!==o;)p[g++]=s[d++];return p}}}function d(e){var n=h(e);if(n)return n;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:d}}var wi=bi;const Ei=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Si=e=>(new TextEncoder).encode(e),Oi=e=>(new TextDecoder).decode(e);class Ri{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xi{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return Ci(this,e)}}class Ii{constructor(e){this.decoders=e}or(e){return Ci(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 Ci=(e,t)=>new Ii({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Pi{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Ri(e,t,n),this.decoder=new xi(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ki=({name:e,prefix:t,encode:n,decode:r})=>new Pi(e,t,n,r),Ni=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:i}=wi(n,t);return ki({prefix:e,name:t,encode:r,decode:e=>Ei(i(e))})},Ai=(e,t,n,r)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*n/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${r} character`);c=c<<n|o,a+=n,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},Ti=(e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let o="",s=0,a=0;for(let r=0;r<e.length;++r)for(a=a<<8|e[r],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o},Mi=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>ki({prefix:t,name:e,encode:e=>Ti(e,r,n),decode:t=>Ai(t,r,n,e)}),Li=ki({prefix:"\0",name:"identity",encode:e=>Oi(e),decode:e=>Si(e)});var Ui=Object.freeze({__proto__:null,identity:Li});const ji=Mi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Di=Object.freeze({__proto__:null,base2:ji});const zi=Mi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Bi=Object.freeze({__proto__:null,base8:zi});const Fi=Ni({prefix:"9",name:"base10",alphabet:"0123456789"});var Hi=Object.freeze({__proto__:null,base10:Fi});const $i=Mi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Vi=Mi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qi=Object.freeze({__proto__:null,base16:$i,base16upper:Vi});const Wi=Mi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ki=Mi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gi=Mi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ji=Mi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Xi=Mi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zi=Mi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),eo=Mi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),to=Mi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),no=Mi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ro=Object.freeze({__proto__:null,base32:Wi,base32upper:Ki,base32pad:Gi,base32padupper:Ji,base32hex:Xi,base32hexupper:Zi,base32hexpad:eo,base32hexpadupper:to,base32z:no});const io=Ni({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),oo=Ni({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var so=Object.freeze({__proto__:null,base36:io,base36upper:oo});const ao=Ni({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),co=Ni({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var uo=Object.freeze({__proto__:null,base58btc:ao,base58flickr:co});const lo=Mi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),fo=Mi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ho=Mi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),po=Mi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var go=Object.freeze({__proto__:null,base64:lo,base64pad:fo,base64url:ho,base64urlpad:po});const yo=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),vo=yo.reduce(((e,t,n)=>(e[n]=t,e)),[]),mo=yo.reduce(((e,t,n)=>(e[t.codePointAt(0)]=n,e)),[]);function _o(e){return e.reduce(((e,t)=>e+=vo[t]),"")}function bo(e){const t=[];for(const n of e){const e=mo[n.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}const wo=ki({prefix:"🚀",name:"base256emoji",encode:_o,decode:bo});var Eo=Object.freeze({__proto__:null,base256emoji:wo}),So=Io,Oo=128,Ro=-128,xo=Math.pow(2,31);function Io(e,t,n){t=t||[];for(var r=n=n||0;e>=xo;)t[n++]=255&e|Oo,e/=128;for(;e&Ro;)t[n++]=255&e|Oo,e>>>=7;return t[n]=0|e,Io.bytes=n-r+1,t}var Co=No,Po=128,ko=127;function No(e,t){var n,r=0,i=0,o=t=t||0,s=e.length;do{if(o>=s)throw No.bytes=0,new RangeError("Could not decode varint");n=e[o++],r+=i<28?(n&ko)<<i:(n&ko)*Math.pow(2,i),i+=7}while(n>=Po);return No.bytes=o-t,r}var Ao=Math.pow(2,7),To=Math.pow(2,14),Mo=Math.pow(2,21),Lo=Math.pow(2,28),Uo=Math.pow(2,35),jo=Math.pow(2,42),Do=Math.pow(2,49),zo=Math.pow(2,56),Bo=Math.pow(2,63),Fo={encode:So,decode:Co,encodingLength:function(e){return e<Ao?1:e<To?2:e<Mo?3:e<Lo?4:e<Uo?5:e<jo?6:e<Do?7:e<zo?8:e<Bo?9:10}},Ho=Fo;const $o=(e,t,n=0)=>(Ho.encode(e,t,n),t),Vo=e=>Ho.encodingLength(e),qo=(e,t)=>{const n=t.byteLength,r=Vo(e),i=r+Vo(n),o=new Uint8Array(i+n);return $o(e,o,0),$o(n,o,r),o.set(t,i),new Wo(e,n,t,o)};class Wo{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const Ko=({name:e,code:t,encode:n})=>new Go(e,t,n);class Go{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?qo(this.code,t):t.then((e=>qo(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Yo=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Qo=Ko({name:"sha2-256",code:18,encode:Yo("SHA-256")}),Jo=Ko({name:"sha2-512",code:19,encode:Yo("SHA-512")});Object.freeze({__proto__:null,sha256:Qo,sha512:Jo});const Xo=0,Zo="identity",es=Ei;Object.freeze({__proto__:null,identity:{code:Xo,name:Zo,encode:es,digest:e=>qo(Xo,es(e))}}),new TextEncoder,new TextDecoder;const ts={...Ui,...Di,...Bi,...Hi,...qi,...ro,...so,...uo,...go,...Eo};function ns(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}const rs=ns("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),is=ns("ascii","a",(e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}),(e=>{const t=mi((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t})),os={utf8:rs,"utf-8":rs,hex:ts.base16,latin1:is,ascii:is,binary:is,...ts};function ss(e,t="utf8"){const n=os[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}function as(e,t="utf8"){const n=os[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode(`${n.prefix}${e}`):vi(globalThis.Buffer.from(e,"utf-8"))}function cs(e){return ss(as(sr(e),ci),ai)}function us(e){const t=as(gi,di),n=pi+ss(_i([t,e]),di);return[fi,hi,n].join(li)}function ls(e){return ss(e,ai)}function fs(e){return as([cs(e.header),cs(e.payload)].join(si),ui)}function hs(e){return[cs(e.header),cs(e.payload),ls(e.signature)].join(si)}function ds(e=cr.randomBytes(yi)){return ar.generateKeyPairFromSeed(e)}async function ps(e,t,n,r,i=We.fromMiliseconds(Date.now())){const o={alg:ii,typ:oi},s={iss:us(r.publicKey),sub:e,aud:t,iat:i,exp:i+n},a=fs({header:o,payload:s});return hs({header:o,payload:s,signature:ar.sign(r.secretKey,a)})}var gs={},ys={};Object.defineProperty(ys,"__esModule",{value:!0});var vs=Or,ms=gr,_s=20;function bs(e,t,n){for(var r=1634760805,i=857760878,o=2036477234,s=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],u=n[11]<<24|n[10]<<16|n[9]<<8|n[8],l=n[15]<<24|n[14]<<16|n[13]<<8|n[12],f=n[19]<<24|n[18]<<16|n[17]<<8|n[16],h=n[23]<<24|n[22]<<16|n[21]<<8|n[20],d=n[27]<<24|n[26]<<16|n[25]<<8|n[24],p=n[31]<<24|n[30]<<16|n[29]<<8|n[28],g=t[3]<<24|t[2]<<16|t[1]<<8|t[0],y=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=r,b=i,w=o,E=s,S=a,O=c,R=u,x=l,I=f,C=h,P=d,k=p,N=g,A=y,T=v,M=m,L=0;L<_s;L+=2)S=(S^=I=I+(N=(N^=_=_+S|0)>>>16|N<<16)|0)>>>20|S<<12,O=(O^=C=C+(A=(A^=b=b+O|0)>>>16|A<<16)|0)>>>20|O<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>16|T<<16)|0)>>>20|R<<12,x=(x^=k=k+(M=(M^=E=E+x|0)>>>16|M<<16)|0)>>>20|x<<12,R=(R^=P=P+(T=(T^=w=w+R|0)>>>24|T<<8)|0)>>>25|R<<7,x=(x^=k=k+(M=(M^=E=E+x|0)>>>24|M<<8)|0)>>>25|x<<7,O=(O^=C=C+(A=(A^=b=b+O|0)>>>24|A<<8)|0)>>>25|O<<7,S=(S^=I=I+(N=(N^=_=_+S|0)>>>24|N<<8)|0)>>>25|S<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>16|M<<16)|0)>>>20|O<<12,R=(R^=k=k+(N=(N^=b=b+R|0)>>>16|N<<16)|0)>>>20|R<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>16|A<<16)|0)>>>20|x<<12,S=(S^=C=C+(T=(T^=E=E+S|0)>>>16|T<<16)|0)>>>20|S<<12,x=(x^=I=I+(A=(A^=w=w+x|0)>>>24|A<<8)|0)>>>25|x<<7,S=(S^=C=C+(T=(T^=E=E+S|0)>>>24|T<<8)|0)>>>25|S<<7,R=(R^=k=k+(N=(N^=b=b+R|0)>>>24|N<<8)|0)>>>25|R<<7,O=(O^=P=P+(M=(M^=_=_+O|0)>>>24|M<<8)|0)>>>25|O<<7;vs.writeUint32LE(_+r|0,e,0),vs.writeUint32LE(b+i|0,e,4),vs.writeUint32LE(w+o|0,e,8),vs.writeUint32LE(E+s|0,e,12),vs.writeUint32LE(S+a|0,e,16),vs.writeUint32LE(O+c|0,e,20),vs.writeUint32LE(R+u|0,e,24),vs.writeUint32LE(x+l|0,e,28),vs.writeUint32LE(I+f|0,e,32),vs.writeUint32LE(C+h|0,e,36),vs.writeUint32LE(P+d|0,e,40),vs.writeUint32LE(k+p|0,e,44),vs.writeUint32LE(N+g|0,e,48),vs.writeUint32LE(A+y|0,e,52),vs.writeUint32LE(T+v|0,e,56),vs.writeUint32LE(M+m|0,e,60)}function ws(e,t,n,r,i){if(void 0===i&&(i=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(r.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(0===i){if(8!==t.length&&12!==t.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=(o=new Uint8Array(16)).length-t.length,o.set(t,s)}else{if(16!==t.length)throw new Error("ChaCha nonce with counter must be 16 bytes");o=t,s=i}for(var a=new Uint8Array(64),c=0;c<n.length;c+=64){bs(a,o,e);for(var u=c;u<c+64&&u<n.length;u++)r[u]=n[u]^a[u-c];Ss(o,0,s)}return ms.wipe(a),0===i&&ms.wipe(o),r}function Es(e,t,n,r){return void 0===r&&(r=0),ms.wipe(n),ws(e,t,n,n,r)}function Ss(e,t,n){for(var r=1;n--;)r=r+(255&e[t])|0,e[t]=255&r,r>>>=8,t++;if(r>0)throw new Error("ChaCha: counter overflow")}ys.streamXOR=ws,ys.stream=Es;var Os={},Rs={};function xs(e,t,n){return~(e-1)&t|e-1&n}function Is(e,t){return(0|e)-(0|t)-1>>>31&1}function Cs(e,t){if(e.length!==t.length)return 0;for(var n=0,r=0;r<e.length;r++)n|=e[r]^t[r];return 1&n-1>>>8}function Ps(e,t){return 0!==e.length&&0!==t.length&&0!==Cs(e,t)}Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.select=xs,Rs.lessOrEqual=Is,Rs.compare=Cs,Rs.equal=Ps,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Rs,n=gr;e.DIGEST_LENGTH=16;var r=function(){function t(t){this.digestLength=e.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 n=t[0]|t[1]<<8;this._r[0]=8191&n;var r=t[2]|t[3]<<8;this._r[1]=8191&(n>>>13|r<<3);var i=t[4]|t[5]<<8;this._r[2]=7939&(r>>>10|i<<6);var o=t[6]|t[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=t[8]|t[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var u=t[14]|t[15]<<8;this._r[8]=8191&(c>>>8|u<<8),this._r[9]=u>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(e,t,n){for(var r=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],u=this._h[5],l=this._h[6],f=this._h[7],h=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],y=this._r[2],v=this._r[3],m=this._r[4],_=this._r[5],b=this._r[6],w=this._r[7],E=this._r[8],S=this._r[9];n>=16;){var O=e[t+0]|e[t+1]<<8;i+=8191&O;var R=e[t+2]|e[t+3]<<8;o+=8191&(O>>>13|R<<3);var x=e[t+4]|e[t+5]<<8;s+=8191&(R>>>10|x<<6);var I=e[t+6]|e[t+7]<<8;a+=8191&(x>>>7|I<<9);var C=e[t+8]|e[t+9]<<8;c+=8191&(I>>>4|C<<12),u+=C>>>1&8191;var P=e[t+10]|e[t+11]<<8;l+=8191&(C>>>14|P<<2);var k=e[t+12]|e[t+13]<<8;f+=8191&(P>>>11|k<<5);var N=e[t+14]|e[t+15]<<8,A=0,T=A;T+=i*p,T+=o*(5*S),T+=s*(5*E),T+=a*(5*w),A=(T+=c*(5*b))>>>13,T&=8191,T+=u*(5*_),T+=l*(5*m),T+=f*(5*v),T+=(h+=8191&(k>>>8|N<<8))*(5*y);var M=A+=(T+=(d+=N>>>5|r)*(5*g))>>>13;M+=i*g,M+=o*p,M+=s*(5*S),M+=a*(5*E),A=(M+=c*(5*w))>>>13,M&=8191,M+=u*(5*b),M+=l*(5*_),M+=f*(5*m),M+=h*(5*v),A+=(M+=d*(5*y))>>>13,M&=8191;var L=A;L+=i*y,L+=o*g,L+=s*p,L+=a*(5*S),A=(L+=c*(5*E))>>>13,L&=8191,L+=u*(5*w),L+=l*(5*b),L+=f*(5*_),L+=h*(5*m);var U=A+=(L+=d*(5*v))>>>13;U+=i*v,U+=o*y,U+=s*g,U+=a*p,A=(U+=c*(5*S))>>>13,U&=8191,U+=u*(5*E),U+=l*(5*w),U+=f*(5*b),U+=h*(5*_);var j=A+=(U+=d*(5*m))>>>13;j+=i*m,j+=o*v,j+=s*y,j+=a*g,A=(j+=c*p)>>>13,j&=8191,j+=u*(5*S),j+=l*(5*E),j+=f*(5*w),j+=h*(5*b);var D=A+=(j+=d*(5*_))>>>13;D+=i*_,D+=o*m,D+=s*v,D+=a*y,A=(D+=c*g)>>>13,D&=8191,D+=u*p,D+=l*(5*S),D+=f*(5*E),D+=h*(5*w);var z=A+=(D+=d*(5*b))>>>13;z+=i*b,z+=o*_,z+=s*m,z+=a*v,A=(z+=c*y)>>>13,z&=8191,z+=u*g,z+=l*p,z+=f*(5*S),z+=h*(5*E);var B=A+=(z+=d*(5*w))>>>13;B+=i*w,B+=o*b,B+=s*_,B+=a*m,A=(B+=c*v)>>>13,B&=8191,B+=u*y,B+=l*g,B+=f*p,B+=h*(5*S);var F=A+=(B+=d*(5*E))>>>13;F+=i*E,F+=o*w,F+=s*b,F+=a*_,A=(F+=c*m)>>>13,F&=8191,F+=u*v,F+=l*y,F+=f*g,F+=h*p;var H=A+=(F+=d*(5*S))>>>13;H+=i*S,H+=o*E,H+=s*w,H+=a*b,A=(H+=c*_)>>>13,H&=8191,H+=u*m,H+=l*v,H+=f*y,H+=h*g,i=T=8191&(A=(A=((A+=(H+=d*p)>>>13)<<2)+A|0)+(T&=8191)|0),o=M+=A>>>=13,s=L&=8191,a=U&=8191,c=j&=8191,u=D&=8191,l=z&=8191,f=B&=8191,h=F&=8191,d=H&=8191,t+=16,n-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=u,this._h[6]=l,this._h[7]=f,this._h[8]=h,this._h[9]=d},t.prototype.finish=function(e,t){void 0===t&&(t=0);var n,r,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(n=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=n,n=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*n,n=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=n,n=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=n,s[0]=this._h[0]+5,n=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+n,n=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,r=(1^n)-1,o=0;o<10;o++)s[o]&=r;for(r=~r,o=0;o<10;o++)this._h[o]=this._h[o]&r|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var t,n=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[n+i];if(r-=t,n+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(r>=16&&(t=r-r%16,this._blocks(e,n,t),n+=t,r-=t),r){for(i=0;i<r;i++)this._buffer[this._leftover+i]=e[n+i];this._leftover+=r}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();function i(e,t){var n=new r(e);n.update(t);var i=n.digest();return n.clean(),i}function o(n,r){return n.length===e.DIGEST_LENGTH&&r.length===e.DIGEST_LENGTH&&t.equal(n,r)}e.Poly1305=r,e.oneTimeAuth=i,e.equal=o}(Os),function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ys,n=Os,r=gr,i=Or,o=Rs;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var s=new Uint8Array(16),a=function(){function a(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return a.prototype.seal=function(e,n,i,o){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);t.stream(this._key,s,a,4);var c,u=n.length+this.tagLength;if(o){if(o.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");c=o}else c=new Uint8Array(u);return t.streamXOR(this._key,s,n,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),i),r.wipe(s),c},a.prototype.open=function(e,n,i,s){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(n.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);t.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,n.subarray(0,n.length-this.tagLength),i),!o.equal(u,n.subarray(n.length-this.tagLength,n.length)))return null;var l,f=n.length-this.tagLength;if(s){if(s.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");l=s}else l=new Uint8Array(f);return t.streamXOR(this._key,a,n.subarray(0,n.length-this.tagLength),l,4),r.wipe(a),l},a.prototype.clean=function(){return r.wipe(this._key),this},a.prototype._authenticate=function(e,t,o,a){var c=new n.Poly1305(t);a&&(c.update(a),a.length%16>0&&c.update(s.subarray(a.length%16))),c.update(o),o.length%16>0&&c.update(s.subarray(o.length%16));var u=new Uint8Array(8);a&&i.writeUint64LE(a.length,u),c.update(u),i.writeUint64LE(o.length,u),c.update(u);for(var l=c.digest(),f=0;f<l.length;f++)e[f]=l[f];c.clean(),r.wipe(l),r.wipe(u)},a}();e.ChaCha20Poly1305=a}(gs);var ks={},Ns={},As={};function Ts(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}Object.defineProperty(As,"__esModule",{value:!0}),As.isSerializableHash=Ts,Object.defineProperty(Ns,"__esModule",{value:!0});var Ms=As,Ls=Rs,Us=gr,js=function(){function e(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);for(var r=0;r<n.length;r++)n[r]^=54;for(this._inner.update(n),r=0;r<n.length;r++)n[r]^=106;this._outer.update(n),Ms.isSerializableHash(this._inner)&&Ms.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Us.wipe(n)}return e.prototype.reset=function(){if(!Ms.isSerializableHash(this._inner)||!Ms.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},e.prototype.clean=function(){Ms.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ms.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.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)},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!Ms.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!Ms.isSerializableHash(this._inner)||!Ms.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},e.prototype.cleanSavedState=function(e){if(!Ms.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();function Ds(e,t,n){var r=new js(e,t);r.update(n);var i=r.digest();return r.clean(),i}Ns.HMAC=js,Ns.hmac=Ds,Ns.equal=Ls.equal,Object.defineProperty(ks,"__esModule",{value:!0});var zs=Ns,Bs=gr,Fs=function(){function e(e,t,n,r){void 0===n&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=r;var i=zs.hmac(this._hash,n,t);this._hmac=new zs.HMAC(e,i),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)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},e.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),Bs.wipe(this._buffer),Bs.wipe(this._counter),this._bufpos=0},e}(),Hs=ks.HKDF=Fs,$s={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Or,n=gr;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var r=function(){function r(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 r.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},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=o(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var n=this._bytesHashed,r=this._bufferLength,i=n/536870912|0,s=n<<3,a=n%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/4;c++)t.writeUint32BE(this._state[c],e,4*c);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();e.SHA256=r;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(e,n,r,o,s){for(;s>=64;){for(var a=n[0],c=n[1],u=n[2],l=n[3],f=n[4],h=n[5],d=n[6],p=n[7],g=0;g<16;g++){var y=o+4*g;e[g]=t.readUint32BE(r,y)}for(g=16;g<64;g++){var v=e[g-2],m=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,_=((v=e[g-15])>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;e[g]=(m+e[g-7]|0)+(_+e[g-16]|0)}for(g=0;g<64;g++)m=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&h^~f&d)|0)+(p+(i[g]+e[g]|0)|0)|0,_=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&u^c&u)|0,p=d,d=h,h=f,f=l+m|0,l=u,u=c,c=a,a=m+_|0;n[0]+=a,n[1]+=c,n[2]+=u,n[3]+=l,n[4]+=f,n[5]+=h,n[6]+=d,n[7]+=p,o+=64,s-=64}return o}function s(e){var t=new r;t.update(e);var n=t.digest();return t.clean(),n}e.hash=s}($s);var Vs={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=cr,n=gr;function r(e){const t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;const i=new Uint8Array(32);i[0]=9;const o=r([56129,1]);function s(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function a(e,t,n){const r=~(n-1);for(let n=0;n<16;n++){const i=r&(e[n]^t[n]);e[n]^=i,t[n]^=i}}function c(e,t){const n=r(),i=r();for(let e=0;e<16;e++)i[e]=t[e];s(i),s(i),s(i);for(let e=0;e<2;e++){n[0]=i[0]-65517;for(let e=1;e<15;e++)n[e]=i[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=i[15]-32767-(n[14]>>16&1);const e=n[15]>>16&1;n[14]&=65535,a(i,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}function u(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function l(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function f(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function h(e,t,n){let r,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,g=0,y=0,v=0,m=0,_=0,b=0,w=0,E=0,S=0,O=0,R=0,x=0,I=0,C=0,P=0,k=0,N=0,A=0,T=0,M=0,L=0,U=n[0],j=n[1],D=n[2],z=n[3],B=n[4],F=n[5],H=n[6],$=n[7],V=n[8],q=n[9],W=n[10],K=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];r=t[0],o+=r*U,s+=r*j,a+=r*D,c+=r*z,u+=r*B,l+=r*F,f+=r*H,h+=r*$,d+=r*V,p+=r*q,g+=r*W,y+=r*K,v+=r*G,m+=r*Y,_+=r*Q,b+=r*J,r=t[1],s+=r*U,a+=r*j,c+=r*D,u+=r*z,l+=r*B,f+=r*F,h+=r*H,d+=r*$,p+=r*V,g+=r*q,y+=r*W,v+=r*K,m+=r*G,_+=r*Y,b+=r*Q,w+=r*J,r=t[2],a+=r*U,c+=r*j,u+=r*D,l+=r*z,f+=r*B,h+=r*F,d+=r*H,p+=r*$,g+=r*V,y+=r*q,v+=r*W,m+=r*K,_+=r*G,b+=r*Y,w+=r*Q,E+=r*J,r=t[3],c+=r*U,u+=r*j,l+=r*D,f+=r*z,h+=r*B,d+=r*F,p+=r*H,g+=r*$,y+=r*V,v+=r*q,m+=r*W,_+=r*K,b+=r*G,w+=r*Y,E+=r*Q,S+=r*J,r=t[4],u+=r*U,l+=r*j,f+=r*D,h+=r*z,d+=r*B,p+=r*F,g+=r*H,y+=r*$,v+=r*V,m+=r*q,_+=r*W,b+=r*K,w+=r*G,E+=r*Y,S+=r*Q,O+=r*J,r=t[5],l+=r*U,f+=r*j,h+=r*D,d+=r*z,p+=r*B,g+=r*F,y+=r*H,v+=r*$,m+=r*V,_+=r*q,b+=r*W,w+=r*K,E+=r*G,S+=r*Y,O+=r*Q,R+=r*J,r=t[6],f+=r*U,h+=r*j,d+=r*D,p+=r*z,g+=r*B,y+=r*F,v+=r*H,m+=r*$,_+=r*V,b+=r*q,w+=r*W,E+=r*K,S+=r*G,O+=r*Y,R+=r*Q,x+=r*J,r=t[7],h+=r*U,d+=r*j,p+=r*D,g+=r*z,y+=r*B,v+=r*F,m+=r*H,_+=r*$,b+=r*V,w+=r*q,E+=r*W,S+=r*K,O+=r*G,R+=r*Y,x+=r*Q,I+=r*J,r=t[8],d+=r*U,p+=r*j,g+=r*D,y+=r*z,v+=r*B,m+=r*F,_+=r*H,b+=r*$,w+=r*V,E+=r*q,S+=r*W,O+=r*K,R+=r*G,x+=r*Y,I+=r*Q,C+=r*J,r=t[9],p+=r*U,g+=r*j,y+=r*D,v+=r*z,m+=r*B,_+=r*F,b+=r*H,w+=r*$,E+=r*V,S+=r*q,O+=r*W,R+=r*K,x+=r*G,I+=r*Y,C+=r*Q,P+=r*J,r=t[10],g+=r*U,y+=r*j,v+=r*D,m+=r*z,_+=r*B,b+=r*F,w+=r*H,E+=r*$,S+=r*V,O+=r*q,R+=r*W,x+=r*K,I+=r*G,C+=r*Y,P+=r*Q,k+=r*J,r=t[11],y+=r*U,v+=r*j,m+=r*D,_+=r*z,b+=r*B,w+=r*F,E+=r*H,S+=r*$,O+=r*V,R+=r*q,x+=r*W,I+=r*K,C+=r*G,P+=r*Y,k+=r*Q,N+=r*J,r=t[12],v+=r*U,m+=r*j,_+=r*D,b+=r*z,w+=r*B,E+=r*F,S+=r*H,O+=r*$,R+=r*V,x+=r*q,I+=r*W,C+=r*K,P+=r*G,k+=r*Y,N+=r*Q,A+=r*J,r=t[13],m+=r*U,_+=r*j,b+=r*D,w+=r*z,E+=r*B,S+=r*F,O+=r*H,R+=r*$,x+=r*V,I+=r*q,C+=r*W,P+=r*K,k+=r*G,N+=r*Y,A+=r*Q,T+=r*J,r=t[14],_+=r*U,b+=r*j,w+=r*D,E+=r*z,S+=r*B,O+=r*F,R+=r*H,x+=r*$,I+=r*V,C+=r*q,P+=r*W,k+=r*K,N+=r*G,A+=r*Y,T+=r*Q,M+=r*J,r=t[15],b+=r*U,w+=r*j,E+=r*D,S+=r*z,O+=r*B,R+=r*F,x+=r*H,I+=r*$,C+=r*V,P+=r*q,k+=r*W,N+=r*K,A+=r*G,T+=r*Y,M+=r*Q,L+=r*J,o+=38*w,s+=38*E,a+=38*S,c+=38*O,u+=38*R,l+=38*x,f+=38*I,h+=38*C,d+=38*P,p+=38*k,g+=38*N,y+=38*A,v+=38*T,m+=38*M,_+=38*L,i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),i=1,r=o+i+65535,i=Math.floor(r/65536),o=r-65536*i,r=s+i+65535,i=Math.floor(r/65536),s=r-65536*i,r=a+i+65535,i=Math.floor(r/65536),a=r-65536*i,r=c+i+65535,i=Math.floor(r/65536),c=r-65536*i,r=u+i+65535,i=Math.floor(r/65536),u=r-65536*i,r=l+i+65535,i=Math.floor(r/65536),l=r-65536*i,r=f+i+65535,i=Math.floor(r/65536),f=r-65536*i,r=h+i+65535,i=Math.floor(r/65536),h=r-65536*i,r=d+i+65535,i=Math.floor(r/65536),d=r-65536*i,r=p+i+65535,i=Math.floor(r/65536),p=r-65536*i,r=g+i+65535,i=Math.floor(r/65536),g=r-65536*i,r=y+i+65535,i=Math.floor(r/65536),y=r-65536*i,r=v+i+65535,i=Math.floor(r/65536),v=r-65536*i,r=m+i+65535,i=Math.floor(r/65536),m=r-65536*i,r=_+i+65535,i=Math.floor(r/65536),_=r-65536*i,r=b+i+65535,i=Math.floor(r/65536),b=r-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=_,e[15]=b}function d(e,t){h(e,t,t)}function p(e,t){const n=r();for(let e=0;e<16;e++)n[e]=t[e];for(let e=253;e>=0;e--)d(n,n),2!==e&&4!==e&&h(n,n,t);for(let t=0;t<16;t++)e[t]=n[t]}function g(e,t){const n=new Uint8Array(32),i=new Float64Array(80),s=r(),g=r(),y=r(),v=r(),m=r(),_=r();for(let t=0;t<31;t++)n[t]=e[t];n[31]=127&e[31]|64,n[0]&=248,u(i,t);for(let e=0;e<16;e++)g[e]=i[e];s[0]=v[0]=1;for(let e=254;e>=0;--e){const t=n[e>>>3]>>>(7&e)&1;a(s,g,t),a(y,v,t),l(m,s,y),f(s,s,y),l(y,g,v),f(g,g,v),d(v,m),d(_,s),h(s,y,s),h(y,g,m),l(m,s,y),f(s,s,y),d(g,s),f(y,v,_),h(s,y,o),l(s,s,v),h(y,y,s),h(s,v,_),h(v,g,i),d(g,m),a(s,g,t),a(y,v,t)}for(let e=0;e<16;e++)i[e+16]=s[e],i[e+32]=y[e],i[e+48]=g[e],i[e+64]=v[e];const b=i.subarray(32),w=i.subarray(16);p(b,b),h(w,w,b);const E=new Uint8Array(32);return c(E,w),E}function y(e){return g(e,i)}function v(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const n=new Uint8Array(t);return{publicKey:y(n),secretKey:n}}function m(e){const r=(0,t.randomBytes)(32,e),i=v(r);return(0,n.wipe)(r),i}function _(t,n,r=!1){if(t.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(n.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const i=g(t,n);if(r){let e=0;for(let t=0;t<i.length;t++)e|=i[t];if(0===e)throw new Error("X25519: invalid shared key")}return i}e.scalarMult=g,e.scalarMultBase=y,e.generateKeyPairFromSeed=v,e.generateKeyPair=m,e.sharedKey=_}(Vs);var qs=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Ws=function(){function e(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return e}(),Ks=function(){function e(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return e}(),Gs=function(){function e(e,t,n,r){this.name=e,this.version=t,this.os=n,this.bot=r,this.type="bot-device"}return e}(),Ys=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Qs=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Js=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xs=3,Zs=[["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",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],ea=[["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 ta(e){return e?ra(e):typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product?new Qs:typeof navigator<"u"?ra(navigator.userAgent):oa()}function na(e){return""!==e&&Zs.reduce((function(t,n){var r=n[0],i=n[1];if(t)return t;var o=i.exec(e);return!!o&&[r,o]}),!1)}function ra(e){var t=na(e);if(!t)return null;var n=t[0],r=t[1];if("searchbot"===n)return new Ys;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<Xs&&(i=qs(qs([],i,!0),sa(Xs-i.length),!0)):i=[];var o=i.join("."),s=ia(e),a=Js.exec(e);return a&&a[1]?new Gs(n,o,s,a[1]):new Ws(n,o,s)}function ia(e){for(var t=0,n=ea.length;t<n;t++){var r=ea[t],i=r[0];if(r[1].exec(e))return i}return null}function oa(){return typeof process<"u"&&process.version?new Ks(process.version.slice(1)):null}function sa(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}var aa={};function ca(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}function ua(e){const t=ca(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}function la(){return ua("document")}function fa(){return ca("document")}Object.defineProperty(aa,"__esModule",{value:!0}),aa.getLocalStorage=aa.getLocalStorageOrThrow=aa.getCrypto=aa.getCryptoOrThrow=ma=aa.getLocation=aa.getLocationOrThrow=ga=aa.getNavigator=aa.getNavigatorOrThrow=ha=aa.getDocument=aa.getDocumentOrThrow=aa.getFromWindowOrThrow=aa.getFromWindow=void 0,aa.getFromWindow=ca,aa.getFromWindowOrThrow=ua,aa.getDocumentOrThrow=la;var ha=aa.getDocument=fa;function da(){return ua("navigator")}function pa(){return ca("navigator")}aa.getNavigatorOrThrow=da;var ga=aa.getNavigator=pa;function ya(){return ua("location")}function va(){return ca("location")}aa.getLocationOrThrow=ya;var ma=aa.getLocation=va;function _a(){return ua("crypto")}function ba(){return ca("crypto")}function wa(){return ua("localStorage")}function Ea(){return ca("localStorage")}aa.getCryptoOrThrow=_a,aa.getCrypto=ba,aa.getLocalStorageOrThrow=wa,aa.getLocalStorage=Ea;var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});var Oa=Sa.getWindowMetadata=void 0;const Ra=aa;function xa(){let e,t;try{e=Ra.getDocumentOrThrow(),t=Ra.getLocationOrThrow()}catch{return null}function n(){const n=e.getElementsByTagName("link"),r=[];for(let e=0;e<n.length;e++){const i=n[e],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let n=t.protocol+"//"+t.host;if(0===e.indexOf("/"))n+=e;else{const r=t.pathname.split("/");r.pop(),n+=r.join("/")+"/"+e}r.push(n)}else if(0===e.indexOf("//")){const n=t.protocol+e;r.push(n)}else r.push(e)}}return r}function r(...t){const n=e.getElementsByTagName("meta");for(let e=0;e<n.length;e++){const r=n[e],i=["itemprop","property","name"].map((e=>r.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=r.getAttribute("content");if(e)return e}}return""}function i(){let t=r("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}function o(){return r("description","og:description","twitter:description","keywords")}const s=i();return{description:o(),url:t.origin,icons:n(),name:s}}Oa=Sa.getWindowMetadata=xa;var Ia={},Ca=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),Pa="%[a-f0-9]{2}",ka=new RegExp("("+Pa+")|([^%]+?)","gi"),Na=new RegExp("("+Pa+")+","gi");function Aa(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Aa(n),Aa(r))}function Ta(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(ka)||[],n=1;n<t.length;n++)t=(e=Aa(t,n).join("")).match(ka)||[];return e}}function Ma(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=Na.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{var r=Ta(n[0]);r!==n[0]&&(t[n[0]]=r)}n=Na.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),o=0;o<i.length;o++){var s=i[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}var La=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Ma(e)}},Ua=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]},ja=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),o=0;o<r.length;o++){var s=r[o],a=e[s];(i?-1!==t.indexOf(s):t(s,a,e))&&(n[s]=a)}return n};!function(e){const t=Ca,n=La,r=Ua,i=ja,o=e=>null==e,s=Symbol("encodeFragmentIdentifier");function a(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",i,"]"].join("")]:[...n,[l(t,e),"[",l(i,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[l(n,e),t,l(i,e)].join("")]:[[r,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}function c(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&f(n,e).includes(e.arrayFormatSeparator);n=o?f(n,e):n;const s=i||o?n.split(e.arrayFormatSeparator).map((t=>f(t,e))):null===n?n:f(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n&&f(n,e));const o=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>f(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}function u(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function f(e,t){return t.decode?n(e):e}function h(e){return Array.isArray(e)?e.sort():"object"==typeof e?h(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}function g(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function y(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function v(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=c(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const o of e.split("&")){if(""===o)continue;let[e,s]=r(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:f(s,t),n(f(e,t),s,i)}for(const e of Object.keys(i)){const n=i[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=y(n[e],t);else i[e]=y(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const n=i[t];return n&&"object"==typeof n&&!Array.isArray(n)?e[t]=h(n):e[t]=n,e}),Object.create(null))}e.extract=g,e.parse=v,e.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&o(e[n])||t.skipEmptyString&&""===e[n],r=a(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map((n=>{const i=e[n];return void 0===i?"":null===i?l(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":i.reduce(r(n),[]).join("&"):l(n,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:v(g(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:f(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=d(t.url).split("?")[0]||"",i=e.extract(t.url),o=e.parse(i,{sort:!1}),a=Object.assign(o,t.query);let c=e.stringify(a,n);c&&(c=`?${c}`);let u=p(t.url);return t.fragmentIdentifier&&(u=`#${n[s]?l(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${c}${u}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:a,fragmentIdentifier:c}=e.parseUrl(t,r);return e.stringifyUrl({url:o,query:i(a,n),fragmentIdentifier:c},r)},e.exclude=(t,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}}(Ia);const Da={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function za(e,t){return e.includes(":")?[e]:t.chains||[]}const Ba="base10",Fa="base16",Ha="base64pad",$a="utf8",Va=0,qa=1,Wa=0,Ka=1,Ga=12,Ya=32;function Qa(){const e=Vs.generateKeyPair();return{privateKey:ss(e.secretKey,Fa),publicKey:ss(e.publicKey,Fa)}}function Ja(){return ss(cr.randomBytes(Ya),Fa)}function Xa(e,t){const n=Vs.sharedKey(as(e,Fa),as(t,Fa));return ss(new Hs($s.SHA256,n).expand(Ya),Fa)}function Za(e){return ss($s.hash(as(e,Fa)),Fa)}function ec(e){return ss($s.hash(as(e,$a)),Fa)}function tc(e){return as(`${e}`,Ba)}function nc(e){return Number(ss(e,Ba))}function rc(e){const t=tc(typeof e.type<"u"?e.type:Va);if(nc(t)===qa&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof e.senderPublicKey<"u"?as(e.senderPublicKey,Fa):void 0,r=typeof e.iv<"u"?as(e.iv,Fa):cr.randomBytes(Ga);return oc({type:t,sealed:new gs.ChaCha20Poly1305(as(e.symKey,Fa)).seal(r,as(e.message,$a)),iv:r,senderPublicKey:n})}function ic(e){const t=new gs.ChaCha20Poly1305(as(e.symKey,Fa)),{sealed:n,iv:r}=sc(e.encoded),i=t.open(r,n);if(null===i)throw new Error("Failed to decrypt");return ss(i,$a)}function oc(e){if(nc(e.type)===qa){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ss(_i([e.type,e.senderPublicKey,e.iv,e.sealed]),Ha)}return ss(_i([e.type,e.iv,e.sealed]),Ha)}function sc(e){const t=as(e,Ha),n=t.slice(Wa,Ka),r=Ka;if(nc(n)===qa){const e=r+Ya,i=e+Ga,o=t.slice(r,e),s=t.slice(e,i);return{type:n,sealed:t.slice(i),iv:s,senderPublicKey:o}}const i=r+Ga,o=t.slice(r,i);return{type:n,sealed:t.slice(i),iv:o}}function ac(e,t){const n=sc(e);return cc({type:nc(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?ss(n.senderPublicKey,Fa):void 0,receiverPublicKey:t?.receiverPublicKey})}function cc(e){const t=e?.type||Va;if(t===qa){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function uc(e){return e.type===qa&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var lc=Object.defineProperty,fc=Object.getOwnPropertySymbols,hc=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable,pc=(e,t,n)=>t in e?lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gc=(e,t)=>{for(var n in t||(t={}))hc.call(t,n)&&pc(e,n,t[n]);if(fc)for(var n of fc(t))dc.call(t,n)&&pc(e,n,t[n]);return e};const yc="ReactNative",vc={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},mc="js";function _c(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function bc(){return!ha()&&!!ga()&&navigator.product===yc}function wc(){return!_c()&&!!ga()}function Ec(){return bc()?vc.reactNative:_c()?vc.node:wc()?vc.browser:vc.unknown}function Sc(e,t){let n=Ia.parse(e);return n=gc(gc({},n),t),e=Ia.stringify(n)}function Oc(){return Oa()||{name:"",description:"",url:"",icons:[""]}}function Rc(){const e=ta();if(null===e)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function xc(){var e;const t=Ec();return t===vc.browser?[t,(null==(e=ma())?void 0:e.host)||"unknown"].join(":"):t}function Ic(e,t,n){const r=Rc(),i=xc();return[[e,t].join("-"),[mc,n].join("-"),r,i].join("/")}function Cc({protocol:e,version:t,relayUrl:n,sdkVersion:r,auth:i,projectId:o,useOnCloseEvent:s}){const a=n.split("?"),c={auth:i,ua:Ic(e,t,r),projectId:o,useOnCloseEvent:s||void 0},u=Sc(a[1]||"",c);return a[0]+"?"+u}function Pc(e,t){return e.filter((e=>t.includes(e))).length===e.length}function kc(e){return Object.fromEntries(e.entries())}function Nc(e){return new Map(Object.entries(e))}function Ac(e=We.FIVE_MINUTES,t){const n=We.toMiliseconds(e||We.FIVE_MINUTES);let r,i,o;return{resolve:e=>{o&&r&&(clearTimeout(o),r(e))},reject:e=>{o&&i&&(clearTimeout(o),i(e))},done:()=>new Promise(((e,s)=>{o=setTimeout((()=>{s(new Error(t))}),n),r=e,i=s}))}}function Tc(e,t,n){return new Promise((async(r,i)=>{const o=setTimeout((()=>i(new Error(n))),t);try{r(await e)}catch(e){i(e)}clearTimeout(o)}))}function Mc(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function Lc(e){return Mc("topic",e)}function Uc(e){return Mc("id",e)}function jc(e){const[t,n]=e.split(":"),r={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof n)r.topic=n;else{if("id"!==t||!Number.isInteger(Number(n)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${n}`);r.id=Number(n)}return r}function Dc(e,t){return We.fromMiliseconds((t||Date.now())+We.toMiliseconds(e))}function zc(e){return Date.now()>=We.toMiliseconds(e)}function Bc(e,t){return`${e}${t?`:${t}`:""}`}function Fc(e=[],t=[]){return[...new Set([...e,...t])]}async function Hc({id:e,topic:t,wcDeepLink:n}){try{if(!n)return;const r="string"==typeof n?JSON.parse(n):n;let i=r?.href;if("string"!=typeof i)return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${e}&sessionTopic=${t}`,s=Ec();s===vc.browser?window.open(o,"_self","noreferrer noopener"):s===vc.reactNative&&typeof(null==d?void 0:d.Linking)<"u"&&await d.Linking.openURL(o)}catch(e){console.error(e)}}const $c="irn";function Vc(e){return e?.relay||{protocol:$c}}function qc(e){const t=Da[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Wc=Object.defineProperty,Kc=Object.getOwnPropertySymbols,Gc=Object.prototype.hasOwnProperty,Yc=Object.prototype.propertyIsEnumerable,Qc=(e,t,n)=>t in e?Wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jc=(e,t)=>{for(var n in t||(t={}))Gc.call(t,n)&&Qc(e,n,t[n]);if(Kc)for(var n of Kc(t))Yc.call(t,n)&&Qc(e,n,t[n]);return e};function Xc(e,t="-"){const n={},r="relay"+t;return Object.keys(e).forEach((t=>{if(t.startsWith(r)){const i=t.replace(r,""),o=e[t];n[i]=o}})),n}function Zc(e){const t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=e.substring(t+1,n).split("@"),o=typeof n<"u"?e.substring(n):"",s=Ia.parse(o);return{protocol:r,topic:eu(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:Xc(s)}}function eu(e){return e.startsWith("//")?e.substring(2):e}function tu(e,t="-"){const n="relay",r={};return Object.keys(e).forEach((i=>{const o=n+t+i;e[i]&&(r[o]=e[i])})),r}function nu(e){return`${e.protocol}:${e.topic}@${e.version}?`+Ia.stringify(Jc({symKey:e.symKey},tu(e.relay)))}function ru(e){const t=[];return e.forEach((e=>{const[n,r]=e.split(":");t.push(`${n}:${r}`)})),t}function iu(e){const t=[];return Object.values(e).forEach((e=>{t.push(...ru(e.accounts))})),t}function ou(e,t){const n=[];return Object.values(e).forEach((e=>{ru(e.accounts).includes(t)&&n.push(...e.methods)})),n}function su(e,t){const n=[];return Object.values(e).forEach((e=>{ru(e.accounts).includes(t)&&n.push(...e.events)})),n}function au(e,t){const n=Mu(e,t);if(n)throw new Error(n.message);const r={};for(const[t,n]of Object.entries(e))r[t]={methods:n.methods,events:n.events,chains:n.accounts.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))};return r}function cu(e){return e.includes(":")}function uu(e){return cu(e)?e.split(":")[0]:e}const lu={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}},fu={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 hu(e,t){const{message:n,code:r}=fu[e];return{message:t?`${n} ${t}`:n,code:r}}function du(e,t){const{message:n,code:r}=lu[e];return{message:t?`${n} ${t}`:n,code:r}}function pu(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function gu(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function yu(e){return typeof e>"u"}function vu(e,t){return!(!t||!yu(e))||"string"==typeof e&&!!e.trim().length}function mu(e,t){return!(!t||!yu(e))||"number"==typeof e&&!isNaN(e)}function _u(e,t){const{requiredNamespaces:n}=t,r=Object.keys(e.namespaces),i=Object.keys(n);let o=!0;return!!Pc(i,r)&&(r.forEach((t=>{const{accounts:r,methods:i,events:s}=e.namespaces[t],a=ru(r),c=n[t];Pc(za(t,c),a)&&Pc(c.methods,i)&&Pc(c.events,s)||(o=!1)})),o)}function bu(e){return!(!vu(e,!1)||!e.includes(":"))&&2===e.split(":").length}function wu(e){if(vu(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&bu(e)}}return!1}function Eu(e){if(vu(e,!1))try{return typeof new URL(e)<"u"}catch{return!1}return!1}function Su(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}function Ou(e){return e?.topic}function Ru(e,t){let n=null;return vu(e?.publicKey,!1)||(n=hu("MISSING_OR_INVALID",`${t} controller public key should be a string`)),n}function xu(e){let t=!0;return pu(e)?e.length&&(t=e.every((e=>vu(e,!1)))):t=!1,t}function Iu(e,t,n){let r=null;return pu(t)?t.forEach((t=>{r||(!bu(t)||!t.includes(e))&&(r=du("UNSUPPORTED_CHAINS",`${n}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):r=du("UNSUPPORTED_CHAINS",`${n}, chains ${t} should be an array of strings conforming to "namespace:chainId" format`),r}function Cu(e,t){let n=null;return Object.entries(e).forEach((([e,r])=>{if(n)return;const i=Iu(e,za(e,r),`${t} requiredNamespace`);i&&(n=i)})),n}function Pu(e,t){let n=null;return pu(e)?e.forEach((e=>{n||wu(e)||(n=du("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))})):n=du("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function ku(e,t){let n=null;return Object.values(e).forEach((e=>{if(n)return;const r=Pu(e?.accounts,`${t} namespace`);r&&(n=r)})),n}function Nu(e,t){let n=null;return xu(e?.methods)?xu(e?.events)||(n=du("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):n=du("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),n}function Au(e,t){let n=null;return Object.values(e).forEach((e=>{if(n)return;const r=Nu(e,`${t}, namespace`);r&&(n=r)})),n}function Tu(e,t,n){let r=null;if(e&&gu(e)){const n=Au(e,t);n&&(r=n);const i=Cu(e,t);i&&(r=i)}else r=hu("MISSING_OR_INVALID",`${t}, ${n} should be an object with data`);return r}function Mu(e,t){let n=null;if(e&&gu(e)){const r=Au(e,t);r&&(n=r);const i=ku(e,t);i&&(n=i)}else n=hu("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return n}function Lu(e){return vu(e.protocol,!0)}function Uu(e,t){let n=!1;return t&&!e?n=!0:e&&pu(e)&&e.length&&e.forEach((e=>{n=Lu(e)})),n}function ju(e){return"number"==typeof e}function Du(e){return typeof e<"u"&&null!==typeof e}function zu(e){return!!(e&&"object"==typeof e&&e.code&&mu(e.code,!1)&&e.message&&vu(e.message,!1))}function Bu(e){return!(yu(e)||!vu(e.method,!1))}function Fu(e){return!(yu(e)||yu(e.result)&&yu(e.error)||!mu(e.id,!1)||!vu(e.jsonrpc,!1))}function Hu(e){return!(yu(e)||!vu(e.name,!1))}function $u(e,t){return!(!bu(t)||!iu(e).includes(t))}function Vu(e,t,n){return!!vu(n,!1)&&ou(e,t).includes(n)}function qu(e,t,n){return!!vu(n,!1)&&su(e,t).includes(n)}function Wu(e,t,n){let r=null;const i=Ku(e),o=Yu(t),s=Object.keys(i),a=Object.keys(o),c=Gu(Object.keys(e)),u=Gu(Object.keys(t)),l=c.filter((e=>!u.includes(e)));return l.length&&(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces.\n Required: ${l.toString()}\n Received: ${Object.keys(t).toString()}`)),Pc(s,a)||(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach((e=>{if(!e.includes(":")||r)return;const i=ru(t[e].accounts);i.includes(e)||(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${i.toString()}`))})),s.forEach((e=>{r||(Pc(i[e].methods,o[e].methods)?Pc(i[e].events,o[e].events)||(r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${e}`)):r=hu("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${e}`))})),r}function Ku(e){const t={};return Object.keys(e).forEach((n=>{var r;n.includes(":")?t[n]=e[n]:null==(r=e[n].chains)||r.forEach((r=>{t[r]={methods:e[n].methods,events:e[n].events}}))})),t}function Gu(e){return[...new Set(e.map((e=>e.includes(":")?e.split(":")[0]:e)))]}function Yu(e){const t={};return Object.keys(e).forEach((n=>{if(n.includes(":"))t[n]=e[n];else{const r=ru(e[n].accounts);r?.forEach((r=>{t[r]={accounts:e[n].accounts.filter((e=>e.includes(`${r}:`))),methods:e[n].methods,events:e[n].events}}))}})),t}function Qu(e,t){return mu(e,!1)&&e<=t.max&&e>=t.min}const Ju="INTERNAL_ERROR",Xu="SERVER_ERROR",Zu=[-32700,-32600,-32601,-32602,-32603],el={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[Ju]:{code:-32603,message:"Internal error"},[Xu]:{code:-32e3,message:"Server error"}},tl=Xu;function nl(e){return Zu.includes(e)}function rl(e){return Object.keys(el).includes(e)?el[e]:el[tl]}function il(e){return Object.values(el).find((t=>t.code===e))||el[tl]}function ol(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${t}`):e}var sl={},al=function(e,t){return(al=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};
|
307
307
|
/*! *****************************************************************************
|
308
308
|
Copyright (c) Microsoft Corporation.
|
309
309
|
|
@@ -317,7 +317,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
317
317
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
318
318
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
319
319
|
PERFORMANCE OF THIS SOFTWARE.
|
320
|
-
***************************************************************************** */function cl(e,t){function n(){this.constructor=e}al(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ul=function(){return ul=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ul.apply(this,arguments)};function ll(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function fl(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function hl(e,t){return function(n,r){t(n,r,e)}}function dl(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function pl(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):i(e.value).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function gl(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function yl(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function vl(e,t){for(var n in e)"default"!==n&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function ml(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function bl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_l(arguments[t]));return e}function wl(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function El(e){return this instanceof El?(this.v=e,this):new El(e)}function Sl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{c(i[e](t))}catch(e){f(o[0][3],e)}}function c(e){e.value instanceof El?Promise.resolve(e.value.v).then(u,l):f(o[0][2],e)}function u(e){a("next",e)}function l(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Ol(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:El(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function Rl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof ml?ml(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){i(r,o,(t=e[n](t)).done,t.value)}))}}function i(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}}function xl(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Il(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function Cl(e){return e&&e.__esModule?e:{default:e}}function Pl(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function kl(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var Nl,Al=r(Object.freeze({__proto__:null,__extends:cl,get __assign(){return ul},__rest:ll,__decorate:fl,__param:hl,__metadata:dl,__awaiter:pl,__generator:gl,__createBinding:yl,__exportStar:vl,__values:ml,__read:_l,__spread:bl,__spreadArrays:wl,__await:El,__asyncGenerator:Sl,__asyncDelegator:Ol,__asyncValues:Rl,__makeTemplateObject:xl,__importStar:Il,__importDefault:Cl,__classPrivateFieldGet:Pl,__classPrivateFieldSet:kl})),Tl={};function Ml(){if(Nl)return Tl;function e(){return t?.crypto||t?.msCrypto||{}}function n(){const t=e();return t.subtle||t.webkitSubtle}function r(){return!!e()&&!!n()}return Nl=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.isBrowserCryptoAvailable=Tl.getSubtleCrypto=Tl.getBrowerCrypto=void 0,Tl.getBrowerCrypto=e,Tl.getSubtleCrypto=n,Tl.isBrowserCryptoAvailable=r,Tl}var Ll,Ul={};function jl(){if(Ll)return Ul;function e(){return typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product}function t(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function n(){return!e()&&!t()}return Ll=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.isBrowser=Ul.isNode=Ul.isReactNative=void 0,Ul.isReactNative=e,Ul.isNode=t,Ul.isBrowser=n,Ul}function Dl(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function zl(e=6){return BigInt(Dl(e))}function Bl(e,t,n){return{id:n||Dl(),jsonrpc:"2.0",method:e,params:t}}function Fl(e,t){return{id:e,jsonrpc:"2.0",result:t}}function Hl(e,t,n){return{id:e,jsonrpc:"2.0",error:$l(t,n)}}function $l(e,t){return typeof e>"u"?rl(Ju):("string"==typeof e&&(e=Object.assign(Object.assign({},rl(Xu)),{message:e})),typeof t<"u"&&(e.data=t),nl(e.code)&&(e=il(e.code)),e)}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Al;t.__exportStar(Ml(),e),t.__exportStar(jl(),e)}(sl);class Vl{}class ql extends Vl{constructor(){super()}}class Wl extends ql{constructor(e){super()}}const Kl="^https?:",Gl="^wss?:";function Yl(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}function Ql(e,t){const n=Yl(e);return!(typeof n>"u")&&new RegExp(t).test(n)}function Jl(e){return Ql(e,Kl)}function Xl(e){return Ql(e,Gl)}function Zl(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function ef(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function tf(e){return ef(e)&&"method"in e}function nf(e){return ef(e)&&(rf(e)||of(e))}function rf(e){return"result"in e}function of(e){return"error"in e}class sf extends Wl{constructor(e){super(e),this.events=new o.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Bl(e.method,e.params||[],e.id||zl().toString()),t)}async requestStrict(e,t){return new Promise((async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(e){r(e)}this.events.on(`${e.id}`,(e=>{of(e)?r(e.error):n(e.result)}));try{await this.connection.send(e,t)}catch(e){r(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),nf(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&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(),"string"==typeof e&&(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 af=10,cf=()=>typeof window<"u",uf=typeof d<"u"&&typeof d.WebSocket<"u"?d.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:Xi?Ji:(Xi=1,Ji=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")});class lf{constructor(e){if(this.url=e,this.events=new o.exports.EventEmitter,this.registering=!1,!Xl(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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise(((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())}))}async send(e,t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(sr(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Xl(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)}))}))}return this.url=e,this.registering=!0,new Promise(((t,n)=>{const r=sl.isReactNative()?void 0:{rejectUnauthorized:!Zl(e)},i=new uf(e,[],r);cf()?i.onerror=e=>{const t=e;n(this.emitError(t.error))}:i.on("error",(e=>{n(this.emitError(e))})),i.onopen=()=>{this.onOpen(i),t(i)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),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 t="string"==typeof e.data?or(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=Hl(e,n.message||n.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return ol(e,t,"WS")}resetMaxListeners(){this.events.getMaxListeners()>af&&this.events.setMaxListeners(af)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",t),t}}var ff={exports:{}};!function(e,n){var r=200,i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,c="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",h="[object Date]",d="[object Error]",p="[object Function]",g="[object GeneratorFunction]",y="[object Map]",v="[object Number]",m="[object Null]",_="[object Object]",b="[object Promise]",w="[object Proxy]",E="[object RegExp]",S="[object Set]",O="[object String]",R="[object Symbol]",x="[object Undefined]",I="[object WeakMap]",C="[object ArrayBuffer]",P="[object DataView]",k="[object Float64Array]",N="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",M="[object Uint8Array]",L="[object Uint8ClampedArray]",U="[object Uint16Array]",j="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,z=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,F={};F["[object Float32Array]"]=F[k]=F[N]=F[A]=F[T]=F[M]=F[L]=F[U]=F[j]=!0,F[c]=F[u]=F[C]=F[f]=F[P]=F[h]=F[d]=F[p]=F[y]=F[v]=F[_]=F[E]=F[S]=F[O]=F[I]=!1;var H="object"==typeof t&&t&&t.Object===Object&&t,$="object"==typeof self&&self&&self.Object===Object&&self,V=H||$||Function("return this")(),q=n&&!n.nodeType&&n,W=q&&e&&!e.nodeType&&e,K=W&&W.exports===q,G=K&&H.process,Y=function(){try{return G&&G.binding&&G.binding("util")}catch{}}(),Q=Y&&Y.isTypedArray;function J(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function X(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Z(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function ee(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function te(e){return function(t){return e(t)}}function ne(e,t){return e.has(t)}function re(e,t){return e?.[t]}function ie(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function oe(e,t){return function(n){return e(t(n))}}function se(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var ae=Array.prototype,ce=Function.prototype,ue=Object.prototype,le=V["__core-js_shared__"],fe=ce.toString,he=ue.hasOwnProperty,de=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),pe=ue.toString,ge=RegExp("^"+fe.call(he).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=K?V.Buffer:void 0,ve=V.Symbol,me=V.Uint8Array,_e=ue.propertyIsEnumerable,be=ae.splice,we=ve?ve.toStringTag:void 0,Ee=Object.getOwnPropertySymbols,Se=ye?ye.isBuffer:void 0,Oe=oe(Object.keys,Object),Re=xt(V,"DataView"),xe=xt(V,"Map"),Ie=xt(V,"Promise"),Ce=xt(V,"Set"),Pe=xt(V,"WeakMap"),ke=xt(Object,"create"),Ne=Lt(Re),Ae=Lt(xe),Te=Lt(Ie),Me=Lt(Ce),Le=Lt(Pe),Ue=ve?ve.prototype:void 0,je=Ue?Ue.valueOf:void 0;function De(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ze(){this.__data__=ke?ke(null):{},this.size=0}function Be(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Fe(e){var t=this.__data__;if(ke){var n=t[e];return n===i?void 0:n}return he.call(t,e)?t[e]:void 0}function He(e){var t=this.__data__;return ke?void 0!==t[e]:he.call(t,e)}function $e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ke&&void 0===t?i:t,this}function Ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qe(){this.__data__=[],this.size=0}function We(e){var t=this.__data__,n=ht(t,e);return!(n<0||(n==t.length-1?t.pop():be.call(t,n,1),--this.size,0))}function Ke(e){var t=this.__data__,n=ht(t,e);return n<0?void 0:t[n][1]}function Ge(e){return ht(this.__data__,e)>-1}function Ye(e,t){var n=this.__data__,r=ht(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Je(){this.size=0,this.__data__={hash:new De,map:new(xe||Ve),string:new De}}function Xe(e){var t=Rt(this,e).delete(e);return this.size-=t?1:0,t}function Ze(e){return Rt(this,e).get(e)}function et(e){return Rt(this,e).has(e)}function tt(e,t){var n=Rt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function nt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Qe;++t<n;)this.add(e[t])}function rt(e){return this.__data__.set(e,i),this}function it(e){return this.__data__.has(e)}function ot(e){var t=this.__data__=new Ve(e);this.size=t.size}function st(){this.__data__=new Ve,this.size=0}function at(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ct(e){return this.__data__.get(e)}function ut(e){return this.__data__.has(e)}function lt(e,t){var n=this.__data__;if(n instanceof Ve){var i=n.__data__;if(!xe||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qe(i)}return n.set(e,t),this.size=n.size,this}function ft(e,t){var n=Dt(e),r=!n&&jt(e),i=!n&&!r&&Bt(e),o=!n&&!r&&!i&&Wt(e),s=n||r||i||o,a=s?ee(e.length,String):[],c=a.length;for(var u in e)(t||he.call(e,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||kt(u,c)))&&a.push(u);return a}function ht(e,t){for(var n=e.length;n--;)if(Ut(e[n][0],t))return n;return-1}function dt(e,t,n){var r=t(e);return Dt(e)?r:X(r,n(e))}function pt(e){return null==e?void 0===e?x:m:we&&we in Object(e)?It(e):Mt(e)}function gt(e){return qt(e)&&pt(e)==c}function yt(e,t,n,r,i){return e===t||(null==e||null==t||!qt(e)&&!qt(t)?e!=e&&t!=t:vt(e,t,n,r,yt,i))}function vt(e,t,n,r,i,s){var a=Dt(e),l=Dt(t),f=a?u:Pt(e),h=l?u:Pt(t),d=(f=f==c?_:f)==_,p=(h=h==c?_:h)==_,g=f==h;if(g&&Bt(e)){if(!Bt(t))return!1;a=!0,d=!1}if(g&&!d)return s||(s=new ot),a||Wt(e)?wt(e,t,n,r,i,s):Et(e,t,f,n,r,i,s);if(!(n&o)){var y=d&&he.call(e,"__wrapped__"),v=p&&he.call(t,"__wrapped__");if(y||v){var m=y?e.value():e,b=v?t.value():t;return s||(s=new ot),i(m,b,n,r,s)}}return!!g&&(s||(s=new ot),St(e,t,n,r,i,s))}function mt(e){return!(!Vt(e)||At(e))&&(Ht(e)?ge:z).test(Lt(e))}function _t(e){return qt(e)&&$t(e.length)&&!!F[pt(e)]}function bt(e){if(!Tt(e))return Oe(e);var t=[];for(var n in Object(e))he.call(e,n)&&"constructor"!=n&&t.push(n);return t}function wt(e,t,n,r,i,a){var c=n&o,u=e.length,l=t.length;if(u!=l&&!(c&&l>u))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var h=-1,d=!0,p=n&s?new nt:void 0;for(a.set(e,t),a.set(t,e);++h<u;){var g=e[h],y=t[h];if(r)var v=c?r(y,g,h,t,e,a):r(g,y,h,e,t,a);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Z(t,(function(e,t){if(!ne(p,t)&&(g===e||i(g,e,n,r,a)))return p.push(t)}))){d=!1;break}}else if(g!==y&&!i(g,y,n,r,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function Et(e,t,n,r,i,a,c){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C:return!(e.byteLength!=t.byteLength||!a(new me(e),new me(t)));case f:case h:case v:return Ut(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case O:return e==t+"";case y:var u=ie;case S:var l=r&o;if(u||(u=se),e.size!=t.size&&!l)return!1;var p=c.get(e);if(p)return p==t;r|=s,c.set(e,t);var g=wt(u(e),u(t),r,i,a,c);return c.delete(e),g;case R:if(je)return je.call(e)==je.call(t)}return!1}function St(e,t,n,r,i,s){var a=n&o,c=Ot(e),u=c.length;if(u!=Ot(t).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in t:he.call(t,f)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var d=!0;s.set(e,t),s.set(t,e);for(var p=a;++l<u;){var g=e[f=c[l]],y=t[f];if(r)var v=a?r(y,g,f,t,e,s):r(g,y,f,e,t,s);if(!(void 0===v?g===y||i(g,y,n,r,s):v)){d=!1;break}p||(p="constructor"==f)}if(d&&!p){var m=e.constructor,_=t.constructor;m!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return s.delete(e),s.delete(t),d}function Ot(e){return dt(e,Kt,Ct)}function Rt(e,t){var n=e.__data__;return Nt(t)?n["string"==typeof t?"string":"hash"]:n.map}function xt(e,t){var n=re(e,t);return mt(n)?n:void 0}function It(e){var t=he.call(e,we),n=e[we];try{e[we]=void 0;var r=!0}catch{}var i=pe.call(e);return r&&(t?e[we]=n:delete e[we]),i}De.prototype.clear=ze,De.prototype.delete=Be,De.prototype.get=Fe,De.prototype.has=He,De.prototype.set=$e,Ve.prototype.clear=qe,Ve.prototype.delete=We,Ve.prototype.get=Ke,Ve.prototype.has=Ge,Ve.prototype.set=Ye,Qe.prototype.clear=Je,Qe.prototype.delete=Xe,Qe.prototype.get=Ze,Qe.prototype.has=et,Qe.prototype.set=tt,nt.prototype.add=nt.prototype.push=rt,nt.prototype.has=it,ot.prototype.clear=st,ot.prototype.delete=at,ot.prototype.get=ct,ot.prototype.has=ut,ot.prototype.set=lt;var Ct=Ee?function(e){return null==e?[]:(e=Object(e),J(Ee(e),(function(t){return _e.call(e,t)})))}:Gt,Pt=pt;function kt(e,t){return!!(t=t??a)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Nt(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function At(e){return!!de&&de in e}function Tt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ue)}function Mt(e){return pe.call(e)}function Lt(e){if(null!=e){try{return fe.call(e)}catch{}try{return e+""}catch{}}return""}function Ut(e,t){return e===t||e!=e&&t!=t}(Re&&Pt(new Re(new ArrayBuffer(1)))!=P||xe&&Pt(new xe)!=y||Ie&&Pt(Ie.resolve())!=b||Ce&&Pt(new Ce)!=S||Pe&&Pt(new Pe)!=I)&&(Pt=function(e){var t=pt(e),n=t==_?e.constructor:void 0,r=n?Lt(n):"";if(r)switch(r){case Ne:return P;case Ae:return y;case Te:return b;case Me:return S;case Le:return I}return t});var jt=gt(function(){return arguments}())?gt:function(e){return qt(e)&&he.call(e,"callee")&&!_e.call(e,"callee")},Dt=Array.isArray;function zt(e){return null!=e&&$t(e.length)&&!Ht(e)}var Bt=Se||Yt;function Ft(e,t){return yt(e,t)}function Ht(e){if(!Vt(e))return!1;var t=pt(e);return t==p||t==g||t==l||t==w}function $t(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Vt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qt(e){return null!=e&&"object"==typeof e}var Wt=Q?te(Q):_t;function Kt(e){return zt(e)?ft(e):bt(e)}function Gt(){return[]}function Yt(){return!1}e.exports=Ft}(ff,ff.exports);var hf=ff.exports,df=Object.defineProperty,pf=Object.getOwnPropertySymbols,gf=Object.prototype.hasOwnProperty,yf=Object.prototype.propertyIsEnumerable,vf=(e,t,n)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mf=(e,t)=>{for(var n in t||(t={}))gf.call(t,n)&&vf(e,n,t[n]);if(pf)for(var n of pf(t))yf.call(t,n)&&vf(e,n,t[n]);return e};function _f(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==n[s])throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var f=t[i],h=0,d=s-1;(0!==f||h<r)&&-1!==d;d--,h++)f+=256*u[d]>>>0,u[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=h,i++}for(var p=s-r;p!==s&&0===u[p];)p++;for(var g=c.repeat(n);p<s;++p)g+=e.charAt(u[p]);return g}function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*s[h]>>>0,s[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(r+(o-d)),g=r;d!==o;)p[g++]=s[d++];return p}}}function d(e){var n=h(e);if(n)return n;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:d}}var bf=_f;const wf=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ef=e=>(new TextEncoder).encode(e),Sf=e=>(new TextDecoder).decode(e);class Of{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Rf{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return If(this,e)}}class xf{constructor(e){this.decoders=e}or(e){return If(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 If=(e,t)=>new xf(mf(mf({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}));class Cf{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Of(e,t,n),this.decoder=new Rf(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Pf=({name:e,prefix:t,encode:n,decode:r})=>new Cf(e,t,n,r),kf=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:i}=bf(n,t);return Pf({prefix:e,name:t,encode:r,decode:e=>wf(i(e))})},Nf=(e,t,n,r)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*n/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${r} character`);c=c<<n|o,a+=n,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},Af=(e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let o="",s=0,a=0;for(let r=0;r<e.length;++r)for(a=a<<8|e[r],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o},Tf=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Pf({prefix:t,name:e,encode:e=>Af(e,r,n),decode:t=>Nf(t,r,n,e)}),Mf=Pf({prefix:"\0",name:"identity",encode:e=>Sf(e),decode:e=>Ef(e)});var Lf=Object.freeze({__proto__:null,identity:Mf});const Uf=Tf({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var jf=Object.freeze({__proto__:null,base2:Uf});const Df=Tf({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zf=Object.freeze({__proto__:null,base8:Df});const Bf=kf({prefix:"9",name:"base10",alphabet:"0123456789"});var Ff=Object.freeze({__proto__:null,base10:Bf});const Hf=Tf({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$f=Tf({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Vf=Object.freeze({__proto__:null,base16:Hf,base16upper:$f});const qf=Tf({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wf=Tf({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Kf=Tf({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Gf=Tf({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Yf=Tf({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qf=Tf({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Jf=Tf({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xf=Tf({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zf=Tf({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var eh=Object.freeze({__proto__:null,base32:qf,base32upper:Wf,base32pad:Kf,base32padupper:Gf,base32hex:Yf,base32hexupper:Qf,base32hexpad:Jf,base32hexpadupper:Xf,base32z:Zf});const th=kf({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nh=kf({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var rh=Object.freeze({__proto__:null,base36:th,base36upper:nh});const ih=kf({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oh=kf({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sh=Object.freeze({__proto__:null,base58btc:ih,base58flickr:oh});const ah=Tf({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ch=Tf({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),uh=Tf({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),lh=Tf({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var fh=Object.freeze({__proto__:null,base64:ah,base64pad:ch,base64url:uh,base64urlpad:lh});const hh=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),dh=hh.reduce(((e,t,n)=>(e[n]=t,e)),[]),ph=hh.reduce(((e,t,n)=>(e[t.codePointAt(0)]=n,e)),[]);function gh(e){return e.reduce(((e,t)=>e+=dh[t]),"")}function yh(e){const t=[];for(const n of e){const e=ph[n.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}const vh=Pf({prefix:"🚀",name:"base256emoji",encode:gh,decode:yh});var mh=Object.freeze({__proto__:null,base256emoji:vh}),_h=Sh,bh=128,wh=-128,Eh=Math.pow(2,31);function Sh(e,t,n){t=t||[];for(var r=n=n||0;e>=Eh;)t[n++]=255&e|bh,e/=128;for(;e&wh;)t[n++]=255&e|bh,e>>>=7;return t[n]=0|e,Sh.bytes=n-r+1,t}var Oh=Ih,Rh=128,xh=127;function Ih(e,t){var n,r=0,i=0,o=t=t||0,s=e.length;do{if(o>=s)throw Ih.bytes=0,new RangeError("Could not decode varint");n=e[o++],r+=i<28?(n&xh)<<i:(n&xh)*Math.pow(2,i),i+=7}while(n>=Rh);return Ih.bytes=o-t,r}var Ch=Math.pow(2,7),Ph=Math.pow(2,14),kh=Math.pow(2,21),Nh=Math.pow(2,28),Ah=Math.pow(2,35),Th=Math.pow(2,42),Mh=Math.pow(2,49),Lh=Math.pow(2,56),Uh=Math.pow(2,63),jh={encode:_h,decode:Oh,encodingLength:function(e){return e<Ch?1:e<Ph?2:e<kh?3:e<Nh?4:e<Ah?5:e<Th?6:e<Mh?7:e<Lh?8:e<Uh?9:10}};const Dh=(e,t,n=0)=>(jh.encode(e,t,n),t),zh=e=>jh.encodingLength(e),Bh=(e,t)=>{const n=t.byteLength,r=zh(e),i=r+zh(n),o=new Uint8Array(i+n);return Dh(e,o,0),Dh(n,o,r),o.set(t,i),new Fh(e,n,t,o)};class Fh{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const Hh=({name:e,code:t,encode:n})=>new $h(e,t,n);class $h{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Bh(this.code,t):t.then((e=>Bh(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Vh=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),qh=Hh({name:"sha2-256",code:18,encode:Vh("SHA-256")}),Wh=Hh({name:"sha2-512",code:19,encode:Vh("SHA-512")});var Kh=Object.freeze({__proto__:null,sha256:qh,sha512:Wh});const Gh=0,Yh="identity",Qh=wf;var Jh=Object.freeze({__proto__:null,identity:{code:Gh,name:Yh,encode:Qh,digest:e=>Bh(Gh,Qh(e))}});new TextEncoder,new TextDecoder;const Xh=mf(mf(mf(mf(mf(mf(mf(mf(mf(mf({},Lf),jf),zf),Ff),Vf),eh),rh),sh),fh),mh);function Zh(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function ed(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Zh(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function td(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}mf(mf({},Kh),Jh);const nd=td("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),rd=td("ascii","a",(e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}),(e=>{const t=ed((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t})),id=mf({utf8:nd,"utf-8":nd,hex:Xh.base16,latin1:rd,ascii:rd,binary:rd},Xh);function od(e,t="utf8"){const n=id[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode(`${n.prefix}${e}`):Zh(globalThis.Buffer.from(e,"utf-8"))}const sd="wc",ad=2,cd="core",ud=`${sd}@2:${cd}:`,ld={name:cd,logger:"error"},fd={database:":memory:"},hd="crypto",dd="client_ed25519_seed",pd=We.ONE_DAY,gd="keychain",yd="0.3",vd="messages",md="0.3",_d=We.SIX_HOURS,bd="publisher",wd="irn",Ed="error",Sd="wss://relay.walletconnect.com",Od="relayer",Rd={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"},xd="_subscription",Id={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Cd=We.ONE_SECOND/2,Pd="2.8.1",kd=1e4,Nd="0.3",Ad="WALLETCONNECT_CLIENT_ID",Td={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Md="subscription",Ld="0.3",Ud=1e3*We.FIVE_SECONDS,jd="pairing",Dd="0.3",zd={wc_pairingDelete:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:We.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:We.ONE_DAY,prompt:!1,tag:0},res:{ttl:We.ONE_DAY,prompt:!1,tag:0}}},Bd={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Fd="history",Hd="0.3",$d="expirer",Vd={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},qd="0.3",Wd="verify-api",Kd="https://verify.walletconnect.com";class Gd{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=gd,this.version=yd,this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=cn.generateChildLogger(t,this.name)}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,kc(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Nc(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Yd{constructor(e,t,n){this.core=e,this.logger=t,this.name=hd,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),us(ds(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const e=Qa();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();const t=ds(await this.getClientSeed()),n=Ja();return await ps(n,e,pd,t)},this.generateSharedKey=(e,t,n)=>{this.isInitialized();const r=Xa(this.getPrivateKey(e),t);return this.setSymKey(r,n)},this.setSymKey=async(e,t)=>{this.isInitialized();const n=t||Za(e);return await this.keychain.set(n,e),n},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,n)=>{this.isInitialized();const r=cc(n),i=sr(t);if(uc(r)){const t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}const o=this.getSymKey(e),{type:s,senderPublicKey:a}=r;return rc({type:s,symKey:o,message:i,senderPublicKey:a})},this.decode=async(e,t,n)=>{this.isInitialized();const r=ac(t,n);if(uc(r)){const t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}return or(ic({symKey:this.getSymKey(e),encoded:t}))},this.getPayloadType=e=>nc(sc(e).type),this.getPayloadSenderPublicKey=e=>{const t=sc(e);return t.senderPublicKey?ss(t.senderPublicKey,Fa):void 0},this.core=e,this.logger=cn.generateChildLogger(t,this.name),this.keychain=n||new Gd(this.core,this.logger)}get context(){return cn.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(dd)}catch{e=Ja(),await this.keychain.set(dd,e)}return od(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Qd extends Gn{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=vd,this.version=md,this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();const n=ec(t);let r=this.messages.get(e);return typeof r>"u"&&(r={}),typeof r[n]<"u"||(r[n]=t,this.messages.set(e,r),await this.persist()),n},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[ec(t)]<"u"),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=cn.generateChildLogger(e,this.name),this.core=t}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,kc(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Nc(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Jd extends Yn{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new o.exports.EventEmitter,this.name=bd,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(e,t,n)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:n}});try{const r=n?.ttl||_d,i=Vc(n),o=n?.prompt||!1,s=n?.tag||0,a=n?.id||zl().toString(),c={topic:e,message:t,opts:{ttl:r,relay:i,prompt:o,tag:s,id:a}};this.queue.set(a,c);try{await await Tc(this.rpcPublish(e,t,r,i,o,s,a),this.publishTimeout),this.relayer.events.emit(Rd.publish,c)}catch{return this.logger.debug("Publishing Payload stalled"),void this.relayer.events.emit(Rd.connection_stalled)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:n}})}catch(e){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(e),e}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=cn.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return cn.getLoggerContext(this.logger)}rpcPublish(e,t,n,r,i,o,s){var a,c,u,l;const f={method:qc(r.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:i,tag:o},id:s};return yu(null==(a=f.params)?void 0:a.prompt)&&(null==(c=f.params)||delete c.prompt),yu(null==(u=f.params)?void 0:u.tag)&&(null==(l=f.params)||delete l.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:f}),this.relayer.request(f)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach((async e=>{const{topic:t,message:n,opts:r}=e;await this.publish(t,n,r)}))}registerEventListeners(){this.relayer.core.heartbeat.on(_e.HEARTBEAT_EVENTS.pulse,(()=>{this.checkQueue()})),this.relayer.on(Rd.message_ack,(e=>{this.onPublish(e.id.toString())}))}}class Xd{constructor(){this.map=new Map,this.set=(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const r=n.filter((e=>e!==t));r.length?this.map.set(e,r):this.map.delete(e)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Zd=Object.defineProperty,ep=Object.defineProperties,tp=Object.getOwnPropertyDescriptors,np=Object.getOwnPropertySymbols,rp=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,op=(e,t,n)=>t in e?Zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sp=(e,t)=>{for(var n in t||(t={}))rp.call(t,n)&&op(e,n,t[n]);if(np)for(var n of np(t))ip.call(t,n)&&op(e,n,t[n]);return e},ap=(e,t)=>ep(e,tp(t));class cp extends Xn{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new Xd,this.events=new o.exports.EventEmitter,this.name=Md,this.version=Ld,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=ud,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const n=Vc(t),r={topic:e,relay:n};this.pending.set(e,r);const i=await this.rpcSubscribe(e,n);return this.onSubscribe(i,r),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}}),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>!!this.topics.includes(e)||await new Promise(((t,n)=>{const r=new We.Watch;r.start(this.pendingSubscriptionWatchLabel);const i=setInterval((()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(i),r.stop(this.pendingSubscriptionWatchLabel),t(!0)),r.elapsed(this.pendingSubscriptionWatchLabel)>=Ud&&(clearInterval(i),r.stop(this.pendingSubscriptionWatchLabel),n(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1)),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=cn.generateChildLogger(t,this.name),this.clientId=""}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map((async n=>await this.unsubscribeById(e,n,t))))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const r=Vc(n);await this.rpcUnsubscribe(e,t,r);const i=du("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t){const n={method:qc(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Tc(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Rd.connection_stalled)}return ec(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:qc(e[0].relay.protocol).batchSubscribe,params:{topics:e.map((e=>e.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await Tc(this.relayer.request(t),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Rd.connection_stalled)}}rpcUnsubscribe(e,t,n){const r={method:qc(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,ap(sp({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach((e=>{this.setSubscription(e.id,sp({},e)),this.pending.delete(e.topic)}))}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,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,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,sp({},t)),this.topicMap.set(t.topic,e),this.events.emit(Td.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Td.deleted,ap(sp({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Td.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const e=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(e)}}this.events.emit(Td.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}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 t=await this.rpcBatchSubscribe(e);pu(t)&&this.onBatchSubscribe(t.map(((t,n)=>ap(sp({},e[n]),{id:t}))))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach((t=>{e.push(t)})),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(_e.HEARTBEAT_EVENTS.pulse,(async()=>{await this.checkPending()})),this.relayer.on(Rd.connect,(async()=>{await this.onConnect()})),this.relayer.on(Rd.disconnect,(()=>{this.onDisconnect()})),this.events.on(Td.created,(async e=>{const t=Td.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})),this.events.on(Td.deleted,(async e=>{const t=Td.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise((e=>{const t=setInterval((()=>{this.restartInProgress||(clearInterval(t),e())}),this.pollingInterval)}))}}var up=Object.defineProperty,lp=Object.getOwnPropertySymbols,fp=Object.prototype.hasOwnProperty,hp=Object.prototype.propertyIsEnumerable,dp=(e,t,n)=>t in e?up(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pp=(e,t)=>{for(var n in t||(t={}))fp.call(t,n)&&dp(e,n,t[n]);if(lp)for(var n of lp(t))hp.call(t,n)&&dp(e,n,t[n]);return e};class gp extends Qn{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new o.exports.EventEmitter,this.name=Od,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async e=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(e)}catch(e){throw this.logger.debug("Failed to Publish Request"),this.logger.error(e),e}},this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?cn.generateChildLogger(e.logger,this.name):cn.pino(cn.getDefaultLoggerOptions({level:e.logger||Ed})),this.messages=new Qd(this.logger,e.core),this.subscriber=new cp(this,this.logger),this.publisher=new Jd(this,this.logger),this.relayUrl=e?.relayUrl||Sd,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout((async()=>{0===this.subscriber.topics.length&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)}),kd)}get context(){return cn.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var n;this.isInitialized();let r=(null==(n=this.subscriber.topicMap.get(e))?void 0:n[0])||"";return r||(await Promise.all([new Promise((t=>{this.subscriber.once(Td.created,(n=>{n.topic===e&&t()}))})),new Promise((async n=>{r=await this.subscriber.subscribe(e,t),n()}))]),r)}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(Rd.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise((e=>{this.initialized||e(),this.subscriber.once(Td.resubscribed,(()=>{e()}))})),await Promise.race([new Promise((async(e,t)=>{await Tc(this.provider.connect(),5e3,"socket stalled").catch((e=>t(e))).then((()=>e())).finally((()=>this.removeListener(Rd.transport_closed,this.rejectTransportOpen)))})),new Promise((e=>this.once(Rd.transport_closed,this.rejectTransportOpen)))])])}catch(e){this.logger.error(e);const t=e;if(!this.isConnectionStalled(t.message))throw e;this.events.emit(Rd.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise((e=>{this.provider.once(Id.disconnect,(()=>{e()}))})),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some((t=>e.includes(t)))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new sf(new lf(Cc({sdkVersion:Pd,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:n}=e;await this.messages.set(t,n)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;return!await this.subscriber.isSubscribed(t)||this.messages.has(t,n)}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),tf(e)){if(!e.method.endsWith(xd))return;const t=e.params,{topic:n,message:r,publishedAt:i}=t.data,o={topic:n,message:r,publishedAt:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(pp({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else nf(e)&&this.events.emit(Rd.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Rd.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Fl(e.id,!0);await this.provider.connection.send(t)}registerProviderListeners(){this.provider.on(Id.payload,(e=>this.onProviderPayload(e))),this.provider.on(Id.connect,(()=>{this.events.emit(Rd.connect)})),this.provider.on(Id.disconnect,(()=>{this.onProviderDisconnect()})),this.provider.on(Id.error,(e=>{this.logger.error(e),this.events.emit(Rd.error,e)}))}registerEventListeners(){this.events.on(Rd.connection_stalled,(async()=>{await this.restartTransport()}))}onProviderDisconnect(){this.events.emit(Rd.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout((async()=>{await this.restartTransport()}),We.toMiliseconds(Cd))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise((e=>{const t=setInterval((()=>{this.connected&&(clearInterval(t),e())}),this.connectionStatusPollingInterval)}));await this.restartTransport()}}}var yp=Object.defineProperty,vp=Object.getOwnPropertySymbols,mp=Object.prototype.hasOwnProperty,_p=Object.prototype.propertyIsEnumerable,bp=(e,t,n)=>t in e?yp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wp=(e,t)=>{for(var n in t||(t={}))mp.call(t,n)&&bp(e,n,t[n]);if(vp)for(var n of vp(t))_p.call(t,n)&&bp(e,n,t[n]);return e};class Ep extends Jn{constructor(e,t,n,r=ud,i=void 0){super(e,t,n,r),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=Nd,this.cached=[],this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>{this.getKey&&null!==e&&!yu(e)?this.map.set(this.getKey(e),e):Su(e)?this.map.set(e.id,e):Ou(e)&&this.map.set(e.topic,e)})),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter((t=>Object.keys(e).every((n=>hf(t[n],e[n]))))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const n=wp(wp({},this.getData(e)),t);this.map.set(e,n),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),await this.persist())},this.logger=cn.generateChildLogger(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}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:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}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}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Sp{constructor(e,t){this.core=e,this.logger=t,this.name=jd,this.version=Dd,this.events=new o.exports,this.initialized=!1,this.storagePrefix=ud,this.ignoredPayloadTypes=[qa],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:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async()=>{this.isInitialized();const e=Ja(),t=await this.core.crypto.setSymKey(e),n=Dc(We.FIVE_MINUTES),r={protocol:wd},i={topic:t,expiry:n,relay:r,active:!1},o=nu({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:e,relay:r});return await this.pairings.set(t,i),await this.core.relayer.subscribe(t),this.core.expirer.set(t,n),{topic:t,uri:o}},this.pair=async e=>{this.isInitialized(),this.isValidPair(e);const{topic:t,symKey:n,relay:r}=Zc(e.uri);if(this.pairings.keys.includes(t))throw new Error(`Pairing already exists: ${t}`);if(this.core.crypto.hasKeys(t))throw new Error(`Keychain already exists: ${t}`);const i=Dc(We.FIVE_MINUTES),o={topic:t,relay:r,expiry:i,active:!1};return await this.pairings.set(t,o),await this.core.crypto.setSymKey(n,t),await this.core.relayer.subscribe(t,{relay:r}),this.core.expirer.set(t,i),e.activatePairing&&await this.activate({topic:t}),o},this.activate=async({topic:e})=>{this.isInitialized();const t=Dc(We.THIRTY_DAYS);await this.pairings.update(e,{active:!0,expiry:t}),this.core.expirer.set(e,t)},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:n,resolve:r,reject:i}=Ac();this.events.once(Bc("pairing_ping",e),(({error:e})=>{e?i(e):r()})),await n()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",du("USER_DISCONNECTED")),await this.deletePairing(t))},this.sendRequest=async(e,t,n)=>{const r=Bl(t,n),i=await this.core.crypto.encode(e,r),o=zd[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,o),r.id},this.sendResult=async(e,t,n)=>{const r=Fl(e,n),i=await this.core.crypto.encode(t,r),o=await this.core.history.get(t,e),s=zd[o.request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(r)},this.sendError=async(e,t,n)=>{const r=Hl(e,n),i=await this.core.crypto.encode(t,r),o=await this.core.history.get(t,e),s=zd[o.request.method]?zd[o.request.method].res:zd.unregistered_method.res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,du("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{const e=this.pairings.getAll().filter((e=>zc(e.expiry)));await Promise.all(e.map((e=>this.deletePairing(e.topic))))},this.onRelayEventRequest=e=>{const{topic:t,payload:n}=e,r=n.method;if(this.pairings.keys.includes(t))switch(r){case"wc_pairingPing":return this.onPairingPingRequest(t,n);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,n);default:return this.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;if(this.pairings.keys.includes(t))return"wc_pairingPing"===r?this.onPairingPingResponse(t,n):this.onUnknownRpcMethodResponse(r)},this.onPairingPingRequest=async(e,t)=>{const{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit("pairing_ping",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{const{id:n}=t;setTimeout((()=>{rf(t)?this.events.emit(Bc("pairing_ping",n),{}):of(t)&&this.events.emit(Bc("pairing_ping",n),{error:t.error})}),500)},this.onPairingDeleteRequest=async(e,t)=>{const{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit("pairing_delete",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{const{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;const t=du("WC_METHOD_UNSUPPORTED",r);await this.sendError(n,e,t),this.logger.error(t)}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(du("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`pair() params: ${e}`);throw new Error(t)}if(!Eu(e.uri)){const{message:t}=hu("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw new Error(t)}},this.isValidPing=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!vu(e,!1)){const{message:t}=hu("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(zc(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=hu("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}},this.core=e,this.logger=cn.generateChildLogger(t,this.name),this.pairings=new Ep(this.core,this.logger,this.name,this.storagePrefix)}get context(){return cn.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Rd.message,(async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const r=await this.core.crypto.decode(t,n);tf(r)?(this.core.history.set(t,r),this.onRelayEventRequest({topic:t,payload:r})):nf(r)&&(await this.core.history.resolve(r),this.onRelayEventResponse({topic:t,payload:r}))}))}registerExpirerEvents(){this.core.expirer.on(Vd.expired,(async e=>{const{topic:t}=jc(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit("pairing_expire",{topic:t}))}))}}class Op extends Kn{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new o.exports.EventEmitter,this.name=Fd,this.version=Hd,this.cached=[],this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.records.set(e.id,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,n)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:n}),this.records.has(t.id))return;const r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n};this.records.set(r.id,r),this.events.emit(Bd.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=of(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.events.emit(Bd.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach((n=>{if(n.topic===e){if(typeof t<"u"&&n.id!==t)return;this.records.delete(n.id),this.events.emit(Bd.deleted,n)}}))},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=cn.generateChildLogger(t,this.name)}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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((t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:Bl(t.request.method,t.request.params,t.id),chainId:t.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 t=this.records.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Bd.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}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(Bd.created,(e=>{const t=Bd.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(Bd.updated,(e=>{const t=Bd.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(Bd.deleted,(e=>{const t=Bd.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Rp extends Zn{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new o.exports.EventEmitter,this.name=$d,this.version=qd,this.cached=[],this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.expirations.set(e.target,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}},this.set=(e,t)=>{this.isInitialized();const n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(Vd.created,{target:n,expiration:r})},this.get=e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(Vd.deleted,{target:t,expiration:n})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=cn.generateChildLogger(t,this.name)}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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("string"==typeof e)return Lc(e);if("number"==typeof e)return Uc(e);const{message:t}=hu("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}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(Vd.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}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 t=this.expirations.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:n}=t;We.toMiliseconds(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Vd.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((e,t)=>this.checkExpiry(t,e)))}registerEventListeners(){this.core.heartbeat.on(_e.HEARTBEAT_EVENTS.pulse,(()=>this.checkExpirations())),this.events.on(Vd.created,(e=>{const t=Vd.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(Vd.expired,(e=>{const t=Vd.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(Vd.deleted,(e=>{const t=Vd.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class xp extends er{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Wd,this.initialized=!1,this.init=async e=>{bc()||!wc()||(this.verifyUrl=e?.verifyUrl||Kd,await this.createIframe())},this.register=async e=>{var t;this.initialized||await this.init(),this.iframe&&(null==(t=this.iframe.contentWindow)||t.postMessage(e.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${e.attestationId} ${this.verifyUrl}`))},this.resolve=async e=>{var t;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${e.attestationId}`);const n=this.startAbortTimer(We.FIVE_SECONDS),r=await fetch(`${this.verifyUrl}/attestation/${e.attestationId}`,{signal:this.abortController.signal});return clearTimeout(n),200===r.status?null==(t=await r.json())?void 0:t.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise(((e,t)=>{if(document.getElementById(Wd))return e();const n=document.createElement("iframe");n.setAttribute("id",Wd),n.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),n.style.display="none",n.addEventListener("load",(()=>{this.initialized=!0,e()})),n.addEventListener("error",(e=>{t(e)})),document.body.append(n),this.iframe=n})),new Promise((e=>{setTimeout((()=>e("iframe load timeout")),We.toMiliseconds(We.ONE_SECOND/2))}))])}catch(e){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(e)}},this.logger=cn.generateChildLogger(t,this.name),this.verifyUrl=Kd,this.abortController=new AbortController,this.isDevEnv=_c()&&process.env.IS_VITEST}get context(){return cn.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout((()=>this.abortController.abort()),We.toMiliseconds(e))}}var Ip=Object.defineProperty,Cp=Object.getOwnPropertySymbols,Pp=Object.prototype.hasOwnProperty,kp=Object.prototype.propertyIsEnumerable,Np=(e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ap=(e,t)=>{for(var n in t||(t={}))Pp.call(t,n)&&Np(e,n,t[n]);if(Cp)for(var n of Cp(t))kp.call(t,n)&&Np(e,n,t[n]);return e};class Tp extends Wn{constructor(e){super(e),this.protocol=sd,this.version=ad,this.name=cd,this.events=new o.exports.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Sd;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:cn.pino(cn.getDefaultLoggerOptions({level:e?.logger||ld.logger}));this.logger=cn.generateChildLogger(t,this.name),this.heartbeat=new _e.HeartBeat,this.crypto=new Yd(this,this.logger,e?.keychain),this.history=new Op(this,this.logger),this.expirer=new Rp(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new me(Ap(Ap({},fd),e?.storageOptions)),this.relayer=new gp({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Sp(this,this.logger),this.verify=new xp(this.projectId||"",this.logger)}static async init(e){const t=new Tp(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem(Ad,n),t}get context(){return cn.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}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 Mp=Tp,Lp="wc",Up=2,jp="client",Dp=`${Lp}@${Up}:${jp}:`,zp={name:jp,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Bp="WALLETCONNECT_DEEPLINK_CHOICE",Fp="proposal",Hp="Proposal expired",$p="session",Vp=We.SEVEN_DAYS,qp="engine",Wp={wc_sessionPropose:{req:{ttl:We.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1104},res:{ttl:We.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1106},res:{ttl:We.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:We.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:We.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1112},res:{ttl:We.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1115}}},Kp={min:We.FIVE_MINUTES,max:We.SEVEN_DAYS},Gp="request",Yp=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var Qp=Object.defineProperty,Jp=Object.defineProperties,Xp=Object.getOwnPropertyDescriptors,Zp=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,tg=Object.prototype.propertyIsEnumerable,ng=(e,t,n)=>t in e?Qp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rg=(e,t)=>{for(var n in t||(t={}))eg.call(t,n)&&ng(e,n,t[n]);if(Zp)for(var n of Zp(t))tg.call(t,n)&&ng(e,n,t[n]);return e},ig=(e,t)=>Jp(e,Xp(t));class og extends nr{constructor(e){super(e),this.name=qp,this.events=new o.exports,this.initialized=!1,this.ignoredPayloadTypes=[qa],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Wp)}),this.initialized=!0)},this.connect=async e=>{this.isInitialized();const t=ig(rg({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);const{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:o,relays:s}=t;let a,c=n,u=!1;if(c&&(u=this.client.core.pairing.pairings.get(c).active),!c||!u){const{topic:e,uri:t}=await this.client.core.pairing.create();c=e,a=t}const l=await this.client.core.crypto.generateKeyPair(),f=rg({requiredNamespaces:r,optionalNamespaces:i,relays:s??[{protocol:wd}],proposer:{publicKey:l,metadata:this.client.metadata}},o&&{sessionProperties:o}),{reject:h,resolve:d,done:p}=Ac(We.FIVE_MINUTES,Hp);if(this.events.once(Bc("session_connect"),(async({error:e,session:t})=>{if(e)h(e);else if(t){t.self.publicKey=l;const e=ig(rg({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:t.peer.metadata}),d(e)}})),!c){const{message:e}=hu("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(e)}const g=await this.sendRequest(c,"wc_sessionPropose",f),y=Dc(We.FIVE_MINUTES);return await this.setProposal(g,rg({id:g,expiry:y},f)),{uri:a,approval:p}},this.pair=async e=>(this.isInitialized(),await this.client.core.pairing.pair(e)),this.approve=async e=>{this.isInitialized(),await this.isValidApprove(e);const{id:t,relayProtocol:n,namespaces:r,sessionProperties:i}=e,o=this.client.proposal.get(t);let{pairingTopic:s,proposer:a,requiredNamespaces:c,optionalNamespaces:u}=o;s=s||"",gu(c)||(c=au(r,"approve()"));const l=await this.client.core.crypto.generateKeyPair(),f=a.publicKey,h=await this.client.core.crypto.generateSharedKey(l,f);s&&t&&(await this.client.core.pairing.updateMetadata({topic:s,metadata:a.metadata}),await this.sendResult(t,s,{relay:{protocol:n??"irn"},responderPublicKey:l}),await this.client.proposal.delete(t,du("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:s}));const d=rg({relay:{protocol:n??"irn"},namespaces:r,requiredNamespaces:c,optionalNamespaces:u,pairingTopic:s,controller:{publicKey:l,metadata:this.client.metadata},expiry:Dc(Vp)},i&&{sessionProperties:i});await this.client.core.relayer.subscribe(h),await this.sendRequest(h,"wc_sessionSettle",d);const p=ig(rg({},d),{topic:h,pairingTopic:s,acknowledged:!1,self:d.controller,peer:{publicKey:a.publicKey,metadata:a.metadata},controller:l});return await this.client.session.set(h,p),await this.setExpiry(h,Dc(Vp)),{topic:h,acknowledged:()=>new Promise((e=>setTimeout((()=>e(this.client.session.get(h))),500)))}},this.reject=async e=>{this.isInitialized(),await this.isValidReject(e);const{id:t,reason:n}=e,{pairingTopic:r}=this.client.proposal.get(t);r&&(await this.sendError(t,r,n),await this.client.proposal.delete(t,du("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.isValidUpdate(e);const{topic:t,namespaces:n}=e,r=await this.sendRequest(t,"wc_sessionUpdate",{namespaces:n}),{done:i,resolve:o,reject:s}=Ac();return this.events.once(Bc("session_update",r),(({error:e})=>{e?s(e):o()})),await this.client.session.update(t,{namespaces:n}),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.isValidExtend(e);const{topic:t}=e,n=await this.sendRequest(t,"wc_sessionExtend",{}),{done:r,resolve:i,reject:o}=Ac();return this.events.once(Bc("session_extend",n),(({error:e})=>{e?o(e):i()})),await this.setExpiry(t,Dc(Vp)),{acknowledged:r}},this.request=async e=>{this.isInitialized(),await this.isValidRequest(e);const{chainId:t,request:n,topic:r,expiry:i}=e,o=await this.sendRequest(r,"wc_sessionRequest",{request:n,chainId:t},i),{done:s,resolve:a,reject:c}=Ac(i);return this.events.once(Bc("session_request",o),(({error:e,result:t})=>{e?c(e):a(t)})),this.client.events.emit("session_request_sent",{topic:r,request:n,chainId:t,id:o}),Hc({id:o,topic:r,wcDeepLink:await this.client.core.storage.getItem(Bp)}),await s()},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:n}=e,{id:r}=n;rf(n)?await this.sendResult(r,t,n.result):of(n)&&await this.sendError(r,t,n.error),this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=await this.sendRequest(t,"wc_sessionPing",{}),{done:n,resolve:r,reject:i}=Ac();this.events.once(Bc("session_ping",e),(({error:e})=>{e?i(e):r()})),await n()}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.isValidEmit(e);const{topic:t,event:n,chainId:r}=e;await this.sendRequest(t,"wc_sessionEvent",{event:n,chainId:r})},this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=zl().toString();let n;const r=t=>{t?.id.toString()===e&&(this.client.core.relayer.events.removeListener(Rd.message_ack,r),n())};await Promise.all([new Promise((e=>{n=e,this.client.core.relayer.on(Rd.message_ack,r)})),this.sendRequest(t,"wc_sessionDelete",du("USER_DISCONNECTED"),void 0,e)]),await this.deleteSession(t)}else await this.client.core.pairing.disconnect({topic:t})},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter((t=>_u(t,e)))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async e=>{try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter((n=>{var r,i;return(null==(r=n.peerMetadata)?void 0:r.url)&&(null==(i=n.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&n.topic&&n.topic!==t.topic}));if(0===n.length)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map((e=>this.client.core.pairing.disconnect({topic:e.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async(e,t)=>{const{self:n}=this.client.session.get(e);await this.client.core.relayer.unsubscribe(e),this.client.session.delete(e,du("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(n.publicKey)&&await this.client.core.crypto.deleteKeyPair(n.publicKey),this.client.core.crypto.keychain.has(e)&&await this.client.core.crypto.deleteSymKey(e),t||this.client.core.expirer.del(e)},this.deleteProposal=async(e,t)=>{await Promise.all([this.client.proposal.delete(e,du("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)])},this.deletePendingSessionRequest=async(e,t,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&await this.client.session.update(e,{expiry:t}),this.client.core.expirer.set(e,t)},this.setProposal=async(e,t)=>{await this.client.proposal.set(e,t),this.client.core.expirer.set(e,t.expiry)},this.setPendingSessionRequest=async e=>{const t=Wp.wc_sessionRequest.req.ttl,{id:n,topic:r,params:i}=e;await this.client.pendingRequest.set(n,{id:n,topic:r,params:i}),t&&this.client.core.expirer.set(n,Dc(t))},this.sendRequest=async(e,t,n,r,i)=>{const o=Bl(t,n);if(wc()&&Yp.includes(t)){const e=ec(JSON.stringify(o));await this.client.core.verify.register({attestationId:e})}const s=await this.client.core.crypto.encode(e,o),a=Wp[t].req;return r&&(a.ttl=r),i&&(a.id=i),this.client.core.history.set(e,o),this.client.core.relayer.publish(e,s,a),o.id},this.sendResult=async(e,t,n)=>{const r=Fl(e,n),i=await this.client.core.crypto.encode(t,r),o=await this.client.core.history.get(t,e),s=Wp[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(r)},this.sendError=async(e,t,n)=>{const r=Hl(e,n),i=await this.client.core.crypto.encode(t,r),o=await this.client.core.history.get(t,e),s=Wp[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(r)},this.cleanup=async()=>{const e=[],t=[];this.client.session.getAll().forEach((t=>{zc(t.expiry)&&e.push(t.topic)})),this.client.proposal.getAll().forEach((e=>{zc(e.expiry)&&t.push(e.id)})),await Promise.all([...e.map((e=>this.deleteSession(e))),...t.map((e=>this.deleteProposal(e)))])},this.onRelayEventRequest=e=>{const{topic:t,payload:n}=e,r=n.method;switch(r){case"wc_sessionPropose":return this.onSessionProposeRequest(t,n);case"wc_sessionSettle":return this.onSessionSettleRequest(t,n);case"wc_sessionUpdate":return this.onSessionUpdateRequest(t,n);case"wc_sessionExtend":return this.onSessionExtendRequest(t,n);case"wc_sessionPing":return this.onSessionPingRequest(t,n);case"wc_sessionDelete":return this.onSessionDeleteRequest(t,n);case"wc_sessionRequest":return this.onSessionRequest(t,n);case"wc_sessionEvent":return this.onSessionEventRequest(t,n);default:return this.client.logger.info(`Unsupported request method ${r}`)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:n}=e,r=(await this.client.core.history.get(t,n.id)).request.method;switch(r){case"wc_sessionPropose":return this.onSessionProposeResponse(t,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,n);case"wc_sessionExtend":return this.onSessionExtendResponse(t,n);case"wc_sessionPing":return this.onSessionPingResponse(t,n);case"wc_sessionRequest":return this.onSessionRequestResponse(t,n);default:return this.client.logger.info(`Unsupported response method ${r}`)}},this.onRelayEventUnknownPayload=e=>{const{topic:t}=e,{message:n}=hu("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.onSessionProposeRequest=async(e,t)=>{const{params:n,id:r}=t;try{this.isValidConnect(rg({},t.params));const i=Dc(We.FIVE_MINUTES),o=rg({id:r,pairingTopic:e,expiry:i},n);await this.setProposal(r,o);const s=ec(JSON.stringify(t)),a=await this.getVerifyContext(s,o.proposer.metadata);this.client.events.emit("session_proposal",{id:r,params:o,verifyContext:a})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionProposeResponse=async(e,t)=>{const{id:n}=t;if(rf(t)){const{result:r}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:r});const i=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});const o=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const s=r.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:s});const a=await this.client.core.crypto.generateSharedKey(o,s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});const c=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else of(t)&&(await this.client.proposal.delete(n,du("USER_DISCONNECTED")),this.events.emit(Bc("session_connect"),{error:t.error}))},this.onSessionSettleRequest=async(e,t)=>{const{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);const{relay:n,controller:i,expiry:o,namespaces:s,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:u,pairingTopic:l}=t.params,f=rg({topic:e,relay:n,expiry:o,namespaces:s,acknowledged:!0,pairingTopic:l,requiredNamespaces:a,optionalNamespaces:c,controller:i.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},u&&{sessionProperties:u});await this.sendResult(t.id,e,!0),this.events.emit(Bc("session_connect"),{session:f}),this.cleanupDuplicatePairings(f)}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{const{id:n}=t;rf(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(Bc("session_approve",n),{})):of(t)&&(await this.client.session.delete(e,du("USER_DISCONNECTED")),this.events.emit(Bc("session_approve",n),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{const{params:n,id:r}=t;try{this.isValidUpdate(rg({topic:e},n)),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult(r,e,!0),this.client.events.emit("session_update",{id:r,topic:e,params:n})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionUpdateResponse=(e,t)=>{const{id:n}=t;rf(t)?this.events.emit(Bc("session_update",n),{}):of(t)&&this.events.emit(Bc("session_update",n),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{const{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Dc(Vp)),await this.sendResult(n,e,!0),this.client.events.emit("session_extend",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{const{id:n}=t;rf(t)?this.events.emit(Bc("session_extend",n),{}):of(t)&&this.events.emit(Bc("session_extend",n),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{const{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.client.events.emit("session_ping",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{const{id:n}=t;setTimeout((()=>{rf(t)?this.events.emit(Bc("session_ping",n),{}):of(t)&&this.events.emit(Bc("session_ping",n),{error:t.error})}),500)},this.onSessionDeleteRequest=async(e,t)=>{const{id:n}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise((t=>{this.client.core.relayer.once(Rd.publish,(async()=>{t(await this.deleteSession(e))}))})),this.sendResult(n,e,!0)]),this.client.events.emit("session_delete",{id:n,topic:e})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async(e,t)=>{const{id:n,params:r}=t;try{this.isValidRequest(rg({topic:e},r)),await this.setPendingSessionRequest({id:n,topic:e,params:r});const i=ec(JSON.stringify(t)),o=this.client.session.get(e),s=await this.getVerifyContext(i,o.peer.metadata);this.client.events.emit("session_request",{id:n,topic:e,params:r,verifyContext:s})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionRequestResponse=(e,t)=>{const{id:n}=t;rf(t)?this.events.emit(Bc("session_request",n),{result:t.result}):of(t)&&this.events.emit(Bc("session_request",n),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{const{id:n,params:r}=t;try{this.isValidEmit(rg({topic:e},r)),this.client.events.emit("session_event",{id:n,topic:e,params:r})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.isValidConnect=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,relays:o}=e;if(yu(t)||await this.isValidPairingTopic(t),!Uu(o,!0)){const{message:e}=hu("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(e)}!yu(n)&&0!==gu(n)&&this.validateNamespaces(n,"requiredNamespaces"),!yu(r)&&0!==gu(r)&&this.validateNamespaces(r,"optionalNamespaces"),yu(i)||this.validateSessionProps(i,"sessionProperties")},this.validateNamespaces=(e,t)=>{const n=Tu(e,"connect()",t);if(n)throw new Error(n.message)},this.isValidApprove=async e=>{if(!Du(e))throw new Error(hu("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:n,relayProtocol:r,sessionProperties:i}=e;await this.isValidProposalId(t);const o=this.client.proposal.get(t),s=Mu(n,"approve()");if(s)throw new Error(s.message);const a=Wu(o.requiredNamespaces,n,"approve()");if(a)throw new Error(a.message);if(!vu(r,!0)){const{message:e}=hu("MISSING_OR_INVALID",`approve() relayProtocol: ${r}`);throw new Error(e)}yu(i)||this.validateSessionProps(i,"sessionProperties")},this.isValidReject=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:n}=e;if(await this.isValidProposalId(t),!zu(n)){const{message:e}=hu("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(e)}},this.isValidSessionSettleRequest=e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!Lu(t)){const{message:e}=hu("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const o=Ru(n,"onSessionSettleRequest()");if(o)throw new Error(o.message);const s=Mu(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);if(zc(i)){const{message:e}=hu("EXPIRED","onSessionSettleRequest()");throw new Error(e)}},this.isValidUpdate=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:n}=e;await this.isValidSessionTopic(t);const r=this.client.session.get(t),i=Mu(n,"update()");if(i)throw new Error(i.message);const o=Wu(r.requiredNamespaces,n,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:n,chainId:r,expiry:i}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!$u(o,r)){const{message:e}=hu("MISSING_OR_INVALID",`request() chainId: ${r}`);throw new Error(e)}if(!Bu(n)){const{message:e}=hu("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(e)}if(!Vu(o,r,n.method)){const{message:e}=hu("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(e)}if(i&&!Qu(i,Kp)){const{message:e}=hu("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${Kp.min} and ${Kp.max}`);throw new Error(e)}},this.isValidRespond=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:t,response:n}=e;if(await this.isValidSessionTopic(t),!Fu(n)){const{message:e}=hu("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw new Error(e)}},this.isValidPing=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!$u(i,r)){const{message:e}=hu("MISSING_OR_INVALID",`emit() chainId: ${r}`);throw new Error(e)}if(!Hu(n)){const{message:e}=hu("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(e)}if(!qu(i,r,n.name)){const{message:e}=hu("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(e)}},this.isValidDisconnect=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.getVerifyContext=async(e,t)=>{const n={verified:{verifyUrl:t.verifyUrl||"",validation:"UNKNOWN",origin:t.url||""}};try{const r=await this.client.core.verify.resolve({attestationId:e,verifyUrl:t.verifyUrl});r&&(n.verified.origin=r,n.verified.validation=r===t.url?"VALID":"INVALID")}catch(e){this.client.logger.error(e)}return this.client.logger.info(`Verify context: ${JSON.stringify(n)}`),n},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((e=>{if(!vu(e,!1)){const{message:n}=hu("MISSING_OR_INVALID",`${t} must be in Record<string, string> format. Received: ${JSON.stringify(e)}`);throw new Error(n)}}))}}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Rd.message,(async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const r=await this.client.core.crypto.decode(t,n);tf(r)?(this.client.core.history.set(t,r),this.onRelayEventRequest({topic:t,payload:r})):nf(r)?(await this.client.core.history.resolve(r),this.onRelayEventResponse({topic:t,payload:r})):this.onRelayEventUnknownPayload({topic:t,payload:r})}))}registerExpirerEvents(){this.client.core.expirer.on(Vd.expired,(async e=>{const{topic:t,id:n}=jc(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,hu("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession(t,!0),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))}))}isValidPairingTopic(e){if(!vu(e,!1)){const{message:t}=hu("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(zc(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=hu("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!vu(e,!1)){const{message:t}=hu("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(zc(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:t}=hu("EXPIRED",`session topic: ${e}`);throw new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(vu(e,!1)){const{message:t}=hu("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=hu("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!ju(e)){const{message:t}=hu("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(zc(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:t}=hu("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class sg extends Ep{constructor(e,t){super(e,t,Fp,Dp),this.core=e,this.logger=t}}class ag extends Ep{constructor(e,t){super(e,t,$p,Dp),this.core=e,this.logger=t}}class cg extends Ep{constructor(e,t){super(e,t,Gp,Dp,(e=>e.id)),this.core=e,this.logger=t}}class ug extends tr{constructor(e){super(e),this.protocol=Lp,this.version=Up,this.name=zp.name,this.events=new o.exports.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||zp.name,this.metadata=e?.metadata||Oc();const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:cn.pino(cn.getDefaultLoggerOptions({level:e?.logger||zp.logger}));this.core=e?.core||new Mp(e),this.logger=cn.generateChildLogger(t,this.name),this.session=new ag(this.core,this.logger),this.proposal=new sg(this.core,this.logger),this.pendingRequest=new cg(this.core,this.logger),this.engine=new og(this)}static async init(e){const t=new ug(e);return await t.initialize(),t}get context(){return cn.getLoggerContext(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(),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}}}const lg="error",fg="wss://relay.walletconnect.com",hg="wc@2:universal_provider:",dg="https://rpc.walletconnect.com/v1",pg={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var gg,yg,vg={exports:{}};
|
320
|
+
***************************************************************************** */function cl(e,t){function n(){this.constructor=e}al(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ul=function(){return ul=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ul.apply(this,arguments)};function ll(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function fl(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function hl(e,t){return function(n,r){t(n,r,e)}}function dl(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function pl(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):i(e.value).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function gl(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function yl(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function vl(e,t){for(var n in e)"default"!==n&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function ml(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function bl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_l(arguments[t]));return e}function wl(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function El(e){return this instanceof El?(this.v=e,this):new El(e)}function Sl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{c(i[e](t))}catch(e){f(o[0][3],e)}}function c(e){e.value instanceof El?Promise.resolve(e.value.v).then(u,l):f(o[0][2],e)}function u(e){a("next",e)}function l(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Ol(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:El(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function Rl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof ml?ml(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){i(r,o,(t=e[n](t)).done,t.value)}))}}function i(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}}function xl(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Il(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function Cl(e){return e&&e.__esModule?e:{default:e}}function Pl(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function kl(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var Nl,Al=r(Object.freeze({__proto__:null,__extends:cl,get __assign(){return ul},__rest:ll,__decorate:fl,__param:hl,__metadata:dl,__awaiter:pl,__generator:gl,__createBinding:yl,__exportStar:vl,__values:ml,__read:_l,__spread:bl,__spreadArrays:wl,__await:El,__asyncGenerator:Sl,__asyncDelegator:Ol,__asyncValues:Rl,__makeTemplateObject:xl,__importStar:Il,__importDefault:Cl,__classPrivateFieldGet:Pl,__classPrivateFieldSet:kl})),Tl={};function Ml(){if(Nl)return Tl;function e(){return t?.crypto||t?.msCrypto||{}}function n(){const t=e();return t.subtle||t.webkitSubtle}function r(){return!!e()&&!!n()}return Nl=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.isBrowserCryptoAvailable=Tl.getSubtleCrypto=Tl.getBrowerCrypto=void 0,Tl.getBrowerCrypto=e,Tl.getSubtleCrypto=n,Tl.isBrowserCryptoAvailable=r,Tl}var Ll,Ul={};function jl(){if(Ll)return Ul;function e(){return typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product}function t(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function n(){return!e()&&!t()}return Ll=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.isBrowser=Ul.isNode=Ul.isReactNative=void 0,Ul.isReactNative=e,Ul.isNode=t,Ul.isBrowser=n,Ul}function Dl(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function zl(e=6){return BigInt(Dl(e))}function Bl(e,t,n){return{id:n||Dl(),jsonrpc:"2.0",method:e,params:t}}function Fl(e,t){return{id:e,jsonrpc:"2.0",result:t}}function Hl(e,t,n){return{id:e,jsonrpc:"2.0",error:$l(t,n)}}function $l(e,t){return typeof e>"u"?rl(Ju):("string"==typeof e&&(e=Object.assign(Object.assign({},rl(Xu)),{message:e})),typeof t<"u"&&(e.data=t),nl(e.code)&&(e=il(e.code)),e)}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Al;t.__exportStar(Ml(),e),t.__exportStar(jl(),e)}(sl);class Vl{}class ql extends Vl{constructor(){super()}}class Wl extends ql{constructor(e){super()}}const Kl="^https?:",Gl="^wss?:";function Yl(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}function Ql(e,t){const n=Yl(e);return!(typeof n>"u")&&new RegExp(t).test(n)}function Jl(e){return Ql(e,Kl)}function Xl(e){return Ql(e,Gl)}function Zl(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function ef(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function tf(e){return ef(e)&&"method"in e}function nf(e){return ef(e)&&(rf(e)||of(e))}function rf(e){return"result"in e}function of(e){return"error"in e}class sf extends Wl{constructor(e){super(e),this.events=new o.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Bl(e.method,e.params||[],e.id||zl().toString()),t)}async requestStrict(e,t){return new Promise((async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(e){r(e)}this.events.on(`${e.id}`,(e=>{of(e)?r(e.error):n(e.result)}));try{await this.connection.send(e,t)}catch(e){r(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),nf(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&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(),"string"==typeof e&&(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 af=10,cf=()=>typeof window<"u",uf=typeof d<"u"&&typeof d.WebSocket<"u"?d.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:Qi?Yi:(Qi=1,Yi=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")});class lf{constructor(e){if(this.url=e,this.events=new o.exports.EventEmitter,this.registering=!1,!Xl(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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise(((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())}))}async send(e,t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(sr(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Xl(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)}))}))}return this.url=e,this.registering=!0,new Promise(((t,n)=>{const r=sl.isReactNative()?void 0:{rejectUnauthorized:!Zl(e)},i=new uf(e,[],r);cf()?i.onerror=e=>{const t=e;n(this.emitError(t.error))}:i.on("error",(e=>{n(this.emitError(e))})),i.onopen=()=>{this.onOpen(i),t(i)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),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 t="string"==typeof e.data?or(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=Hl(e,n.message||n.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return ol(e,t,"WS")}resetMaxListeners(){this.events.getMaxListeners()>af&&this.events.setMaxListeners(af)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",t),t}}var ff={exports:{}};!function(e,n){var r=200,i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,c="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",h="[object Date]",d="[object Error]",p="[object Function]",g="[object GeneratorFunction]",y="[object Map]",v="[object Number]",m="[object Null]",_="[object Object]",b="[object Promise]",w="[object Proxy]",E="[object RegExp]",S="[object Set]",O="[object String]",R="[object Symbol]",x="[object Undefined]",I="[object WeakMap]",C="[object ArrayBuffer]",P="[object DataView]",k="[object Float64Array]",N="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",M="[object Uint8Array]",L="[object Uint8ClampedArray]",U="[object Uint16Array]",j="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,z=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,F={};F["[object Float32Array]"]=F[k]=F[N]=F[A]=F[T]=F[M]=F[L]=F[U]=F[j]=!0,F[c]=F[u]=F[C]=F[f]=F[P]=F[h]=F[d]=F[p]=F[y]=F[v]=F[_]=F[E]=F[S]=F[O]=F[I]=!1;var H="object"==typeof t&&t&&t.Object===Object&&t,$="object"==typeof self&&self&&self.Object===Object&&self,V=H||$||Function("return this")(),q=n&&!n.nodeType&&n,W=q&&e&&!e.nodeType&&e,K=W&&W.exports===q,G=K&&H.process,Y=function(){try{return G&&G.binding&&G.binding("util")}catch{}}(),Q=Y&&Y.isTypedArray;function J(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function X(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Z(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function ee(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function te(e){return function(t){return e(t)}}function ne(e,t){return e.has(t)}function re(e,t){return e?.[t]}function ie(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function oe(e,t){return function(n){return e(t(n))}}function se(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var ae=Array.prototype,ce=Function.prototype,ue=Object.prototype,le=V["__core-js_shared__"],fe=ce.toString,he=ue.hasOwnProperty,de=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),pe=ue.toString,ge=RegExp("^"+fe.call(he).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=K?V.Buffer:void 0,ve=V.Symbol,me=V.Uint8Array,_e=ue.propertyIsEnumerable,be=ae.splice,we=ve?ve.toStringTag:void 0,Ee=Object.getOwnPropertySymbols,Se=ye?ye.isBuffer:void 0,Oe=oe(Object.keys,Object),Re=xt(V,"DataView"),xe=xt(V,"Map"),Ie=xt(V,"Promise"),Ce=xt(V,"Set"),Pe=xt(V,"WeakMap"),ke=xt(Object,"create"),Ne=Lt(Re),Ae=Lt(xe),Te=Lt(Ie),Me=Lt(Ce),Le=Lt(Pe),Ue=ve?ve.prototype:void 0,je=Ue?Ue.valueOf:void 0;function De(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ze(){this.__data__=ke?ke(null):{},this.size=0}function Be(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Fe(e){var t=this.__data__;if(ke){var n=t[e];return n===i?void 0:n}return he.call(t,e)?t[e]:void 0}function He(e){var t=this.__data__;return ke?void 0!==t[e]:he.call(t,e)}function $e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ke&&void 0===t?i:t,this}function Ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qe(){this.__data__=[],this.size=0}function We(e){var t=this.__data__,n=ht(t,e);return!(n<0||(n==t.length-1?t.pop():be.call(t,n,1),--this.size,0))}function Ke(e){var t=this.__data__,n=ht(t,e);return n<0?void 0:t[n][1]}function Ge(e){return ht(this.__data__,e)>-1}function Ye(e,t){var n=this.__data__,r=ht(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Je(){this.size=0,this.__data__={hash:new De,map:new(xe||Ve),string:new De}}function Xe(e){var t=Rt(this,e).delete(e);return this.size-=t?1:0,t}function Ze(e){return Rt(this,e).get(e)}function et(e){return Rt(this,e).has(e)}function tt(e,t){var n=Rt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function nt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Qe;++t<n;)this.add(e[t])}function rt(e){return this.__data__.set(e,i),this}function it(e){return this.__data__.has(e)}function ot(e){var t=this.__data__=new Ve(e);this.size=t.size}function st(){this.__data__=new Ve,this.size=0}function at(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ct(e){return this.__data__.get(e)}function ut(e){return this.__data__.has(e)}function lt(e,t){var n=this.__data__;if(n instanceof Ve){var i=n.__data__;if(!xe||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qe(i)}return n.set(e,t),this.size=n.size,this}function ft(e,t){var n=Dt(e),r=!n&&jt(e),i=!n&&!r&&Bt(e),o=!n&&!r&&!i&&Wt(e),s=n||r||i||o,a=s?ee(e.length,String):[],c=a.length;for(var u in e)(t||he.call(e,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||kt(u,c)))&&a.push(u);return a}function ht(e,t){for(var n=e.length;n--;)if(Ut(e[n][0],t))return n;return-1}function dt(e,t,n){var r=t(e);return Dt(e)?r:X(r,n(e))}function pt(e){return null==e?void 0===e?x:m:we&&we in Object(e)?It(e):Mt(e)}function gt(e){return qt(e)&&pt(e)==c}function yt(e,t,n,r,i){return e===t||(null==e||null==t||!qt(e)&&!qt(t)?e!=e&&t!=t:vt(e,t,n,r,yt,i))}function vt(e,t,n,r,i,s){var a=Dt(e),l=Dt(t),f=a?u:Pt(e),h=l?u:Pt(t),d=(f=f==c?_:f)==_,p=(h=h==c?_:h)==_,g=f==h;if(g&&Bt(e)){if(!Bt(t))return!1;a=!0,d=!1}if(g&&!d)return s||(s=new ot),a||Wt(e)?wt(e,t,n,r,i,s):Et(e,t,f,n,r,i,s);if(!(n&o)){var y=d&&he.call(e,"__wrapped__"),v=p&&he.call(t,"__wrapped__");if(y||v){var m=y?e.value():e,b=v?t.value():t;return s||(s=new ot),i(m,b,n,r,s)}}return!!g&&(s||(s=new ot),St(e,t,n,r,i,s))}function mt(e){return!(!Vt(e)||At(e))&&(Ht(e)?ge:z).test(Lt(e))}function _t(e){return qt(e)&&$t(e.length)&&!!F[pt(e)]}function bt(e){if(!Tt(e))return Oe(e);var t=[];for(var n in Object(e))he.call(e,n)&&"constructor"!=n&&t.push(n);return t}function wt(e,t,n,r,i,a){var c=n&o,u=e.length,l=t.length;if(u!=l&&!(c&&l>u))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var h=-1,d=!0,p=n&s?new nt:void 0;for(a.set(e,t),a.set(t,e);++h<u;){var g=e[h],y=t[h];if(r)var v=c?r(y,g,h,t,e,a):r(g,y,h,e,t,a);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Z(t,(function(e,t){if(!ne(p,t)&&(g===e||i(g,e,n,r,a)))return p.push(t)}))){d=!1;break}}else if(g!==y&&!i(g,y,n,r,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function Et(e,t,n,r,i,a,c){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C:return!(e.byteLength!=t.byteLength||!a(new me(e),new me(t)));case f:case h:case v:return Ut(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case O:return e==t+"";case y:var u=ie;case S:var l=r&o;if(u||(u=se),e.size!=t.size&&!l)return!1;var p=c.get(e);if(p)return p==t;r|=s,c.set(e,t);var g=wt(u(e),u(t),r,i,a,c);return c.delete(e),g;case R:if(je)return je.call(e)==je.call(t)}return!1}function St(e,t,n,r,i,s){var a=n&o,c=Ot(e),u=c.length;if(u!=Ot(t).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in t:he.call(t,f)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var d=!0;s.set(e,t),s.set(t,e);for(var p=a;++l<u;){var g=e[f=c[l]],y=t[f];if(r)var v=a?r(y,g,f,t,e,s):r(g,y,f,e,t,s);if(!(void 0===v?g===y||i(g,y,n,r,s):v)){d=!1;break}p||(p="constructor"==f)}if(d&&!p){var m=e.constructor,_=t.constructor;m!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return s.delete(e),s.delete(t),d}function Ot(e){return dt(e,Kt,Ct)}function Rt(e,t){var n=e.__data__;return Nt(t)?n["string"==typeof t?"string":"hash"]:n.map}function xt(e,t){var n=re(e,t);return mt(n)?n:void 0}function It(e){var t=he.call(e,we),n=e[we];try{e[we]=void 0;var r=!0}catch{}var i=pe.call(e);return r&&(t?e[we]=n:delete e[we]),i}De.prototype.clear=ze,De.prototype.delete=Be,De.prototype.get=Fe,De.prototype.has=He,De.prototype.set=$e,Ve.prototype.clear=qe,Ve.prototype.delete=We,Ve.prototype.get=Ke,Ve.prototype.has=Ge,Ve.prototype.set=Ye,Qe.prototype.clear=Je,Qe.prototype.delete=Xe,Qe.prototype.get=Ze,Qe.prototype.has=et,Qe.prototype.set=tt,nt.prototype.add=nt.prototype.push=rt,nt.prototype.has=it,ot.prototype.clear=st,ot.prototype.delete=at,ot.prototype.get=ct,ot.prototype.has=ut,ot.prototype.set=lt;var Ct=Ee?function(e){return null==e?[]:(e=Object(e),J(Ee(e),(function(t){return _e.call(e,t)})))}:Gt,Pt=pt;function kt(e,t){return!!(t=t??a)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Nt(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function At(e){return!!de&&de in e}function Tt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ue)}function Mt(e){return pe.call(e)}function Lt(e){if(null!=e){try{return fe.call(e)}catch{}try{return e+""}catch{}}return""}function Ut(e,t){return e===t||e!=e&&t!=t}(Re&&Pt(new Re(new ArrayBuffer(1)))!=P||xe&&Pt(new xe)!=y||Ie&&Pt(Ie.resolve())!=b||Ce&&Pt(new Ce)!=S||Pe&&Pt(new Pe)!=I)&&(Pt=function(e){var t=pt(e),n=t==_?e.constructor:void 0,r=n?Lt(n):"";if(r)switch(r){case Ne:return P;case Ae:return y;case Te:return b;case Me:return S;case Le:return I}return t});var jt=gt(function(){return arguments}())?gt:function(e){return qt(e)&&he.call(e,"callee")&&!_e.call(e,"callee")},Dt=Array.isArray;function zt(e){return null!=e&&$t(e.length)&&!Ht(e)}var Bt=Se||Yt;function Ft(e,t){return yt(e,t)}function Ht(e){if(!Vt(e))return!1;var t=pt(e);return t==p||t==g||t==l||t==w}function $t(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Vt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qt(e){return null!=e&&"object"==typeof e}var Wt=Q?te(Q):_t;function Kt(e){return zt(e)?ft(e):bt(e)}function Gt(){return[]}function Yt(){return!1}e.exports=Ft}(ff,ff.exports);var hf=ff.exports,df=Object.defineProperty,pf=Object.getOwnPropertySymbols,gf=Object.prototype.hasOwnProperty,yf=Object.prototype.propertyIsEnumerable,vf=(e,t,n)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mf=(e,t)=>{for(var n in t||(t={}))gf.call(t,n)&&vf(e,n,t[n]);if(pf)for(var n of pf(t))yf.call(t,n)&&vf(e,n,t[n]);return e};function _f(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==n[s])throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var f=t[i],h=0,d=s-1;(0!==f||h<r)&&-1!==d;d--,h++)f+=256*u[d]>>>0,u[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=h,i++}for(var p=s-r;p!==s&&0===u[p];)p++;for(var g=c.repeat(n);p<s;++p)g+=e.charAt(u[p]);return g}function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*s[h]>>>0,s[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(r+(o-d)),g=r;d!==o;)p[g++]=s[d++];return p}}}function d(e){var n=h(e);if(n)return n;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:d}}var bf=_f;const wf=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ef=e=>(new TextEncoder).encode(e),Sf=e=>(new TextDecoder).decode(e);class Of{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Rf{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return If(this,e)}}class xf{constructor(e){this.decoders=e}or(e){return If(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 If=(e,t)=>new xf(mf(mf({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}));class Cf{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Of(e,t,n),this.decoder=new Rf(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Pf=({name:e,prefix:t,encode:n,decode:r})=>new Cf(e,t,n,r),kf=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:i}=bf(n,t);return Pf({prefix:e,name:t,encode:r,decode:e=>wf(i(e))})},Nf=(e,t,n,r)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*n/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${r} character`);c=c<<n|o,a+=n,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},Af=(e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let o="",s=0,a=0;for(let r=0;r<e.length;++r)for(a=a<<8|e[r],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o},Tf=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Pf({prefix:t,name:e,encode:e=>Af(e,r,n),decode:t=>Nf(t,r,n,e)}),Mf=Pf({prefix:"\0",name:"identity",encode:e=>Sf(e),decode:e=>Ef(e)});var Lf=Object.freeze({__proto__:null,identity:Mf});const Uf=Tf({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var jf=Object.freeze({__proto__:null,base2:Uf});const Df=Tf({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zf=Object.freeze({__proto__:null,base8:Df});const Bf=kf({prefix:"9",name:"base10",alphabet:"0123456789"});var Ff=Object.freeze({__proto__:null,base10:Bf});const Hf=Tf({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$f=Tf({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Vf=Object.freeze({__proto__:null,base16:Hf,base16upper:$f});const qf=Tf({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wf=Tf({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Kf=Tf({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Gf=Tf({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Yf=Tf({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qf=Tf({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Jf=Tf({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xf=Tf({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zf=Tf({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var eh=Object.freeze({__proto__:null,base32:qf,base32upper:Wf,base32pad:Kf,base32padupper:Gf,base32hex:Yf,base32hexupper:Qf,base32hexpad:Jf,base32hexpadupper:Xf,base32z:Zf});const th=kf({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nh=kf({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var rh=Object.freeze({__proto__:null,base36:th,base36upper:nh});const ih=kf({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oh=kf({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sh=Object.freeze({__proto__:null,base58btc:ih,base58flickr:oh});const ah=Tf({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ch=Tf({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),uh=Tf({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),lh=Tf({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var fh=Object.freeze({__proto__:null,base64:ah,base64pad:ch,base64url:uh,base64urlpad:lh});const hh=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),dh=hh.reduce(((e,t,n)=>(e[n]=t,e)),[]),ph=hh.reduce(((e,t,n)=>(e[t.codePointAt(0)]=n,e)),[]);function gh(e){return e.reduce(((e,t)=>e+=dh[t]),"")}function yh(e){const t=[];for(const n of e){const e=ph[n.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}const vh=Pf({prefix:"🚀",name:"base256emoji",encode:gh,decode:yh});var mh=Object.freeze({__proto__:null,base256emoji:vh}),_h=Sh,bh=128,wh=-128,Eh=Math.pow(2,31);function Sh(e,t,n){t=t||[];for(var r=n=n||0;e>=Eh;)t[n++]=255&e|bh,e/=128;for(;e&wh;)t[n++]=255&e|bh,e>>>=7;return t[n]=0|e,Sh.bytes=n-r+1,t}var Oh=Ih,Rh=128,xh=127;function Ih(e,t){var n,r=0,i=0,o=t=t||0,s=e.length;do{if(o>=s)throw Ih.bytes=0,new RangeError("Could not decode varint");n=e[o++],r+=i<28?(n&xh)<<i:(n&xh)*Math.pow(2,i),i+=7}while(n>=Rh);return Ih.bytes=o-t,r}var Ch=Math.pow(2,7),Ph=Math.pow(2,14),kh=Math.pow(2,21),Nh=Math.pow(2,28),Ah=Math.pow(2,35),Th=Math.pow(2,42),Mh=Math.pow(2,49),Lh=Math.pow(2,56),Uh=Math.pow(2,63),jh={encode:_h,decode:Oh,encodingLength:function(e){return e<Ch?1:e<Ph?2:e<kh?3:e<Nh?4:e<Ah?5:e<Th?6:e<Mh?7:e<Lh?8:e<Uh?9:10}};const Dh=(e,t,n=0)=>(jh.encode(e,t,n),t),zh=e=>jh.encodingLength(e),Bh=(e,t)=>{const n=t.byteLength,r=zh(e),i=r+zh(n),o=new Uint8Array(i+n);return Dh(e,o,0),Dh(n,o,r),o.set(t,i),new Fh(e,n,t,o)};class Fh{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const Hh=({name:e,code:t,encode:n})=>new $h(e,t,n);class $h{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Bh(this.code,t):t.then((e=>Bh(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Vh=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),qh=Hh({name:"sha2-256",code:18,encode:Vh("SHA-256")}),Wh=Hh({name:"sha2-512",code:19,encode:Vh("SHA-512")});var Kh=Object.freeze({__proto__:null,sha256:qh,sha512:Wh});const Gh=0,Yh="identity",Qh=wf;var Jh=Object.freeze({__proto__:null,identity:{code:Gh,name:Yh,encode:Qh,digest:e=>Bh(Gh,Qh(e))}});new TextEncoder,new TextDecoder;const Xh=mf(mf(mf(mf(mf(mf(mf(mf(mf(mf({},Lf),jf),zf),Ff),Vf),eh),rh),sh),fh),mh);function Zh(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function ed(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Zh(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function td(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}mf(mf({},Kh),Jh);const nd=td("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),rd=td("ascii","a",(e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}),(e=>{const t=ed((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t})),id=mf({utf8:nd,"utf-8":nd,hex:Xh.base16,latin1:rd,ascii:rd,binary:rd},Xh);function od(e,t="utf8"){const n=id[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode(`${n.prefix}${e}`):Zh(globalThis.Buffer.from(e,"utf-8"))}const sd="wc",ad=2,cd="core",ud=`${sd}@2:${cd}:`,ld={name:cd,logger:"error"},fd={database:":memory:"},hd="crypto",dd="client_ed25519_seed",pd=We.ONE_DAY,gd="keychain",yd="0.3",vd="messages",md="0.3",_d=We.SIX_HOURS,bd="publisher",wd="irn",Ed="error",Sd="wss://relay.walletconnect.com",Od="relayer",Rd={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"},xd="_subscription",Id={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Cd=We.ONE_SECOND/2,Pd="2.8.1",kd=1e4,Nd="0.3",Ad="WALLETCONNECT_CLIENT_ID",Td={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Md="subscription",Ld="0.3",Ud=1e3*We.FIVE_SECONDS,jd="pairing",Dd="0.3",zd={wc_pairingDelete:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:We.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:We.ONE_DAY,prompt:!1,tag:0},res:{ttl:We.ONE_DAY,prompt:!1,tag:0}}},Bd={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Fd="history",Hd="0.3",$d="expirer",Vd={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},qd="0.3",Wd="verify-api",Kd="https://verify.walletconnect.com";class Gd{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=gd,this.version=yd,this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=cn.generateChildLogger(t,this.name)}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,kc(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Nc(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Yd{constructor(e,t,n){this.core=e,this.logger=t,this.name=hd,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),us(ds(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const e=Qa();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();const t=ds(await this.getClientSeed()),n=Ja();return await ps(n,e,pd,t)},this.generateSharedKey=(e,t,n)=>{this.isInitialized();const r=Xa(this.getPrivateKey(e),t);return this.setSymKey(r,n)},this.setSymKey=async(e,t)=>{this.isInitialized();const n=t||Za(e);return await this.keychain.set(n,e),n},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,n)=>{this.isInitialized();const r=cc(n),i=sr(t);if(uc(r)){const t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}const o=this.getSymKey(e),{type:s,senderPublicKey:a}=r;return rc({type:s,symKey:o,message:i,senderPublicKey:a})},this.decode=async(e,t,n)=>{this.isInitialized();const r=ac(t,n);if(uc(r)){const t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}return or(ic({symKey:this.getSymKey(e),encoded:t}))},this.getPayloadType=e=>nc(sc(e).type),this.getPayloadSenderPublicKey=e=>{const t=sc(e);return t.senderPublicKey?ss(t.senderPublicKey,Fa):void 0},this.core=e,this.logger=cn.generateChildLogger(t,this.name),this.keychain=n||new Gd(this.core,this.logger)}get context(){return cn.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(dd)}catch{e=Ja(),await this.keychain.set(dd,e)}return od(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Qd extends Gn{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=vd,this.version=md,this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();const n=ec(t);let r=this.messages.get(e);return typeof r>"u"&&(r={}),typeof r[n]<"u"||(r[n]=t,this.messages.set(e,r),await this.persist()),n},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[ec(t)]<"u"),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=cn.generateChildLogger(e,this.name),this.core=t}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,kc(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Nc(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Jd extends Yn{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new o.exports.EventEmitter,this.name=bd,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(e,t,n)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:n}});try{const r=n?.ttl||_d,i=Vc(n),o=n?.prompt||!1,s=n?.tag||0,a=n?.id||zl().toString(),c={topic:e,message:t,opts:{ttl:r,relay:i,prompt:o,tag:s,id:a}};this.queue.set(a,c);try{await await Tc(this.rpcPublish(e,t,r,i,o,s,a),this.publishTimeout),this.relayer.events.emit(Rd.publish,c)}catch{return this.logger.debug("Publishing Payload stalled"),void this.relayer.events.emit(Rd.connection_stalled)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:n}})}catch(e){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(e),e}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=cn.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return cn.getLoggerContext(this.logger)}rpcPublish(e,t,n,r,i,o,s){var a,c,u,l;const f={method:qc(r.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:i,tag:o},id:s};return yu(null==(a=f.params)?void 0:a.prompt)&&(null==(c=f.params)||delete c.prompt),yu(null==(u=f.params)?void 0:u.tag)&&(null==(l=f.params)||delete l.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:f}),this.relayer.request(f)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach((async e=>{const{topic:t,message:n,opts:r}=e;await this.publish(t,n,r)}))}registerEventListeners(){this.relayer.core.heartbeat.on(_e.HEARTBEAT_EVENTS.pulse,(()=>{this.checkQueue()})),this.relayer.on(Rd.message_ack,(e=>{this.onPublish(e.id.toString())}))}}class Xd{constructor(){this.map=new Map,this.set=(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const r=n.filter((e=>e!==t));r.length?this.map.set(e,r):this.map.delete(e)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Zd=Object.defineProperty,ep=Object.defineProperties,tp=Object.getOwnPropertyDescriptors,np=Object.getOwnPropertySymbols,rp=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,op=(e,t,n)=>t in e?Zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sp=(e,t)=>{for(var n in t||(t={}))rp.call(t,n)&&op(e,n,t[n]);if(np)for(var n of np(t))ip.call(t,n)&&op(e,n,t[n]);return e},ap=(e,t)=>ep(e,tp(t));class cp extends Xn{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new Xd,this.events=new o.exports.EventEmitter,this.name=Md,this.version=Ld,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=ud,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const n=Vc(t),r={topic:e,relay:n};this.pending.set(e,r);const i=await this.rpcSubscribe(e,n);return this.onSubscribe(i,r),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}}),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>!!this.topics.includes(e)||await new Promise(((t,n)=>{const r=new We.Watch;r.start(this.pendingSubscriptionWatchLabel);const i=setInterval((()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(i),r.stop(this.pendingSubscriptionWatchLabel),t(!0)),r.elapsed(this.pendingSubscriptionWatchLabel)>=Ud&&(clearInterval(i),r.stop(this.pendingSubscriptionWatchLabel),n(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1)),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=cn.generateChildLogger(t,this.name),this.clientId=""}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map((async n=>await this.unsubscribeById(e,n,t))))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const r=Vc(n);await this.rpcUnsubscribe(e,t,r);const i=du("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t){const n={method:qc(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Tc(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Rd.connection_stalled)}return ec(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:qc(e[0].relay.protocol).batchSubscribe,params:{topics:e.map((e=>e.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await Tc(this.relayer.request(t),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Rd.connection_stalled)}}rpcUnsubscribe(e,t,n){const r={method:qc(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,ap(sp({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach((e=>{this.setSubscription(e.id,sp({},e)),this.pending.delete(e.topic)}))}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,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,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,sp({},t)),this.topicMap.set(t.topic,e),this.events.emit(Td.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Td.deleted,ap(sp({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Td.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const e=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(e)}}this.events.emit(Td.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}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 t=await this.rpcBatchSubscribe(e);pu(t)&&this.onBatchSubscribe(t.map(((t,n)=>ap(sp({},e[n]),{id:t}))))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach((t=>{e.push(t)})),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(_e.HEARTBEAT_EVENTS.pulse,(async()=>{await this.checkPending()})),this.relayer.on(Rd.connect,(async()=>{await this.onConnect()})),this.relayer.on(Rd.disconnect,(()=>{this.onDisconnect()})),this.events.on(Td.created,(async e=>{const t=Td.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})),this.events.on(Td.deleted,(async e=>{const t=Td.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise((e=>{const t=setInterval((()=>{this.restartInProgress||(clearInterval(t),e())}),this.pollingInterval)}))}}var up=Object.defineProperty,lp=Object.getOwnPropertySymbols,fp=Object.prototype.hasOwnProperty,hp=Object.prototype.propertyIsEnumerable,dp=(e,t,n)=>t in e?up(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pp=(e,t)=>{for(var n in t||(t={}))fp.call(t,n)&&dp(e,n,t[n]);if(lp)for(var n of lp(t))hp.call(t,n)&&dp(e,n,t[n]);return e};class gp extends Qn{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new o.exports.EventEmitter,this.name=Od,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async e=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(e)}catch(e){throw this.logger.debug("Failed to Publish Request"),this.logger.error(e),e}},this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?cn.generateChildLogger(e.logger,this.name):cn.pino(cn.getDefaultLoggerOptions({level:e.logger||Ed})),this.messages=new Qd(this.logger,e.core),this.subscriber=new cp(this,this.logger),this.publisher=new Jd(this,this.logger),this.relayUrl=e?.relayUrl||Sd,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout((async()=>{0===this.subscriber.topics.length&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)}),kd)}get context(){return cn.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var n;this.isInitialized();let r=(null==(n=this.subscriber.topicMap.get(e))?void 0:n[0])||"";return r||(await Promise.all([new Promise((t=>{this.subscriber.once(Td.created,(n=>{n.topic===e&&t()}))})),new Promise((async n=>{r=await this.subscriber.subscribe(e,t),n()}))]),r)}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(Rd.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise((e=>{this.initialized||e(),this.subscriber.once(Td.resubscribed,(()=>{e()}))})),await Promise.race([new Promise((async(e,t)=>{await Tc(this.provider.connect(),5e3,"socket stalled").catch((e=>t(e))).then((()=>e())).finally((()=>this.removeListener(Rd.transport_closed,this.rejectTransportOpen)))})),new Promise((e=>this.once(Rd.transport_closed,this.rejectTransportOpen)))])])}catch(e){this.logger.error(e);const t=e;if(!this.isConnectionStalled(t.message))throw e;this.events.emit(Rd.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise((e=>{this.provider.once(Id.disconnect,(()=>{e()}))})),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some((t=>e.includes(t)))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new sf(new lf(Cc({sdkVersion:Pd,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:n}=e;await this.messages.set(t,n)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;return!await this.subscriber.isSubscribed(t)||this.messages.has(t,n)}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),tf(e)){if(!e.method.endsWith(xd))return;const t=e.params,{topic:n,message:r,publishedAt:i}=t.data,o={topic:n,message:r,publishedAt:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(pp({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else nf(e)&&this.events.emit(Rd.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Rd.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Fl(e.id,!0);await this.provider.connection.send(t)}registerProviderListeners(){this.provider.on(Id.payload,(e=>this.onProviderPayload(e))),this.provider.on(Id.connect,(()=>{this.events.emit(Rd.connect)})),this.provider.on(Id.disconnect,(()=>{this.onProviderDisconnect()})),this.provider.on(Id.error,(e=>{this.logger.error(e),this.events.emit(Rd.error,e)}))}registerEventListeners(){this.events.on(Rd.connection_stalled,(async()=>{await this.restartTransport()}))}onProviderDisconnect(){this.events.emit(Rd.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout((async()=>{await this.restartTransport()}),We.toMiliseconds(Cd))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise((e=>{const t=setInterval((()=>{this.connected&&(clearInterval(t),e())}),this.connectionStatusPollingInterval)}));await this.restartTransport()}}}var yp=Object.defineProperty,vp=Object.getOwnPropertySymbols,mp=Object.prototype.hasOwnProperty,_p=Object.prototype.propertyIsEnumerable,bp=(e,t,n)=>t in e?yp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wp=(e,t)=>{for(var n in t||(t={}))mp.call(t,n)&&bp(e,n,t[n]);if(vp)for(var n of vp(t))_p.call(t,n)&&bp(e,n,t[n]);return e};class Ep extends Jn{constructor(e,t,n,r=ud,i=void 0){super(e,t,n,r),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=Nd,this.cached=[],this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>{this.getKey&&null!==e&&!yu(e)?this.map.set(this.getKey(e),e):Su(e)?this.map.set(e.id,e):Ou(e)&&this.map.set(e.topic,e)})),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter((t=>Object.keys(e).every((n=>hf(t[n],e[n]))))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const n=wp(wp({},this.getData(e)),t);this.map.set(e,n),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),await this.persist())},this.logger=cn.generateChildLogger(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}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:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}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}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Sp{constructor(e,t){this.core=e,this.logger=t,this.name=jd,this.version=Dd,this.events=new o.exports,this.initialized=!1,this.storagePrefix=ud,this.ignoredPayloadTypes=[qa],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:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async()=>{this.isInitialized();const e=Ja(),t=await this.core.crypto.setSymKey(e),n=Dc(We.FIVE_MINUTES),r={protocol:wd},i={topic:t,expiry:n,relay:r,active:!1},o=nu({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:e,relay:r});return await this.pairings.set(t,i),await this.core.relayer.subscribe(t),this.core.expirer.set(t,n),{topic:t,uri:o}},this.pair=async e=>{this.isInitialized(),this.isValidPair(e);const{topic:t,symKey:n,relay:r}=Zc(e.uri);if(this.pairings.keys.includes(t))throw new Error(`Pairing already exists: ${t}`);if(this.core.crypto.hasKeys(t))throw new Error(`Keychain already exists: ${t}`);const i=Dc(We.FIVE_MINUTES),o={topic:t,relay:r,expiry:i,active:!1};return await this.pairings.set(t,o),await this.core.crypto.setSymKey(n,t),await this.core.relayer.subscribe(t,{relay:r}),this.core.expirer.set(t,i),e.activatePairing&&await this.activate({topic:t}),o},this.activate=async({topic:e})=>{this.isInitialized();const t=Dc(We.THIRTY_DAYS);await this.pairings.update(e,{active:!0,expiry:t}),this.core.expirer.set(e,t)},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:n,resolve:r,reject:i}=Ac();this.events.once(Bc("pairing_ping",e),(({error:e})=>{e?i(e):r()})),await n()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",du("USER_DISCONNECTED")),await this.deletePairing(t))},this.sendRequest=async(e,t,n)=>{const r=Bl(t,n),i=await this.core.crypto.encode(e,r),o=zd[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,o),r.id},this.sendResult=async(e,t,n)=>{const r=Fl(e,n),i=await this.core.crypto.encode(t,r),o=await this.core.history.get(t,e),s=zd[o.request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(r)},this.sendError=async(e,t,n)=>{const r=Hl(e,n),i=await this.core.crypto.encode(t,r),o=await this.core.history.get(t,e),s=zd[o.request.method]?zd[o.request.method].res:zd.unregistered_method.res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,du("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{const e=this.pairings.getAll().filter((e=>zc(e.expiry)));await Promise.all(e.map((e=>this.deletePairing(e.topic))))},this.onRelayEventRequest=e=>{const{topic:t,payload:n}=e,r=n.method;if(this.pairings.keys.includes(t))switch(r){case"wc_pairingPing":return this.onPairingPingRequest(t,n);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,n);default:return this.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;if(this.pairings.keys.includes(t))return"wc_pairingPing"===r?this.onPairingPingResponse(t,n):this.onUnknownRpcMethodResponse(r)},this.onPairingPingRequest=async(e,t)=>{const{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit("pairing_ping",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{const{id:n}=t;setTimeout((()=>{rf(t)?this.events.emit(Bc("pairing_ping",n),{}):of(t)&&this.events.emit(Bc("pairing_ping",n),{error:t.error})}),500)},this.onPairingDeleteRequest=async(e,t)=>{const{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit("pairing_delete",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{const{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;const t=du("WC_METHOD_UNSUPPORTED",r);await this.sendError(n,e,t),this.logger.error(t)}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(du("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`pair() params: ${e}`);throw new Error(t)}if(!Eu(e.uri)){const{message:t}=hu("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw new Error(t)}},this.isValidPing=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!vu(e,!1)){const{message:t}=hu("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(zc(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=hu("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}},this.core=e,this.logger=cn.generateChildLogger(t,this.name),this.pairings=new Ep(this.core,this.logger,this.name,this.storagePrefix)}get context(){return cn.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Rd.message,(async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const r=await this.core.crypto.decode(t,n);tf(r)?(this.core.history.set(t,r),this.onRelayEventRequest({topic:t,payload:r})):nf(r)&&(await this.core.history.resolve(r),this.onRelayEventResponse({topic:t,payload:r}))}))}registerExpirerEvents(){this.core.expirer.on(Vd.expired,(async e=>{const{topic:t}=jc(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit("pairing_expire",{topic:t}))}))}}class Op extends Kn{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new o.exports.EventEmitter,this.name=Fd,this.version=Hd,this.cached=[],this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.records.set(e.id,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,n)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:n}),this.records.has(t.id))return;const r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n};this.records.set(r.id,r),this.events.emit(Bd.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=of(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.events.emit(Bd.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach((n=>{if(n.topic===e){if(typeof t<"u"&&n.id!==t)return;this.records.delete(n.id),this.events.emit(Bd.deleted,n)}}))},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=cn.generateChildLogger(t,this.name)}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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((t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:Bl(t.request.method,t.request.params,t.id),chainId:t.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 t=this.records.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Bd.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}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(Bd.created,(e=>{const t=Bd.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(Bd.updated,(e=>{const t=Bd.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(Bd.deleted,(e=>{const t=Bd.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Rp extends Zn{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new o.exports.EventEmitter,this.name=$d,this.version=qd,this.cached=[],this.initialized=!1,this.storagePrefix=ud,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.expirations.set(e.target,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}},this.set=(e,t)=>{this.isInitialized();const n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(Vd.created,{target:n,expiration:r})},this.get=e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(Vd.deleted,{target:t,expiration:n})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=cn.generateChildLogger(t,this.name)}get context(){return cn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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("string"==typeof e)return Lc(e);if("number"==typeof e)return Uc(e);const{message:t}=hu("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}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(Vd.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=hu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}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 t=this.expirations.get(e);if(!t){const{message:t}=hu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:n}=t;We.toMiliseconds(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Vd.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((e,t)=>this.checkExpiry(t,e)))}registerEventListeners(){this.core.heartbeat.on(_e.HEARTBEAT_EVENTS.pulse,(()=>this.checkExpirations())),this.events.on(Vd.created,(e=>{const t=Vd.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(Vd.expired,(e=>{const t=Vd.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(Vd.deleted,(e=>{const t=Vd.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}}class xp extends er{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Wd,this.initialized=!1,this.init=async e=>{bc()||!wc()||(this.verifyUrl=e?.verifyUrl||Kd,await this.createIframe())},this.register=async e=>{var t;this.initialized||await this.init(),this.iframe&&(null==(t=this.iframe.contentWindow)||t.postMessage(e.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${e.attestationId} ${this.verifyUrl}`))},this.resolve=async e=>{var t;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${e.attestationId}`);const n=this.startAbortTimer(We.FIVE_SECONDS),r=await fetch(`${this.verifyUrl}/attestation/${e.attestationId}`,{signal:this.abortController.signal});return clearTimeout(n),200===r.status?null==(t=await r.json())?void 0:t.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise(((e,t)=>{if(document.getElementById(Wd))return e();const n=document.createElement("iframe");n.setAttribute("id",Wd),n.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),n.style.display="none",n.addEventListener("load",(()=>{this.initialized=!0,e()})),n.addEventListener("error",(e=>{t(e)})),document.body.append(n),this.iframe=n})),new Promise((e=>{setTimeout((()=>e("iframe load timeout")),We.toMiliseconds(We.ONE_SECOND/2))}))])}catch(e){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(e)}},this.logger=cn.generateChildLogger(t,this.name),this.verifyUrl=Kd,this.abortController=new AbortController,this.isDevEnv=_c()&&process.env.IS_VITEST}get context(){return cn.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout((()=>this.abortController.abort()),We.toMiliseconds(e))}}var Ip=Object.defineProperty,Cp=Object.getOwnPropertySymbols,Pp=Object.prototype.hasOwnProperty,kp=Object.prototype.propertyIsEnumerable,Np=(e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ap=(e,t)=>{for(var n in t||(t={}))Pp.call(t,n)&&Np(e,n,t[n]);if(Cp)for(var n of Cp(t))kp.call(t,n)&&Np(e,n,t[n]);return e};class Tp extends Wn{constructor(e){super(e),this.protocol=sd,this.version=ad,this.name=cd,this.events=new o.exports.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Sd;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:cn.pino(cn.getDefaultLoggerOptions({level:e?.logger||ld.logger}));this.logger=cn.generateChildLogger(t,this.name),this.heartbeat=new _e.HeartBeat,this.crypto=new Yd(this,this.logger,e?.keychain),this.history=new Op(this,this.logger),this.expirer=new Rp(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new me(Ap(Ap({},fd),e?.storageOptions)),this.relayer=new gp({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Sp(this,this.logger),this.verify=new xp(this.projectId||"",this.logger)}static async init(e){const t=new Tp(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem(Ad,n),t}get context(){return cn.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}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 Mp=Tp,Lp="wc",Up=2,jp="client",Dp=`${Lp}@${Up}:${jp}:`,zp={name:jp,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Bp="WALLETCONNECT_DEEPLINK_CHOICE",Fp="proposal",Hp="Proposal expired",$p="session",Vp=We.SEVEN_DAYS,qp="engine",Wp={wc_sessionPropose:{req:{ttl:We.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1104},res:{ttl:We.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1106},res:{ttl:We.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:We.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:We.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:We.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:We.ONE_DAY,prompt:!1,tag:1112},res:{ttl:We.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:We.THIRTY_SECONDS,prompt:!1,tag:1115}}},Kp={min:We.FIVE_MINUTES,max:We.SEVEN_DAYS},Gp="request",Yp=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var Qp=Object.defineProperty,Jp=Object.defineProperties,Xp=Object.getOwnPropertyDescriptors,Zp=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,tg=Object.prototype.propertyIsEnumerable,ng=(e,t,n)=>t in e?Qp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rg=(e,t)=>{for(var n in t||(t={}))eg.call(t,n)&&ng(e,n,t[n]);if(Zp)for(var n of Zp(t))tg.call(t,n)&&ng(e,n,t[n]);return e},ig=(e,t)=>Jp(e,Xp(t));class og extends nr{constructor(e){super(e),this.name=qp,this.events=new o.exports,this.initialized=!1,this.ignoredPayloadTypes=[qa],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Wp)}),this.initialized=!0)},this.connect=async e=>{this.isInitialized();const t=ig(rg({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);const{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:o,relays:s}=t;let a,c=n,u=!1;if(c&&(u=this.client.core.pairing.pairings.get(c).active),!c||!u){const{topic:e,uri:t}=await this.client.core.pairing.create();c=e,a=t}const l=await this.client.core.crypto.generateKeyPair(),f=rg({requiredNamespaces:r,optionalNamespaces:i,relays:s??[{protocol:wd}],proposer:{publicKey:l,metadata:this.client.metadata}},o&&{sessionProperties:o}),{reject:h,resolve:d,done:p}=Ac(We.FIVE_MINUTES,Hp);if(this.events.once(Bc("session_connect"),(async({error:e,session:t})=>{if(e)h(e);else if(t){t.self.publicKey=l;const e=ig(rg({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:t.peer.metadata}),d(e)}})),!c){const{message:e}=hu("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(e)}const g=await this.sendRequest(c,"wc_sessionPropose",f),y=Dc(We.FIVE_MINUTES);return await this.setProposal(g,rg({id:g,expiry:y},f)),{uri:a,approval:p}},this.pair=async e=>(this.isInitialized(),await this.client.core.pairing.pair(e)),this.approve=async e=>{this.isInitialized(),await this.isValidApprove(e);const{id:t,relayProtocol:n,namespaces:r,sessionProperties:i}=e,o=this.client.proposal.get(t);let{pairingTopic:s,proposer:a,requiredNamespaces:c,optionalNamespaces:u}=o;s=s||"",gu(c)||(c=au(r,"approve()"));const l=await this.client.core.crypto.generateKeyPair(),f=a.publicKey,h=await this.client.core.crypto.generateSharedKey(l,f);s&&t&&(await this.client.core.pairing.updateMetadata({topic:s,metadata:a.metadata}),await this.sendResult(t,s,{relay:{protocol:n??"irn"},responderPublicKey:l}),await this.client.proposal.delete(t,du("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:s}));const d=rg({relay:{protocol:n??"irn"},namespaces:r,requiredNamespaces:c,optionalNamespaces:u,pairingTopic:s,controller:{publicKey:l,metadata:this.client.metadata},expiry:Dc(Vp)},i&&{sessionProperties:i});await this.client.core.relayer.subscribe(h),await this.sendRequest(h,"wc_sessionSettle",d);const p=ig(rg({},d),{topic:h,pairingTopic:s,acknowledged:!1,self:d.controller,peer:{publicKey:a.publicKey,metadata:a.metadata},controller:l});return await this.client.session.set(h,p),await this.setExpiry(h,Dc(Vp)),{topic:h,acknowledged:()=>new Promise((e=>setTimeout((()=>e(this.client.session.get(h))),500)))}},this.reject=async e=>{this.isInitialized(),await this.isValidReject(e);const{id:t,reason:n}=e,{pairingTopic:r}=this.client.proposal.get(t);r&&(await this.sendError(t,r,n),await this.client.proposal.delete(t,du("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.isValidUpdate(e);const{topic:t,namespaces:n}=e,r=await this.sendRequest(t,"wc_sessionUpdate",{namespaces:n}),{done:i,resolve:o,reject:s}=Ac();return this.events.once(Bc("session_update",r),(({error:e})=>{e?s(e):o()})),await this.client.session.update(t,{namespaces:n}),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.isValidExtend(e);const{topic:t}=e,n=await this.sendRequest(t,"wc_sessionExtend",{}),{done:r,resolve:i,reject:o}=Ac();return this.events.once(Bc("session_extend",n),(({error:e})=>{e?o(e):i()})),await this.setExpiry(t,Dc(Vp)),{acknowledged:r}},this.request=async e=>{this.isInitialized(),await this.isValidRequest(e);const{chainId:t,request:n,topic:r,expiry:i}=e,o=await this.sendRequest(r,"wc_sessionRequest",{request:n,chainId:t},i),{done:s,resolve:a,reject:c}=Ac(i);return this.events.once(Bc("session_request",o),(({error:e,result:t})=>{e?c(e):a(t)})),this.client.events.emit("session_request_sent",{topic:r,request:n,chainId:t,id:o}),Hc({id:o,topic:r,wcDeepLink:await this.client.core.storage.getItem(Bp)}),await s()},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:n}=e,{id:r}=n;rf(n)?await this.sendResult(r,t,n.result):of(n)&&await this.sendError(r,t,n.error),this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=await this.sendRequest(t,"wc_sessionPing",{}),{done:n,resolve:r,reject:i}=Ac();this.events.once(Bc("session_ping",e),(({error:e})=>{e?i(e):r()})),await n()}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.isValidEmit(e);const{topic:t,event:n,chainId:r}=e;await this.sendRequest(t,"wc_sessionEvent",{event:n,chainId:r})},this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=zl().toString();let n;const r=t=>{t?.id.toString()===e&&(this.client.core.relayer.events.removeListener(Rd.message_ack,r),n())};await Promise.all([new Promise((e=>{n=e,this.client.core.relayer.on(Rd.message_ack,r)})),this.sendRequest(t,"wc_sessionDelete",du("USER_DISCONNECTED"),void 0,e)]),await this.deleteSession(t)}else await this.client.core.pairing.disconnect({topic:t})},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter((t=>_u(t,e)))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async e=>{try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter((n=>{var r,i;return(null==(r=n.peerMetadata)?void 0:r.url)&&(null==(i=n.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&n.topic&&n.topic!==t.topic}));if(0===n.length)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map((e=>this.client.core.pairing.disconnect({topic:e.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async(e,t)=>{const{self:n}=this.client.session.get(e);await this.client.core.relayer.unsubscribe(e),this.client.session.delete(e,du("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(n.publicKey)&&await this.client.core.crypto.deleteKeyPair(n.publicKey),this.client.core.crypto.keychain.has(e)&&await this.client.core.crypto.deleteSymKey(e),t||this.client.core.expirer.del(e)},this.deleteProposal=async(e,t)=>{await Promise.all([this.client.proposal.delete(e,du("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)])},this.deletePendingSessionRequest=async(e,t,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&await this.client.session.update(e,{expiry:t}),this.client.core.expirer.set(e,t)},this.setProposal=async(e,t)=>{await this.client.proposal.set(e,t),this.client.core.expirer.set(e,t.expiry)},this.setPendingSessionRequest=async e=>{const t=Wp.wc_sessionRequest.req.ttl,{id:n,topic:r,params:i}=e;await this.client.pendingRequest.set(n,{id:n,topic:r,params:i}),t&&this.client.core.expirer.set(n,Dc(t))},this.sendRequest=async(e,t,n,r,i)=>{const o=Bl(t,n);if(wc()&&Yp.includes(t)){const e=ec(JSON.stringify(o));await this.client.core.verify.register({attestationId:e})}const s=await this.client.core.crypto.encode(e,o),a=Wp[t].req;return r&&(a.ttl=r),i&&(a.id=i),this.client.core.history.set(e,o),this.client.core.relayer.publish(e,s,a),o.id},this.sendResult=async(e,t,n)=>{const r=Fl(e,n),i=await this.client.core.crypto.encode(t,r),o=await this.client.core.history.get(t,e),s=Wp[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(r)},this.sendError=async(e,t,n)=>{const r=Hl(e,n),i=await this.client.core.crypto.encode(t,r),o=await this.client.core.history.get(t,e),s=Wp[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(r)},this.cleanup=async()=>{const e=[],t=[];this.client.session.getAll().forEach((t=>{zc(t.expiry)&&e.push(t.topic)})),this.client.proposal.getAll().forEach((e=>{zc(e.expiry)&&t.push(e.id)})),await Promise.all([...e.map((e=>this.deleteSession(e))),...t.map((e=>this.deleteProposal(e)))])},this.onRelayEventRequest=e=>{const{topic:t,payload:n}=e,r=n.method;switch(r){case"wc_sessionPropose":return this.onSessionProposeRequest(t,n);case"wc_sessionSettle":return this.onSessionSettleRequest(t,n);case"wc_sessionUpdate":return this.onSessionUpdateRequest(t,n);case"wc_sessionExtend":return this.onSessionExtendRequest(t,n);case"wc_sessionPing":return this.onSessionPingRequest(t,n);case"wc_sessionDelete":return this.onSessionDeleteRequest(t,n);case"wc_sessionRequest":return this.onSessionRequest(t,n);case"wc_sessionEvent":return this.onSessionEventRequest(t,n);default:return this.client.logger.info(`Unsupported request method ${r}`)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:n}=e,r=(await this.client.core.history.get(t,n.id)).request.method;switch(r){case"wc_sessionPropose":return this.onSessionProposeResponse(t,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,n);case"wc_sessionExtend":return this.onSessionExtendResponse(t,n);case"wc_sessionPing":return this.onSessionPingResponse(t,n);case"wc_sessionRequest":return this.onSessionRequestResponse(t,n);default:return this.client.logger.info(`Unsupported response method ${r}`)}},this.onRelayEventUnknownPayload=e=>{const{topic:t}=e,{message:n}=hu("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.onSessionProposeRequest=async(e,t)=>{const{params:n,id:r}=t;try{this.isValidConnect(rg({},t.params));const i=Dc(We.FIVE_MINUTES),o=rg({id:r,pairingTopic:e,expiry:i},n);await this.setProposal(r,o);const s=ec(JSON.stringify(t)),a=await this.getVerifyContext(s,o.proposer.metadata);this.client.events.emit("session_proposal",{id:r,params:o,verifyContext:a})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionProposeResponse=async(e,t)=>{const{id:n}=t;if(rf(t)){const{result:r}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:r});const i=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});const o=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const s=r.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:s});const a=await this.client.core.crypto.generateSharedKey(o,s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});const c=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else of(t)&&(await this.client.proposal.delete(n,du("USER_DISCONNECTED")),this.events.emit(Bc("session_connect"),{error:t.error}))},this.onSessionSettleRequest=async(e,t)=>{const{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);const{relay:n,controller:i,expiry:o,namespaces:s,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:u,pairingTopic:l}=t.params,f=rg({topic:e,relay:n,expiry:o,namespaces:s,acknowledged:!0,pairingTopic:l,requiredNamespaces:a,optionalNamespaces:c,controller:i.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},u&&{sessionProperties:u});await this.sendResult(t.id,e,!0),this.events.emit(Bc("session_connect"),{session:f}),this.cleanupDuplicatePairings(f)}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{const{id:n}=t;rf(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(Bc("session_approve",n),{})):of(t)&&(await this.client.session.delete(e,du("USER_DISCONNECTED")),this.events.emit(Bc("session_approve",n),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{const{params:n,id:r}=t;try{this.isValidUpdate(rg({topic:e},n)),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult(r,e,!0),this.client.events.emit("session_update",{id:r,topic:e,params:n})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionUpdateResponse=(e,t)=>{const{id:n}=t;rf(t)?this.events.emit(Bc("session_update",n),{}):of(t)&&this.events.emit(Bc("session_update",n),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{const{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Dc(Vp)),await this.sendResult(n,e,!0),this.client.events.emit("session_extend",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{const{id:n}=t;rf(t)?this.events.emit(Bc("session_extend",n),{}):of(t)&&this.events.emit(Bc("session_extend",n),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{const{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.client.events.emit("session_ping",{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{const{id:n}=t;setTimeout((()=>{rf(t)?this.events.emit(Bc("session_ping",n),{}):of(t)&&this.events.emit(Bc("session_ping",n),{error:t.error})}),500)},this.onSessionDeleteRequest=async(e,t)=>{const{id:n}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise((t=>{this.client.core.relayer.once(Rd.publish,(async()=>{t(await this.deleteSession(e))}))})),this.sendResult(n,e,!0)]),this.client.events.emit("session_delete",{id:n,topic:e})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async(e,t)=>{const{id:n,params:r}=t;try{this.isValidRequest(rg({topic:e},r)),await this.setPendingSessionRequest({id:n,topic:e,params:r});const i=ec(JSON.stringify(t)),o=this.client.session.get(e),s=await this.getVerifyContext(i,o.peer.metadata);this.client.events.emit("session_request",{id:n,topic:e,params:r,verifyContext:s})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionRequestResponse=(e,t)=>{const{id:n}=t;rf(t)?this.events.emit(Bc("session_request",n),{result:t.result}):of(t)&&this.events.emit(Bc("session_request",n),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{const{id:n,params:r}=t;try{this.isValidEmit(rg({topic:e},r)),this.client.events.emit("session_event",{id:n,topic:e,params:r})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.isValidConnect=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,relays:o}=e;if(yu(t)||await this.isValidPairingTopic(t),!Uu(o,!0)){const{message:e}=hu("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(e)}!yu(n)&&0!==gu(n)&&this.validateNamespaces(n,"requiredNamespaces"),!yu(r)&&0!==gu(r)&&this.validateNamespaces(r,"optionalNamespaces"),yu(i)||this.validateSessionProps(i,"sessionProperties")},this.validateNamespaces=(e,t)=>{const n=Tu(e,"connect()",t);if(n)throw new Error(n.message)},this.isValidApprove=async e=>{if(!Du(e))throw new Error(hu("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:n,relayProtocol:r,sessionProperties:i}=e;await this.isValidProposalId(t);const o=this.client.proposal.get(t),s=Mu(n,"approve()");if(s)throw new Error(s.message);const a=Wu(o.requiredNamespaces,n,"approve()");if(a)throw new Error(a.message);if(!vu(r,!0)){const{message:e}=hu("MISSING_OR_INVALID",`approve() relayProtocol: ${r}`);throw new Error(e)}yu(i)||this.validateSessionProps(i,"sessionProperties")},this.isValidReject=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:n}=e;if(await this.isValidProposalId(t),!zu(n)){const{message:e}=hu("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(e)}},this.isValidSessionSettleRequest=e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!Lu(t)){const{message:e}=hu("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const o=Ru(n,"onSessionSettleRequest()");if(o)throw new Error(o.message);const s=Mu(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);if(zc(i)){const{message:e}=hu("EXPIRED","onSessionSettleRequest()");throw new Error(e)}},this.isValidUpdate=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:n}=e;await this.isValidSessionTopic(t);const r=this.client.session.get(t),i=Mu(n,"update()");if(i)throw new Error(i.message);const o=Wu(r.requiredNamespaces,n,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:n,chainId:r,expiry:i}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!$u(o,r)){const{message:e}=hu("MISSING_OR_INVALID",`request() chainId: ${r}`);throw new Error(e)}if(!Bu(n)){const{message:e}=hu("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(e)}if(!Vu(o,r,n.method)){const{message:e}=hu("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(e)}if(i&&!Qu(i,Kp)){const{message:e}=hu("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${Kp.min} and ${Kp.max}`);throw new Error(e)}},this.isValidRespond=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:t,response:n}=e;if(await this.isValidSessionTopic(t),!Fu(n)){const{message:e}=hu("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw new Error(e)}},this.isValidPing=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!$u(i,r)){const{message:e}=hu("MISSING_OR_INVALID",`emit() chainId: ${r}`);throw new Error(e)}if(!Hu(n)){const{message:e}=hu("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(e)}if(!qu(i,r,n.name)){const{message:e}=hu("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(e)}},this.isValidDisconnect=async e=>{if(!Du(e)){const{message:t}=hu("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.getVerifyContext=async(e,t)=>{const n={verified:{verifyUrl:t.verifyUrl||"",validation:"UNKNOWN",origin:t.url||""}};try{const r=await this.client.core.verify.resolve({attestationId:e,verifyUrl:t.verifyUrl});r&&(n.verified.origin=r,n.verified.validation=r===t.url?"VALID":"INVALID")}catch(e){this.client.logger.error(e)}return this.client.logger.info(`Verify context: ${JSON.stringify(n)}`),n},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((e=>{if(!vu(e,!1)){const{message:n}=hu("MISSING_OR_INVALID",`${t} must be in Record<string, string> format. Received: ${JSON.stringify(e)}`);throw new Error(n)}}))}}isInitialized(){if(!this.initialized){const{message:e}=hu("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Rd.message,(async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const r=await this.client.core.crypto.decode(t,n);tf(r)?(this.client.core.history.set(t,r),this.onRelayEventRequest({topic:t,payload:r})):nf(r)?(await this.client.core.history.resolve(r),this.onRelayEventResponse({topic:t,payload:r})):this.onRelayEventUnknownPayload({topic:t,payload:r})}))}registerExpirerEvents(){this.client.core.expirer.on(Vd.expired,(async e=>{const{topic:t,id:n}=jc(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,hu("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession(t,!0),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))}))}isValidPairingTopic(e){if(!vu(e,!1)){const{message:t}=hu("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(zc(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=hu("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!vu(e,!1)){const{message:t}=hu("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(zc(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:t}=hu("EXPIRED",`session topic: ${e}`);throw new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(vu(e,!1)){const{message:t}=hu("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=hu("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!ju(e)){const{message:t}=hu("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=hu("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(zc(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:t}=hu("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class sg extends Ep{constructor(e,t){super(e,t,Fp,Dp),this.core=e,this.logger=t}}class ag extends Ep{constructor(e,t){super(e,t,$p,Dp),this.core=e,this.logger=t}}class cg extends Ep{constructor(e,t){super(e,t,Gp,Dp,(e=>e.id)),this.core=e,this.logger=t}}class ug extends tr{constructor(e){super(e),this.protocol=Lp,this.version=Up,this.name=zp.name,this.events=new o.exports.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||zp.name,this.metadata=e?.metadata||Oc();const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:cn.pino(cn.getDefaultLoggerOptions({level:e?.logger||zp.logger}));this.core=e?.core||new Mp(e),this.logger=cn.generateChildLogger(t,this.name),this.session=new ag(this.core,this.logger),this.proposal=new sg(this.core,this.logger),this.pendingRequest=new cg(this.core,this.logger),this.engine=new og(this)}static async init(e){const t=new ug(e);return await t.initialize(),t}get context(){return cn.getLoggerContext(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(),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}}}const lg="error",fg="wss://relay.walletconnect.com",hg="wc@2:universal_provider:",dg="https://rpc.walletconnect.com/v1",pg={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var gg,yg,vg={exports:{}};
|
321
321
|
/**
|
322
322
|
* @license
|
323
323
|
* Lodash <https://lodash.com/>
|
@@ -325,4 +325,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
325
325
|
* Released under MIT license <https://lodash.com/license>
|
326
326
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
327
327
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
328
|
-
*/gg=vg,yg=vg.exports,function(){var e,n="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",l=1,f=2,h=4,d=1,p=2,g=1,y=2,v=4,m=8,_=16,b=32,w=64,E=128,S=256,O=512,R=30,x="...",I=800,C=16,P=1,k=2,N=3,A=1/0,T=9007199254740991,M=17976931348623157e292,L=NaN,U=4294967295,j=U-1,D=U>>>1,z=[["ary",E],["bind",g],["bindKey",y],["curry",m],["curryRight",_],["flip",O],["partial",b],["partialRight",w],["rearg",S]],B="[object Arguments]",F="[object Array]",H="[object AsyncFunction]",$="[object Boolean]",V="[object Date]",q="[object DOMException]",W="[object Error]",K="[object Function]",G="[object GeneratorFunction]",Y="[object Map]",Q="[object Number]",J="[object Null]",X="[object Object]",Z="[object Promise]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",se="[object WeakMap]",ae="[object WeakSet]",ce="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",he="[object Int8Array]",de="[object Int16Array]",pe="[object Int32Array]",ge="[object Uint8Array]",ye="[object Uint8ClampedArray]",ve="[object Uint16Array]",me="[object Uint32Array]",_e=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,we=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ee=/&(?:amp|lt|gt|quot|#39);/g,Se=/[&<>"']/g,Oe=RegExp(Ee.source),Re=RegExp(Se.source),xe=/<%-([\s\S]+?)%>/g,Ie=/<%([\s\S]+?)%>/g,Ce=/<%=([\s\S]+?)%>/g,Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ke=/^\w*$/,Ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/[\\^$.*+?()[\]{}|]/g,Te=RegExp(Ae.source),Me=/^\s+/,Le=/\s/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,je=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/[()=,{}\[\]\/\s]/,Fe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$e=/\w*$/,Ve=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,Ke=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qe=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Xe="\\ud800-\\udfff",Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",et="\\u2700-\\u27bf",tt="a-z\\xdf-\\xf6\\xf8-\\xff",nt="A-Z\\xc0-\\xd6\\xd8-\\xde",rt="\\ufe0e\\ufe0f",it="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ot="['’]",st="["+Xe+"]",at="["+it+"]",ct="["+Ze+"]",ut="\\d+",lt="["+et+"]",ft="["+tt+"]",ht="[^"+Xe+it+ut+et+tt+nt+"]",dt="\\ud83c[\\udffb-\\udfff]",pt="[^"+Xe+"]",gt="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="["+nt+"]",mt="\\u200d",_t="(?:"+ft+"|"+ht+")",bt="(?:"+vt+"|"+ht+")",wt="(?:"+ot+"(?:d|ll|m|re|s|t|ve))?",Et="(?:"+ot+"(?:D|LL|M|RE|S|T|VE))?",St="(?:"+ct+"|"+dt+")?",Ot="["+rt+"]?",Rt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",It=Ot+St+"(?:"+mt+"(?:"+[pt,gt,yt].join("|")+")"+Ot+St+")*",Ct="(?:"+[lt,gt,yt].join("|")+")"+It,Pt="(?:"+[pt+ct+"?",ct,gt,yt,st].join("|")+")",kt=RegExp(ot,"g"),Nt=RegExp(ct,"g"),At=RegExp(dt+"(?="+dt+")|"+Pt+It,"g"),Tt=RegExp([vt+"?"+ft+"+"+wt+"(?="+[at,vt,"$"].join("|")+")",bt+"+"+Et+"(?="+[at,vt+_t,"$"].join("|")+")",vt+"?"+_t+"+"+wt,vt+"+"+Et,xt,Rt,ut,Ct].join("|"),"g"),Mt=RegExp("["+mt+Xe+Ze+rt+"]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ut=["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"],jt=-1,Dt={};Dt[le]=Dt[fe]=Dt[he]=Dt[de]=Dt[pe]=Dt[ge]=Dt[ye]=Dt[ve]=Dt[me]=!0,Dt[B]=Dt[F]=Dt[ce]=Dt[$]=Dt[ue]=Dt[V]=Dt[W]=Dt[K]=Dt[Y]=Dt[Q]=Dt[X]=Dt[te]=Dt[ne]=Dt[re]=Dt[se]=!1;var zt={};zt[B]=zt[F]=zt[ce]=zt[ue]=zt[$]=zt[V]=zt[le]=zt[fe]=zt[he]=zt[de]=zt[pe]=zt[Y]=zt[Q]=zt[X]=zt[te]=zt[ne]=zt[re]=zt[ie]=zt[ge]=zt[ye]=zt[ve]=zt[me]=!0,zt[W]=zt[K]=zt[se]=!1;var Bt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Ft={"&":"&","<":"<",">":">",'"':""","'":"'"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'"},$t={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,qt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,Gt=Wt||Kt||Function("return this")(),Yt=yg&&!yg.nodeType&&yg,Qt=Yt&&gg&&!gg.nodeType&&gg,Jt=Qt&&Qt.exports===Yt,Xt=Jt&&Wt.process,Zt=function(){try{return Qt&&Qt.require&&Qt.require("util").types||Xt&&Xt.binding&&Xt.binding("util")}catch{}}(),en=Zt&&Zt.isArrayBuffer,tn=Zt&&Zt.isDate,nn=Zt&&Zt.isMap,rn=Zt&&Zt.isRegExp,on=Zt&&Zt.isSet,sn=Zt&&Zt.isTypedArray;function an(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cn(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function un(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ln(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function fn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function hn(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function dn(e,t){return!(null==e||!e.length)&&Rn(e,t,0)>-1}function pn(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function gn(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function yn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function vn(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function mn(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function _n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var bn=Pn("length");function wn(e){return e.split("")}function En(e){return e.match(ze)||[]}function Sn(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function On(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Rn(e,t,n){return t==t?tr(e,t,n):On(e,In,n)}function xn(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function In(e){return e!=e}function Cn(e,t){var n=null==e?0:e.length;return n?Tn(e,t)/n:L}function Pn(t){return function(n){return null==n?e:n[t]}}function kn(t){return function(n){return null==t?e:t[n]}}function Nn(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function An(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Tn(t,n){for(var r,i=-1,o=t.length;++i<o;){var s=n(t[i]);s!==e&&(r=r===e?s:r+s)}return r}function Mn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ln(e,t){return gn(t,(function(t){return[t,e[t]]}))}function Un(e){return e&&e.slice(0,or(e)+1).replace(Me,"")}function jn(e){return function(t){return e(t)}}function Dn(e,t){return gn(t,(function(t){return e[t]}))}function zn(e,t){return e.has(t)}function Bn(e,t){for(var n=-1,r=e.length;++n<r&&Rn(t,e[n],0)>-1;);return n}function Fn(e,t){for(var n=e.length;n--&&Rn(t,e[n],0)>-1;);return n}function Hn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var $n=kn(Bt),Vn=kn(Ft);function qn(e){return"\\"+$t[e]}function Wn(t,n){return null==t?e:t[n]}function Kn(e){return Mt.test(e)}function Gn(e){return Lt.test(e)}function Yn(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Qn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Jn(e,t){return function(n){return e(t(n))}}function Xn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===u)&&(e[n]=u,o[i++]=n)}return o}function Zn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function er(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function tr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function nr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function rr(e){return Kn(e)?ar(e):bn(e)}function ir(e){return Kn(e)?cr(e):wn(e)}function or(e){for(var t=e.length;t--&&Le.test(e.charAt(t)););return t}var sr=kn(Ht);function ar(e){for(var t=At.lastIndex=0;At.test(e);)++t;return t}function cr(e){return e.match(At)||[]}function ur(e){return e.match(Tt)||[]}var lr=function t(Le){var ze,Xe=(Le=null==Le?Gt:fr.defaults(Gt.Object(),Le,fr.pick(Gt,Ut))).Array,Ze=Le.Date,et=Le.Error,tt=Le.Function,nt=Le.Math,rt=Le.Object,it=Le.RegExp,ot=Le.String,st=Le.TypeError,at=Xe.prototype,ct=tt.prototype,ut=rt.prototype,lt=Le["__core-js_shared__"],ft=ct.toString,ht=ut.hasOwnProperty,dt=0,pt=(ze=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||""))?"Symbol(src)_1."+ze:"",gt=ut.toString,yt=ft.call(rt),vt=Gt._,mt=it("^"+ft.call(ht).replace(Ae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Jt?Le.Buffer:e,bt=Le.Symbol,wt=Le.Uint8Array,Et=_t?_t.allocUnsafe:e,St=Jn(rt.getPrototypeOf,rt),Ot=rt.create,Rt=ut.propertyIsEnumerable,xt=at.splice,It=bt?bt.isConcatSpreadable:e,Ct=bt?bt.iterator:e,Pt=bt?bt.toStringTag:e,At=function(){try{var e=Gs(rt,"defineProperty");return e({},"",{}),e}catch{}}(),Tt=Le.clearTimeout!==Gt.clearTimeout&&Le.clearTimeout,Mt=Ze&&Ze.now!==Gt.Date.now&&Ze.now,Lt=Le.setTimeout!==Gt.setTimeout&&Le.setTimeout,Bt=nt.ceil,Ft=nt.floor,Ht=rt.getOwnPropertySymbols,$t=_t?_t.isBuffer:e,Wt=Le.isFinite,Kt=at.join,Yt=Jn(rt.keys,rt),Qt=nt.max,Xt=nt.min,Zt=Ze.now,bn=Le.parseInt,wn=nt.random,kn=at.reverse,tr=Gs(Le,"DataView"),ar=Gs(Le,"Map"),cr=Gs(Le,"Promise"),lr=Gs(Le,"Set"),hr=Gs(Le,"WeakMap"),dr=Gs(rt,"create"),pr=hr&&new hr,gr={},yr=Ta(tr),vr=Ta(ar),mr=Ta(cr),_r=Ta(lr),br=Ta(hr),wr=bt?bt.prototype:e,Er=wr?wr.valueOf:e,Sr=wr?wr.toString:e;function Or(e){if(xl(e)&&!ul(e)&&!(e instanceof Cr)){if(e instanceof Ir)return e;if(ht.call(e,"__wrapped__"))return La(e)}return new Ir(e)}var Rr=function(){function t(){}return function(n){if(!Rl(n))return{};if(Ot)return Ot(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function xr(){}function Ir(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Cr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U,this.__views__=[]}function Pr(){var e=new Cr(this.__wrapped__);return e.__actions__=os(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=os(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=os(this.__views__),e}function kr(){if(this.__filtered__){var e=new Cr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e}function Nr(){var e=this.__wrapped__.value(),t=this.__dir__,n=ul(e),r=t<0,i=n?e.length:0,o=Zs(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=r?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=Xt(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return Bo(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var g=-1,y=e[u+=t];++g<f;){var v=l[g],m=v.iteratee,_=v.type,b=m(y);if(_==k)y=b;else if(!b){if(_==P)continue e;break e}}p[h++]=y}return p}function Ar(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Tr(){this.__data__=dr?dr(null):{},this.size=0}function Mr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Lr(t){var n=this.__data__;if(dr){var r=n[t];return r===a?e:r}return ht.call(n,t)?n[t]:e}function Ur(t){var n=this.__data__;return dr?n[t]!==e:ht.call(n,t)}function jr(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dr&&n===e?a:n,this}function Dr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zr(){this.__data__=[],this.size=0}function Br(e){var t=this.__data__,n=fi(t,e);return!(n<0||(n==t.length-1?t.pop():xt.call(t,n,1),--this.size,0))}function Fr(t){var n=this.__data__,r=fi(n,t);return r<0?e:n[r][1]}function Hr(e){return fi(this.__data__,e)>-1}function $r(e,t){var n=this.__data__,r=fi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Vr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qr(){this.size=0,this.__data__={hash:new Ar,map:new(ar||Dr),string:new Ar}}function Wr(e){var t=Ws(this,e).delete(e);return this.size-=t?1:0,t}function Kr(e){return Ws(this,e).get(e)}function Gr(e){return Ws(this,e).has(e)}function Yr(e,t){var n=Ws(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Qr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vr;++t<n;)this.add(e[t])}function Jr(e){return this.__data__.set(e,a),this}function Xr(e){return this.__data__.has(e)}function Zr(e){var t=this.__data__=new Dr(e);this.size=t.size}function ei(){this.__data__=new Dr,this.size=0}function ti(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ni(e){return this.__data__.get(e)}function ri(e){return this.__data__.has(e)}function ii(e,t){var n=this.__data__;if(n instanceof Dr){var i=n.__data__;if(!ar||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vr(i)}return n.set(e,t),this.size=n.size,this}function oi(e,t){var n=ul(e),r=!n&&cl(e),i=!n&&!r&&pl(e),o=!n&&!r&&!i&&Fl(e),s=n||r||i||o,a=s?Mn(e.length,ot):[],c=a.length;for(var u in e)(t||ht.call(e,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||aa(u,c)))&&a.push(u);return a}function si(t){var n=t.length;return n?t[_o(0,n-1)]:e}function ai(e,t){return ka(os(e),vi(t,0,e.length))}function ci(e){return ka(os(e))}function ui(t,n,r){(r!==e&&!ol(t[n],r)||r===e&&!(n in t))&&gi(t,n,r)}function li(t,n,r){var i=t[n];(!ht.call(t,n)||!ol(i,r)||r===e&&!(n in t))&&gi(t,n,r)}function fi(e,t){for(var n=e.length;n--;)if(ol(e[n][0],t))return n;return-1}function hi(e,t,n,r){return Si(e,(function(e,i,o){t(r,e,n(e),o)})),r}function di(e,t){return e&&ss(t,Of(t),e)}function pi(e,t){return e&&ss(t,Rf(t),e)}function gi(e,t,n){"__proto__"==t&&At?At(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function yi(t,n){for(var r=-1,i=n.length,o=Xe(i),s=null==t;++r<i;)o[r]=s?e:mf(t,n[r]);return o}function vi(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function mi(t,n,r,i,o,s){var a,c=n&l,u=n&f,d=n&h;if(r&&(a=o?r(t,i,o,s):r(t)),a!==e)return a;if(!Rl(t))return t;var p=ul(t);if(p){if(a=na(t),!c)return os(t,a)}else{var g=Xs(t),y=g==K||g==G;if(pl(t))return Yo(t,c);if(g==X||g==B||y&&!o){if(a=u||y?{}:ra(t),!c)return u?cs(t,pi(a,t)):as(t,di(a,t))}else{if(!zt[g])return o?t:{};a=ia(t,g,c)}}s||(s=new Zr);var v=s.get(t);if(v)return v;s.set(t,a),Dl(t)?t.forEach((function(e){a.add(mi(e,n,r,e,t,s))})):Il(t)&&t.forEach((function(e,i){a.set(i,mi(e,n,r,i,t,s))}));var m=p?e:(d?u?Fs:Bs:u?Rf:Of)(t);return un(m||t,(function(e,i){m&&(e=t[i=e]),li(a,i,mi(e,n,r,i,t,s))})),a}function _i(e){var t=Of(e);return function(n){return bi(n,e,t)}}function bi(t,n,r){var i=r.length;if(null==t)return!i;for(t=rt(t);i--;){var o=r[i],s=n[o],a=t[o];if(a===e&&!(o in t)||!s(a))return!1}return!0}function wi(t,n,r){if("function"!=typeof t)throw new st(o);return xa((function(){t.apply(e,r)}),n)}function Ei(e,t,n,i){var o=-1,s=dn,a=!0,c=e.length,u=[],l=t.length;if(!c)return u;n&&(t=gn(t,jn(n))),i?(s=pn,a=!1):t.length>=r&&(s=zn,a=!1,t=new Qr(t));e:for(;++o<c;){var f=e[o],h=null==n?f:n(f);if(f=i||0!==f?f:0,a&&h==h){for(var d=l;d--;)if(t[d]===h)continue e;u.push(f)}else s(t,h,i)||u.push(f)}return u}Or.templateSettings={escape:xe,evaluate:Ie,interpolate:Ce,variable:"",imports:{_:Or}},Or.prototype=xr.prototype,Or.prototype.constructor=Or,Ir.prototype=Rr(xr.prototype),Ir.prototype.constructor=Ir,Cr.prototype=Rr(xr.prototype),Cr.prototype.constructor=Cr,Ar.prototype.clear=Tr,Ar.prototype.delete=Mr,Ar.prototype.get=Lr,Ar.prototype.has=Ur,Ar.prototype.set=jr,Dr.prototype.clear=zr,Dr.prototype.delete=Br,Dr.prototype.get=Fr,Dr.prototype.has=Hr,Dr.prototype.set=$r,Vr.prototype.clear=qr,Vr.prototype.delete=Wr,Vr.prototype.get=Kr,Vr.prototype.has=Gr,Vr.prototype.set=Yr,Qr.prototype.add=Qr.prototype.push=Jr,Qr.prototype.has=Xr,Zr.prototype.clear=ei,Zr.prototype.delete=ti,Zr.prototype.get=ni,Zr.prototype.has=ri,Zr.prototype.set=ii;var Si=fs(Ai),Oi=fs(Ti,!0);function Ri(e,t){var n=!0;return Si(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function xi(t,n,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=n(s);if(null!=a&&(c===e?a==a&&!Bl(a):r(a,c)))var c=a,u=s}return u}function Ii(t,n,r,i){var o=t.length;for((r=Yl(r))<0&&(r=-r>o?0:o+r),(i=i===e||i>o?o:Yl(i))<0&&(i+=o),i=r>i?0:Ql(i);r<i;)t[r++]=n;return t}function Ci(e,t){var n=[];return Si(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Pi(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=sa),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?Pi(a,t-1,n,r,i):yn(i,a):r||(i[i.length]=a)}return i}var ki=hs(),Ni=hs(!0);function Ai(e,t){return e&&ki(e,t,Of)}function Ti(e,t){return e&&Ni(e,t,Of)}function Mi(e,t){return hn(t,(function(t){return El(e[t])}))}function Li(t,n){for(var r=0,i=(n=qo(n,t)).length;null!=t&&r<i;)t=t[Aa(n[r++])];return r&&r==i?t:e}function Ui(e,t,n){var r=t(e);return ul(e)?r:yn(r,n(e))}function ji(t){return null==t?t===e?oe:J:Pt&&Pt in rt(t)?Ys(t):ba(t)}function Di(e,t){return e>t}function zi(e,t){return null!=e&&ht.call(e,t)}function Bi(e,t){return null!=e&&t in rt(e)}function Fi(e,t,n){return e>=Xt(t,n)&&e<Qt(t,n)}function Hi(t,n,r){for(var i=r?pn:dn,o=t[0].length,s=t.length,a=s,c=Xe(s),u=1/0,l=[];a--;){var f=t[a];a&&n&&(f=gn(f,jn(n))),u=Xt(f.length,u),c[a]=!r&&(n||o>=120&&f.length>=120)?new Qr(a&&f):e}f=t[0];var h=-1,d=c[0];e:for(;++h<o&&l.length<u;){var p=f[h],g=n?n(p):p;if(p=r||0!==p?p:0,!(d?zn(d,g):i(l,g,r))){for(a=s;--a;){var y=c[a];if(!(y?zn(y,g):i(t[a],g,r)))continue e}d&&d.push(g),l.push(p)}}return l}function $i(e,t,n,r){return Ai(e,(function(e,i,o){t(r,n(e),i,o)})),r}function Vi(t,n,r){var i=null==(t=Ea(t,n=qo(n,t)))?t:t[Aa(sc(n))];return null==i?e:an(i,t,r)}function qi(e){return xl(e)&&ji(e)==B}function Wi(e){return xl(e)&&ji(e)==ce}function Ki(e){return xl(e)&&ji(e)==V}function Gi(e,t,n,r,i){return e===t||(null==e||null==t||!xl(e)&&!xl(t)?e!=e&&t!=t:Yi(e,t,n,r,Gi,i))}function Yi(e,t,n,r,i,o){var s=ul(e),a=ul(t),c=s?F:Xs(e),u=a?F:Xs(t),l=(c=c==B?X:c)==X,f=(u=u==B?X:u)==X,h=c==u;if(h&&pl(e)){if(!pl(t))return!1;s=!0,l=!1}if(h&&!l)return o||(o=new Zr),s||Fl(e)?Us(e,t,n,r,i,o):js(e,t,c,n,r,i,o);if(!(n&d)){var p=l&&ht.call(e,"__wrapped__"),g=f&&ht.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,v=g?t.value():t;return o||(o=new Zr),i(y,v,n,r,o)}}return!!h&&(o||(o=new Zr),Ds(e,t,n,r,i,o))}function Qi(e){return xl(e)&&Xs(e)==Y}function Ji(t,n,r,i){var o=r.length,s=o,a=!i;if(null==t)return!s;for(t=rt(t);o--;){var c=r[o];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<s;){var u=(c=r[o])[0],l=t[u],f=c[1];if(a&&c[2]){if(l===e&&!(u in t))return!1}else{var h=new Zr;if(i)var g=i(l,f,u,t,n,h);if(!(g===e?Gi(f,l,d|p,i,h):g))return!1}}return!0}function Xi(e){return!(!Rl(e)||ha(e))&&(El(e)?mt:We).test(Ta(e))}function Zi(e){return xl(e)&&ji(e)==te}function eo(e){return xl(e)&&Xs(e)==ne}function to(e){return xl(e)&&Ol(e.length)&&!!Dt[ji(e)]}function no(e){return"function"==typeof e?e:null==e?Ah:"object"==typeof e?ul(e)?co(e[0],e[1]):ao(e):qh(e)}function ro(e){if(!pa(e))return Yt(e);var t=[];for(var n in rt(e))ht.call(e,n)&&"constructor"!=n&&t.push(n);return t}function io(e){if(!Rl(e))return _a(e);var t=pa(e),n=[];for(var r in e)"constructor"==r&&(t||!ht.call(e,r))||n.push(r);return n}function oo(e,t){return e<t}function so(e,t){var n=-1,r=fl(e)?Xe(e.length):[];return Si(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function ao(e){var t=Ks(e);return 1==t.length&&t[0][2]?ya(t[0][0],t[0][1]):function(n){return n===e||Ji(n,e,t)}}function co(t,n){return ua(t)&&ga(n)?ya(Aa(t),n):function(r){var i=mf(r,t);return i===e&&i===n?bf(r,t):Gi(n,i,d|p)}}function uo(t,n,r,i,o){t!==n&&ki(n,(function(s,a){if(o||(o=new Zr),Rl(s))lo(t,n,a,r,uo,i,o);else{var c=i?i(Oa(t,a),s,a+"",t,n,o):e;c===e&&(c=s),ui(t,a,c)}}),Rf)}function lo(t,n,r,i,o,s,a){var c=Oa(t,r),u=Oa(n,r),l=a.get(u);if(l)ui(t,r,l);else{var f=s?s(c,u,r+"",t,n,a):e,h=f===e;if(h){var d=ul(u),p=!d&&pl(u),g=!d&&!p&&Fl(u);f=u,d||p||g?ul(c)?f=c:hl(c)?f=os(c):p?(h=!1,f=Yo(u,!0)):g?(h=!1,f=es(u,!0)):f=[]:Ll(u)||cl(u)?(f=c,cl(c)?f=Xl(c):(!Rl(c)||El(c))&&(f=ra(u))):h=!1}h&&(a.set(u,f),o(f,u,i,s,a),a.delete(u)),ui(t,r,f)}}function fo(t,n){var r=t.length;if(r)return aa(n+=n<0?r:0,r)?t[n]:e}function ho(e,t,n){t=t.length?gn(t,(function(e){return ul(e)?function(t){return Li(t,1===e.length?e[0]:e)}:e})):[Ah];var r=-1;t=gn(t,jn(qs()));var i=so(e,(function(e,n,i){var o=gn(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return An(i,(function(e,t){return ns(e,t,n)}))}function po(e,t){return go(e,t,(function(t,n){return bf(e,n)}))}function go(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=Li(e,s);n(a,s)&&Ro(o,qo(s,e),a)}return o}function yo(e){return function(t){return Li(t,e)}}function vo(e,t,n,r){var i=r?xn:Rn,o=-1,s=t.length,a=e;for(e===t&&(t=os(t)),n&&(a=gn(e,jn(n)));++o<s;)for(var c=0,u=t[o],l=n?n(u):u;(c=i(a,l,c,r))>-1;)a!==e&&xt.call(a,c,1),xt.call(e,c,1);return e}function mo(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;aa(i)?xt.call(e,i,1):jo(e,i)}}return e}function _o(e,t){return e+Ft(wn()*(t-e+1))}function bo(e,t,n,r){for(var i=-1,o=Qt(Bt((t-e)/(n||1)),0),s=Xe(o);o--;)s[r?o:++i]=e,e+=n;return s}function wo(e,t){var n="";if(!e||t<1||t>T)return n;do{t%2&&(n+=e),(t=Ft(t/2))&&(e+=e)}while(t);return n}function Eo(e,t){return Ia(wa(e,t,Ah),e+"")}function So(e){return si($f(e))}function Oo(e,t){var n=$f(e);return ka(n,vi(t,0,n.length))}function Ro(t,n,r,i){if(!Rl(t))return t;for(var o=-1,s=(n=qo(n,t)).length,a=s-1,c=t;null!=c&&++o<s;){var u=Aa(n[o]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var f=c[u];(l=i?i(f,u,c):e)===e&&(l=Rl(f)?f:aa(n[o+1])?[]:{})}li(c,u,l),c=c[u]}return t}var xo=pr?function(e,t){return pr.set(e,t),e}:Ah,Io=At?function(e,t){return At(e,"toString",{configurable:!0,enumerable:!1,value:Ch(t),writable:!0})}:Ah;function Co(e){return ka($f(e))}function Po(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Xe(i);++r<i;)o[r]=e[r+t];return o}function ko(e,t){var n;return Si(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function No(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=D){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!Bl(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return Ao(e,t,Ah,n)}function Ao(t,n,r,i){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(n=r(n))!=n,c=null===n,u=Bl(n),l=n===e;o<s;){var f=Ft((o+s)/2),h=r(t[f]),d=h!==e,p=null===h,g=h==h,y=Bl(h);if(a)var v=i||g;else v=l?g&&(i||d):c?g&&d&&(i||!p):u?g&&d&&!p&&(i||!y):!p&&!y&&(i?h<=n:h<n);v?o=f+1:s=f}return Xt(s,j)}function To(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!ol(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function Mo(e){return"number"==typeof e?e:Bl(e)?L:+e}function Lo(e){if("string"==typeof e)return e;if(ul(e))return gn(e,Lo)+"";if(Bl(e))return Sr?Sr.call(e):"";var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Uo(e,t,n){var i=-1,o=dn,s=e.length,a=!0,c=[],u=c;if(n)a=!1,o=pn;else if(s>=r){var l=t?null:ks(e);if(l)return Zn(l);a=!1,o=zn,u=new Qr}else u=t?[]:c;e:for(;++i<s;){var f=e[i],h=t?t(f):f;if(f=n||0!==f?f:0,a&&h==h){for(var d=u.length;d--;)if(u[d]===h)continue e;t&&u.push(h),c.push(f)}else o(u,h,n)||(u!==c&&u.push(h),c.push(f))}return c}function jo(e,t){return null==(e=Ea(e,t=qo(t,e)))||delete e[Aa(sc(t))]}function Do(e,t,n,r){return Ro(e,t,n(Li(e,t)),r)}function zo(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Po(e,r?0:o,r?o+1:i):Po(e,r?o+1:0,r?i:o)}function Bo(e,t){var n=e;return n instanceof Cr&&(n=n.value()),vn(t,(function(e,t){return t.func.apply(t.thisArg,yn([e],t.args))}),n)}function Fo(e,t,n){var r=e.length;if(r<2)return r?Uo(e[0]):[];for(var i=-1,o=Xe(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=Ei(o[i]||s,e[a],t,n));return Uo(Pi(o,1),t,n)}function Ho(t,n,r){for(var i=-1,o=t.length,s=n.length,a={};++i<o;){var c=i<s?n[i]:e;r(a,t[i],c)}return a}function $o(e){return hl(e)?e:[]}function Vo(e){return"function"==typeof e?e:Ah}function qo(e,t){return ul(e)?e:ua(e,t)?[e]:Na(ef(e))}var Wo=Eo;function Ko(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:Po(t,n,r)}var Go=Tt||function(e){return Gt.clearTimeout(e)};function Yo(e,t){if(t)return e.slice();var n=e.length,r=Et?Et(n):new e.constructor(n);return e.copy(r),r}function Qo(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Jo(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Xo(e){var t=new e.constructor(e.source,$e.exec(e));return t.lastIndex=e.lastIndex,t}function Zo(e){return Er?rt(Er.call(e)):{}}function es(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ts(t,n){if(t!==n){var r=t!==e,i=null===t,o=t==t,s=Bl(t),a=n!==e,c=null===n,u=n==n,l=Bl(n);if(!c&&!l&&!s&&t>n||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&t<n||l&&r&&o&&!i&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}function ns(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var c=ts(i[r],o[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}function rs(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,c=t.length,u=Qt(o-s,0),l=Xe(c+u),f=!r;++a<c;)l[a]=t[a];for(;++i<s;)(f||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[a++]=e[i++];return l}function is(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,c=-1,u=t.length,l=Qt(o-a,0),f=Xe(l+u),h=!r;++i<l;)f[i]=e[i];for(var d=i;++c<u;)f[d+c]=t[c];for(;++s<a;)(h||i<o)&&(f[d+n[s]]=e[i++]);return f}function os(e,t){var n=-1,r=e.length;for(t||(t=Xe(r));++n<r;)t[n]=e[n];return t}function ss(t,n,r,i){var o=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var c=n[s],u=i?i(r[c],t[c],c,r,t):e;u===e&&(u=t[c]),o?gi(r,c,u):li(r,c,u)}return r}function as(e,t){return ss(e,Qs(e),t)}function cs(e,t){return ss(e,Js(e),t)}function us(e,t){return function(n,r){var i=ul(n)?cn:hi,o=t?t():{};return i(n,e,qs(r,2),o)}}function ls(t){return Eo((function(n,r){var i=-1,o=r.length,s=o>1?r[o-1]:e,a=o>2?r[2]:e;for(s=t.length>3&&"function"==typeof s?(o--,s):e,a&&ca(r[0],r[1],a)&&(s=o<3?e:s,o=1),n=rt(n);++i<o;){var c=r[i];c&&t(n,c,i,s)}return n}))}function fs(e,t){return function(n,r){if(null==n)return n;if(!fl(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=rt(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function hs(e){return function(t,n,r){for(var i=-1,o=rt(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}function ds(e,t,n){var r=t&g,i=ys(e);function o(){return(this&&this!==Gt&&this instanceof o?i:e).apply(r?n:this,arguments)}return o}function ps(t){return function(n){var r=Kn(n=ef(n))?ir(n):e,i=r?r[0]:n.charAt(0),o=r?Ko(r,1).join(""):n.slice(1);return i[t]()+o}}function gs(e){return function(t){return vn(Sh(Qf(t).replace(kt,"")),e,"")}}function ys(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Rr(e.prototype),r=e.apply(n,t);return Rl(r)?r:n}}function vs(t,n,r){var i=ys(t);function o(){for(var s=arguments.length,a=Xe(s),c=s,u=Vs(o);c--;)a[c]=arguments[c];var l=s<3&&a[0]!==u&&a[s-1]!==u?[]:Xn(a,u);return(s-=l.length)<r?Cs(t,n,bs,o.placeholder,e,a,l,e,e,r-s):an(this&&this!==Gt&&this instanceof o?i:t,this,a)}return o}function ms(t){return function(n,r,i){var o=rt(n);if(!fl(n)){var s=qs(r,3);n=Of(n),r=function(e){return s(o[e],e,o)}}var a=t(n,r,i);return a>-1?o[s?n[a]:a]:e}}function _s(t){return zs((function(n){var r=n.length,i=r,s=Ir.prototype.thru;for(t&&n.reverse();i--;){var a=n[i];if("function"!=typeof a)throw new st(o);if(s&&!c&&"wrapper"==$s(a))var c=new Ir([],!0)}for(i=c?i:r;++i<r;){var u=$s(a=n[i]),l="wrapper"==u?Hs(a):e;c=l&&fa(l[0])&&l[1]==(E|m|b|S)&&!l[4].length&&1==l[9]?c[$s(l[0])].apply(c,l[3]):1==a.length&&fa(a)?c[u]():c.thru(a)}return function(){var e=arguments,t=e[0];if(c&&1==e.length&&ul(t))return c.plant(t).value();for(var i=0,o=r?n[i].apply(this,e):t;++i<r;)o=n[i].call(this,o);return o}}))}function bs(t,n,r,i,o,s,a,c,u,l){var f=n&E,h=n&g,d=n&y,p=n&(m|_),v=n&O,b=d?e:ys(t);function w(){for(var e=arguments.length,g=Xe(e),y=e;y--;)g[y]=arguments[y];if(p)var m=Vs(w),_=Hn(g,m);if(i&&(g=rs(g,i,o,p)),s&&(g=is(g,s,a,p)),e-=_,p&&e<l){var E=Xn(g,m);return Cs(t,n,bs,w.placeholder,r,g,E,c,u,l-e)}var S=h?r:this,O=d?S[t]:t;return e=g.length,c?g=Sa(g,c):v&&e>1&&g.reverse(),f&&u<e&&(g.length=u),this&&this!==Gt&&this instanceof w&&(O=b||ys(O)),O.apply(S,g)}return w}function ws(e,t){return function(n,r){return $i(n,e,t(r),{})}}function Es(t,n){return function(r,i){var o;if(r===e&&i===e)return n;if(r!==e&&(o=r),i!==e){if(o===e)return i;"string"==typeof r||"string"==typeof i?(r=Lo(r),i=Lo(i)):(r=Mo(r),i=Mo(i)),o=t(r,i)}return o}}function Ss(e){return zs((function(t){return t=gn(t,jn(qs())),Eo((function(n){var r=this;return e(t,(function(e){return an(e,r,n)}))}))}))}function Os(t,n){var r=(n=n===e?" ":Lo(n)).length;if(r<2)return r?wo(n,t):n;var i=wo(n,Bt(t/rr(n)));return Kn(n)?Ko(ir(i),0,t).join(""):i.slice(0,t)}function Rs(e,t,n,r){var i=t&g,o=ys(e);function s(){for(var t=-1,a=arguments.length,c=-1,u=r.length,l=Xe(u+a),f=this&&this!==Gt&&this instanceof s?o:e;++c<u;)l[c]=r[c];for(;a--;)l[c++]=arguments[++t];return an(f,i?n:this,l)}return s}function xs(t){return function(n,r,i){return i&&"number"!=typeof i&&ca(n,r,i)&&(r=i=e),n=Gl(n),r===e?(r=n,n=0):r=Gl(r),bo(n,r,i=i===e?n<r?1:-1:Gl(i),t)}}function Is(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Jl(t),n=Jl(n)),e(t,n)}}function Cs(t,n,r,i,o,s,a,c,u,l){var f=n&m;n|=f?b:w,(n&=~(f?w:b))&v||(n&=~(g|y));var h=[t,n,o,f?s:e,f?a:e,f?e:s,f?e:a,c,u,l],d=r.apply(e,h);return fa(t)&&Ra(d,h),d.placeholder=i,Ca(d,t,n)}function Ps(e){var t=nt[e];return function(e,n){if(e=Jl(e),(n=null==n?0:Xt(Yl(n),292))&&Wt(e)){var r=(ef(e)+"e").split("e");return+((r=(ef(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var ks=lr&&1/Zn(new lr([,-0]))[1]==A?function(e){return new lr(e)}:Bh;function Ns(e){return function(t){var n=Xs(t);return n==Y?Qn(t):n==ne?er(t):Ln(t,e(t))}}function As(t,n,r,i,s,a,c,u){var l=n&y;if(!l&&"function"!=typeof t)throw new st(o);var f=i?i.length:0;if(f||(n&=~(b|w),i=s=e),c=c===e?c:Qt(Yl(c),0),u=u===e?u:Yl(u),f-=s?s.length:0,n&w){var h=i,d=s;i=s=e}var p=l?e:Hs(t),v=[t,n,r,i,s,h,d,a,c,u];if(p&&ma(v,p),t=v[0],n=v[1],r=v[2],i=v[3],s=v[4],!(u=v[9]=v[9]===e?l?0:t.length:Qt(v[9]-f,0))&&n&(m|_)&&(n&=~(m|_)),n&&n!=g)E=n==m||n==_?vs(t,n,u):n!=b&&n!=(g|b)||s.length?bs.apply(e,v):Rs(t,n,r,i);else var E=ds(t,n,r);return Ca((p?xo:Ra)(E,v),t,n)}function Ts(t,n,r,i){return t===e||ol(t,ut[r])&&!ht.call(i,r)?n:t}function Ms(t,n,r,i,o,s){return Rl(t)&&Rl(n)&&(s.set(n,t),uo(t,n,e,Ms,s),s.delete(n)),t}function Ls(t){return Ll(t)?e:t}function Us(t,n,r,i,o,s){var a=r&d,c=t.length,u=n.length;if(c!=u&&!(a&&u>c))return!1;var l=s.get(t),f=s.get(n);if(l&&f)return l==n&&f==t;var h=-1,g=!0,y=r&p?new Qr:e;for(s.set(t,n),s.set(n,t);++h<c;){var v=t[h],m=n[h];if(i)var _=a?i(m,v,h,n,t,s):i(v,m,h,t,n,s);if(_!==e){if(_)continue;g=!1;break}if(y){if(!_n(n,(function(e,t){if(!zn(y,t)&&(v===e||o(v,e,r,i,s)))return y.push(t)}))){g=!1;break}}else if(v!==m&&!o(v,m,r,i,s)){g=!1;break}}return s.delete(t),s.delete(n),g}function js(e,t,n,r,i,o,s){switch(n){case ue:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ce:return!(e.byteLength!=t.byteLength||!o(new wt(e),new wt(t)));case $:case V:case Q:return ol(+e,+t);case W:return e.name==t.name&&e.message==t.message;case te:case re:return e==t+"";case Y:var a=Qn;case ne:var c=r&d;if(a||(a=Zn),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=p,s.set(e,t);var l=Us(a(e),a(t),r,i,o,s);return s.delete(e),l;case ie:if(Er)return Er.call(e)==Er.call(t)}return!1}function Ds(t,n,r,i,o,s){var a=r&d,c=Bs(t),u=c.length;if(u!=Bs(n).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in n:ht.call(n,f)))return!1}var h=s.get(t),p=s.get(n);if(h&&p)return h==n&&p==t;var g=!0;s.set(t,n),s.set(n,t);for(var y=a;++l<u;){var v=t[f=c[l]],m=n[f];if(i)var _=a?i(m,v,f,n,t,s):i(v,m,f,t,n,s);if(!(_===e?v===m||o(v,m,r,i,s):_)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=t.constructor,w=n.constructor;b!=w&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(n),g}function zs(t){return Ia(wa(t,e,Ya),t+"")}function Bs(e){return Ui(e,Of,Qs)}function Fs(e){return Ui(e,Rf,Js)}var Hs=pr?function(e){return pr.get(e)}:Bh;function $s(e){for(var t=e.name+"",n=gr[t],r=ht.call(gr,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Vs(e){return(ht.call(Or,"placeholder")?Or:e).placeholder}function qs(){var e=Or.iteratee||Th;return e=e===Th?no:e,arguments.length?e(arguments[0],arguments[1]):e}function Ws(e,t){var n=e.__data__;return la(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ks(e){for(var t=Of(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ga(i)]}return t}function Gs(t,n){var r=Wn(t,n);return Xi(r)?r:e}function Ys(t){var n=ht.call(t,Pt),r=t[Pt];try{t[Pt]=e;var i=!0}catch{}var o=gt.call(t);return i&&(n?t[Pt]=r:delete t[Pt]),o}var Qs=Ht?function(e){return null==e?[]:(e=rt(e),hn(Ht(e),(function(t){return Rt.call(e,t)})))}:Yh,Js=Ht?function(e){for(var t=[];e;)yn(t,Qs(e)),e=St(e);return t}:Yh,Xs=ji;function Zs(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=Xt(t,e+s);break;case"takeRight":e=Qt(e,t-s)}}return{start:e,end:t}}function ea(e){var t=e.match(je);return t?t[1].split(De):[]}function ta(e,t,n){for(var r=-1,i=(t=qo(t,e)).length,o=!1;++r<i;){var s=Aa(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ol(i)&&aa(s,i)&&(ul(e)||cl(e))}function na(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ht.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ra(e){return"function"!=typeof e.constructor||pa(e)?{}:Rr(St(e))}function ia(e,t,n){var r=e.constructor;switch(t){case ce:return Qo(e);case $:case V:return new r(+e);case ue:return Jo(e,n);case le:case fe:case he:case de:case pe:case ge:case ye:case ve:case me:return es(e,n);case Y:return new r;case Q:case re:return new r(e);case te:return Xo(e);case ne:return new r;case ie:return Zo(e)}}function oa(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ue,"{\n/* [wrapped with "+t+"] */\n")}function sa(e){return ul(e)||cl(e)||!!(It&&e&&e[It])}function aa(e,t){var n=typeof e;return!!(t=t??T)&&("number"==n||"symbol"!=n&&Ge.test(e))&&e>-1&&e%1==0&&e<t}function ca(e,t,n){if(!Rl(n))return!1;var r=typeof t;return!!("number"==r?fl(n)&&aa(t,n.length):"string"==r&&t in n)&&ol(n[t],e)}function ua(e,t){if(ul(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Bl(e))||ke.test(e)||!Pe.test(e)||null!=t&&e in rt(t)}function la(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function fa(e){var t=$s(e),n=Or[t];if("function"!=typeof n||!(t in Cr.prototype))return!1;if(e===n)return!0;var r=Hs(n);return!!r&&e===r[0]}function ha(e){return!!pt&&pt in e}(tr&&Xs(new tr(new ArrayBuffer(1)))!=ue||ar&&Xs(new ar)!=Y||cr&&Xs(cr.resolve())!=Z||lr&&Xs(new lr)!=ne||hr&&Xs(new hr)!=se)&&(Xs=function(t){var n=ji(t),r=n==X?t.constructor:e,i=r?Ta(r):"";if(i)switch(i){case yr:return ue;case vr:return Y;case mr:return Z;case _r:return ne;case br:return se}return n});var da=lt?El:Qh;function pa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ut)}function ga(e){return e==e&&!Rl(e)}function ya(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in rt(r))}}function va(e){var t=Fu(e,(function(e){return n.size===c&&n.clear(),e})),n=t.cache;return t}function ma(e,t){var n=e[1],r=t[1],i=n|r,o=i<(g|y|E),s=r==E&&n==m||r==E&&n==S&&e[7].length<=t[8]||r==(E|S)&&t[7].length<=t[8]&&n==m;if(!o&&!s)return e;r&g&&(e[2]=t[2],i|=n&g?0:v);var a=t[3];if(a){var c=e[3];e[3]=c?rs(c,a,t[4]):a,e[4]=c?Xn(e[3],u):t[4]}return(a=t[5])&&(c=e[5],e[5]=c?is(c,a,t[6]):a,e[6]=c?Xn(e[5],u):t[6]),(a=t[7])&&(e[7]=a),r&E&&(e[8]=null==e[8]?t[8]:Xt(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}function _a(e){var t=[];if(null!=e)for(var n in rt(e))t.push(n);return t}function ba(e){return gt.call(e)}function wa(t,n,r){return n=Qt(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,o=Qt(e.length-n,0),s=Xe(o);++i<o;)s[i]=e[n+i];i=-1;for(var a=Xe(n+1);++i<n;)a[i]=e[i];return a[n]=r(s),an(t,this,a)}}function Ea(e,t){return t.length<2?e:Li(e,Po(t,0,-1))}function Sa(t,n){for(var r=t.length,i=Xt(n.length,r),o=os(t);i--;){var s=n[i];t[i]=aa(s,r)?o[s]:e}return t}function Oa(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ra=Pa(xo),xa=Lt||function(e,t){return Gt.setTimeout(e,t)},Ia=Pa(Io);function Ca(e,t,n){var r=t+"";return Ia(e,oa(r,Ma(ea(r),n)))}function Pa(t){var n=0,r=0;return function(){var i=Zt(),o=C-(i-r);if(r=i,o>0){if(++n>=I)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ka(t,n){var r=-1,i=t.length,o=i-1;for(n=n===e?i:n;++r<n;){var s=_o(r,o),a=t[s];t[s]=t[r],t[r]=a}return t.length=n,t}var Na=va((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ne,(function(e,n,r,i){t.push(r?i.replace(Fe,"$1"):n||e)})),t}));function Aa(e){if("string"==typeof e||Bl(e))return e;var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Ta(e){if(null!=e){try{return ft.call(e)}catch{}try{return e+""}catch{}}return""}function Ma(e,t){return un(z,(function(n){var r="_."+n[0];t&n[1]&&!dn(e,r)&&e.push(r)})),e.sort()}function La(e){if(e instanceof Cr)return e.clone();var t=new Ir(e.__wrapped__,e.__chain__);return t.__actions__=os(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Ua(t,n,r){n=(r?ca(t,n,r):n===e)?1:Qt(Yl(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,s=0,a=Xe(Bt(i/n));o<i;)a[s++]=Po(t,o,o+=n);return a}function ja(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}function Da(){var e=arguments.length;if(!e)return[];for(var t=Xe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return yn(ul(n)?os(n):[n],Pi(t,1))}var za=Eo((function(e,t){return hl(e)?Ei(e,Pi(t,1,hl,!0)):[]})),Ba=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),qs(r,2)):[]})),Fa=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),e,r):[]}));function Ha(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=r||n===e?1:Yl(n))<0?0:n,i):[]}function $a(t,n,r){var i=null==t?0:t.length;return i?Po(t,0,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n):[]}function Va(e,t){return e&&e.length?zo(e,qs(t,3),!0,!0):[]}function qa(e,t){return e&&e.length?zo(e,qs(t,3),!0):[]}function Wa(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ca(e,t,n)&&(n=0,r=i),Ii(e,t,n,r)):[]}function Ka(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),On(e,qs(t,3),i)}function Ga(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==e&&(o=Yl(r),o=r<0?Qt(i+o,0):Xt(o,i-1)),On(t,qs(n,3),o,!0)}function Ya(e){return null!=e&&e.length?Pi(e,1):[]}function Qa(e){return null!=e&&e.length?Pi(e,A):[]}function Ja(t,n){return null!=t&&t.length?Pi(t,n=n===e?1:Yl(n)):[]}function Xa(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}function Za(t){return t&&t.length?t[0]:e}function ec(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),Rn(e,t,i)}function tc(e){return null!=e&&e.length?Po(e,0,-1):[]}var nc=Eo((function(e){var t=gn(e,$o);return t.length&&t[0]===e[0]?Hi(t):[]})),rc=Eo((function(t){var n=sc(t),r=gn(t,$o);return n===sc(r)?n=e:r.pop(),r.length&&r[0]===t[0]?Hi(r,qs(n,2)):[]})),ic=Eo((function(t){var n=sc(t),r=gn(t,$o);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?Hi(r,e,n):[]}));function oc(e,t){return null==e?"":Kt.call(e,t)}function sc(t){var n=null==t?0:t.length;return n?t[n-1]:e}function ac(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==e&&(o=(o=Yl(r))<0?Qt(i+o,0):Xt(o,i-1)),n==n?nr(t,n,o):On(t,In,o,!0)}function cc(t,n){return t&&t.length?fo(t,Yl(n)):e}var uc=Eo(lc);function lc(e,t){return e&&e.length&&t&&t.length?vo(e,t):e}function fc(e,t,n){return e&&e.length&&t&&t.length?vo(e,t,qs(n,2)):e}function hc(t,n,r){return t&&t.length&&n&&n.length?vo(t,n,e,r):t}var dc=zs((function(e,t){var n=null==e?0:e.length,r=yi(e,t);return mo(e,gn(t,(function(e){return aa(e,n)?+e:e})).sort(ts)),r}));function pc(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=qs(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return mo(e,i),n}function gc(e){return null==e?e:kn.call(e)}function yc(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&ca(t,n,r)?(n=0,r=i):(n=null==n?0:Yl(n),r=r===e?i:Yl(r)),Po(t,n,r)):[]}function vc(e,t){return No(e,t)}function mc(e,t,n){return Ao(e,t,qs(n,2))}function _c(e,t){var n=null==e?0:e.length;if(n){var r=No(e,t);if(r<n&&ol(e[r],t))return r}return-1}function bc(e,t){return No(e,t,!0)}function wc(e,t,n){return Ao(e,t,qs(n,2),!0)}function Ec(e,t){if(null!=e&&e.length){var n=No(e,t,!0)-1;if(ol(e[n],t))return n}return-1}function Sc(e){return e&&e.length?To(e):[]}function Oc(e,t){return e&&e.length?To(e,qs(t,2)):[]}function Rc(e){var t=null==e?0:e.length;return t?Po(e,1,t):[]}function xc(t,n,r){return t&&t.length?Po(t,0,(n=r||n===e?1:Yl(n))<0?0:n):[]}function Ic(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n,i):[]}function Cc(e,t){return e&&e.length?zo(e,qs(t,3),!1,!0):[]}function Pc(e,t){return e&&e.length?zo(e,qs(t,3)):[]}var kc=Eo((function(e){return Uo(Pi(e,1,hl,!0))})),Nc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Uo(Pi(t,1,hl,!0),qs(n,2))})),Ac=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Uo(Pi(t,1,hl,!0),e,n)}));function Tc(e){return e&&e.length?Uo(e):[]}function Mc(e,t){return e&&e.length?Uo(e,qs(t,2)):[]}function Lc(t,n){return n="function"==typeof n?n:e,t&&t.length?Uo(t,e,n):[]}function Uc(e){if(!e||!e.length)return[];var t=0;return e=hn(e,(function(e){if(hl(e))return t=Qt(e.length,t),!0})),Mn(t,(function(t){return gn(e,Pn(t))}))}function jc(t,n){if(!t||!t.length)return[];var r=Uc(t);return null==n?r:gn(r,(function(t){return an(n,e,t)}))}var Dc=Eo((function(e,t){return hl(e)?Ei(e,t):[]})),zc=Eo((function(e){return Fo(hn(e,hl))})),Bc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Fo(hn(t,hl),qs(n,2))})),Fc=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Fo(hn(t,hl),e,n)})),Hc=Eo(Uc);function $c(e,t){return Ho(e||[],t||[],li)}function Vc(e,t){return Ho(e||[],t||[],Ro)}var qc=Eo((function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,jc(t,r)}));function Wc(e){var t=Or(e);return t.__chain__=!0,t}function Kc(e,t){return t(e),e}function Gc(e,t){return t(e)}var Yc=zs((function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,o=function(e){return yi(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Cr&&aa(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:Gc,args:[o],thisArg:e}),new Ir(i,this.__chain__).thru((function(t){return n&&!t.length&&t.push(e),t}))):this.thru(o)}));function Qc(){return Wc(this)}function Jc(){return new Ir(this.value(),this.__chain__)}function Xc(){this.__values__===e&&(this.__values__=Kl(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}}function Zc(){return this}function eu(t){for(var n,r=this;r instanceof xr;){var i=La(r);i.__index__=0,i.__values__=e,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,n}function tu(){var t=this.__wrapped__;if(t instanceof Cr){var n=t;return this.__actions__.length&&(n=new Cr(this)),(n=n.reverse()).__actions__.push({func:Gc,args:[gc],thisArg:e}),new Ir(n,this.__chain__)}return this.thru(gc)}function nu(){return Bo(this.__wrapped__,this.__actions__)}var ru=us((function(e,t,n){ht.call(e,n)?++e[n]:gi(e,n,1)}));function iu(t,n,r){var i=ul(t)?fn:Ri;return r&&ca(t,n,r)&&(n=e),i(t,qs(n,3))}function ou(e,t){return(ul(e)?hn:Ci)(e,qs(t,3))}var su=ms(Ka),au=ms(Ga);function cu(e,t){return Pi(vu(e,t),1)}function uu(e,t){return Pi(vu(e,t),A)}function lu(t,n,r){return r=r===e?1:Yl(r),Pi(vu(t,n),r)}function fu(e,t){return(ul(e)?un:Si)(e,qs(t,3))}function hu(e,t){return(ul(e)?ln:Oi)(e,qs(t,3))}var du=us((function(e,t,n){ht.call(e,n)?e[n].push(t):gi(e,n,[t])}));function pu(e,t,n,r){e=fl(e)?e:$f(e),n=n&&!r?Yl(n):0;var i=e.length;return n<0&&(n=Qt(i+n,0)),zl(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Rn(e,t,n)>-1}var gu=Eo((function(e,t,n){var r=-1,i="function"==typeof t,o=fl(e)?Xe(e.length):[];return Si(e,(function(e){o[++r]=i?an(t,e,n):Vi(e,t,n)})),o})),yu=us((function(e,t,n){gi(e,n,t)}));function vu(e,t){return(ul(e)?gn:so)(e,qs(t,3))}function mu(t,n,r,i){return null==t?[]:(ul(n)||(n=null==n?[]:[n]),ul(r=i?e:r)||(r=null==r?[]:[r]),ho(t,n,r))}var _u=us((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function bu(e,t,n){var r=ul(e)?vn:Nn,i=arguments.length<3;return r(e,qs(t,4),n,i,Si)}function wu(e,t,n){var r=ul(e)?mn:Nn,i=arguments.length<3;return r(e,qs(t,4),n,i,Oi)}function Eu(e,t){return(ul(e)?hn:Ci)(e,Hu(qs(t,3)))}function Su(e){return(ul(e)?si:So)(e)}function Ou(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),(ul(t)?ai:Oo)(t,n)}function Ru(e){return(ul(e)?ci:Co)(e)}function xu(e){if(null==e)return 0;if(fl(e))return zl(e)?rr(e):e.length;var t=Xs(e);return t==Y||t==ne?e.size:ro(e).length}function Iu(t,n,r){var i=ul(t)?_n:ko;return r&&ca(t,n,r)&&(n=e),i(t,qs(n,3))}var Cu=Eo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ca(e,t[0],t[1])?t=[]:n>2&&ca(t[0],t[1],t[2])&&(t=[t[0]]),ho(e,Pi(t,1),[])})),Pu=Mt||function(){return Gt.Date.now()};function ku(e,t){if("function"!=typeof t)throw new st(o);return e=Yl(e),function(){if(--e<1)return t.apply(this,arguments)}}function Nu(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,As(t,E,e,e,e,e,n)}function Au(t,n){var r;if("function"!=typeof n)throw new st(o);return t=Yl(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=e),r}}var Tu=Eo((function(e,t,n){var r=g;if(n.length){var i=Xn(n,Vs(Tu));r|=b}return As(e,r,t,n,i)})),Mu=Eo((function(e,t,n){var r=g|y;if(n.length){var i=Xn(n,Vs(Mu));r|=b}return As(t,r,e,n,i)}));function Lu(t,n,r){var i=As(t,m,e,e,e,e,e,n=r?e:n);return i.placeholder=Lu.placeholder,i}function Uu(t,n,r){var i=As(t,_,e,e,e,e,e,n=r?e:n);return i.placeholder=Uu.placeholder,i}function ju(t,n,r){var i,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new st(o);function g(n){var r=i,o=s;return i=s=e,f=n,c=t.apply(o,r)}function y(e){return f=e,u=xa(_,n),h?g(e):c}function v(e){var t=n-(e-l);return d?Xt(t,a-(e-f)):t}function m(t){var r=t-l;return l===e||r>=n||r<0||d&&t-f>=a}function _(){var e=Pu();if(m(e))return b(e);u=xa(_,v(e))}function b(t){return u=e,p&&i?g(t):(i=s=e,c)}function w(){u!==e&&Go(u),f=0,i=l=s=u=e}function E(){return u===e?c:b(Pu())}function S(){var t=Pu(),r=m(t);if(i=arguments,s=this,l=t,r){if(u===e)return y(l);if(d)return Go(u),u=xa(_,n),g(l)}return u===e&&(u=xa(_,n)),c}return n=Jl(n)||0,Rl(r)&&(h=!!r.leading,a=(d="maxWait"in r)?Qt(Jl(r.maxWait)||0,n):a,p="trailing"in r?!!r.trailing:p),S.cancel=w,S.flush=E,S}var Du=Eo((function(e,t){return wi(e,1,t)})),zu=Eo((function(e,t,n){return wi(e,Jl(t)||0,n)}));function Bu(e){return As(e,O)}function Fu(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new st(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Fu.Cache||Vr),n}function Hu(e){if("function"!=typeof e)throw new st(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function $u(e){return Au(2,e)}Fu.Cache=Vr;var Vu=Wo((function(e,t){var n=(t=1==t.length&&ul(t[0])?gn(t[0],jn(qs())):gn(Pi(t,1),jn(qs()))).length;return Eo((function(r){for(var i=-1,o=Xt(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return an(e,this,r)}))})),qu=Eo((function(t,n){var r=Xn(n,Vs(qu));return As(t,b,e,n,r)})),Wu=Eo((function(t,n){var r=Xn(n,Vs(Wu));return As(t,w,e,n,r)})),Ku=zs((function(t,n){return As(t,S,e,e,e,n)}));function Gu(t,n){if("function"!=typeof t)throw new st(o);return Eo(t,n=n===e?n:Yl(n))}function Yu(e,t){if("function"!=typeof e)throw new st(o);return t=null==t?0:Qt(Yl(t),0),Eo((function(n){var r=n[t],i=Ko(n,0,t);return r&&yn(i,r),an(e,this,i)}))}function Qu(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new st(o);return Rl(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ju(e,t,{leading:r,maxWait:t,trailing:i})}function Ju(e){return Nu(e,1)}function Xu(e,t){return qu(Vo(t),e)}function Zu(){if(!arguments.length)return[];var e=arguments[0];return ul(e)?e:[e]}function el(e){return mi(e,h)}function tl(t,n){return mi(t,h,n="function"==typeof n?n:e)}function nl(e){return mi(e,l|h)}function rl(t,n){return mi(t,l|h,n="function"==typeof n?n:e)}function il(e,t){return null==t||bi(e,t,Of(t))}function ol(e,t){return e===t||e!=e&&t!=t}var sl=Is(Di),al=Is((function(e,t){return e>=t})),cl=qi(function(){return arguments}())?qi:function(e){return xl(e)&&ht.call(e,"callee")&&!Rt.call(e,"callee")},ul=Xe.isArray,ll=en?jn(en):Wi;function fl(e){return null!=e&&Ol(e.length)&&!El(e)}function hl(e){return xl(e)&&fl(e)}function dl(e){return!0===e||!1===e||xl(e)&&ji(e)==$}var pl=$t||Qh,gl=tn?jn(tn):Ki;function yl(e){return xl(e)&&1===e.nodeType&&!Ll(e)}function vl(e){if(null==e)return!0;if(fl(e)&&(ul(e)||"string"==typeof e||"function"==typeof e.splice||pl(e)||Fl(e)||cl(e)))return!e.length;var t=Xs(e);if(t==Y||t==ne)return!e.size;if(pa(e))return!ro(e).length;for(var n in e)if(ht.call(e,n))return!1;return!0}function ml(e,t){return Gi(e,t)}function _l(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Gi(t,n,e,r):!!i}function bl(e){if(!xl(e))return!1;var t=ji(e);return t==W||t==q||"string"==typeof e.message&&"string"==typeof e.name&&!Ll(e)}function wl(e){return"number"==typeof e&&Wt(e)}function El(e){if(!Rl(e))return!1;var t=ji(e);return t==K||t==G||t==H||t==ee}function Sl(e){return"number"==typeof e&&e==Yl(e)}function Ol(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=T}function Rl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xl(e){return null!=e&&"object"==typeof e}var Il=nn?jn(nn):Qi;function Cl(e,t){return e===t||Ji(e,t,Ks(t))}function Pl(t,n,r){return r="function"==typeof r?r:e,Ji(t,n,Ks(n),r)}function kl(e){return Ml(e)&&e!=+e}function Nl(e){if(da(e))throw new et(i);return Xi(e)}function Al(e){return null===e}function Tl(e){return null==e}function Ml(e){return"number"==typeof e||xl(e)&&ji(e)==Q}function Ll(e){if(!xl(e)||ji(e)!=X)return!1;var t=St(e);if(null===t)return!0;var n=ht.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ft.call(n)==yt}var Ul=rn?jn(rn):Zi;function jl(e){return Sl(e)&&e>=-T&&e<=T}var Dl=on?jn(on):eo;function zl(e){return"string"==typeof e||!ul(e)&&xl(e)&&ji(e)==re}function Bl(e){return"symbol"==typeof e||xl(e)&&ji(e)==ie}var Fl=sn?jn(sn):to;function Hl(t){return t===e}function $l(e){return xl(e)&&Xs(e)==se}function Vl(e){return xl(e)&&ji(e)==ae}var ql=Is(oo),Wl=Is((function(e,t){return e<=t}));function Kl(e){if(!e)return[];if(fl(e))return zl(e)?ir(e):os(e);if(Ct&&e[Ct])return Yn(e[Ct]());var t=Xs(e);return(t==Y?Qn:t==ne?Zn:$f)(e)}function Gl(e){return e?(e=Jl(e))===A||e===-A?(e<0?-1:1)*M:e==e?e:0:0===e?e:0}function Yl(e){var t=Gl(e),n=t%1;return t==t?n?t-n:t:0}function Ql(e){return e?vi(Yl(e),0,U):0}function Jl(e){if("number"==typeof e)return e;if(Bl(e))return L;if(Rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Un(e);var n=qe.test(e);return n||Ke.test(e)?qt(e.slice(2),n?2:8):Ve.test(e)?L:+e}function Xl(e){return ss(e,Rf(e))}function Zl(e){return e?vi(Yl(e),-T,T):0===e?e:0}function ef(e){return null==e?"":Lo(e)}var tf=ls((function(e,t){if(pa(t)||fl(t))ss(t,Of(t),e);else for(var n in t)ht.call(t,n)&&li(e,n,t[n])})),nf=ls((function(e,t){ss(t,Rf(t),e)})),rf=ls((function(e,t,n,r){ss(t,Rf(t),e,r)})),of=ls((function(e,t,n,r){ss(t,Of(t),e,r)})),sf=zs(yi);function af(e,t){var n=Rr(e);return null==t?n:di(n,t)}var cf=Eo((function(t,n){t=rt(t);var r=-1,i=n.length,o=i>2?n[2]:e;for(o&&ca(n[0],n[1],o)&&(i=1);++r<i;)for(var s=n[r],a=Rf(s),c=-1,u=a.length;++c<u;){var l=a[c],f=t[l];(f===e||ol(f,ut[l])&&!ht.call(t,l))&&(t[l]=s[l])}return t})),uf=Eo((function(t){return t.push(e,Ms),an(Pf,e,t)}));function lf(e,t){return Sn(e,qs(t,3),Ai)}function ff(e,t){return Sn(e,qs(t,3),Ti)}function hf(e,t){return null==e?e:ki(e,qs(t,3),Rf)}function df(e,t){return null==e?e:Ni(e,qs(t,3),Rf)}function pf(e,t){return e&&Ai(e,qs(t,3))}function gf(e,t){return e&&Ti(e,qs(t,3))}function yf(e){return null==e?[]:Mi(e,Of(e))}function vf(e){return null==e?[]:Mi(e,Rf(e))}function mf(t,n,r){var i=null==t?e:Li(t,n);return i===e?r:i}function _f(e,t){return null!=e&&ta(e,t,zi)}function bf(e,t){return null!=e&&ta(e,t,Bi)}var wf=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),e[t]=n}),Ch(Ah)),Ef=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),ht.call(e,t)?e[t].push(n):e[t]=[n]}),qs),Sf=Eo(Vi);function Of(e){return fl(e)?oi(e):ro(e)}function Rf(e){return fl(e)?oi(e,!0):io(e)}function xf(e,t){var n={};return t=qs(t,3),Ai(e,(function(e,r,i){gi(n,t(e,r,i),e)})),n}function If(e,t){var n={};return t=qs(t,3),Ai(e,(function(e,r,i){gi(n,r,t(e,r,i))})),n}var Cf=ls((function(e,t,n){uo(e,t,n)})),Pf=ls((function(e,t,n,r){uo(e,t,n,r)})),kf=zs((function(e,t){var n={};if(null==e)return n;var r=!1;t=gn(t,(function(t){return t=qo(t,e),r||(r=t.length>1),t})),ss(e,Fs(e),n),r&&(n=mi(n,l|f|h,Ls));for(var i=t.length;i--;)jo(n,t[i]);return n}));function Nf(e,t){return Tf(e,Hu(qs(t)))}var Af=zs((function(e,t){return null==e?{}:po(e,t)}));function Tf(e,t){if(null==e)return{};var n=gn(Fs(e),(function(e){return[e]}));return t=qs(t),go(e,n,(function(e,n){return t(e,n[0])}))}function Mf(t,n,r){var i=-1,o=(n=qo(n,t)).length;for(o||(o=1,t=e);++i<o;){var s=null==t?e:t[Aa(n[i])];s===e&&(i=o,s=r),t=El(s)?s.call(t):s}return t}function Lf(e,t,n){return null==e?e:Ro(e,t,n)}function Uf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Ro(t,n,r,i)}var jf=Ns(Of),Df=Ns(Rf);function zf(e,t,n){var r=ul(e),i=r||pl(e)||Fl(e);if(t=qs(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Rl(e)&&El(o)?Rr(St(e)):{}}return(i?un:Ai)(e,(function(e,r,i){return t(n,e,r,i)})),n}function Bf(e,t){return null==e||jo(e,t)}function Ff(e,t,n){return null==e?e:Do(e,t,Vo(n))}function Hf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Do(t,n,Vo(r),i)}function $f(e){return null==e?[]:Dn(e,Of(e))}function Vf(e){return null==e?[]:Dn(e,Rf(e))}function qf(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=Jl(r))==r?r:0),n!==e&&(n=(n=Jl(n))==n?n:0),vi(Jl(t),n,r)}function Wf(t,n,r){return n=Gl(n),r===e?(r=n,n=0):r=Gl(r),Fi(t=Jl(t),n,r)}function Kf(t,n,r){if(r&&"boolean"!=typeof r&&ca(t,n,r)&&(n=r=e),r===e&&("boolean"==typeof n?(r=n,n=e):"boolean"==typeof t&&(r=t,t=e)),t===e&&n===e?(t=0,n=1):(t=Gl(t),n===e?(n=t,t=0):n=Gl(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var o=wn();return Xt(t+o*(n-t+Vt("1e-"+((o+"").length-1))),n)}return _o(t,n)}var Gf=gs((function(e,t,n){return t=t.toLowerCase(),e+(n?Yf(t):t)}));function Yf(e){return Eh(ef(e).toLowerCase())}function Qf(e){return(e=ef(e))&&e.replace(Ye,$n).replace(Nt,"")}function Jf(t,n,r){t=ef(t),n=Lo(n);var i=t.length,o=r=r===e?i:vi(Yl(r),0,i);return(r-=n.length)>=0&&t.slice(r,o)==n}function Xf(e){return(e=ef(e))&&Re.test(e)?e.replace(Se,Vn):e}function Zf(e){return(e=ef(e))&&Te.test(e)?e.replace(Ae,"\\$&"):e}var eh=gs((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),th=gs((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),nh=ps("toLowerCase");function rh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Os(Ft(i),n)+e+Os(Bt(i),n)}function ih(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?e+Os(t-r,n):e}function oh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?Os(t-r,n)+e:e}function sh(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(ef(e).replace(Me,""),t||0)}function ah(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),wo(ef(t),n)}function ch(){var e=arguments,t=ef(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var uh=gs((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));function lh(t,n,r){return r&&"number"!=typeof r&&ca(t,n,r)&&(n=r=e),(r=r===e?U:r>>>0)?(t=ef(t))&&("string"==typeof n||null!=n&&!Ul(n))&&!(n=Lo(n))&&Kn(t)?Ko(ir(t),0,r):t.split(n,r):[]}var fh=gs((function(e,t,n){return e+(n?" ":"")+Eh(t)}));function hh(e,t,n){return e=ef(e),n=null==n?0:vi(Yl(n),0,e.length),t=Lo(t),e.slice(n,n+t.length)==t}function dh(t,n,r){var i=Or.templateSettings;r&&ca(t,n,r)&&(n=e),t=ef(t),n=rf({},n,i,Ts);var o,a,c=rf({},n.imports,i.imports,Ts),u=Of(c),l=Dn(c,u),f=0,h=n.interpolate||Qe,d="__p += '",p=it((n.escape||Qe).source+"|"+h.source+"|"+(h===Ce?He:Qe).source+"|"+(n.evaluate||Qe).source+"|$","g"),g="//# sourceURL="+(ht.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jt+"]")+"\n";t.replace(p,(function(e,n,r,i,s,c){return r||(r=i),d+=t.slice(f,c).replace(Je,qn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=c+e.length,e})),d+="';\n";var y=ht.call(n,"variable")&&n.variable;if(y){if(Be.test(y))throw new et(s)}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(_e,""):d).replace(be,"$1").replace(we,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Oh((function(){return tt(u,g+"return "+d).apply(e,l)}));if(v.source=d,bl(v))throw v;return v}function ph(e){return ef(e).toLowerCase()}function gh(e){return ef(e).toUpperCase()}function yh(t,n,r){if((t=ef(t))&&(r||n===e))return Un(t);if(!t||!(n=Lo(n)))return t;var i=ir(t),o=ir(n);return Ko(i,Bn(i,o),Fn(i,o)+1).join("")}function vh(t,n,r){if((t=ef(t))&&(r||n===e))return t.slice(0,or(t)+1);if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,0,Fn(i,ir(n))+1).join("")}function mh(t,n,r){if((t=ef(t))&&(r||n===e))return t.replace(Me,"");if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,Bn(i,ir(n))).join("")}function _h(t,n){var r=R,i=x;if(Rl(n)){var o="separator"in n?n.separator:o;r="length"in n?Yl(n.length):r,i="omission"in n?Lo(n.omission):i}var s=(t=ef(t)).length;if(Kn(t)){var a=ir(t);s=a.length}if(r>=s)return t;var c=r-rr(i);if(c<1)return i;var u=a?Ko(a,0,c).join(""):t.slice(0,c);if(o===e)return u+i;if(a&&(c+=u.length-c),Ul(o)){if(t.slice(c).search(o)){var l,f=u;for(o.global||(o=it(o.source,ef($e.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===e?c:h)}}else if(t.indexOf(Lo(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+i}function bh(e){return(e=ef(e))&&Oe.test(e)?e.replace(Ee,sr):e}var wh=gs((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Eh=ps("toUpperCase");function Sh(t,n,r){return t=ef(t),(n=r?e:n)===e?Gn(t)?ur(t):En(t):t.match(n)||[]}var Oh=Eo((function(t,n){try{return an(t,e,n)}catch(e){return bl(e)?e:new et(e)}})),Rh=zs((function(e,t){return un(t,(function(t){t=Aa(t),gi(e,t,Tu(e[t],e))})),e}));function xh(e){var t=null==e?0:e.length,n=qs();return e=t?gn(e,(function(e){if("function"!=typeof e[1])throw new st(o);return[n(e[0]),e[1]]})):[],Eo((function(n){for(var r=-1;++r<t;){var i=e[r];if(an(i[0],this,n))return an(i[1],this,n)}}))}function Ih(e){return _i(mi(e,l))}function Ch(e){return function(){return e}}function Ph(e,t){return null==e||e!=e?t:e}var kh=_s(),Nh=_s(!0);function Ah(e){return e}function Th(e){return no("function"==typeof e?e:mi(e,l))}function Mh(e){return ao(mi(e,l))}function Lh(e,t){return co(e,mi(t,l))}var Uh=Eo((function(e,t){return function(n){return Vi(n,e,t)}})),jh=Eo((function(e,t){return function(n){return Vi(e,n,t)}}));function Dh(e,t,n){var r=Of(t),i=Mi(t,r);null==n&&(!Rl(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=Mi(t,Of(t)));var o=!(Rl(n)&&"chain"in n&&!n.chain),s=El(e);return un(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=os(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,yn([this.value()],arguments))})})),e}function zh(){return Gt._===this&&(Gt._=vt),this}function Bh(){}function Fh(e){return e=Yl(e),Eo((function(t){return fo(t,e)}))}var Hh=Ss(gn),$h=Ss(fn),Vh=Ss(_n);function qh(e){return ua(e)?Pn(Aa(e)):yo(e)}function Wh(t){return function(n){return null==t?e:Li(t,n)}}var Kh=xs(),Gh=xs(!0);function Yh(){return[]}function Qh(){return!1}function Jh(){return{}}function Xh(){return""}function Zh(){return!0}function ed(e,t){if((e=Yl(e))<1||e>T)return[];var n=U,r=Xt(e,U);t=qs(t),e-=U;for(var i=Mn(r,t);++n<e;)t(n);return i}function td(e){return ul(e)?gn(e,Aa):Bl(e)?[e]:os(Na(ef(e)))}function nd(e){var t=++dt;return ef(e)+t}var rd=Es((function(e,t){return e+t}),0),id=Ps("ceil"),od=Es((function(e,t){return e/t}),1),sd=Ps("floor");function ad(t){return t&&t.length?xi(t,Ah,Di):e}function cd(t,n){return t&&t.length?xi(t,qs(n,2),Di):e}function ud(e){return Cn(e,Ah)}function ld(e,t){return Cn(e,qs(t,2))}function fd(t){return t&&t.length?xi(t,Ah,oo):e}function hd(t,n){return t&&t.length?xi(t,qs(n,2),oo):e}var dd=Es((function(e,t){return e*t}),1),pd=Ps("round"),gd=Es((function(e,t){return e-t}),0);function yd(e){return e&&e.length?Tn(e,Ah):0}function vd(e,t){return e&&e.length?Tn(e,qs(t,2)):0}return Or.after=ku,Or.ary=Nu,Or.assign=tf,Or.assignIn=nf,Or.assignInWith=rf,Or.assignWith=of,Or.at=sf,Or.before=Au,Or.bind=Tu,Or.bindAll=Rh,Or.bindKey=Mu,Or.castArray=Zu,Or.chain=Wc,Or.chunk=Ua,Or.compact=ja,Or.concat=Da,Or.cond=xh,Or.conforms=Ih,Or.constant=Ch,Or.countBy=ru,Or.create=af,Or.curry=Lu,Or.curryRight=Uu,Or.debounce=ju,Or.defaults=cf,Or.defaultsDeep=uf,Or.defer=Du,Or.delay=zu,Or.difference=za,Or.differenceBy=Ba,Or.differenceWith=Fa,Or.drop=Ha,Or.dropRight=$a,Or.dropRightWhile=Va,Or.dropWhile=qa,Or.fill=Wa,Or.filter=ou,Or.flatMap=cu,Or.flatMapDeep=uu,Or.flatMapDepth=lu,Or.flatten=Ya,Or.flattenDeep=Qa,Or.flattenDepth=Ja,Or.flip=Bu,Or.flow=kh,Or.flowRight=Nh,Or.fromPairs=Xa,Or.functions=yf,Or.functionsIn=vf,Or.groupBy=du,Or.initial=tc,Or.intersection=nc,Or.intersectionBy=rc,Or.intersectionWith=ic,Or.invert=wf,Or.invertBy=Ef,Or.invokeMap=gu,Or.iteratee=Th,Or.keyBy=yu,Or.keys=Of,Or.keysIn=Rf,Or.map=vu,Or.mapKeys=xf,Or.mapValues=If,Or.matches=Mh,Or.matchesProperty=Lh,Or.memoize=Fu,Or.merge=Cf,Or.mergeWith=Pf,Or.method=Uh,Or.methodOf=jh,Or.mixin=Dh,Or.negate=Hu,Or.nthArg=Fh,Or.omit=kf,Or.omitBy=Nf,Or.once=$u,Or.orderBy=mu,Or.over=Hh,Or.overArgs=Vu,Or.overEvery=$h,Or.overSome=Vh,Or.partial=qu,Or.partialRight=Wu,Or.partition=_u,Or.pick=Af,Or.pickBy=Tf,Or.property=qh,Or.propertyOf=Wh,Or.pull=uc,Or.pullAll=lc,Or.pullAllBy=fc,Or.pullAllWith=hc,Or.pullAt=dc,Or.range=Kh,Or.rangeRight=Gh,Or.rearg=Ku,Or.reject=Eu,Or.remove=pc,Or.rest=Gu,Or.reverse=gc,Or.sampleSize=Ou,Or.set=Lf,Or.setWith=Uf,Or.shuffle=Ru,Or.slice=yc,Or.sortBy=Cu,Or.sortedUniq=Sc,Or.sortedUniqBy=Oc,Or.split=lh,Or.spread=Yu,Or.tail=Rc,Or.take=xc,Or.takeRight=Ic,Or.takeRightWhile=Cc,Or.takeWhile=Pc,Or.tap=Kc,Or.throttle=Qu,Or.thru=Gc,Or.toArray=Kl,Or.toPairs=jf,Or.toPairsIn=Df,Or.toPath=td,Or.toPlainObject=Xl,Or.transform=zf,Or.unary=Ju,Or.union=kc,Or.unionBy=Nc,Or.unionWith=Ac,Or.uniq=Tc,Or.uniqBy=Mc,Or.uniqWith=Lc,Or.unset=Bf,Or.unzip=Uc,Or.unzipWith=jc,Or.update=Ff,Or.updateWith=Hf,Or.values=$f,Or.valuesIn=Vf,Or.without=Dc,Or.words=Sh,Or.wrap=Xu,Or.xor=zc,Or.xorBy=Bc,Or.xorWith=Fc,Or.zip=Hc,Or.zipObject=$c,Or.zipObjectDeep=Vc,Or.zipWith=qc,Or.entries=jf,Or.entriesIn=Df,Or.extend=nf,Or.extendWith=rf,Dh(Or,Or),Or.add=rd,Or.attempt=Oh,Or.camelCase=Gf,Or.capitalize=Yf,Or.ceil=id,Or.clamp=qf,Or.clone=el,Or.cloneDeep=nl,Or.cloneDeepWith=rl,Or.cloneWith=tl,Or.conformsTo=il,Or.deburr=Qf,Or.defaultTo=Ph,Or.divide=od,Or.endsWith=Jf,Or.eq=ol,Or.escape=Xf,Or.escapeRegExp=Zf,Or.every=iu,Or.find=su,Or.findIndex=Ka,Or.findKey=lf,Or.findLast=au,Or.findLastIndex=Ga,Or.findLastKey=ff,Or.floor=sd,Or.forEach=fu,Or.forEachRight=hu,Or.forIn=hf,Or.forInRight=df,Or.forOwn=pf,Or.forOwnRight=gf,Or.get=mf,Or.gt=sl,Or.gte=al,Or.has=_f,Or.hasIn=bf,Or.head=Za,Or.identity=Ah,Or.includes=pu,Or.indexOf=ec,Or.inRange=Wf,Or.invoke=Sf,Or.isArguments=cl,Or.isArray=ul,Or.isArrayBuffer=ll,Or.isArrayLike=fl,Or.isArrayLikeObject=hl,Or.isBoolean=dl,Or.isBuffer=pl,Or.isDate=gl,Or.isElement=yl,Or.isEmpty=vl,Or.isEqual=ml,Or.isEqualWith=_l,Or.isError=bl,Or.isFinite=wl,Or.isFunction=El,Or.isInteger=Sl,Or.isLength=Ol,Or.isMap=Il,Or.isMatch=Cl,Or.isMatchWith=Pl,Or.isNaN=kl,Or.isNative=Nl,Or.isNil=Tl,Or.isNull=Al,Or.isNumber=Ml,Or.isObject=Rl,Or.isObjectLike=xl,Or.isPlainObject=Ll,Or.isRegExp=Ul,Or.isSafeInteger=jl,Or.isSet=Dl,Or.isString=zl,Or.isSymbol=Bl,Or.isTypedArray=Fl,Or.isUndefined=Hl,Or.isWeakMap=$l,Or.isWeakSet=Vl,Or.join=oc,Or.kebabCase=eh,Or.last=sc,Or.lastIndexOf=ac,Or.lowerCase=th,Or.lowerFirst=nh,Or.lt=ql,Or.lte=Wl,Or.max=ad,Or.maxBy=cd,Or.mean=ud,Or.meanBy=ld,Or.min=fd,Or.minBy=hd,Or.stubArray=Yh,Or.stubFalse=Qh,Or.stubObject=Jh,Or.stubString=Xh,Or.stubTrue=Zh,Or.multiply=dd,Or.nth=cc,Or.noConflict=zh,Or.noop=Bh,Or.now=Pu,Or.pad=rh,Or.padEnd=ih,Or.padStart=oh,Or.parseInt=sh,Or.random=Kf,Or.reduce=bu,Or.reduceRight=wu,Or.repeat=ah,Or.replace=ch,Or.result=Mf,Or.round=pd,Or.runInContext=t,Or.sample=Su,Or.size=xu,Or.snakeCase=uh,Or.some=Iu,Or.sortedIndex=vc,Or.sortedIndexBy=mc,Or.sortedIndexOf=_c,Or.sortedLastIndex=bc,Or.sortedLastIndexBy=wc,Or.sortedLastIndexOf=Ec,Or.startCase=fh,Or.startsWith=hh,Or.subtract=gd,Or.sum=yd,Or.sumBy=vd,Or.template=dh,Or.times=ed,Or.toFinite=Gl,Or.toInteger=Yl,Or.toLength=Ql,Or.toLower=ph,Or.toNumber=Jl,Or.toSafeInteger=Zl,Or.toString=ef,Or.toUpper=gh,Or.trim=yh,Or.trimEnd=vh,Or.trimStart=mh,Or.truncate=_h,Or.unescape=bh,Or.uniqueId=nd,Or.upperCase=wh,Or.upperFirst=Eh,Or.each=fu,Or.eachRight=hu,Or.first=Za,Dh(Or,function(){var e={};return Ai(Or,(function(t,n){ht.call(Or.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Or.VERSION=n,un(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Or[e].placeholder=Or})),un(["drop","take"],(function(t,n){Cr.prototype[t]=function(r){r=r===e?1:Qt(Yl(r),0);var i=this.__filtered__&&!n?new Cr(this):this.clone();return i.__filtered__?i.__takeCount__=Xt(r,i.__takeCount__):i.__views__.push({size:Xt(r,U),type:t+(i.__dir__<0?"Right":"")}),i},Cr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),un(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=n==P||n==N;Cr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qs(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),un(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Cr.prototype[e]=function(){return this[n](1).value()[0]}})),un(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Cr.prototype[e]=function(){return this.__filtered__?new Cr(this):this[n](1)}})),Cr.prototype.compact=function(){return this.filter(Ah)},Cr.prototype.find=function(e){return this.filter(e).head()},Cr.prototype.findLast=function(e){return this.reverse().find(e)},Cr.prototype.invokeMap=Eo((function(e,t){return"function"==typeof e?new Cr(this):this.map((function(n){return Vi(n,e,t)}))})),Cr.prototype.reject=function(e){return this.filter(Hu(qs(e)))},Cr.prototype.slice=function(t,n){t=Yl(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Cr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=Yl(n))<0?r.dropRight(-n):r.take(n-t)),r)},Cr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Cr.prototype.toArray=function(){return this.take(U)},Ai(Cr.prototype,(function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Or[i?"take"+("last"==n?"Right":""):n],s=i||/^find/.test(n);o&&(Or.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,c=n instanceof Cr,u=a[0],l=c||ul(n),f=function(e){var t=o.apply(Or,yn([e],a));return i&&h?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=c&&!d;if(!s&&l){n=g?n:new Cr(this);var y=t.apply(n,a);return y.__actions__.push({func:Gc,args:[f],thisArg:e}),new Ir(y,h)}return p&&g?t.apply(this,a):(y=this.thru(f),p?i?y.value()[0]:y.value():y)})})),un(["pop","push","shift","sort","splice","unshift"],(function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Or.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ul(i)?i:[],e)}return this[n]((function(n){return t.apply(ul(n)?n:[],e)}))}})),Ai(Cr.prototype,(function(e,t){var n=Or[t];if(n){var r=n.name+"";ht.call(gr,r)||(gr[r]=[]),gr[r].push({name:t,func:n})}})),gr[bs(e,y).name]=[{name:"wrapper",func:e}],Cr.prototype.clone=Pr,Cr.prototype.reverse=kr,Cr.prototype.value=Nr,Or.prototype.at=Yc,Or.prototype.chain=Qc,Or.prototype.commit=Jc,Or.prototype.next=Xc,Or.prototype.plant=eu,Or.prototype.reverse=tu,Or.prototype.toJSON=Or.prototype.valueOf=Or.prototype.value=nu,Or.prototype.first=Or.prototype.head,Ct&&(Or.prototype[Ct]=Zc),Or},fr=lr();Qt?((Qt.exports=fr)._=fr,Yt._=fr):Gt._=fr}.call(t);var mg=Object.defineProperty,_g=Object.defineProperties,bg=Object.getOwnPropertyDescriptors,wg=Object.getOwnPropertySymbols,Eg=Object.prototype.hasOwnProperty,Sg=Object.prototype.propertyIsEnumerable,Og=(e,t,n)=>t in e?mg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rg=(e,t)=>{for(var n in t||(t={}))Eg.call(t,n)&&Og(e,n,t[n]);if(wg)for(var n of wg(t))Sg.call(t,n)&&Og(e,n,t[n]);return e},xg=(e,t)=>_g(e,bg(t));function Ig(e,t,n){let r;const i=Cg(e);return t.rpcMap&&(r=t.rpcMap[i]),r||(r=`${dg}?chainId=eip155:${i}&projectId=${n}`),r}function Cg(e){return e.includes("eip155")?Number(e.split(":")[1]):Number(e)}function Pg(e,t){if(!t.includes(e))throw new Error(`Chain '${e}' not approved. Please use one of the following: ${t.toString()}`)}function kg(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}function Ng(e,t){const n=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!n.length)return[];const r=[];return n.forEach((e=>{const n=t.namespaces[e].accounts;r.push(...n)})),r}function Ag(e,t={}){const n=Tg(e),r=Tg(t);return vg.exports.merge(n,r)}function Tg(e){var t,n,r,i;const o={};if(!gu(e))return o;for(const[s,a]of Object.entries(e)){const e=cu(s)?[s]:a.chains,c=a.methods||[],u=a.events||[],l=a.rpcMap||{},f=uu(s);o[f]=xg(Rg(Rg({},o[f]),a),{chains:Fc(e,null==(t=o[f])?void 0:t.chains),methods:Fc(c,null==(n=o[f])?void 0:n.methods),events:Fc(u,null==(r=o[f])?void 0:r.events),rpcMap:Rg(Rg({},l),null==(i=o[f])?void 0:i.rpcMap)})}return o}const Mg={},Lg=e=>Mg[e],Ug=(e,t)=>{Mg[e]=t};var jg={exports:{}};!function(e,n){var r,i=typeof self<"u"?self:t,o=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();r=o,function(e){var t={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function n(e){return e&&DataView.prototype.isPrototypeOf(e)}if(t.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function d(e){var t=new FileReader,n=f(t);return t.readAsText(e),n}function p(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:t.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:t.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():t.arrayBuffer&&t.blob&&n(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;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?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return d(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=a(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e){var t=e.toUpperCase();return v.indexOf(t)>-1?t:e}function _(e,t){var n=(t=t||{}).body;if(e instanceof _){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&null!=e._bodyInit&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=m(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},y.call(_.prototype),y.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];E.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch{e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function O(n,r){return new Promise((function(i,o){var s=new _(n,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:w(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;i(new E(t,e))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(typeof s._bodyInit>"u"?null:s._bodyInit)}))}O.polyfill=!0,r.fetch||(r.fetch=O,r.Headers=u,r.Request=_,r.Response=E),e.Headers=u,e.Request=_,e.Response=E,e.fetch=O,Object.defineProperty(e,"__esModule",{value:!0})}({}),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var s=o;(n=s.fetch).default=s.fetch,n.fetch=s.fetch,n.Headers=s.Headers,n.Request=s.Request,n.Response=s.Response,e.exports=n}(jg,jg.exports);var Dg=n(jg.exports);const zg={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Bg=10;class Fg{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new o.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Jl(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}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,t){this.isAvailable||await this.register();try{const t=sr(e),n=await(await Dg(this.url,Object.assign(Object.assign({},zg),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!Jl(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=sr({id:1,jsonrpc:"2.0",method:"test",params:[]});await Dg(e,Object.assign(Object.assign({},zg),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}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 t="string"==typeof e.data?or(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=Hl(e,n.message||n.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return ol(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Bg&&this.events.setMaxListeners(Bg)}}class Hg{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class $g{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){var t;switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}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,t){const n=Cg(e);if(!this.httpProviders[n]){const e=t||Ig(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!e)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,e)}this.chainId=n,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}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,t){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Cg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}handleSwitchChain(e){const t=parseInt(e,16);Pg(`${this.name}:${t}`,this.namespace.chains),this.setDefaultChain(`${t}`)}}class Vg{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class qg{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class Wg{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{const n=this.getCardanoRPCUrl(t);e[t]=this.createHttpProvider(t,n)})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class Kg{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class Gg{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}var Yg=Object.defineProperty,Qg=Object.defineProperties,Jg=Object.getOwnPropertyDescriptors,Xg=Object.getOwnPropertySymbols,Zg=Object.prototype.hasOwnProperty,ey=Object.prototype.propertyIsEnumerable,ty=(e,t,n)=>t in e?Yg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ny=(e,t)=>{for(var n in t||(t={}))Zg.call(t,n)&&ty(e,n,t[n]);if(Xg)for(var n of Xg(t))ey.call(t,n)&&ty(e,n,t[n]);return e},ry=(e,t)=>Qg(e,Jg(t));class iy{constructor(e){this.events=new o.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:cn.pino(cn.getDefaultLoggerOptions({level:e?.logger||lg})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new iy(e);return await t.initialize(),t}async request(e,t){const[n,r]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ny({},e),chainId:`${n}:${r}`,topic:this.session.topic})}sendAsync(e,t,n){this.request(e,n).then((e=>t(null,e))).catch((e=>t(e,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:null==(e=this.session)?void 0:e.topic,reason:du("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)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:r}=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 r().then((e=>{this.session=e})).catch((e=>{if(e.message!==Hp)throw e;t++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{const[n,r]=this.validateChain(e);this.getProvider(n).setDefaultChain(r,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(pu(t)){for(const n of t)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: ${t.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 ug.init({logger:this.providerOpts.logger||lg,relayUrl:this.providerOpts.relayUrl||fg,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,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((e=>uu(e))))];Ug("client",this.client),Ug("events",this.events),Ug("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=Ng(e,this.session),n=kg(t),r=Ag(this.namespaces,this.optionalNamespaces),i=ry(ny({},r[e]),{accounts:t,chains:n});switch(e){case"eip155":this.rpcProviders[e]=new $g({namespace:i});break;case"solana":this.rpcProviders[e]=new Vg({namespace:i});break;case"cosmos":this.rpcProviders[e]=new qg({namespace:i});break;case"polkadot":this.rpcProviders[e]=new Hg({namespace:i});break;case"cip34":this.rpcProviders[e]=new Wg({namespace:i});break;case"elrond":this.rpcProviders[e]=new Kg({namespace:i});break;case"multiversx":this.rpcProviders[e]=new Gg({namespace:i})}}))}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:t}=e,{event:n}=t;"accountsChanged"===n.name?this.events.emit("accountsChanged",n.data):"chainChanged"===n.name?this.onChainChanged(t.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var n;const{namespaces:r}=t,i=null==(n=this.client)?void 0:n.session.get(e);this.session=ry(ny({},i),{namespaces:r}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",ry(ny({},du("USER_DISCONNECTED")),{data:e.topic}))})),this.on(pg.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 t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:r}=e;if(!t||!Object.keys(t).length)throw new Error("Namespaces must be not empty");this.namespaces=t,this.optionalNamespaces=n,this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(t&&!Object.keys(this.namespaces).map((e=>uu(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const r=uu(Object.keys(this.namespaces)[0]);return[r,this.rpcProviders[r].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var n;const[r,i]=this.validateChain(e);t||this.getProvider(r).setDefaultChain(i),(null!=(n=this.namespaces[r])?n:this.namespaces[`${r}:${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,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${hg}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${hg}/${e}`)}}const oy=iy;e.UniversalProvider=oy,e.default=iy,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,Zi.exports);const eo=["eth_sendTransaction","personal_sign"],to=["eth_accounts","eth_requestAccounts","eth_call","eth_getBalance","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],no=["chainChanged","accountsChanged"],ro=["message","disconnect","connect"];function io(e){return Number(e[0].split(":")[1])}function oo(e){return`0x${e.toString(16)}`}class so{constructor(){this.events=new _n.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static init(e){return c(this,void 0,void 0,(function*(){const t=new so;return yield t.initialize(e),t}))}request(e){return c(this,void 0,void 0,(function*(){return yield this.signer.request(e,this.formatChainId(this.chainId))}))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}enable(){return c(this,void 0,void 0,(function*(){this.session||(yield this.connect());return yield this.request({method:"eth_requestAccounts"})}))}connect(e){return c(this,void 0,void 0,(function*(){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:n}=function(e){const{chains:t,optionalChains:n,methods:r,optionalMethods:i,events:o,optionalEvents:s,rpcMap:a}=e;if(!Qi(t))throw new Error("Invalid chains");const c=t,u=r||eo,l=o||no,f={chains:c,methods:u,events:l,rpcMap:{[io(c)]:a[io(c)]}},h=null==o?void 0:o.filter((e=>!no.includes(e))),d=null==r?void 0:r.filter((e=>!eo.includes(e)));if(!(n||s||i||(null==h?void 0:h.length)||(null==d?void 0:d.length)))return{required:f};const p=(null==h?void 0:h.length)&&(null==d?void 0:d.length)||!n;return{required:f,optional:{chains:[...new Set(p?c.concat(n||[]):n)],methods:[...new Set(u.concat(i||[]))],events:[...new Set(l.concat(s||[]))],rpcMap:a}}}(this.rpc);try{const r=yield new Promise(((r,i)=>c(this,void 0,void 0,(function*(){yield this.signer.connect(Object.assign(Object.assign({namespaces:{[this.namespace]:t}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:null==e?void 0:e.pairingTopic})).then((e=>{r(e)})).catch((e=>{i(new Error(e.message))}))}))));if(!r)return;this.setChainIds(this.rpc.chains);const i=function(e,t=[]){const n=[];return Object.keys(e).forEach((r=>{if(t.length&&!t.includes(r))return;const i=e[r];n.push(...i.accounts)})),n}(r.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:oo(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}}))}disconnect(){return c(this,void 0,void 0,(function*(){this.session&&(yield this.signer.disconnect()),this.reset()}))}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(e=>{const{params:t}=e,{event:n}=t;"accountsChanged"===n.name?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===n.name?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 t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",oo(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",Object.assign(Object.assign({},function(e,t){const{message:n,code:r}=Yi[e];return{message:t?`${n} ${t}`:n,code:r}}("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(e=>{this.events.emit("display_uri",e)}))}setHttpProvider(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter((e=>this.isCompatibleChainId(e))),n=t.map((e=>this.parseChainId(e)));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",oo(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.setHttpProvider(t)}}parseAccountId(e){const[t,n,r]=e.split(":");return{chainId:`${t}:${n}`,address:r}}setAccounts(e){this.accounts=e.filter((e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId)).map((e=>this.parseAccountId(e).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t;return{chains:(null===(t=e.chains)||void 0===t?void 0:t.map((e=>this.formatChainId(e))))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map((e=>this.formatChainId(e))):void 0,methods:(null==e?void 0:e.methods)||eo,events:(null==e?void 0:e.events)||no,optionalMethods:(null==e?void 0:e.optionalMethods)||[],optionalEvents:(null==e?void 0:e.optionalEvents)||[],rpcMap:(null==e?void 0:e.rpcMap)||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach((e=>{n[e]=this.getRpcUrl(e,t)})),n}initialize(e){return c(this,void 0,void 0,(function*(){this.rpc=this.getRpcConfig(e),this.chainId=io(this.rpc.chains),this.signer=yield Zi.exports.UniversalProvider.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata}),this.registerEventListeners(),yield this.loadPersistedSession()}))}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:r}=e;t&&Qi(t)&&(this.rpc.chains=t.map((e=>this.formatChainId(e))),t.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)}))),n&&Qi(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null==n?void 0:n.map((e=>this.formatChainId(e))),n.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)})))}getRpcUrl(e,t){var n;return(null===(n=this.rpc.rpcMap)||void 0===n?void 0:n[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}loadPersistedSession(){return c(this,void 0,void 0,(function*(){if(!this.session)return;const e=yield this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}))}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((e=>this.parseAccount(e)))}}const ao=n("WalletConnectEvm"),co=r("WalletConnectEvm");function uo(){return c(this,void 0,void 0,(function*(){ao("getWalletConnectProvider");try{const e=yield function(){return c(this,void 0,void 0,(function*(){ao("initWalletConnectProvider");const e=bo();ao("walletConnectProviderOptions is",e);const t={projectId:e.projectId,chains:e.chains,optionalChains:e.optionalChains,methods:e.methods,optionalMethods:e.optionalMethods||to,events:e.events,optionalEvents:e.optionalEvents||ro,rpcMap:e.rpcMap,metadata:e.metadata,showQrModal:!1};ao("ethereum init options are",t),ao("creating a new provider instance");try{return so.init(t)}catch(e){throw co("Error while initializing ethereum provider"),e}}))}();return function(e){if(ao("assignWalletConnectProviderEvents"),!e)return;function t(e){e&&(e.removeListener("connect",lo),e.removeListener("session_delete",n),e.removeListener("display_uri",fo))}function n(n){ao("disconnectHandler",n),e.disconnect(),t(e)}t(e),e.on("connect",lo),e.on("display_uri",fo),e.on("session_delete",n),ao("provider is",e)}(e),e.request=function(e){ao("patchWalletConnectProviderRequest");const t=e.request.bind(e),n=bo();return ao("walletConnectProviderOptions is",n),function({method:r,params:i}){return c(this,void 0,void 0,(function*(){return"eth_requestAccounts"===r?(ao("calling patched",r,i),new Promise(((o,a)=>c(this,void 0,void 0,(function*(){var c;try{(null===(c=null==e?void 0:e.session)||void 0===c?void 0:c.connected)?(ao("reusing existing session"),o(yield t({method:r,params:i}))):(pn({uri:"",onClose:()=>{co("user rejected"),a(new s)}}),ao("creating a new session"),yield e.connect({chains:n.chains,optionalChains:n.optionalChains}),o(yield t({method:r,params:i})))}catch(e){return co("error",e),a(e)}}))))):(ao("calling provider",r,i),yield t({method:r,params:i}))}))}}(e),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw co("error",t),t}}))}function lo(e){ao("connectHandler",e),bt(!1)}function fo(e){ao("displayUriHandler",e),_t()&&nn(e)}const ho=n("getProvider"),po=[1];var go,yo;let vo;!function(e){e.Ethereum="Ethereum",e.Solana="Solana"}(go||(go={})),function(e){e.LedgerConnect="LedgerConnect",e.WalletConnect="WalletConnect"}(yo||(yo={}));const mo=n("supportOptions");let _o;const bo=()=>(mo("getSupportOptions"),_o),wo=n("ExtensionEvm"),Eo="ethereum",So="isLedgerConnect";var Oo;function Ro(e){return("iOS"===e.os.name||"macOS"===e.os.name)&&"Safari"===e.browser.name}function xo(e){return!!Oo[e]}function Io(e){return e.every(xo)}function Co(){var e;if(wo("getEthereumProvider"),"undefined"==typeof window)throw new a;let t=window[Eo];if(void 0===t||void 0===t[So])throw new i;wo("chainId is",t.chainId);const n=`0x${(null===(e=bo().chainId)||void 0===e?void 0:e.toString(16))||0}`;return wo("hex chainId is",n),t.chainId!=n&&wo("chainIds are different, changing to",n),t}!function(e){e[e.EthereumMainnet=1]="EthereumMainnet",e[e.Polygon=137]="Polygon"}(Oo||(Oo={}));const Po=n("support");let ko;e.checkSupport=function(e){Po("checkSupport",e),(e=>{var t;mo("setSupportOptions",e);const n=e.version||1;let r,i,o=[];1===n?(i=e.chainId||1,r=[i]):(r=e.chains||po,i=r[0],o.push(...r),(null===(t=e.optionalChains)||void 0===t?void 0:t.length)&&o.push(...e.optionalChains.filter((e=>o.indexOf(e)<0))));const s=Object.assign(Object.assign({},e),{version:n,chains:r,chainId:i,optionalChains:o,projectId:e.projectId||""});if(2===n&&(!e.projectId||""===e.projectId))throw new Error("WalletConnect requires a projectId. Please visit https://cloud.walletconnect.com to get one.");_o=s})(e);const t=bo();let n;switch(t.providerType){case go.Ethereum:n=function(e){Po("checkEthereumSupport",e);const t=fn();let n=!1;try{n=!!Co()}catch(e){}const r={isLedgerConnectSupported:Ro(t),isLedgerConnectEnabled:!!n,isChainIdSupported:Io(e.chains),providerImplementation:yo.LedgerConnect};r.isLedgerConnectSupported&&r.isLedgerConnectEnabled&&r.isChainIdSupported||(r.providerImplementation=yo.WalletConnect);return function(e){ho("setProviderImplementation",e),vo=e}(r.providerImplementation),r}(t);break;case go.Solana:n=function(){Po("checkSolanaSupport");const e=fn();let t=!1;try{t=!!h()}catch(e){}const n={isLedgerConnectSupported:Ro(e),isLedgerConnectEnabled:!!t,providerImplementation:yo.LedgerConnect};n.isLedgerConnectSupported?n.isLedgerConnectSupported&&!n.isLedgerConnectEnabled&&dn("ExtensionInstallModal"):dn("PlatformNotSupportedModal");return n}()}return Po("checkSupportResult is",n),ko=n,n},e.enableDebugLogs=()=>{t=!0},e.getProvider=function(){return c(this,void 0,void 0,(function*(){ho("getProvider",vo);const e=bo();switch(e.providerType){case go.Ethereum:return(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))||vo!==yo.LedgerConnect?(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||1!==e.version&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))?yield uo():yield vn():Co();case go.Solana:return h();default:throw new o}}))},Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map
|
328
|
+
*/gg=vg,yg=vg.exports,function(){var e,n="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",l=1,f=2,h=4,d=1,p=2,g=1,y=2,v=4,m=8,_=16,b=32,w=64,E=128,S=256,O=512,R=30,x="...",I=800,C=16,P=1,k=2,N=3,A=1/0,T=9007199254740991,M=17976931348623157e292,L=NaN,U=4294967295,j=U-1,D=U>>>1,z=[["ary",E],["bind",g],["bindKey",y],["curry",m],["curryRight",_],["flip",O],["partial",b],["partialRight",w],["rearg",S]],B="[object Arguments]",F="[object Array]",H="[object AsyncFunction]",$="[object Boolean]",V="[object Date]",q="[object DOMException]",W="[object Error]",K="[object Function]",G="[object GeneratorFunction]",Y="[object Map]",Q="[object Number]",J="[object Null]",X="[object Object]",Z="[object Promise]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",se="[object WeakMap]",ae="[object WeakSet]",ce="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",he="[object Int8Array]",de="[object Int16Array]",pe="[object Int32Array]",ge="[object Uint8Array]",ye="[object Uint8ClampedArray]",ve="[object Uint16Array]",me="[object Uint32Array]",_e=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,we=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ee=/&(?:amp|lt|gt|quot|#39);/g,Se=/[&<>"']/g,Oe=RegExp(Ee.source),Re=RegExp(Se.source),xe=/<%-([\s\S]+?)%>/g,Ie=/<%([\s\S]+?)%>/g,Ce=/<%=([\s\S]+?)%>/g,Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ke=/^\w*$/,Ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/[\\^$.*+?()[\]{}|]/g,Te=RegExp(Ae.source),Me=/^\s+/,Le=/\s/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,je=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/[()=,{}\[\]\/\s]/,Fe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$e=/\w*$/,Ve=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,Ke=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qe=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Xe="\\ud800-\\udfff",Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",et="\\u2700-\\u27bf",tt="a-z\\xdf-\\xf6\\xf8-\\xff",nt="A-Z\\xc0-\\xd6\\xd8-\\xde",rt="\\ufe0e\\ufe0f",it="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ot="['’]",st="["+Xe+"]",at="["+it+"]",ct="["+Ze+"]",ut="\\d+",lt="["+et+"]",ft="["+tt+"]",ht="[^"+Xe+it+ut+et+tt+nt+"]",dt="\\ud83c[\\udffb-\\udfff]",pt="[^"+Xe+"]",gt="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="["+nt+"]",mt="\\u200d",_t="(?:"+ft+"|"+ht+")",bt="(?:"+vt+"|"+ht+")",wt="(?:"+ot+"(?:d|ll|m|re|s|t|ve))?",Et="(?:"+ot+"(?:D|LL|M|RE|S|T|VE))?",St="(?:"+ct+"|"+dt+")?",Ot="["+rt+"]?",Rt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",It=Ot+St+"(?:"+mt+"(?:"+[pt,gt,yt].join("|")+")"+Ot+St+")*",Ct="(?:"+[lt,gt,yt].join("|")+")"+It,Pt="(?:"+[pt+ct+"?",ct,gt,yt,st].join("|")+")",kt=RegExp(ot,"g"),Nt=RegExp(ct,"g"),At=RegExp(dt+"(?="+dt+")|"+Pt+It,"g"),Tt=RegExp([vt+"?"+ft+"+"+wt+"(?="+[at,vt,"$"].join("|")+")",bt+"+"+Et+"(?="+[at,vt+_t,"$"].join("|")+")",vt+"?"+_t+"+"+wt,vt+"+"+Et,xt,Rt,ut,Ct].join("|"),"g"),Mt=RegExp("["+mt+Xe+Ze+rt+"]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ut=["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"],jt=-1,Dt={};Dt[le]=Dt[fe]=Dt[he]=Dt[de]=Dt[pe]=Dt[ge]=Dt[ye]=Dt[ve]=Dt[me]=!0,Dt[B]=Dt[F]=Dt[ce]=Dt[$]=Dt[ue]=Dt[V]=Dt[W]=Dt[K]=Dt[Y]=Dt[Q]=Dt[X]=Dt[te]=Dt[ne]=Dt[re]=Dt[se]=!1;var zt={};zt[B]=zt[F]=zt[ce]=zt[ue]=zt[$]=zt[V]=zt[le]=zt[fe]=zt[he]=zt[de]=zt[pe]=zt[Y]=zt[Q]=zt[X]=zt[te]=zt[ne]=zt[re]=zt[ie]=zt[ge]=zt[ye]=zt[ve]=zt[me]=!0,zt[W]=zt[K]=zt[se]=!1;var Bt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Ft={"&":"&","<":"<",">":">",'"':""","'":"'"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'"},$t={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,qt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,Gt=Wt||Kt||Function("return this")(),Yt=yg&&!yg.nodeType&&yg,Qt=Yt&&gg&&!gg.nodeType&&gg,Jt=Qt&&Qt.exports===Yt,Xt=Jt&&Wt.process,Zt=function(){try{return Qt&&Qt.require&&Qt.require("util").types||Xt&&Xt.binding&&Xt.binding("util")}catch{}}(),en=Zt&&Zt.isArrayBuffer,tn=Zt&&Zt.isDate,nn=Zt&&Zt.isMap,rn=Zt&&Zt.isRegExp,on=Zt&&Zt.isSet,sn=Zt&&Zt.isTypedArray;function an(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cn(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function un(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ln(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function fn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function hn(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function dn(e,t){return!(null==e||!e.length)&&Rn(e,t,0)>-1}function pn(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function gn(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function yn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function vn(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function mn(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function _n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var bn=Pn("length");function wn(e){return e.split("")}function En(e){return e.match(ze)||[]}function Sn(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function On(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Rn(e,t,n){return t==t?tr(e,t,n):On(e,In,n)}function xn(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function In(e){return e!=e}function Cn(e,t){var n=null==e?0:e.length;return n?Tn(e,t)/n:L}function Pn(t){return function(n){return null==n?e:n[t]}}function kn(t){return function(n){return null==t?e:t[n]}}function Nn(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function An(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Tn(t,n){for(var r,i=-1,o=t.length;++i<o;){var s=n(t[i]);s!==e&&(r=r===e?s:r+s)}return r}function Mn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ln(e,t){return gn(t,(function(t){return[t,e[t]]}))}function Un(e){return e&&e.slice(0,or(e)+1).replace(Me,"")}function jn(e){return function(t){return e(t)}}function Dn(e,t){return gn(t,(function(t){return e[t]}))}function zn(e,t){return e.has(t)}function Bn(e,t){for(var n=-1,r=e.length;++n<r&&Rn(t,e[n],0)>-1;);return n}function Fn(e,t){for(var n=e.length;n--&&Rn(t,e[n],0)>-1;);return n}function Hn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var $n=kn(Bt),Vn=kn(Ft);function qn(e){return"\\"+$t[e]}function Wn(t,n){return null==t?e:t[n]}function Kn(e){return Mt.test(e)}function Gn(e){return Lt.test(e)}function Yn(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Qn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Jn(e,t){return function(n){return e(t(n))}}function Xn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===u)&&(e[n]=u,o[i++]=n)}return o}function Zn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function er(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function tr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function nr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function rr(e){return Kn(e)?ar(e):bn(e)}function ir(e){return Kn(e)?cr(e):wn(e)}function or(e){for(var t=e.length;t--&&Le.test(e.charAt(t)););return t}var sr=kn(Ht);function ar(e){for(var t=At.lastIndex=0;At.test(e);)++t;return t}function cr(e){return e.match(At)||[]}function ur(e){return e.match(Tt)||[]}var lr=function t(Le){var ze,Xe=(Le=null==Le?Gt:fr.defaults(Gt.Object(),Le,fr.pick(Gt,Ut))).Array,Ze=Le.Date,et=Le.Error,tt=Le.Function,nt=Le.Math,rt=Le.Object,it=Le.RegExp,ot=Le.String,st=Le.TypeError,at=Xe.prototype,ct=tt.prototype,ut=rt.prototype,lt=Le["__core-js_shared__"],ft=ct.toString,ht=ut.hasOwnProperty,dt=0,pt=(ze=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||""))?"Symbol(src)_1."+ze:"",gt=ut.toString,yt=ft.call(rt),vt=Gt._,mt=it("^"+ft.call(ht).replace(Ae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Jt?Le.Buffer:e,bt=Le.Symbol,wt=Le.Uint8Array,Et=_t?_t.allocUnsafe:e,St=Jn(rt.getPrototypeOf,rt),Ot=rt.create,Rt=ut.propertyIsEnumerable,xt=at.splice,It=bt?bt.isConcatSpreadable:e,Ct=bt?bt.iterator:e,Pt=bt?bt.toStringTag:e,At=function(){try{var e=Gs(rt,"defineProperty");return e({},"",{}),e}catch{}}(),Tt=Le.clearTimeout!==Gt.clearTimeout&&Le.clearTimeout,Mt=Ze&&Ze.now!==Gt.Date.now&&Ze.now,Lt=Le.setTimeout!==Gt.setTimeout&&Le.setTimeout,Bt=nt.ceil,Ft=nt.floor,Ht=rt.getOwnPropertySymbols,$t=_t?_t.isBuffer:e,Wt=Le.isFinite,Kt=at.join,Yt=Jn(rt.keys,rt),Qt=nt.max,Xt=nt.min,Zt=Ze.now,bn=Le.parseInt,wn=nt.random,kn=at.reverse,tr=Gs(Le,"DataView"),ar=Gs(Le,"Map"),cr=Gs(Le,"Promise"),lr=Gs(Le,"Set"),hr=Gs(Le,"WeakMap"),dr=Gs(rt,"create"),pr=hr&&new hr,gr={},yr=Ta(tr),vr=Ta(ar),mr=Ta(cr),_r=Ta(lr),br=Ta(hr),wr=bt?bt.prototype:e,Er=wr?wr.valueOf:e,Sr=wr?wr.toString:e;function Or(e){if(xl(e)&&!ul(e)&&!(e instanceof Cr)){if(e instanceof Ir)return e;if(ht.call(e,"__wrapped__"))return La(e)}return new Ir(e)}var Rr=function(){function t(){}return function(n){if(!Rl(n))return{};if(Ot)return Ot(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function xr(){}function Ir(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Cr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U,this.__views__=[]}function Pr(){var e=new Cr(this.__wrapped__);return e.__actions__=os(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=os(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=os(this.__views__),e}function kr(){if(this.__filtered__){var e=new Cr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e}function Nr(){var e=this.__wrapped__.value(),t=this.__dir__,n=ul(e),r=t<0,i=n?e.length:0,o=Zs(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=r?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=Xt(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return Bo(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var g=-1,y=e[u+=t];++g<f;){var v=l[g],m=v.iteratee,_=v.type,b=m(y);if(_==k)y=b;else if(!b){if(_==P)continue e;break e}}p[h++]=y}return p}function Ar(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Tr(){this.__data__=dr?dr(null):{},this.size=0}function Mr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Lr(t){var n=this.__data__;if(dr){var r=n[t];return r===a?e:r}return ht.call(n,t)?n[t]:e}function Ur(t){var n=this.__data__;return dr?n[t]!==e:ht.call(n,t)}function jr(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dr&&n===e?a:n,this}function Dr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zr(){this.__data__=[],this.size=0}function Br(e){var t=this.__data__,n=fi(t,e);return!(n<0||(n==t.length-1?t.pop():xt.call(t,n,1),--this.size,0))}function Fr(t){var n=this.__data__,r=fi(n,t);return r<0?e:n[r][1]}function Hr(e){return fi(this.__data__,e)>-1}function $r(e,t){var n=this.__data__,r=fi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Vr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qr(){this.size=0,this.__data__={hash:new Ar,map:new(ar||Dr),string:new Ar}}function Wr(e){var t=Ws(this,e).delete(e);return this.size-=t?1:0,t}function Kr(e){return Ws(this,e).get(e)}function Gr(e){return Ws(this,e).has(e)}function Yr(e,t){var n=Ws(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Qr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vr;++t<n;)this.add(e[t])}function Jr(e){return this.__data__.set(e,a),this}function Xr(e){return this.__data__.has(e)}function Zr(e){var t=this.__data__=new Dr(e);this.size=t.size}function ei(){this.__data__=new Dr,this.size=0}function ti(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ni(e){return this.__data__.get(e)}function ri(e){return this.__data__.has(e)}function ii(e,t){var n=this.__data__;if(n instanceof Dr){var i=n.__data__;if(!ar||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vr(i)}return n.set(e,t),this.size=n.size,this}function oi(e,t){var n=ul(e),r=!n&&cl(e),i=!n&&!r&&pl(e),o=!n&&!r&&!i&&Fl(e),s=n||r||i||o,a=s?Mn(e.length,ot):[],c=a.length;for(var u in e)(t||ht.call(e,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||aa(u,c)))&&a.push(u);return a}function si(t){var n=t.length;return n?t[_o(0,n-1)]:e}function ai(e,t){return ka(os(e),vi(t,0,e.length))}function ci(e){return ka(os(e))}function ui(t,n,r){(r!==e&&!ol(t[n],r)||r===e&&!(n in t))&&gi(t,n,r)}function li(t,n,r){var i=t[n];(!ht.call(t,n)||!ol(i,r)||r===e&&!(n in t))&&gi(t,n,r)}function fi(e,t){for(var n=e.length;n--;)if(ol(e[n][0],t))return n;return-1}function hi(e,t,n,r){return Si(e,(function(e,i,o){t(r,e,n(e),o)})),r}function di(e,t){return e&&ss(t,Of(t),e)}function pi(e,t){return e&&ss(t,Rf(t),e)}function gi(e,t,n){"__proto__"==t&&At?At(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function yi(t,n){for(var r=-1,i=n.length,o=Xe(i),s=null==t;++r<i;)o[r]=s?e:mf(t,n[r]);return o}function vi(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function mi(t,n,r,i,o,s){var a,c=n&l,u=n&f,d=n&h;if(r&&(a=o?r(t,i,o,s):r(t)),a!==e)return a;if(!Rl(t))return t;var p=ul(t);if(p){if(a=na(t),!c)return os(t,a)}else{var g=Xs(t),y=g==K||g==G;if(pl(t))return Yo(t,c);if(g==X||g==B||y&&!o){if(a=u||y?{}:ra(t),!c)return u?cs(t,pi(a,t)):as(t,di(a,t))}else{if(!zt[g])return o?t:{};a=ia(t,g,c)}}s||(s=new Zr);var v=s.get(t);if(v)return v;s.set(t,a),Dl(t)?t.forEach((function(e){a.add(mi(e,n,r,e,t,s))})):Il(t)&&t.forEach((function(e,i){a.set(i,mi(e,n,r,i,t,s))}));var m=p?e:(d?u?Fs:Bs:u?Rf:Of)(t);return un(m||t,(function(e,i){m&&(e=t[i=e]),li(a,i,mi(e,n,r,i,t,s))})),a}function _i(e){var t=Of(e);return function(n){return bi(n,e,t)}}function bi(t,n,r){var i=r.length;if(null==t)return!i;for(t=rt(t);i--;){var o=r[i],s=n[o],a=t[o];if(a===e&&!(o in t)||!s(a))return!1}return!0}function wi(t,n,r){if("function"!=typeof t)throw new st(o);return xa((function(){t.apply(e,r)}),n)}function Ei(e,t,n,i){var o=-1,s=dn,a=!0,c=e.length,u=[],l=t.length;if(!c)return u;n&&(t=gn(t,jn(n))),i?(s=pn,a=!1):t.length>=r&&(s=zn,a=!1,t=new Qr(t));e:for(;++o<c;){var f=e[o],h=null==n?f:n(f);if(f=i||0!==f?f:0,a&&h==h){for(var d=l;d--;)if(t[d]===h)continue e;u.push(f)}else s(t,h,i)||u.push(f)}return u}Or.templateSettings={escape:xe,evaluate:Ie,interpolate:Ce,variable:"",imports:{_:Or}},Or.prototype=xr.prototype,Or.prototype.constructor=Or,Ir.prototype=Rr(xr.prototype),Ir.prototype.constructor=Ir,Cr.prototype=Rr(xr.prototype),Cr.prototype.constructor=Cr,Ar.prototype.clear=Tr,Ar.prototype.delete=Mr,Ar.prototype.get=Lr,Ar.prototype.has=Ur,Ar.prototype.set=jr,Dr.prototype.clear=zr,Dr.prototype.delete=Br,Dr.prototype.get=Fr,Dr.prototype.has=Hr,Dr.prototype.set=$r,Vr.prototype.clear=qr,Vr.prototype.delete=Wr,Vr.prototype.get=Kr,Vr.prototype.has=Gr,Vr.prototype.set=Yr,Qr.prototype.add=Qr.prototype.push=Jr,Qr.prototype.has=Xr,Zr.prototype.clear=ei,Zr.prototype.delete=ti,Zr.prototype.get=ni,Zr.prototype.has=ri,Zr.prototype.set=ii;var Si=fs(Ai),Oi=fs(Ti,!0);function Ri(e,t){var n=!0;return Si(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function xi(t,n,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=n(s);if(null!=a&&(c===e?a==a&&!Bl(a):r(a,c)))var c=a,u=s}return u}function Ii(t,n,r,i){var o=t.length;for((r=Yl(r))<0&&(r=-r>o?0:o+r),(i=i===e||i>o?o:Yl(i))<0&&(i+=o),i=r>i?0:Ql(i);r<i;)t[r++]=n;return t}function Ci(e,t){var n=[];return Si(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Pi(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=sa),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?Pi(a,t-1,n,r,i):yn(i,a):r||(i[i.length]=a)}return i}var ki=hs(),Ni=hs(!0);function Ai(e,t){return e&&ki(e,t,Of)}function Ti(e,t){return e&&Ni(e,t,Of)}function Mi(e,t){return hn(t,(function(t){return El(e[t])}))}function Li(t,n){for(var r=0,i=(n=qo(n,t)).length;null!=t&&r<i;)t=t[Aa(n[r++])];return r&&r==i?t:e}function Ui(e,t,n){var r=t(e);return ul(e)?r:yn(r,n(e))}function ji(t){return null==t?t===e?oe:J:Pt&&Pt in rt(t)?Ys(t):ba(t)}function Di(e,t){return e>t}function zi(e,t){return null!=e&&ht.call(e,t)}function Bi(e,t){return null!=e&&t in rt(e)}function Fi(e,t,n){return e>=Xt(t,n)&&e<Qt(t,n)}function Hi(t,n,r){for(var i=r?pn:dn,o=t[0].length,s=t.length,a=s,c=Xe(s),u=1/0,l=[];a--;){var f=t[a];a&&n&&(f=gn(f,jn(n))),u=Xt(f.length,u),c[a]=!r&&(n||o>=120&&f.length>=120)?new Qr(a&&f):e}f=t[0];var h=-1,d=c[0];e:for(;++h<o&&l.length<u;){var p=f[h],g=n?n(p):p;if(p=r||0!==p?p:0,!(d?zn(d,g):i(l,g,r))){for(a=s;--a;){var y=c[a];if(!(y?zn(y,g):i(t[a],g,r)))continue e}d&&d.push(g),l.push(p)}}return l}function $i(e,t,n,r){return Ai(e,(function(e,i,o){t(r,n(e),i,o)})),r}function Vi(t,n,r){var i=null==(t=Ea(t,n=qo(n,t)))?t:t[Aa(sc(n))];return null==i?e:an(i,t,r)}function qi(e){return xl(e)&&ji(e)==B}function Wi(e){return xl(e)&&ji(e)==ce}function Ki(e){return xl(e)&&ji(e)==V}function Gi(e,t,n,r,i){return e===t||(null==e||null==t||!xl(e)&&!xl(t)?e!=e&&t!=t:Yi(e,t,n,r,Gi,i))}function Yi(e,t,n,r,i,o){var s=ul(e),a=ul(t),c=s?F:Xs(e),u=a?F:Xs(t),l=(c=c==B?X:c)==X,f=(u=u==B?X:u)==X,h=c==u;if(h&&pl(e)){if(!pl(t))return!1;s=!0,l=!1}if(h&&!l)return o||(o=new Zr),s||Fl(e)?Us(e,t,n,r,i,o):js(e,t,c,n,r,i,o);if(!(n&d)){var p=l&&ht.call(e,"__wrapped__"),g=f&&ht.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,v=g?t.value():t;return o||(o=new Zr),i(y,v,n,r,o)}}return!!h&&(o||(o=new Zr),Ds(e,t,n,r,i,o))}function Qi(e){return xl(e)&&Xs(e)==Y}function Ji(t,n,r,i){var o=r.length,s=o,a=!i;if(null==t)return!s;for(t=rt(t);o--;){var c=r[o];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<s;){var u=(c=r[o])[0],l=t[u],f=c[1];if(a&&c[2]){if(l===e&&!(u in t))return!1}else{var h=new Zr;if(i)var g=i(l,f,u,t,n,h);if(!(g===e?Gi(f,l,d|p,i,h):g))return!1}}return!0}function Xi(e){return!(!Rl(e)||ha(e))&&(El(e)?mt:We).test(Ta(e))}function Zi(e){return xl(e)&&ji(e)==te}function eo(e){return xl(e)&&Xs(e)==ne}function to(e){return xl(e)&&Ol(e.length)&&!!Dt[ji(e)]}function no(e){return"function"==typeof e?e:null==e?Ah:"object"==typeof e?ul(e)?co(e[0],e[1]):ao(e):qh(e)}function ro(e){if(!pa(e))return Yt(e);var t=[];for(var n in rt(e))ht.call(e,n)&&"constructor"!=n&&t.push(n);return t}function io(e){if(!Rl(e))return _a(e);var t=pa(e),n=[];for(var r in e)"constructor"==r&&(t||!ht.call(e,r))||n.push(r);return n}function oo(e,t){return e<t}function so(e,t){var n=-1,r=fl(e)?Xe(e.length):[];return Si(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function ao(e){var t=Ks(e);return 1==t.length&&t[0][2]?ya(t[0][0],t[0][1]):function(n){return n===e||Ji(n,e,t)}}function co(t,n){return ua(t)&&ga(n)?ya(Aa(t),n):function(r){var i=mf(r,t);return i===e&&i===n?bf(r,t):Gi(n,i,d|p)}}function uo(t,n,r,i,o){t!==n&&ki(n,(function(s,a){if(o||(o=new Zr),Rl(s))lo(t,n,a,r,uo,i,o);else{var c=i?i(Oa(t,a),s,a+"",t,n,o):e;c===e&&(c=s),ui(t,a,c)}}),Rf)}function lo(t,n,r,i,o,s,a){var c=Oa(t,r),u=Oa(n,r),l=a.get(u);if(l)ui(t,r,l);else{var f=s?s(c,u,r+"",t,n,a):e,h=f===e;if(h){var d=ul(u),p=!d&&pl(u),g=!d&&!p&&Fl(u);f=u,d||p||g?ul(c)?f=c:hl(c)?f=os(c):p?(h=!1,f=Yo(u,!0)):g?(h=!1,f=es(u,!0)):f=[]:Ll(u)||cl(u)?(f=c,cl(c)?f=Xl(c):(!Rl(c)||El(c))&&(f=ra(u))):h=!1}h&&(a.set(u,f),o(f,u,i,s,a),a.delete(u)),ui(t,r,f)}}function fo(t,n){var r=t.length;if(r)return aa(n+=n<0?r:0,r)?t[n]:e}function ho(e,t,n){t=t.length?gn(t,(function(e){return ul(e)?function(t){return Li(t,1===e.length?e[0]:e)}:e})):[Ah];var r=-1;t=gn(t,jn(qs()));var i=so(e,(function(e,n,i){var o=gn(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return An(i,(function(e,t){return ns(e,t,n)}))}function po(e,t){return go(e,t,(function(t,n){return bf(e,n)}))}function go(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=Li(e,s);n(a,s)&&Ro(o,qo(s,e),a)}return o}function yo(e){return function(t){return Li(t,e)}}function vo(e,t,n,r){var i=r?xn:Rn,o=-1,s=t.length,a=e;for(e===t&&(t=os(t)),n&&(a=gn(e,jn(n)));++o<s;)for(var c=0,u=t[o],l=n?n(u):u;(c=i(a,l,c,r))>-1;)a!==e&&xt.call(a,c,1),xt.call(e,c,1);return e}function mo(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;aa(i)?xt.call(e,i,1):jo(e,i)}}return e}function _o(e,t){return e+Ft(wn()*(t-e+1))}function bo(e,t,n,r){for(var i=-1,o=Qt(Bt((t-e)/(n||1)),0),s=Xe(o);o--;)s[r?o:++i]=e,e+=n;return s}function wo(e,t){var n="";if(!e||t<1||t>T)return n;do{t%2&&(n+=e),(t=Ft(t/2))&&(e+=e)}while(t);return n}function Eo(e,t){return Ia(wa(e,t,Ah),e+"")}function So(e){return si($f(e))}function Oo(e,t){var n=$f(e);return ka(n,vi(t,0,n.length))}function Ro(t,n,r,i){if(!Rl(t))return t;for(var o=-1,s=(n=qo(n,t)).length,a=s-1,c=t;null!=c&&++o<s;){var u=Aa(n[o]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var f=c[u];(l=i?i(f,u,c):e)===e&&(l=Rl(f)?f:aa(n[o+1])?[]:{})}li(c,u,l),c=c[u]}return t}var xo=pr?function(e,t){return pr.set(e,t),e}:Ah,Io=At?function(e,t){return At(e,"toString",{configurable:!0,enumerable:!1,value:Ch(t),writable:!0})}:Ah;function Co(e){return ka($f(e))}function Po(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Xe(i);++r<i;)o[r]=e[r+t];return o}function ko(e,t){var n;return Si(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function No(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=D){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!Bl(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return Ao(e,t,Ah,n)}function Ao(t,n,r,i){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(n=r(n))!=n,c=null===n,u=Bl(n),l=n===e;o<s;){var f=Ft((o+s)/2),h=r(t[f]),d=h!==e,p=null===h,g=h==h,y=Bl(h);if(a)var v=i||g;else v=l?g&&(i||d):c?g&&d&&(i||!p):u?g&&d&&!p&&(i||!y):!p&&!y&&(i?h<=n:h<n);v?o=f+1:s=f}return Xt(s,j)}function To(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!ol(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function Mo(e){return"number"==typeof e?e:Bl(e)?L:+e}function Lo(e){if("string"==typeof e)return e;if(ul(e))return gn(e,Lo)+"";if(Bl(e))return Sr?Sr.call(e):"";var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Uo(e,t,n){var i=-1,o=dn,s=e.length,a=!0,c=[],u=c;if(n)a=!1,o=pn;else if(s>=r){var l=t?null:ks(e);if(l)return Zn(l);a=!1,o=zn,u=new Qr}else u=t?[]:c;e:for(;++i<s;){var f=e[i],h=t?t(f):f;if(f=n||0!==f?f:0,a&&h==h){for(var d=u.length;d--;)if(u[d]===h)continue e;t&&u.push(h),c.push(f)}else o(u,h,n)||(u!==c&&u.push(h),c.push(f))}return c}function jo(e,t){return null==(e=Ea(e,t=qo(t,e)))||delete e[Aa(sc(t))]}function Do(e,t,n,r){return Ro(e,t,n(Li(e,t)),r)}function zo(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Po(e,r?0:o,r?o+1:i):Po(e,r?o+1:0,r?i:o)}function Bo(e,t){var n=e;return n instanceof Cr&&(n=n.value()),vn(t,(function(e,t){return t.func.apply(t.thisArg,yn([e],t.args))}),n)}function Fo(e,t,n){var r=e.length;if(r<2)return r?Uo(e[0]):[];for(var i=-1,o=Xe(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=Ei(o[i]||s,e[a],t,n));return Uo(Pi(o,1),t,n)}function Ho(t,n,r){for(var i=-1,o=t.length,s=n.length,a={};++i<o;){var c=i<s?n[i]:e;r(a,t[i],c)}return a}function $o(e){return hl(e)?e:[]}function Vo(e){return"function"==typeof e?e:Ah}function qo(e,t){return ul(e)?e:ua(e,t)?[e]:Na(ef(e))}var Wo=Eo;function Ko(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:Po(t,n,r)}var Go=Tt||function(e){return Gt.clearTimeout(e)};function Yo(e,t){if(t)return e.slice();var n=e.length,r=Et?Et(n):new e.constructor(n);return e.copy(r),r}function Qo(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Jo(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Xo(e){var t=new e.constructor(e.source,$e.exec(e));return t.lastIndex=e.lastIndex,t}function Zo(e){return Er?rt(Er.call(e)):{}}function es(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ts(t,n){if(t!==n){var r=t!==e,i=null===t,o=t==t,s=Bl(t),a=n!==e,c=null===n,u=n==n,l=Bl(n);if(!c&&!l&&!s&&t>n||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&t<n||l&&r&&o&&!i&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}function ns(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var c=ts(i[r],o[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}function rs(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,c=t.length,u=Qt(o-s,0),l=Xe(c+u),f=!r;++a<c;)l[a]=t[a];for(;++i<s;)(f||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[a++]=e[i++];return l}function is(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,c=-1,u=t.length,l=Qt(o-a,0),f=Xe(l+u),h=!r;++i<l;)f[i]=e[i];for(var d=i;++c<u;)f[d+c]=t[c];for(;++s<a;)(h||i<o)&&(f[d+n[s]]=e[i++]);return f}function os(e,t){var n=-1,r=e.length;for(t||(t=Xe(r));++n<r;)t[n]=e[n];return t}function ss(t,n,r,i){var o=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var c=n[s],u=i?i(r[c],t[c],c,r,t):e;u===e&&(u=t[c]),o?gi(r,c,u):li(r,c,u)}return r}function as(e,t){return ss(e,Qs(e),t)}function cs(e,t){return ss(e,Js(e),t)}function us(e,t){return function(n,r){var i=ul(n)?cn:hi,o=t?t():{};return i(n,e,qs(r,2),o)}}function ls(t){return Eo((function(n,r){var i=-1,o=r.length,s=o>1?r[o-1]:e,a=o>2?r[2]:e;for(s=t.length>3&&"function"==typeof s?(o--,s):e,a&&ca(r[0],r[1],a)&&(s=o<3?e:s,o=1),n=rt(n);++i<o;){var c=r[i];c&&t(n,c,i,s)}return n}))}function fs(e,t){return function(n,r){if(null==n)return n;if(!fl(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=rt(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function hs(e){return function(t,n,r){for(var i=-1,o=rt(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}function ds(e,t,n){var r=t&g,i=ys(e);function o(){return(this&&this!==Gt&&this instanceof o?i:e).apply(r?n:this,arguments)}return o}function ps(t){return function(n){var r=Kn(n=ef(n))?ir(n):e,i=r?r[0]:n.charAt(0),o=r?Ko(r,1).join(""):n.slice(1);return i[t]()+o}}function gs(e){return function(t){return vn(Sh(Qf(t).replace(kt,"")),e,"")}}function ys(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Rr(e.prototype),r=e.apply(n,t);return Rl(r)?r:n}}function vs(t,n,r){var i=ys(t);function o(){for(var s=arguments.length,a=Xe(s),c=s,u=Vs(o);c--;)a[c]=arguments[c];var l=s<3&&a[0]!==u&&a[s-1]!==u?[]:Xn(a,u);return(s-=l.length)<r?Cs(t,n,bs,o.placeholder,e,a,l,e,e,r-s):an(this&&this!==Gt&&this instanceof o?i:t,this,a)}return o}function ms(t){return function(n,r,i){var o=rt(n);if(!fl(n)){var s=qs(r,3);n=Of(n),r=function(e){return s(o[e],e,o)}}var a=t(n,r,i);return a>-1?o[s?n[a]:a]:e}}function _s(t){return zs((function(n){var r=n.length,i=r,s=Ir.prototype.thru;for(t&&n.reverse();i--;){var a=n[i];if("function"!=typeof a)throw new st(o);if(s&&!c&&"wrapper"==$s(a))var c=new Ir([],!0)}for(i=c?i:r;++i<r;){var u=$s(a=n[i]),l="wrapper"==u?Hs(a):e;c=l&&fa(l[0])&&l[1]==(E|m|b|S)&&!l[4].length&&1==l[9]?c[$s(l[0])].apply(c,l[3]):1==a.length&&fa(a)?c[u]():c.thru(a)}return function(){var e=arguments,t=e[0];if(c&&1==e.length&&ul(t))return c.plant(t).value();for(var i=0,o=r?n[i].apply(this,e):t;++i<r;)o=n[i].call(this,o);return o}}))}function bs(t,n,r,i,o,s,a,c,u,l){var f=n&E,h=n&g,d=n&y,p=n&(m|_),v=n&O,b=d?e:ys(t);function w(){for(var e=arguments.length,g=Xe(e),y=e;y--;)g[y]=arguments[y];if(p)var m=Vs(w),_=Hn(g,m);if(i&&(g=rs(g,i,o,p)),s&&(g=is(g,s,a,p)),e-=_,p&&e<l){var E=Xn(g,m);return Cs(t,n,bs,w.placeholder,r,g,E,c,u,l-e)}var S=h?r:this,O=d?S[t]:t;return e=g.length,c?g=Sa(g,c):v&&e>1&&g.reverse(),f&&u<e&&(g.length=u),this&&this!==Gt&&this instanceof w&&(O=b||ys(O)),O.apply(S,g)}return w}function ws(e,t){return function(n,r){return $i(n,e,t(r),{})}}function Es(t,n){return function(r,i){var o;if(r===e&&i===e)return n;if(r!==e&&(o=r),i!==e){if(o===e)return i;"string"==typeof r||"string"==typeof i?(r=Lo(r),i=Lo(i)):(r=Mo(r),i=Mo(i)),o=t(r,i)}return o}}function Ss(e){return zs((function(t){return t=gn(t,jn(qs())),Eo((function(n){var r=this;return e(t,(function(e){return an(e,r,n)}))}))}))}function Os(t,n){var r=(n=n===e?" ":Lo(n)).length;if(r<2)return r?wo(n,t):n;var i=wo(n,Bt(t/rr(n)));return Kn(n)?Ko(ir(i),0,t).join(""):i.slice(0,t)}function Rs(e,t,n,r){var i=t&g,o=ys(e);function s(){for(var t=-1,a=arguments.length,c=-1,u=r.length,l=Xe(u+a),f=this&&this!==Gt&&this instanceof s?o:e;++c<u;)l[c]=r[c];for(;a--;)l[c++]=arguments[++t];return an(f,i?n:this,l)}return s}function xs(t){return function(n,r,i){return i&&"number"!=typeof i&&ca(n,r,i)&&(r=i=e),n=Gl(n),r===e?(r=n,n=0):r=Gl(r),bo(n,r,i=i===e?n<r?1:-1:Gl(i),t)}}function Is(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Jl(t),n=Jl(n)),e(t,n)}}function Cs(t,n,r,i,o,s,a,c,u,l){var f=n&m;n|=f?b:w,(n&=~(f?w:b))&v||(n&=~(g|y));var h=[t,n,o,f?s:e,f?a:e,f?e:s,f?e:a,c,u,l],d=r.apply(e,h);return fa(t)&&Ra(d,h),d.placeholder=i,Ca(d,t,n)}function Ps(e){var t=nt[e];return function(e,n){if(e=Jl(e),(n=null==n?0:Xt(Yl(n),292))&&Wt(e)){var r=(ef(e)+"e").split("e");return+((r=(ef(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var ks=lr&&1/Zn(new lr([,-0]))[1]==A?function(e){return new lr(e)}:Bh;function Ns(e){return function(t){var n=Xs(t);return n==Y?Qn(t):n==ne?er(t):Ln(t,e(t))}}function As(t,n,r,i,s,a,c,u){var l=n&y;if(!l&&"function"!=typeof t)throw new st(o);var f=i?i.length:0;if(f||(n&=~(b|w),i=s=e),c=c===e?c:Qt(Yl(c),0),u=u===e?u:Yl(u),f-=s?s.length:0,n&w){var h=i,d=s;i=s=e}var p=l?e:Hs(t),v=[t,n,r,i,s,h,d,a,c,u];if(p&&ma(v,p),t=v[0],n=v[1],r=v[2],i=v[3],s=v[4],!(u=v[9]=v[9]===e?l?0:t.length:Qt(v[9]-f,0))&&n&(m|_)&&(n&=~(m|_)),n&&n!=g)E=n==m||n==_?vs(t,n,u):n!=b&&n!=(g|b)||s.length?bs.apply(e,v):Rs(t,n,r,i);else var E=ds(t,n,r);return Ca((p?xo:Ra)(E,v),t,n)}function Ts(t,n,r,i){return t===e||ol(t,ut[r])&&!ht.call(i,r)?n:t}function Ms(t,n,r,i,o,s){return Rl(t)&&Rl(n)&&(s.set(n,t),uo(t,n,e,Ms,s),s.delete(n)),t}function Ls(t){return Ll(t)?e:t}function Us(t,n,r,i,o,s){var a=r&d,c=t.length,u=n.length;if(c!=u&&!(a&&u>c))return!1;var l=s.get(t),f=s.get(n);if(l&&f)return l==n&&f==t;var h=-1,g=!0,y=r&p?new Qr:e;for(s.set(t,n),s.set(n,t);++h<c;){var v=t[h],m=n[h];if(i)var _=a?i(m,v,h,n,t,s):i(v,m,h,t,n,s);if(_!==e){if(_)continue;g=!1;break}if(y){if(!_n(n,(function(e,t){if(!zn(y,t)&&(v===e||o(v,e,r,i,s)))return y.push(t)}))){g=!1;break}}else if(v!==m&&!o(v,m,r,i,s)){g=!1;break}}return s.delete(t),s.delete(n),g}function js(e,t,n,r,i,o,s){switch(n){case ue:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ce:return!(e.byteLength!=t.byteLength||!o(new wt(e),new wt(t)));case $:case V:case Q:return ol(+e,+t);case W:return e.name==t.name&&e.message==t.message;case te:case re:return e==t+"";case Y:var a=Qn;case ne:var c=r&d;if(a||(a=Zn),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=p,s.set(e,t);var l=Us(a(e),a(t),r,i,o,s);return s.delete(e),l;case ie:if(Er)return Er.call(e)==Er.call(t)}return!1}function Ds(t,n,r,i,o,s){var a=r&d,c=Bs(t),u=c.length;if(u!=Bs(n).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in n:ht.call(n,f)))return!1}var h=s.get(t),p=s.get(n);if(h&&p)return h==n&&p==t;var g=!0;s.set(t,n),s.set(n,t);for(var y=a;++l<u;){var v=t[f=c[l]],m=n[f];if(i)var _=a?i(m,v,f,n,t,s):i(v,m,f,t,n,s);if(!(_===e?v===m||o(v,m,r,i,s):_)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=t.constructor,w=n.constructor;b!=w&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(n),g}function zs(t){return Ia(wa(t,e,Ya),t+"")}function Bs(e){return Ui(e,Of,Qs)}function Fs(e){return Ui(e,Rf,Js)}var Hs=pr?function(e){return pr.get(e)}:Bh;function $s(e){for(var t=e.name+"",n=gr[t],r=ht.call(gr,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Vs(e){return(ht.call(Or,"placeholder")?Or:e).placeholder}function qs(){var e=Or.iteratee||Th;return e=e===Th?no:e,arguments.length?e(arguments[0],arguments[1]):e}function Ws(e,t){var n=e.__data__;return la(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ks(e){for(var t=Of(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ga(i)]}return t}function Gs(t,n){var r=Wn(t,n);return Xi(r)?r:e}function Ys(t){var n=ht.call(t,Pt),r=t[Pt];try{t[Pt]=e;var i=!0}catch{}var o=gt.call(t);return i&&(n?t[Pt]=r:delete t[Pt]),o}var Qs=Ht?function(e){return null==e?[]:(e=rt(e),hn(Ht(e),(function(t){return Rt.call(e,t)})))}:Yh,Js=Ht?function(e){for(var t=[];e;)yn(t,Qs(e)),e=St(e);return t}:Yh,Xs=ji;function Zs(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=Xt(t,e+s);break;case"takeRight":e=Qt(e,t-s)}}return{start:e,end:t}}function ea(e){var t=e.match(je);return t?t[1].split(De):[]}function ta(e,t,n){for(var r=-1,i=(t=qo(t,e)).length,o=!1;++r<i;){var s=Aa(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ol(i)&&aa(s,i)&&(ul(e)||cl(e))}function na(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ht.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ra(e){return"function"!=typeof e.constructor||pa(e)?{}:Rr(St(e))}function ia(e,t,n){var r=e.constructor;switch(t){case ce:return Qo(e);case $:case V:return new r(+e);case ue:return Jo(e,n);case le:case fe:case he:case de:case pe:case ge:case ye:case ve:case me:return es(e,n);case Y:return new r;case Q:case re:return new r(e);case te:return Xo(e);case ne:return new r;case ie:return Zo(e)}}function oa(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ue,"{\n/* [wrapped with "+t+"] */\n")}function sa(e){return ul(e)||cl(e)||!!(It&&e&&e[It])}function aa(e,t){var n=typeof e;return!!(t=t??T)&&("number"==n||"symbol"!=n&&Ge.test(e))&&e>-1&&e%1==0&&e<t}function ca(e,t,n){if(!Rl(n))return!1;var r=typeof t;return!!("number"==r?fl(n)&&aa(t,n.length):"string"==r&&t in n)&&ol(n[t],e)}function ua(e,t){if(ul(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Bl(e))||ke.test(e)||!Pe.test(e)||null!=t&&e in rt(t)}function la(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function fa(e){var t=$s(e),n=Or[t];if("function"!=typeof n||!(t in Cr.prototype))return!1;if(e===n)return!0;var r=Hs(n);return!!r&&e===r[0]}function ha(e){return!!pt&&pt in e}(tr&&Xs(new tr(new ArrayBuffer(1)))!=ue||ar&&Xs(new ar)!=Y||cr&&Xs(cr.resolve())!=Z||lr&&Xs(new lr)!=ne||hr&&Xs(new hr)!=se)&&(Xs=function(t){var n=ji(t),r=n==X?t.constructor:e,i=r?Ta(r):"";if(i)switch(i){case yr:return ue;case vr:return Y;case mr:return Z;case _r:return ne;case br:return se}return n});var da=lt?El:Qh;function pa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ut)}function ga(e){return e==e&&!Rl(e)}function ya(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in rt(r))}}function va(e){var t=Fu(e,(function(e){return n.size===c&&n.clear(),e})),n=t.cache;return t}function ma(e,t){var n=e[1],r=t[1],i=n|r,o=i<(g|y|E),s=r==E&&n==m||r==E&&n==S&&e[7].length<=t[8]||r==(E|S)&&t[7].length<=t[8]&&n==m;if(!o&&!s)return e;r&g&&(e[2]=t[2],i|=n&g?0:v);var a=t[3];if(a){var c=e[3];e[3]=c?rs(c,a,t[4]):a,e[4]=c?Xn(e[3],u):t[4]}return(a=t[5])&&(c=e[5],e[5]=c?is(c,a,t[6]):a,e[6]=c?Xn(e[5],u):t[6]),(a=t[7])&&(e[7]=a),r&E&&(e[8]=null==e[8]?t[8]:Xt(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}function _a(e){var t=[];if(null!=e)for(var n in rt(e))t.push(n);return t}function ba(e){return gt.call(e)}function wa(t,n,r){return n=Qt(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,o=Qt(e.length-n,0),s=Xe(o);++i<o;)s[i]=e[n+i];i=-1;for(var a=Xe(n+1);++i<n;)a[i]=e[i];return a[n]=r(s),an(t,this,a)}}function Ea(e,t){return t.length<2?e:Li(e,Po(t,0,-1))}function Sa(t,n){for(var r=t.length,i=Xt(n.length,r),o=os(t);i--;){var s=n[i];t[i]=aa(s,r)?o[s]:e}return t}function Oa(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ra=Pa(xo),xa=Lt||function(e,t){return Gt.setTimeout(e,t)},Ia=Pa(Io);function Ca(e,t,n){var r=t+"";return Ia(e,oa(r,Ma(ea(r),n)))}function Pa(t){var n=0,r=0;return function(){var i=Zt(),o=C-(i-r);if(r=i,o>0){if(++n>=I)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ka(t,n){var r=-1,i=t.length,o=i-1;for(n=n===e?i:n;++r<n;){var s=_o(r,o),a=t[s];t[s]=t[r],t[r]=a}return t.length=n,t}var Na=va((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ne,(function(e,n,r,i){t.push(r?i.replace(Fe,"$1"):n||e)})),t}));function Aa(e){if("string"==typeof e||Bl(e))return e;var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Ta(e){if(null!=e){try{return ft.call(e)}catch{}try{return e+""}catch{}}return""}function Ma(e,t){return un(z,(function(n){var r="_."+n[0];t&n[1]&&!dn(e,r)&&e.push(r)})),e.sort()}function La(e){if(e instanceof Cr)return e.clone();var t=new Ir(e.__wrapped__,e.__chain__);return t.__actions__=os(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Ua(t,n,r){n=(r?ca(t,n,r):n===e)?1:Qt(Yl(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,s=0,a=Xe(Bt(i/n));o<i;)a[s++]=Po(t,o,o+=n);return a}function ja(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}function Da(){var e=arguments.length;if(!e)return[];for(var t=Xe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return yn(ul(n)?os(n):[n],Pi(t,1))}var za=Eo((function(e,t){return hl(e)?Ei(e,Pi(t,1,hl,!0)):[]})),Ba=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),qs(r,2)):[]})),Fa=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),e,r):[]}));function Ha(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=r||n===e?1:Yl(n))<0?0:n,i):[]}function $a(t,n,r){var i=null==t?0:t.length;return i?Po(t,0,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n):[]}function Va(e,t){return e&&e.length?zo(e,qs(t,3),!0,!0):[]}function qa(e,t){return e&&e.length?zo(e,qs(t,3),!0):[]}function Wa(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ca(e,t,n)&&(n=0,r=i),Ii(e,t,n,r)):[]}function Ka(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),On(e,qs(t,3),i)}function Ga(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==e&&(o=Yl(r),o=r<0?Qt(i+o,0):Xt(o,i-1)),On(t,qs(n,3),o,!0)}function Ya(e){return null!=e&&e.length?Pi(e,1):[]}function Qa(e){return null!=e&&e.length?Pi(e,A):[]}function Ja(t,n){return null!=t&&t.length?Pi(t,n=n===e?1:Yl(n)):[]}function Xa(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}function Za(t){return t&&t.length?t[0]:e}function ec(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),Rn(e,t,i)}function tc(e){return null!=e&&e.length?Po(e,0,-1):[]}var nc=Eo((function(e){var t=gn(e,$o);return t.length&&t[0]===e[0]?Hi(t):[]})),rc=Eo((function(t){var n=sc(t),r=gn(t,$o);return n===sc(r)?n=e:r.pop(),r.length&&r[0]===t[0]?Hi(r,qs(n,2)):[]})),ic=Eo((function(t){var n=sc(t),r=gn(t,$o);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?Hi(r,e,n):[]}));function oc(e,t){return null==e?"":Kt.call(e,t)}function sc(t){var n=null==t?0:t.length;return n?t[n-1]:e}function ac(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==e&&(o=(o=Yl(r))<0?Qt(i+o,0):Xt(o,i-1)),n==n?nr(t,n,o):On(t,In,o,!0)}function cc(t,n){return t&&t.length?fo(t,Yl(n)):e}var uc=Eo(lc);function lc(e,t){return e&&e.length&&t&&t.length?vo(e,t):e}function fc(e,t,n){return e&&e.length&&t&&t.length?vo(e,t,qs(n,2)):e}function hc(t,n,r){return t&&t.length&&n&&n.length?vo(t,n,e,r):t}var dc=zs((function(e,t){var n=null==e?0:e.length,r=yi(e,t);return mo(e,gn(t,(function(e){return aa(e,n)?+e:e})).sort(ts)),r}));function pc(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=qs(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return mo(e,i),n}function gc(e){return null==e?e:kn.call(e)}function yc(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&ca(t,n,r)?(n=0,r=i):(n=null==n?0:Yl(n),r=r===e?i:Yl(r)),Po(t,n,r)):[]}function vc(e,t){return No(e,t)}function mc(e,t,n){return Ao(e,t,qs(n,2))}function _c(e,t){var n=null==e?0:e.length;if(n){var r=No(e,t);if(r<n&&ol(e[r],t))return r}return-1}function bc(e,t){return No(e,t,!0)}function wc(e,t,n){return Ao(e,t,qs(n,2),!0)}function Ec(e,t){if(null!=e&&e.length){var n=No(e,t,!0)-1;if(ol(e[n],t))return n}return-1}function Sc(e){return e&&e.length?To(e):[]}function Oc(e,t){return e&&e.length?To(e,qs(t,2)):[]}function Rc(e){var t=null==e?0:e.length;return t?Po(e,1,t):[]}function xc(t,n,r){return t&&t.length?Po(t,0,(n=r||n===e?1:Yl(n))<0?0:n):[]}function Ic(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n,i):[]}function Cc(e,t){return e&&e.length?zo(e,qs(t,3),!1,!0):[]}function Pc(e,t){return e&&e.length?zo(e,qs(t,3)):[]}var kc=Eo((function(e){return Uo(Pi(e,1,hl,!0))})),Nc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Uo(Pi(t,1,hl,!0),qs(n,2))})),Ac=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Uo(Pi(t,1,hl,!0),e,n)}));function Tc(e){return e&&e.length?Uo(e):[]}function Mc(e,t){return e&&e.length?Uo(e,qs(t,2)):[]}function Lc(t,n){return n="function"==typeof n?n:e,t&&t.length?Uo(t,e,n):[]}function Uc(e){if(!e||!e.length)return[];var t=0;return e=hn(e,(function(e){if(hl(e))return t=Qt(e.length,t),!0})),Mn(t,(function(t){return gn(e,Pn(t))}))}function jc(t,n){if(!t||!t.length)return[];var r=Uc(t);return null==n?r:gn(r,(function(t){return an(n,e,t)}))}var Dc=Eo((function(e,t){return hl(e)?Ei(e,t):[]})),zc=Eo((function(e){return Fo(hn(e,hl))})),Bc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Fo(hn(t,hl),qs(n,2))})),Fc=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Fo(hn(t,hl),e,n)})),Hc=Eo(Uc);function $c(e,t){return Ho(e||[],t||[],li)}function Vc(e,t){return Ho(e||[],t||[],Ro)}var qc=Eo((function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,jc(t,r)}));function Wc(e){var t=Or(e);return t.__chain__=!0,t}function Kc(e,t){return t(e),e}function Gc(e,t){return t(e)}var Yc=zs((function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,o=function(e){return yi(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Cr&&aa(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:Gc,args:[o],thisArg:e}),new Ir(i,this.__chain__).thru((function(t){return n&&!t.length&&t.push(e),t}))):this.thru(o)}));function Qc(){return Wc(this)}function Jc(){return new Ir(this.value(),this.__chain__)}function Xc(){this.__values__===e&&(this.__values__=Kl(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}}function Zc(){return this}function eu(t){for(var n,r=this;r instanceof xr;){var i=La(r);i.__index__=0,i.__values__=e,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,n}function tu(){var t=this.__wrapped__;if(t instanceof Cr){var n=t;return this.__actions__.length&&(n=new Cr(this)),(n=n.reverse()).__actions__.push({func:Gc,args:[gc],thisArg:e}),new Ir(n,this.__chain__)}return this.thru(gc)}function nu(){return Bo(this.__wrapped__,this.__actions__)}var ru=us((function(e,t,n){ht.call(e,n)?++e[n]:gi(e,n,1)}));function iu(t,n,r){var i=ul(t)?fn:Ri;return r&&ca(t,n,r)&&(n=e),i(t,qs(n,3))}function ou(e,t){return(ul(e)?hn:Ci)(e,qs(t,3))}var su=ms(Ka),au=ms(Ga);function cu(e,t){return Pi(vu(e,t),1)}function uu(e,t){return Pi(vu(e,t),A)}function lu(t,n,r){return r=r===e?1:Yl(r),Pi(vu(t,n),r)}function fu(e,t){return(ul(e)?un:Si)(e,qs(t,3))}function hu(e,t){return(ul(e)?ln:Oi)(e,qs(t,3))}var du=us((function(e,t,n){ht.call(e,n)?e[n].push(t):gi(e,n,[t])}));function pu(e,t,n,r){e=fl(e)?e:$f(e),n=n&&!r?Yl(n):0;var i=e.length;return n<0&&(n=Qt(i+n,0)),zl(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Rn(e,t,n)>-1}var gu=Eo((function(e,t,n){var r=-1,i="function"==typeof t,o=fl(e)?Xe(e.length):[];return Si(e,(function(e){o[++r]=i?an(t,e,n):Vi(e,t,n)})),o})),yu=us((function(e,t,n){gi(e,n,t)}));function vu(e,t){return(ul(e)?gn:so)(e,qs(t,3))}function mu(t,n,r,i){return null==t?[]:(ul(n)||(n=null==n?[]:[n]),ul(r=i?e:r)||(r=null==r?[]:[r]),ho(t,n,r))}var _u=us((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function bu(e,t,n){var r=ul(e)?vn:Nn,i=arguments.length<3;return r(e,qs(t,4),n,i,Si)}function wu(e,t,n){var r=ul(e)?mn:Nn,i=arguments.length<3;return r(e,qs(t,4),n,i,Oi)}function Eu(e,t){return(ul(e)?hn:Ci)(e,Hu(qs(t,3)))}function Su(e){return(ul(e)?si:So)(e)}function Ou(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),(ul(t)?ai:Oo)(t,n)}function Ru(e){return(ul(e)?ci:Co)(e)}function xu(e){if(null==e)return 0;if(fl(e))return zl(e)?rr(e):e.length;var t=Xs(e);return t==Y||t==ne?e.size:ro(e).length}function Iu(t,n,r){var i=ul(t)?_n:ko;return r&&ca(t,n,r)&&(n=e),i(t,qs(n,3))}var Cu=Eo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ca(e,t[0],t[1])?t=[]:n>2&&ca(t[0],t[1],t[2])&&(t=[t[0]]),ho(e,Pi(t,1),[])})),Pu=Mt||function(){return Gt.Date.now()};function ku(e,t){if("function"!=typeof t)throw new st(o);return e=Yl(e),function(){if(--e<1)return t.apply(this,arguments)}}function Nu(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,As(t,E,e,e,e,e,n)}function Au(t,n){var r;if("function"!=typeof n)throw new st(o);return t=Yl(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=e),r}}var Tu=Eo((function(e,t,n){var r=g;if(n.length){var i=Xn(n,Vs(Tu));r|=b}return As(e,r,t,n,i)})),Mu=Eo((function(e,t,n){var r=g|y;if(n.length){var i=Xn(n,Vs(Mu));r|=b}return As(t,r,e,n,i)}));function Lu(t,n,r){var i=As(t,m,e,e,e,e,e,n=r?e:n);return i.placeholder=Lu.placeholder,i}function Uu(t,n,r){var i=As(t,_,e,e,e,e,e,n=r?e:n);return i.placeholder=Uu.placeholder,i}function ju(t,n,r){var i,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new st(o);function g(n){var r=i,o=s;return i=s=e,f=n,c=t.apply(o,r)}function y(e){return f=e,u=xa(_,n),h?g(e):c}function v(e){var t=n-(e-l);return d?Xt(t,a-(e-f)):t}function m(t){var r=t-l;return l===e||r>=n||r<0||d&&t-f>=a}function _(){var e=Pu();if(m(e))return b(e);u=xa(_,v(e))}function b(t){return u=e,p&&i?g(t):(i=s=e,c)}function w(){u!==e&&Go(u),f=0,i=l=s=u=e}function E(){return u===e?c:b(Pu())}function S(){var t=Pu(),r=m(t);if(i=arguments,s=this,l=t,r){if(u===e)return y(l);if(d)return Go(u),u=xa(_,n),g(l)}return u===e&&(u=xa(_,n)),c}return n=Jl(n)||0,Rl(r)&&(h=!!r.leading,a=(d="maxWait"in r)?Qt(Jl(r.maxWait)||0,n):a,p="trailing"in r?!!r.trailing:p),S.cancel=w,S.flush=E,S}var Du=Eo((function(e,t){return wi(e,1,t)})),zu=Eo((function(e,t,n){return wi(e,Jl(t)||0,n)}));function Bu(e){return As(e,O)}function Fu(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new st(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Fu.Cache||Vr),n}function Hu(e){if("function"!=typeof e)throw new st(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function $u(e){return Au(2,e)}Fu.Cache=Vr;var Vu=Wo((function(e,t){var n=(t=1==t.length&&ul(t[0])?gn(t[0],jn(qs())):gn(Pi(t,1),jn(qs()))).length;return Eo((function(r){for(var i=-1,o=Xt(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return an(e,this,r)}))})),qu=Eo((function(t,n){var r=Xn(n,Vs(qu));return As(t,b,e,n,r)})),Wu=Eo((function(t,n){var r=Xn(n,Vs(Wu));return As(t,w,e,n,r)})),Ku=zs((function(t,n){return As(t,S,e,e,e,n)}));function Gu(t,n){if("function"!=typeof t)throw new st(o);return Eo(t,n=n===e?n:Yl(n))}function Yu(e,t){if("function"!=typeof e)throw new st(o);return t=null==t?0:Qt(Yl(t),0),Eo((function(n){var r=n[t],i=Ko(n,0,t);return r&&yn(i,r),an(e,this,i)}))}function Qu(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new st(o);return Rl(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ju(e,t,{leading:r,maxWait:t,trailing:i})}function Ju(e){return Nu(e,1)}function Xu(e,t){return qu(Vo(t),e)}function Zu(){if(!arguments.length)return[];var e=arguments[0];return ul(e)?e:[e]}function el(e){return mi(e,h)}function tl(t,n){return mi(t,h,n="function"==typeof n?n:e)}function nl(e){return mi(e,l|h)}function rl(t,n){return mi(t,l|h,n="function"==typeof n?n:e)}function il(e,t){return null==t||bi(e,t,Of(t))}function ol(e,t){return e===t||e!=e&&t!=t}var sl=Is(Di),al=Is((function(e,t){return e>=t})),cl=qi(function(){return arguments}())?qi:function(e){return xl(e)&&ht.call(e,"callee")&&!Rt.call(e,"callee")},ul=Xe.isArray,ll=en?jn(en):Wi;function fl(e){return null!=e&&Ol(e.length)&&!El(e)}function hl(e){return xl(e)&&fl(e)}function dl(e){return!0===e||!1===e||xl(e)&&ji(e)==$}var pl=$t||Qh,gl=tn?jn(tn):Ki;function yl(e){return xl(e)&&1===e.nodeType&&!Ll(e)}function vl(e){if(null==e)return!0;if(fl(e)&&(ul(e)||"string"==typeof e||"function"==typeof e.splice||pl(e)||Fl(e)||cl(e)))return!e.length;var t=Xs(e);if(t==Y||t==ne)return!e.size;if(pa(e))return!ro(e).length;for(var n in e)if(ht.call(e,n))return!1;return!0}function ml(e,t){return Gi(e,t)}function _l(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Gi(t,n,e,r):!!i}function bl(e){if(!xl(e))return!1;var t=ji(e);return t==W||t==q||"string"==typeof e.message&&"string"==typeof e.name&&!Ll(e)}function wl(e){return"number"==typeof e&&Wt(e)}function El(e){if(!Rl(e))return!1;var t=ji(e);return t==K||t==G||t==H||t==ee}function Sl(e){return"number"==typeof e&&e==Yl(e)}function Ol(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=T}function Rl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xl(e){return null!=e&&"object"==typeof e}var Il=nn?jn(nn):Qi;function Cl(e,t){return e===t||Ji(e,t,Ks(t))}function Pl(t,n,r){return r="function"==typeof r?r:e,Ji(t,n,Ks(n),r)}function kl(e){return Ml(e)&&e!=+e}function Nl(e){if(da(e))throw new et(i);return Xi(e)}function Al(e){return null===e}function Tl(e){return null==e}function Ml(e){return"number"==typeof e||xl(e)&&ji(e)==Q}function Ll(e){if(!xl(e)||ji(e)!=X)return!1;var t=St(e);if(null===t)return!0;var n=ht.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ft.call(n)==yt}var Ul=rn?jn(rn):Zi;function jl(e){return Sl(e)&&e>=-T&&e<=T}var Dl=on?jn(on):eo;function zl(e){return"string"==typeof e||!ul(e)&&xl(e)&&ji(e)==re}function Bl(e){return"symbol"==typeof e||xl(e)&&ji(e)==ie}var Fl=sn?jn(sn):to;function Hl(t){return t===e}function $l(e){return xl(e)&&Xs(e)==se}function Vl(e){return xl(e)&&ji(e)==ae}var ql=Is(oo),Wl=Is((function(e,t){return e<=t}));function Kl(e){if(!e)return[];if(fl(e))return zl(e)?ir(e):os(e);if(Ct&&e[Ct])return Yn(e[Ct]());var t=Xs(e);return(t==Y?Qn:t==ne?Zn:$f)(e)}function Gl(e){return e?(e=Jl(e))===A||e===-A?(e<0?-1:1)*M:e==e?e:0:0===e?e:0}function Yl(e){var t=Gl(e),n=t%1;return t==t?n?t-n:t:0}function Ql(e){return e?vi(Yl(e),0,U):0}function Jl(e){if("number"==typeof e)return e;if(Bl(e))return L;if(Rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Un(e);var n=qe.test(e);return n||Ke.test(e)?qt(e.slice(2),n?2:8):Ve.test(e)?L:+e}function Xl(e){return ss(e,Rf(e))}function Zl(e){return e?vi(Yl(e),-T,T):0===e?e:0}function ef(e){return null==e?"":Lo(e)}var tf=ls((function(e,t){if(pa(t)||fl(t))ss(t,Of(t),e);else for(var n in t)ht.call(t,n)&&li(e,n,t[n])})),nf=ls((function(e,t){ss(t,Rf(t),e)})),rf=ls((function(e,t,n,r){ss(t,Rf(t),e,r)})),of=ls((function(e,t,n,r){ss(t,Of(t),e,r)})),sf=zs(yi);function af(e,t){var n=Rr(e);return null==t?n:di(n,t)}var cf=Eo((function(t,n){t=rt(t);var r=-1,i=n.length,o=i>2?n[2]:e;for(o&&ca(n[0],n[1],o)&&(i=1);++r<i;)for(var s=n[r],a=Rf(s),c=-1,u=a.length;++c<u;){var l=a[c],f=t[l];(f===e||ol(f,ut[l])&&!ht.call(t,l))&&(t[l]=s[l])}return t})),uf=Eo((function(t){return t.push(e,Ms),an(Pf,e,t)}));function lf(e,t){return Sn(e,qs(t,3),Ai)}function ff(e,t){return Sn(e,qs(t,3),Ti)}function hf(e,t){return null==e?e:ki(e,qs(t,3),Rf)}function df(e,t){return null==e?e:Ni(e,qs(t,3),Rf)}function pf(e,t){return e&&Ai(e,qs(t,3))}function gf(e,t){return e&&Ti(e,qs(t,3))}function yf(e){return null==e?[]:Mi(e,Of(e))}function vf(e){return null==e?[]:Mi(e,Rf(e))}function mf(t,n,r){var i=null==t?e:Li(t,n);return i===e?r:i}function _f(e,t){return null!=e&&ta(e,t,zi)}function bf(e,t){return null!=e&&ta(e,t,Bi)}var wf=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),e[t]=n}),Ch(Ah)),Ef=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),ht.call(e,t)?e[t].push(n):e[t]=[n]}),qs),Sf=Eo(Vi);function Of(e){return fl(e)?oi(e):ro(e)}function Rf(e){return fl(e)?oi(e,!0):io(e)}function xf(e,t){var n={};return t=qs(t,3),Ai(e,(function(e,r,i){gi(n,t(e,r,i),e)})),n}function If(e,t){var n={};return t=qs(t,3),Ai(e,(function(e,r,i){gi(n,r,t(e,r,i))})),n}var Cf=ls((function(e,t,n){uo(e,t,n)})),Pf=ls((function(e,t,n,r){uo(e,t,n,r)})),kf=zs((function(e,t){var n={};if(null==e)return n;var r=!1;t=gn(t,(function(t){return t=qo(t,e),r||(r=t.length>1),t})),ss(e,Fs(e),n),r&&(n=mi(n,l|f|h,Ls));for(var i=t.length;i--;)jo(n,t[i]);return n}));function Nf(e,t){return Tf(e,Hu(qs(t)))}var Af=zs((function(e,t){return null==e?{}:po(e,t)}));function Tf(e,t){if(null==e)return{};var n=gn(Fs(e),(function(e){return[e]}));return t=qs(t),go(e,n,(function(e,n){return t(e,n[0])}))}function Mf(t,n,r){var i=-1,o=(n=qo(n,t)).length;for(o||(o=1,t=e);++i<o;){var s=null==t?e:t[Aa(n[i])];s===e&&(i=o,s=r),t=El(s)?s.call(t):s}return t}function Lf(e,t,n){return null==e?e:Ro(e,t,n)}function Uf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Ro(t,n,r,i)}var jf=Ns(Of),Df=Ns(Rf);function zf(e,t,n){var r=ul(e),i=r||pl(e)||Fl(e);if(t=qs(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Rl(e)&&El(o)?Rr(St(e)):{}}return(i?un:Ai)(e,(function(e,r,i){return t(n,e,r,i)})),n}function Bf(e,t){return null==e||jo(e,t)}function Ff(e,t,n){return null==e?e:Do(e,t,Vo(n))}function Hf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Do(t,n,Vo(r),i)}function $f(e){return null==e?[]:Dn(e,Of(e))}function Vf(e){return null==e?[]:Dn(e,Rf(e))}function qf(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=Jl(r))==r?r:0),n!==e&&(n=(n=Jl(n))==n?n:0),vi(Jl(t),n,r)}function Wf(t,n,r){return n=Gl(n),r===e?(r=n,n=0):r=Gl(r),Fi(t=Jl(t),n,r)}function Kf(t,n,r){if(r&&"boolean"!=typeof r&&ca(t,n,r)&&(n=r=e),r===e&&("boolean"==typeof n?(r=n,n=e):"boolean"==typeof t&&(r=t,t=e)),t===e&&n===e?(t=0,n=1):(t=Gl(t),n===e?(n=t,t=0):n=Gl(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var o=wn();return Xt(t+o*(n-t+Vt("1e-"+((o+"").length-1))),n)}return _o(t,n)}var Gf=gs((function(e,t,n){return t=t.toLowerCase(),e+(n?Yf(t):t)}));function Yf(e){return Eh(ef(e).toLowerCase())}function Qf(e){return(e=ef(e))&&e.replace(Ye,$n).replace(Nt,"")}function Jf(t,n,r){t=ef(t),n=Lo(n);var i=t.length,o=r=r===e?i:vi(Yl(r),0,i);return(r-=n.length)>=0&&t.slice(r,o)==n}function Xf(e){return(e=ef(e))&&Re.test(e)?e.replace(Se,Vn):e}function Zf(e){return(e=ef(e))&&Te.test(e)?e.replace(Ae,"\\$&"):e}var eh=gs((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),th=gs((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),nh=ps("toLowerCase");function rh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Os(Ft(i),n)+e+Os(Bt(i),n)}function ih(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?e+Os(t-r,n):e}function oh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?Os(t-r,n)+e:e}function sh(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(ef(e).replace(Me,""),t||0)}function ah(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),wo(ef(t),n)}function ch(){var e=arguments,t=ef(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var uh=gs((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));function lh(t,n,r){return r&&"number"!=typeof r&&ca(t,n,r)&&(n=r=e),(r=r===e?U:r>>>0)?(t=ef(t))&&("string"==typeof n||null!=n&&!Ul(n))&&!(n=Lo(n))&&Kn(t)?Ko(ir(t),0,r):t.split(n,r):[]}var fh=gs((function(e,t,n){return e+(n?" ":"")+Eh(t)}));function hh(e,t,n){return e=ef(e),n=null==n?0:vi(Yl(n),0,e.length),t=Lo(t),e.slice(n,n+t.length)==t}function dh(t,n,r){var i=Or.templateSettings;r&&ca(t,n,r)&&(n=e),t=ef(t),n=rf({},n,i,Ts);var o,a,c=rf({},n.imports,i.imports,Ts),u=Of(c),l=Dn(c,u),f=0,h=n.interpolate||Qe,d="__p += '",p=it((n.escape||Qe).source+"|"+h.source+"|"+(h===Ce?He:Qe).source+"|"+(n.evaluate||Qe).source+"|$","g"),g="//# sourceURL="+(ht.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jt+"]")+"\n";t.replace(p,(function(e,n,r,i,s,c){return r||(r=i),d+=t.slice(f,c).replace(Je,qn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=c+e.length,e})),d+="';\n";var y=ht.call(n,"variable")&&n.variable;if(y){if(Be.test(y))throw new et(s)}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(_e,""):d).replace(be,"$1").replace(we,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Oh((function(){return tt(u,g+"return "+d).apply(e,l)}));if(v.source=d,bl(v))throw v;return v}function ph(e){return ef(e).toLowerCase()}function gh(e){return ef(e).toUpperCase()}function yh(t,n,r){if((t=ef(t))&&(r||n===e))return Un(t);if(!t||!(n=Lo(n)))return t;var i=ir(t),o=ir(n);return Ko(i,Bn(i,o),Fn(i,o)+1).join("")}function vh(t,n,r){if((t=ef(t))&&(r||n===e))return t.slice(0,or(t)+1);if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,0,Fn(i,ir(n))+1).join("")}function mh(t,n,r){if((t=ef(t))&&(r||n===e))return t.replace(Me,"");if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,Bn(i,ir(n))).join("")}function _h(t,n){var r=R,i=x;if(Rl(n)){var o="separator"in n?n.separator:o;r="length"in n?Yl(n.length):r,i="omission"in n?Lo(n.omission):i}var s=(t=ef(t)).length;if(Kn(t)){var a=ir(t);s=a.length}if(r>=s)return t;var c=r-rr(i);if(c<1)return i;var u=a?Ko(a,0,c).join(""):t.slice(0,c);if(o===e)return u+i;if(a&&(c+=u.length-c),Ul(o)){if(t.slice(c).search(o)){var l,f=u;for(o.global||(o=it(o.source,ef($e.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===e?c:h)}}else if(t.indexOf(Lo(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+i}function bh(e){return(e=ef(e))&&Oe.test(e)?e.replace(Ee,sr):e}var wh=gs((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Eh=ps("toUpperCase");function Sh(t,n,r){return t=ef(t),(n=r?e:n)===e?Gn(t)?ur(t):En(t):t.match(n)||[]}var Oh=Eo((function(t,n){try{return an(t,e,n)}catch(e){return bl(e)?e:new et(e)}})),Rh=zs((function(e,t){return un(t,(function(t){t=Aa(t),gi(e,t,Tu(e[t],e))})),e}));function xh(e){var t=null==e?0:e.length,n=qs();return e=t?gn(e,(function(e){if("function"!=typeof e[1])throw new st(o);return[n(e[0]),e[1]]})):[],Eo((function(n){for(var r=-1;++r<t;){var i=e[r];if(an(i[0],this,n))return an(i[1],this,n)}}))}function Ih(e){return _i(mi(e,l))}function Ch(e){return function(){return e}}function Ph(e,t){return null==e||e!=e?t:e}var kh=_s(),Nh=_s(!0);function Ah(e){return e}function Th(e){return no("function"==typeof e?e:mi(e,l))}function Mh(e){return ao(mi(e,l))}function Lh(e,t){return co(e,mi(t,l))}var Uh=Eo((function(e,t){return function(n){return Vi(n,e,t)}})),jh=Eo((function(e,t){return function(n){return Vi(e,n,t)}}));function Dh(e,t,n){var r=Of(t),i=Mi(t,r);null==n&&(!Rl(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=Mi(t,Of(t)));var o=!(Rl(n)&&"chain"in n&&!n.chain),s=El(e);return un(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=os(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,yn([this.value()],arguments))})})),e}function zh(){return Gt._===this&&(Gt._=vt),this}function Bh(){}function Fh(e){return e=Yl(e),Eo((function(t){return fo(t,e)}))}var Hh=Ss(gn),$h=Ss(fn),Vh=Ss(_n);function qh(e){return ua(e)?Pn(Aa(e)):yo(e)}function Wh(t){return function(n){return null==t?e:Li(t,n)}}var Kh=xs(),Gh=xs(!0);function Yh(){return[]}function Qh(){return!1}function Jh(){return{}}function Xh(){return""}function Zh(){return!0}function ed(e,t){if((e=Yl(e))<1||e>T)return[];var n=U,r=Xt(e,U);t=qs(t),e-=U;for(var i=Mn(r,t);++n<e;)t(n);return i}function td(e){return ul(e)?gn(e,Aa):Bl(e)?[e]:os(Na(ef(e)))}function nd(e){var t=++dt;return ef(e)+t}var rd=Es((function(e,t){return e+t}),0),id=Ps("ceil"),od=Es((function(e,t){return e/t}),1),sd=Ps("floor");function ad(t){return t&&t.length?xi(t,Ah,Di):e}function cd(t,n){return t&&t.length?xi(t,qs(n,2),Di):e}function ud(e){return Cn(e,Ah)}function ld(e,t){return Cn(e,qs(t,2))}function fd(t){return t&&t.length?xi(t,Ah,oo):e}function hd(t,n){return t&&t.length?xi(t,qs(n,2),oo):e}var dd=Es((function(e,t){return e*t}),1),pd=Ps("round"),gd=Es((function(e,t){return e-t}),0);function yd(e){return e&&e.length?Tn(e,Ah):0}function vd(e,t){return e&&e.length?Tn(e,qs(t,2)):0}return Or.after=ku,Or.ary=Nu,Or.assign=tf,Or.assignIn=nf,Or.assignInWith=rf,Or.assignWith=of,Or.at=sf,Or.before=Au,Or.bind=Tu,Or.bindAll=Rh,Or.bindKey=Mu,Or.castArray=Zu,Or.chain=Wc,Or.chunk=Ua,Or.compact=ja,Or.concat=Da,Or.cond=xh,Or.conforms=Ih,Or.constant=Ch,Or.countBy=ru,Or.create=af,Or.curry=Lu,Or.curryRight=Uu,Or.debounce=ju,Or.defaults=cf,Or.defaultsDeep=uf,Or.defer=Du,Or.delay=zu,Or.difference=za,Or.differenceBy=Ba,Or.differenceWith=Fa,Or.drop=Ha,Or.dropRight=$a,Or.dropRightWhile=Va,Or.dropWhile=qa,Or.fill=Wa,Or.filter=ou,Or.flatMap=cu,Or.flatMapDeep=uu,Or.flatMapDepth=lu,Or.flatten=Ya,Or.flattenDeep=Qa,Or.flattenDepth=Ja,Or.flip=Bu,Or.flow=kh,Or.flowRight=Nh,Or.fromPairs=Xa,Or.functions=yf,Or.functionsIn=vf,Or.groupBy=du,Or.initial=tc,Or.intersection=nc,Or.intersectionBy=rc,Or.intersectionWith=ic,Or.invert=wf,Or.invertBy=Ef,Or.invokeMap=gu,Or.iteratee=Th,Or.keyBy=yu,Or.keys=Of,Or.keysIn=Rf,Or.map=vu,Or.mapKeys=xf,Or.mapValues=If,Or.matches=Mh,Or.matchesProperty=Lh,Or.memoize=Fu,Or.merge=Cf,Or.mergeWith=Pf,Or.method=Uh,Or.methodOf=jh,Or.mixin=Dh,Or.negate=Hu,Or.nthArg=Fh,Or.omit=kf,Or.omitBy=Nf,Or.once=$u,Or.orderBy=mu,Or.over=Hh,Or.overArgs=Vu,Or.overEvery=$h,Or.overSome=Vh,Or.partial=qu,Or.partialRight=Wu,Or.partition=_u,Or.pick=Af,Or.pickBy=Tf,Or.property=qh,Or.propertyOf=Wh,Or.pull=uc,Or.pullAll=lc,Or.pullAllBy=fc,Or.pullAllWith=hc,Or.pullAt=dc,Or.range=Kh,Or.rangeRight=Gh,Or.rearg=Ku,Or.reject=Eu,Or.remove=pc,Or.rest=Gu,Or.reverse=gc,Or.sampleSize=Ou,Or.set=Lf,Or.setWith=Uf,Or.shuffle=Ru,Or.slice=yc,Or.sortBy=Cu,Or.sortedUniq=Sc,Or.sortedUniqBy=Oc,Or.split=lh,Or.spread=Yu,Or.tail=Rc,Or.take=xc,Or.takeRight=Ic,Or.takeRightWhile=Cc,Or.takeWhile=Pc,Or.tap=Kc,Or.throttle=Qu,Or.thru=Gc,Or.toArray=Kl,Or.toPairs=jf,Or.toPairsIn=Df,Or.toPath=td,Or.toPlainObject=Xl,Or.transform=zf,Or.unary=Ju,Or.union=kc,Or.unionBy=Nc,Or.unionWith=Ac,Or.uniq=Tc,Or.uniqBy=Mc,Or.uniqWith=Lc,Or.unset=Bf,Or.unzip=Uc,Or.unzipWith=jc,Or.update=Ff,Or.updateWith=Hf,Or.values=$f,Or.valuesIn=Vf,Or.without=Dc,Or.words=Sh,Or.wrap=Xu,Or.xor=zc,Or.xorBy=Bc,Or.xorWith=Fc,Or.zip=Hc,Or.zipObject=$c,Or.zipObjectDeep=Vc,Or.zipWith=qc,Or.entries=jf,Or.entriesIn=Df,Or.extend=nf,Or.extendWith=rf,Dh(Or,Or),Or.add=rd,Or.attempt=Oh,Or.camelCase=Gf,Or.capitalize=Yf,Or.ceil=id,Or.clamp=qf,Or.clone=el,Or.cloneDeep=nl,Or.cloneDeepWith=rl,Or.cloneWith=tl,Or.conformsTo=il,Or.deburr=Qf,Or.defaultTo=Ph,Or.divide=od,Or.endsWith=Jf,Or.eq=ol,Or.escape=Xf,Or.escapeRegExp=Zf,Or.every=iu,Or.find=su,Or.findIndex=Ka,Or.findKey=lf,Or.findLast=au,Or.findLastIndex=Ga,Or.findLastKey=ff,Or.floor=sd,Or.forEach=fu,Or.forEachRight=hu,Or.forIn=hf,Or.forInRight=df,Or.forOwn=pf,Or.forOwnRight=gf,Or.get=mf,Or.gt=sl,Or.gte=al,Or.has=_f,Or.hasIn=bf,Or.head=Za,Or.identity=Ah,Or.includes=pu,Or.indexOf=ec,Or.inRange=Wf,Or.invoke=Sf,Or.isArguments=cl,Or.isArray=ul,Or.isArrayBuffer=ll,Or.isArrayLike=fl,Or.isArrayLikeObject=hl,Or.isBoolean=dl,Or.isBuffer=pl,Or.isDate=gl,Or.isElement=yl,Or.isEmpty=vl,Or.isEqual=ml,Or.isEqualWith=_l,Or.isError=bl,Or.isFinite=wl,Or.isFunction=El,Or.isInteger=Sl,Or.isLength=Ol,Or.isMap=Il,Or.isMatch=Cl,Or.isMatchWith=Pl,Or.isNaN=kl,Or.isNative=Nl,Or.isNil=Tl,Or.isNull=Al,Or.isNumber=Ml,Or.isObject=Rl,Or.isObjectLike=xl,Or.isPlainObject=Ll,Or.isRegExp=Ul,Or.isSafeInteger=jl,Or.isSet=Dl,Or.isString=zl,Or.isSymbol=Bl,Or.isTypedArray=Fl,Or.isUndefined=Hl,Or.isWeakMap=$l,Or.isWeakSet=Vl,Or.join=oc,Or.kebabCase=eh,Or.last=sc,Or.lastIndexOf=ac,Or.lowerCase=th,Or.lowerFirst=nh,Or.lt=ql,Or.lte=Wl,Or.max=ad,Or.maxBy=cd,Or.mean=ud,Or.meanBy=ld,Or.min=fd,Or.minBy=hd,Or.stubArray=Yh,Or.stubFalse=Qh,Or.stubObject=Jh,Or.stubString=Xh,Or.stubTrue=Zh,Or.multiply=dd,Or.nth=cc,Or.noConflict=zh,Or.noop=Bh,Or.now=Pu,Or.pad=rh,Or.padEnd=ih,Or.padStart=oh,Or.parseInt=sh,Or.random=Kf,Or.reduce=bu,Or.reduceRight=wu,Or.repeat=ah,Or.replace=ch,Or.result=Mf,Or.round=pd,Or.runInContext=t,Or.sample=Su,Or.size=xu,Or.snakeCase=uh,Or.some=Iu,Or.sortedIndex=vc,Or.sortedIndexBy=mc,Or.sortedIndexOf=_c,Or.sortedLastIndex=bc,Or.sortedLastIndexBy=wc,Or.sortedLastIndexOf=Ec,Or.startCase=fh,Or.startsWith=hh,Or.subtract=gd,Or.sum=yd,Or.sumBy=vd,Or.template=dh,Or.times=ed,Or.toFinite=Gl,Or.toInteger=Yl,Or.toLength=Ql,Or.toLower=ph,Or.toNumber=Jl,Or.toSafeInteger=Zl,Or.toString=ef,Or.toUpper=gh,Or.trim=yh,Or.trimEnd=vh,Or.trimStart=mh,Or.truncate=_h,Or.unescape=bh,Or.uniqueId=nd,Or.upperCase=wh,Or.upperFirst=Eh,Or.each=fu,Or.eachRight=hu,Or.first=Za,Dh(Or,function(){var e={};return Ai(Or,(function(t,n){ht.call(Or.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Or.VERSION=n,un(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Or[e].placeholder=Or})),un(["drop","take"],(function(t,n){Cr.prototype[t]=function(r){r=r===e?1:Qt(Yl(r),0);var i=this.__filtered__&&!n?new Cr(this):this.clone();return i.__filtered__?i.__takeCount__=Xt(r,i.__takeCount__):i.__views__.push({size:Xt(r,U),type:t+(i.__dir__<0?"Right":"")}),i},Cr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),un(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=n==P||n==N;Cr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qs(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),un(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Cr.prototype[e]=function(){return this[n](1).value()[0]}})),un(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Cr.prototype[e]=function(){return this.__filtered__?new Cr(this):this[n](1)}})),Cr.prototype.compact=function(){return this.filter(Ah)},Cr.prototype.find=function(e){return this.filter(e).head()},Cr.prototype.findLast=function(e){return this.reverse().find(e)},Cr.prototype.invokeMap=Eo((function(e,t){return"function"==typeof e?new Cr(this):this.map((function(n){return Vi(n,e,t)}))})),Cr.prototype.reject=function(e){return this.filter(Hu(qs(e)))},Cr.prototype.slice=function(t,n){t=Yl(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Cr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=Yl(n))<0?r.dropRight(-n):r.take(n-t)),r)},Cr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Cr.prototype.toArray=function(){return this.take(U)},Ai(Cr.prototype,(function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Or[i?"take"+("last"==n?"Right":""):n],s=i||/^find/.test(n);o&&(Or.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,c=n instanceof Cr,u=a[0],l=c||ul(n),f=function(e){var t=o.apply(Or,yn([e],a));return i&&h?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=c&&!d;if(!s&&l){n=g?n:new Cr(this);var y=t.apply(n,a);return y.__actions__.push({func:Gc,args:[f],thisArg:e}),new Ir(y,h)}return p&&g?t.apply(this,a):(y=this.thru(f),p?i?y.value()[0]:y.value():y)})})),un(["pop","push","shift","sort","splice","unshift"],(function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Or.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ul(i)?i:[],e)}return this[n]((function(n){return t.apply(ul(n)?n:[],e)}))}})),Ai(Cr.prototype,(function(e,t){var n=Or[t];if(n){var r=n.name+"";ht.call(gr,r)||(gr[r]=[]),gr[r].push({name:t,func:n})}})),gr[bs(e,y).name]=[{name:"wrapper",func:e}],Cr.prototype.clone=Pr,Cr.prototype.reverse=kr,Cr.prototype.value=Nr,Or.prototype.at=Yc,Or.prototype.chain=Qc,Or.prototype.commit=Jc,Or.prototype.next=Xc,Or.prototype.plant=eu,Or.prototype.reverse=tu,Or.prototype.toJSON=Or.prototype.valueOf=Or.prototype.value=nu,Or.prototype.first=Or.prototype.head,Ct&&(Or.prototype[Ct]=Zc),Or},fr=lr();Qt?((Qt.exports=fr)._=fr,Yt._=fr):Gt._=fr}.call(t);var mg=Object.defineProperty,_g=Object.defineProperties,bg=Object.getOwnPropertyDescriptors,wg=Object.getOwnPropertySymbols,Eg=Object.prototype.hasOwnProperty,Sg=Object.prototype.propertyIsEnumerable,Og=(e,t,n)=>t in e?mg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rg=(e,t)=>{for(var n in t||(t={}))Eg.call(t,n)&&Og(e,n,t[n]);if(wg)for(var n of wg(t))Sg.call(t,n)&&Og(e,n,t[n]);return e},xg=(e,t)=>_g(e,bg(t));function Ig(e,t,n){let r;const i=Cg(e);return t.rpcMap&&(r=t.rpcMap[i]),r||(r=`${dg}?chainId=eip155:${i}&projectId=${n}`),r}function Cg(e){return e.includes("eip155")?Number(e.split(":")[1]):Number(e)}function Pg(e,t){if(!t.includes(e))throw new Error(`Chain '${e}' not approved. Please use one of the following: ${t.toString()}`)}function kg(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}function Ng(e,t){const n=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!n.length)return[];const r=[];return n.forEach((e=>{const n=t.namespaces[e].accounts;r.push(...n)})),r}function Ag(e,t={}){const n=Tg(e),r=Tg(t);return vg.exports.merge(n,r)}function Tg(e){var t,n,r,i;const o={};if(!gu(e))return o;for(const[s,a]of Object.entries(e)){const e=cu(s)?[s]:a.chains,c=a.methods||[],u=a.events||[],l=a.rpcMap||{},f=uu(s);o[f]=xg(Rg(Rg({},o[f]),a),{chains:Fc(e,null==(t=o[f])?void 0:t.chains),methods:Fc(c,null==(n=o[f])?void 0:n.methods),events:Fc(u,null==(r=o[f])?void 0:r.events),rpcMap:Rg(Rg({},l),null==(i=o[f])?void 0:i.rpcMap)})}return o}const Mg={},Lg=e=>Mg[e],Ug=(e,t)=>{Mg[e]=t};var jg={exports:{}};!function(e,n){var r,i=typeof self<"u"?self:t,o=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();r=o,function(e){var t={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function n(e){return e&&DataView.prototype.isPrototypeOf(e)}if(t.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function d(e){var t=new FileReader,n=f(t);return t.readAsText(e),n}function p(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:t.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:t.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():t.arrayBuffer&&t.blob&&n(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;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?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return d(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=a(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e){var t=e.toUpperCase();return v.indexOf(t)>-1?t:e}function _(e,t){var n=(t=t||{}).body;if(e instanceof _){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&null!=e._bodyInit&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=m(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},y.call(_.prototype),y.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];E.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch{e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function O(n,r){return new Promise((function(i,o){var s=new _(n,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:w(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;i(new E(t,e))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(typeof s._bodyInit>"u"?null:s._bodyInit)}))}O.polyfill=!0,r.fetch||(r.fetch=O,r.Headers=u,r.Request=_,r.Response=E),e.Headers=u,e.Request=_,e.Response=E,e.fetch=O,Object.defineProperty(e,"__esModule",{value:!0})}({}),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var s=o;(n=s.fetch).default=s.fetch,n.fetch=s.fetch,n.Headers=s.Headers,n.Request=s.Request,n.Response=s.Response,e.exports=n}(jg,jg.exports);var Dg=n(jg.exports);const zg={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Bg=10;class Fg{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new o.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Jl(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}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,t){this.isAvailable||await this.register();try{const t=sr(e),n=await(await Dg(this.url,Object.assign(Object.assign({},zg),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!Jl(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=sr({id:1,jsonrpc:"2.0",method:"test",params:[]});await Dg(e,Object.assign(Object.assign({},zg),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}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 t="string"==typeof e.data?or(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=Hl(e,n.message||n.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return ol(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Bg&&this.events.setMaxListeners(Bg)}}class Hg{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class $g{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){var t;switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}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,t){const n=Cg(e);if(!this.httpProviders[n]){const e=t||Ig(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!e)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,e)}this.chainId=n,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}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,t){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Cg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}handleSwitchChain(e){const t=parseInt(e,16);Pg(`${this.name}:${t}`,this.namespace.chains),this.setDefaultChain(`${t}`)}}class Vg{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class qg{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class Wg{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{const n=this.getCardanoRPCUrl(t);e[t]=this.createHttpProvider(t,n)})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class Kg{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}class Gg{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Lg("events"),this.client=Lg("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,t){if(!this.httpProviders[e]){const n=t||Ig(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Ig(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new sf(new Fg(n,Lg("disableProviderPing")))}}var Yg=Object.defineProperty,Qg=Object.defineProperties,Jg=Object.getOwnPropertyDescriptors,Xg=Object.getOwnPropertySymbols,Zg=Object.prototype.hasOwnProperty,ey=Object.prototype.propertyIsEnumerable,ty=(e,t,n)=>t in e?Yg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ny=(e,t)=>{for(var n in t||(t={}))Zg.call(t,n)&&ty(e,n,t[n]);if(Xg)for(var n of Xg(t))ey.call(t,n)&&ty(e,n,t[n]);return e},ry=(e,t)=>Qg(e,Jg(t));class iy{constructor(e){this.events=new o.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:cn.pino(cn.getDefaultLoggerOptions({level:e?.logger||lg})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new iy(e);return await t.initialize(),t}async request(e,t){const[n,r]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ny({},e),chainId:`${n}:${r}`,topic:this.session.topic})}sendAsync(e,t,n){this.request(e,n).then((e=>t(null,e))).catch((e=>t(e,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:null==(e=this.session)?void 0:e.topic,reason:du("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)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:r}=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 r().then((e=>{this.session=e})).catch((e=>{if(e.message!==Hp)throw e;t++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{const[n,r]=this.validateChain(e);this.getProvider(n).setDefaultChain(r,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(pu(t)){for(const n of t)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: ${t.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 ug.init({logger:this.providerOpts.logger||lg,relayUrl:this.providerOpts.relayUrl||fg,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,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((e=>uu(e))))];Ug("client",this.client),Ug("events",this.events),Ug("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=Ng(e,this.session),n=kg(t),r=Ag(this.namespaces,this.optionalNamespaces),i=ry(ny({},r[e]),{accounts:t,chains:n});switch(e){case"eip155":this.rpcProviders[e]=new $g({namespace:i});break;case"solana":this.rpcProviders[e]=new Vg({namespace:i});break;case"cosmos":this.rpcProviders[e]=new qg({namespace:i});break;case"polkadot":this.rpcProviders[e]=new Hg({namespace:i});break;case"cip34":this.rpcProviders[e]=new Wg({namespace:i});break;case"elrond":this.rpcProviders[e]=new Kg({namespace:i});break;case"multiversx":this.rpcProviders[e]=new Gg({namespace:i})}}))}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:t}=e,{event:n}=t;"accountsChanged"===n.name?this.events.emit("accountsChanged",n.data):"chainChanged"===n.name?this.onChainChanged(t.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var n;const{namespaces:r}=t,i=null==(n=this.client)?void 0:n.session.get(e);this.session=ry(ny({},i),{namespaces:r}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",ry(ny({},du("USER_DISCONNECTED")),{data:e.topic}))})),this.on(pg.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 t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:r}=e;if(!t||!Object.keys(t).length)throw new Error("Namespaces must be not empty");this.namespaces=t,this.optionalNamespaces=n,this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(t&&!Object.keys(this.namespaces).map((e=>uu(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const r=uu(Object.keys(this.namespaces)[0]);return[r,this.rpcProviders[r].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var n;const[r,i]=this.validateChain(e);t||this.getProvider(r).setDefaultChain(i),(null!=(n=this.namespaces[r])?n:this.namespaces[`${r}:${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,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${hg}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${hg}/${e}`)}}const oy=iy;e.UniversalProvider=oy,e.default=iy,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,Ji.exports);const Xi=["eth_sendTransaction","personal_sign"],Zi=["eth_accounts","eth_requestAccounts","eth_call","eth_getBalance","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],eo=["chainChanged","accountsChanged"],to=["message","disconnect","connect"];function no(e){return Number(e[0].split(":")[1])}function ro(e){return`0x${e.toString(16)}`}class io{constructor(){this.events=new vn.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static init(e){return c(this,void 0,void 0,(function*(){const t=new io;return yield t.initialize(e),t}))}request(e){return c(this,void 0,void 0,(function*(){return yield this.signer.request(e,this.formatChainId(this.chainId))}))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}enable(){return c(this,void 0,void 0,(function*(){this.session||(yield this.connect());return yield this.request({method:"eth_requestAccounts"})}))}connect(e){return c(this,void 0,void 0,(function*(){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:n}=function(e){const{chains:t,optionalChains:n,methods:r,optionalMethods:i,events:o,optionalEvents:s,rpcMap:a}=e;if(!Gi(t))throw new Error("Invalid chains");const c=t,u=r||Xi,l=o||eo,f={chains:c,methods:u,events:l,rpcMap:{[no(c)]:a[no(c)]}},h=null==o?void 0:o.filter((e=>!eo.includes(e))),d=null==r?void 0:r.filter((e=>!Xi.includes(e)));if(!(n||s||i||(null==h?void 0:h.length)||(null==d?void 0:d.length)))return{required:f};const p=(null==h?void 0:h.length)&&(null==d?void 0:d.length)||!n;return{required:f,optional:{chains:[...new Set(p?c.concat(n||[]):n)],methods:[...new Set(u.concat(i||[]))],events:[...new Set(l.concat(s||[]))],rpcMap:a}}}(this.rpc);try{const r=yield new Promise(((r,i)=>c(this,void 0,void 0,(function*(){yield this.signer.connect(Object.assign(Object.assign({namespaces:{[this.namespace]:t}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:null==e?void 0:e.pairingTopic,skipPairing:!1})).then((e=>{r(e)})).catch((e=>{i(new Error(e.message))}))}))));if(!r)return;this.setChainIds(this.rpc.chains);const i=function(e,t=[]){const n=[];return Object.keys(e).forEach((r=>{if(t.length&&!t.includes(r))return;const i=e[r];n.push(...i.accounts)})),n}(r.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:ro(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}}))}disconnect(){return c(this,void 0,void 0,(function*(){this.session&&(yield this.signer.disconnect()),this.reset()}))}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(e=>{const{params:t}=e,{event:n}=t;"accountsChanged"===n.name?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===n.name?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 t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",ro(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",Object.assign(Object.assign({},function(e,t){const{message:n,code:r}=Ki[e];return{message:t?`${n} ${t}`:n,code:r}}("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(e=>{this.events.emit("display_uri",e)}))}setHttpProvider(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter((e=>this.isCompatibleChainId(e))),n=t.map((e=>this.parseChainId(e)));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",ro(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.setHttpProvider(t)}}parseAccountId(e){const[t,n,r]=e.split(":");return{chainId:`${t}:${n}`,address:r}}setAccounts(e){this.accounts=e.filter((e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId)).map((e=>this.parseAccountId(e).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t;return{chains:(null===(t=e.chains)||void 0===t?void 0:t.map((e=>this.formatChainId(e))))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map((e=>this.formatChainId(e))):void 0,methods:(null==e?void 0:e.methods)||Xi,events:(null==e?void 0:e.events)||eo,optionalMethods:(null==e?void 0:e.optionalMethods)||[],optionalEvents:(null==e?void 0:e.optionalEvents)||[],rpcMap:(null==e?void 0:e.rpcMap)||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach((e=>{n[e]=this.getRpcUrl(e,t)})),n}initialize(e){return c(this,void 0,void 0,(function*(){this.rpc=this.getRpcConfig(e),this.chainId=no(this.rpc.chains),this.signer=yield Ji.exports.UniversalProvider.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata}),this.registerEventListeners(),yield this.loadPersistedSession()}))}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:r}=e;t&&Gi(t)&&(this.rpc.chains=t.map((e=>this.formatChainId(e))),t.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)}))),n&&Gi(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null==n?void 0:n.map((e=>this.formatChainId(e))),n.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)})))}getRpcUrl(e,t){var n;return(null===(n=this.rpc.rpcMap)||void 0===n?void 0:n[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}loadPersistedSession(){return c(this,void 0,void 0,(function*(){if(!this.session)return;const e=yield this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}))}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((e=>this.parseAccount(e)))}}const oo=n("WalletConnectEvm"),so=r("WalletConnectEvm");function ao(){return c(this,void 0,void 0,(function*(){oo("getWalletConnectProvider");try{const e=yield function(){return c(this,void 0,void 0,(function*(){oo("initWalletConnectProvider");const e=yo();oo("walletConnectProviderOptions is",e);const t={projectId:e.projectId,chains:e.chains,optionalChains:e.optionalChains,methods:e.methods,optionalMethods:e.optionalMethods||Zi,events:e.events,optionalEvents:e.optionalEvents||to,rpcMap:e.rpcMap,showQrModal:!1};oo("ethereum init options are",t),oo("creating a new provider instance");try{return io.init(t)}catch(e){throw so("Error while initializing ethereum provider"),e}}))}();return function(e){if(oo("assignWalletConnectProviderEvents"),!e)return;function t(e){e&&(e.removeListener("connect",n),e.removeListener("display_uri",r),e.removeListener("session_delete",i))}function n(t){oo("connectHandler",t),e.removeListener("display_uri",r),mt(!1)}function r(e){oo("displayUriHandler",e),en(e)}function i(n){oo("disconnectHandler",n),e.disconnect(),t(e)}t(e),e.on("connect",n),e.on("display_uri",r),e.on("session_delete",i),oo("provider is",e)}(e),e.request=function(e){oo("patchWalletConnectProviderRequest");const t=e.request.bind(e),n=yo();return oo("walletConnectProviderOptions is",n),function({method:r,params:i}){return c(this,void 0,void 0,(function*(){return"eth_requestAccounts"===r?(oo("calling patched",r,i),new Promise(((o,a)=>c(this,void 0,void 0,(function*(){var c;try{(null===(c=null==e?void 0:e.session)||void 0===c?void 0:c.connected)?(oo("reusing existing session"),o(yield t({method:r,params:i}))):(hn({uri:"",onClose:()=>{so("user rejected"),a(new s)}}),oo("creating a new session"),yield e.connect({chains:n.chains,optionalChains:n.optionalChains}),o(yield t({method:r,params:i})))}catch(e){return so("error",e),a(e)}}))))):(oo("calling provider",r,i),yield t({method:r,params:i}))}))}}(e),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw so("error",t),t}}))}const co=n("getProvider"),uo=[1];var lo,fo;let ho;!function(e){e.Ethereum="Ethereum",e.Solana="Solana"}(lo||(lo={})),function(e){e.LedgerConnect="LedgerConnect",e.WalletConnect="WalletConnect"}(fo||(fo={}));const po=n("supportOptions");let go;const yo=()=>(po("getSupportOptions"),go),vo=n("ExtensionEvm"),mo="ethereum",_o="isLedgerConnect";var bo;function wo(e){return("iOS"===e.os.name||"macOS"===e.os.name)&&"Safari"===e.browser.name}function Eo(e){return!!bo[e]}function So(e){return e.every(Eo)}function Oo(){var e;if(vo("getEthereumProvider"),"undefined"==typeof window)throw new a;let t=window[mo];if(void 0===t||void 0===t[_o])throw new i;vo("chainId is",t.chainId);const n=`0x${(null===(e=yo().chainId)||void 0===e?void 0:e.toString(16))||0}`;return vo("hex chainId is",n),t.chainId!=n&&vo("chainIds are different, changing to",n),t}!function(e){e[e.EthereumMainnet=1]="EthereumMainnet",e[e.Polygon=137]="Polygon"}(bo||(bo={}));const Ro=n("support");let xo;e.checkSupport=function(e){Ro("checkSupport",e),(e=>{var t;po("setSupportOptions",e);const n=e.walletConnectVersion||1;let r,i,o=[];1===n?(i=e.chainId||1,r=[i]):(r=e.chains||uo,i=r[0],o.push(...r),(null===(t=e.optionalChains)||void 0===t?void 0:t.length)&&o.push(...e.optionalChains.filter((e=>o.indexOf(e)<0))));const s=Object.assign(Object.assign({},e),{walletConnectVersion:n,chains:r,chainId:i,optionalChains:o,projectId:e.projectId||""});if(2===n&&(!e.projectId||""===e.projectId))throw new Error("WalletConnect requires a projectId. Please visit https://cloud.walletconnect.com to get one.");go=s})(e);const t=yo();let n;switch(t.providerType){case lo.Ethereum:n=function(e){Ro("checkEthereumSupport",e);const t=un();let n=!1;try{n=!!Oo()}catch(e){}const r={isLedgerConnectSupported:wo(t),isLedgerConnectEnabled:!!n,isChainIdSupported:So(e.chains),providerImplementation:fo.LedgerConnect};r.isLedgerConnectSupported&&r.isLedgerConnectEnabled&&r.isChainIdSupported||(r.providerImplementation=fo.WalletConnect);return function(e){co("setProviderImplementation",e),ho=e}(r.providerImplementation),r}(t);break;case lo.Solana:n=function(){Ro("checkSolanaSupport");const e=un();let t=!1;try{t=!!h()}catch(e){}const n={isLedgerConnectSupported:wo(e),isLedgerConnectEnabled:!!t,providerImplementation:fo.LedgerConnect};n.isLedgerConnectSupported?n.isLedgerConnectSupported&&!n.isLedgerConnectEnabled&&fn("ExtensionInstallModal"):fn("PlatformNotSupportedModal");return n}()}return Ro("checkSupportResult is",n),xo=n,n},e.enableDebugLogs=()=>{t=!0},e.getProvider=function(){return c(this,void 0,void 0,(function*(){co("getProvider",ho);const e=yo();switch(e.providerType){case lo.Ethereum:return(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))||ho!==fo.LedgerConnect?(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||1!==e.walletConnectVersion&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))?yield ao():yield gn():Oo();case lo.Solana:return h();default:throw new o}}))},Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map
|