From dfd4ffe9b6de4120040a09dd18668efc5572465c Mon Sep 17 00:00:00 2001 From: lubej <9722540+lubej@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:03:16 +0100 Subject: [PATCH] wrose-authzn: Deploy v2 --- .../{index-b891ea71.js => index-2e9b2bc9.js} | 54 +++++++++---------- wrose-authzn/assets/index-8e19271c.css | 1 + wrose-authzn/assets/index-b3852aeb.css | 1 - wrose-authzn/index.html | 9 ++-- 4 files changed, 34 insertions(+), 31 deletions(-) rename wrose-authzn/assets/{index-b891ea71.js => index-2e9b2bc9.js} (58%) create mode 100644 wrose-authzn/assets/index-8e19271c.css delete mode 100644 wrose-authzn/assets/index-b3852aeb.css diff --git a/wrose-authzn/assets/index-b891ea71.js b/wrose-authzn/assets/index-2e9b2bc9.js similarity index 58% rename from wrose-authzn/assets/index-b891ea71.js rename to wrose-authzn/assets/index-2e9b2bc9.js index c6d7166..2f7eab0 100644 --- a/wrose-authzn/assets/index-b891ea71.js +++ b/wrose-authzn/assets/index-2e9b2bc9.js @@ -1,4 +1,4 @@ -var XS=Object.defineProperty;var ZS=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>(ZS(t,typeof e!="symbol"?e+"":e,r),r),ag=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var L=(t,e,r)=>(ag(t,e,"read from private field"),r?r.call(t):e.get(t)),me=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ee=(t,e,r,n)=>(ag(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var lg=(t,e,r,n)=>({set _(i){ee(t,e,i,r)},get _(){return L(t,e,n)}}),ot=(t,e,r)=>(ag(t,e,"access private method"),r);function eF(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var f1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function tF(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _A={exports:{}},c1={},PA={exports:{}},Zt={};/** +var XS=Object.defineProperty;var ZS=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>(ZS(t,typeof e!="symbol"?e+"":e,r),r),ag=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var D=(t,e,r)=>(ag(t,e,"read from private field"),r?r.call(t):e.get(t)),me=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ee=(t,e,r,n)=>(ag(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var lg=(t,e,r,n)=>({set _(i){ee(t,e,i,r)},get _(){return D(t,e,n)}}),ot=(t,e,r)=>(ag(t,e,"access private method"),r);function eF(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var f1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function tF(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _A={exports:{}},c1={},PA={exports:{}},Zt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var XS=Object.defineProperty;var ZS=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var d0=Symbol.for("react.element"),rF=Symbol.for("react.portal"),nF=Symbol.for("react.fragment"),iF=Symbol.for("react.strict_mode"),sF=Symbol.for("react.profiler"),oF=Symbol.for("react.provider"),aF=Symbol.for("react.context"),lF=Symbol.for("react.forward_ref"),uF=Symbol.for("react.suspense"),fF=Symbol.for("react.memo"),cF=Symbol.for("react.lazy"),xv=Symbol.iterator;function hF(t){return t===null||typeof t!="object"?null:(t=xv&&t[xv]||t["@@iterator"],typeof t=="function"?t:null)}var NA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},RA=Object.assign,TA={};function tc(t,e,r){this.props=t,this.context=e,this.refs=TA,this.updater=r||NA}tc.prototype.isReactComponent={};tc.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};tc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function IA(){}IA.prototype=tc.prototype;function A2(t,e,r){this.props=t,this.context=e,this.refs=TA,this.updater=r||NA}var E2=A2.prototype=new IA;E2.constructor=A2;RA(E2,tc.prototype);E2.isPureReactComponent=!0;var vv=Array.isArray,MA=Object.prototype.hasOwnProperty,S2={current:null},BA={key:!0,ref:!0,__self:!0,__source:!0};function OA(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)MA.call(e,n)&&!BA.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1e in t?XS(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var vF=we,wF=Symbol.for("react.element"),bF=Symbol.for("react.fragment"),AF=Object.prototype.hasOwnProperty,EF=vF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,SF={key:!0,ref:!0,__self:!0,__source:!0};function UA(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)AF.call(e,n)&&!SF.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:wF,type:t,key:s,ref:o,props:i,_owner:EF.current}}c1.Fragment=bF;c1.jsx=UA;c1.jsxs=UA;_A.exports=c1;var Pe=_A.exports,DA={exports:{}},xi={},LA={exports:{}},zA={};/** + */var vF=we,wF=Symbol.for("react.element"),bF=Symbol.for("react.fragment"),AF=Object.prototype.hasOwnProperty,EF=vF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,SF={key:!0,ref:!0,__self:!0,__source:!0};function UA(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)AF.call(e,n)&&!SF.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:wF,type:t,key:s,ref:o,props:i,_owner:EF.current}}c1.Fragment=bF;c1.jsx=UA;c1.jsxs=UA;_A.exports=c1;var Pe=_A.exports,DA={exports:{}},vi={},LA={exports:{}},zA={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var XS=Object.defineProperty;var ZS=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(R,U){var H=R.length;R.push(U);e:for(;0>>1,g=R[B];if(0>>1;Bi(E,H))Wi(oe,E)?(R[B]=oe,R[W]=H,B=W):(R[B]=E,R[ve]=H,B=ve);else if(Wi(oe,H))R[B]=oe,R[W]=H,B=W;else break e}}return U}function i(R,U){var H=R.sortIndex-U.sortIndex;return H!==0?H:R.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,c=null,p=3,y=!1,v=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(R){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=R)n(u),U.sortIndex=U.expirationTime,e(l,U);else break;U=r(u)}}function F(R){if(b=!1,C(R),!v)if(r(l)!==null)v=!0,S(z);else{var U=r(u);U!==null&&M(F,U.startTime-R)}}function z(R,U){v=!1,b&&(b=!1,x(G),G=-1),y=!0;var H=p;try{for(C(U),c=r(l);c!==null&&(!(c.expirationTime>U)||R&&!te());){var B=c.callback;if(typeof B=="function"){c.callback=null,p=c.priorityLevel;var g=B(c.expirationTime<=U);U=t.unstable_now(),typeof g=="function"?c.callback=g:c===r(l)&&n(l),C(U)}else n(l);c=r(l)}if(c!==null)var O=!0;else{var ve=r(u);ve!==null&&M(F,ve.startTime-U),O=!1}return O}finally{c=null,p=H,y=!1}}var T=!1,D=null,G=-1,$=5,ne=-1;function te(){return!(t.unstable_now()-ne<$)}function de(){if(D!==null){var R=t.unstable_now();ne=R;var U=!0;try{U=D(!0,R)}finally{U?_():(T=!1,D=null)}}else T=!1}var _;if(typeof A=="function")_=function(){A(de)};else if(typeof MessageChannel<"u"){var h=new MessageChannel,m=h.port2;h.port1.onmessage=de,_=function(){m.postMessage(null)}}else _=function(){N(de,0)};function S(R){D=R,T||(T=!0,_())}function M(R,U){G=N(function(){R(t.unstable_now())},U)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_continueExecution=function(){v||y||(v=!0,S(z))},t.unstable_forceFrameRate=function(R){0>R||125B?(R.sortIndex=H,e(u,R),r(l)===null&&R===r(u)&&(b?(x(G),G=-1):b=!0,M(F,H-B))):(R.sortIndex=g,e(l,R),v||y||(v=!0,S(z))),R},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(R){var U=p;return function(){var H=p;p=U;try{return R.apply(this,arguments)}finally{p=H}}}})(zA);LA.exports=zA;var FF=LA.exports;/** + */(function(t){function e(R,U){var G=R.length;R.push(U);e:for(;0>>1,g=R[B];if(0>>1;Bi(E,G))Ji(oe,E)?(R[B]=oe,R[J]=G,B=J):(R[B]=E,R[ve]=G,B=ve);else if(Ji(oe,G))R[B]=oe,R[J]=G,B=J;else break e}}return U}function i(R,U){var G=R.sortIndex-U.sortIndex;return G!==0?G:R.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,c=null,p=3,y=!1,v=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(R){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=R)n(u),U.sortIndex=U.expirationTime,e(l,U);else break;U=r(u)}}function F(R){if(b=!1,C(R),!v)if(r(l)!==null)v=!0,S(L);else{var U=r(u);U!==null&&M(F,U.startTime-R)}}function L(R,U){v=!1,b&&(b=!1,x(H),H=-1),y=!0;var G=p;try{for(C(U),c=r(l);c!==null&&(!(c.expirationTime>U)||R&&!te());){var B=c.callback;if(typeof B=="function"){c.callback=null,p=c.priorityLevel;var g=B(c.expirationTime<=U);U=t.unstable_now(),typeof g=="function"?c.callback=g:c===r(l)&&n(l),C(U)}else n(l);c=r(l)}if(c!==null)var O=!0;else{var ve=r(u);ve!==null&&M(F,ve.startTime-U),O=!1}return O}finally{c=null,p=G,y=!1}}var T=!1,z=null,H=-1,K=5,ne=-1;function te(){return!(t.unstable_now()-neR||125B?(R.sortIndex=G,e(u,R),r(l)===null&&R===r(u)&&(b?(x(H),H=-1):b=!0,M(F,G-B))):(R.sortIndex=g,e(l,R),v||y||(v=!0,S(L))),R},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(R){var U=p;return function(){var G=p;p=U;try{return R.apply(this,arguments)}finally{p=G}}}})(zA);LA.exports=zA;var FF=LA.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var XS=Object.defineProperty;var ZS=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jA=we,yi=FF;function Te(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sm=Object.prototype.hasOwnProperty,CF=/^[: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]*$/,bv={},Av={};function kF(t){return Sm.call(Av,t)?!0:Sm.call(bv,t)?!1:CF.test(t)?Av[t]=!0:(bv[t]=!0,!1)}function _F(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function PF(t,e,r,n){if(e===null||typeof e>"u"||_F(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Gn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var pn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){pn[t]=new Gn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];pn[e]=new Gn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){pn[t]=new Gn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){pn[t]=new Gn(t,2,!1,t,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(t){pn[t]=new Gn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){pn[t]=new Gn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){pn[t]=new Gn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){pn[t]=new Gn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){pn[t]=new Gn(t,5,!1,t.toLowerCase(),null,!1,!1)});var C2=/[\-:]([a-z])/g;function k2(t){return t[1].toUpperCase()}"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(t){var e=t.replace(C2,k2);pn[e]=new Gn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(C2,k2);pn[e]=new Gn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(C2,k2);pn[e]=new Gn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){pn[t]=new Gn(t,1,!1,t.toLowerCase(),null,!1,!1)});pn.xlinkHref=new Gn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){pn[t]=new Gn(t,1,!1,t.toLowerCase(),null,!0,!0)});function _2(t,e,r,n){var i=pn.hasOwnProperty(e)?pn[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sm=Object.prototype.hasOwnProperty,CF=/^[: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]*$/,bv={},Av={};function kF(t){return Sm.call(Av,t)?!0:Sm.call(bv,t)?!1:CF.test(t)?Av[t]=!0:(bv[t]=!0,!1)}function _F(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function PF(t,e,r,n){if(e===null||typeof e>"u"||_F(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Vn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var gn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){gn[t]=new Vn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];gn[e]=new Vn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){gn[t]=new Vn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){gn[t]=new Vn(t,2,!1,t,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(t){gn[t]=new Vn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){gn[t]=new Vn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){gn[t]=new Vn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){gn[t]=new Vn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){gn[t]=new Vn(t,5,!1,t.toLowerCase(),null,!1,!1)});var C2=/[\-:]([a-z])/g;function k2(t){return t[1].toUpperCase()}"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(t){var e=t.replace(C2,k2);gn[e]=new Vn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(C2,k2);gn[e]=new Vn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(C2,k2);gn[e]=new Vn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){gn[t]=new Vn(t,1,!1,t.toLowerCase(),null,!1,!1)});gn.xlinkHref=new Vn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){gn[t]=new Vn(t,1,!1,t.toLowerCase(),null,!0,!0)});function _2(t,e,r,n){var i=gn.hasOwnProperty(e)?gn[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{cg=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Bc(t):""}function NF(t){switch(t.tag){case 5:return Bc(t.type);case 16:return Bc("Lazy");case 13:return Bc("Suspense");case 19:return Bc("SuspenseList");case 0:case 2:case 15:return t=hg(t.type,!1),t;case 11:return t=hg(t.type.render,!1),t;case 1:return t=hg(t.type,!0),t;default:return""}}function _m(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case fu:return"Fragment";case uu:return"Portal";case Fm:return"Profiler";case P2:return"StrictMode";case Cm:return"Suspense";case km:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case VA:return(t.displayName||"Context")+".Consumer";case GA:return(t._context.displayName||"Context")+".Provider";case N2:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case R2:return e=t.displayName||null,e!==null?e:_m(t.type)||"Memo";case Xo:e=t._payload,t=t._init;try{return _m(t(e))}catch{}}return null}function RF(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _m(e);case 8:return e===P2?"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(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ra(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function $A(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function TF(t){var e=$A(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function B0(t){t._valueTracker||(t._valueTracker=TF(t))}function KA(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=$A(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function ep(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Pm(t,e){var r=e.checked;return Nr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Sv(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Ra(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function JA(t,e){e=e.checked,e!=null&&_2(t,"checked",e,!1)}function Nm(t,e){JA(t,e);var r=Ra(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Rm(t,e.type,r):e.hasOwnProperty("defaultValue")&&Rm(t,e.type,Ra(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Fv(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Rm(t,e,r){(e!=="number"||ep(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Oc=Array.isArray;function Tu(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=O0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yh(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Wc={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},IF=["Webkit","ms","Moz","O"];Object.keys(Wc).forEach(function(t){IF.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Wc[e]=Wc[t]})});function XA(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Wc.hasOwnProperty(t)&&Wc[t]?(""+e).trim():e+"px"}function ZA(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=XA(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var MF=Nr({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 Mm(t,e){if(e){if(MF[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Te(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Te(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Te(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Te(62))}}function Bm(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Om=null;function T2(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Um=null,Iu=null,Mu=null;function _v(t){if(t=m0(t)){if(typeof Um!="function")throw Error(Te(280));var e=t.stateNode;e&&(e=m1(e),Um(t.stateNode,t.type,e))}}function e6(t){Iu?Mu?Mu.push(t):Mu=[t]:Iu=t}function t6(){if(Iu){var t=Iu,e=Mu;if(Mu=Iu=null,_v(t),e)for(t=0;t>>=0,t===0?32:31-(QF(t)/$F|0)|0}var U0=64,D0=4194304;function Uc(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ip(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Uc(a):(s&=o,s!==0&&(n=Uc(s)))}else o=r&~i,o!==0?n=Uc(o):s!==0&&(n=Uc(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function p0(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-cs(e),t[e]=r}function YF(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=qc),Uv=String.fromCharCode(32),Dv=!1;function b6(t,e){switch(t){case"keyup":return S7.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A6(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cu=!1;function C7(t,e){switch(t){case"compositionend":return A6(e);case"keypress":return e.which!==32?null:(Dv=!0,Uv);case"textInput":return t=e.data,t===Uv&&Dv?null:t;default:return null}}function k7(t,e){if(cu)return t==="compositionend"||!z2&&b6(t,e)?(t=v6(),Ed=U2=ma=null,cu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Hv(r)}}function C6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?C6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function k6(){for(var t=window,e=ep();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=ep(t.document)}return e}function j2(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function O7(t){var e=k6(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&C6(r.ownerDocument.documentElement,r)){if(n!==null&&j2(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=Gv(r,s);var o=Gv(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,hu=null,Gm=null,Zc=null,Vm=!1;function Vv(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Vm||hu==null||hu!==ep(n)||(n=hu,"selectionStart"in n&&j2(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Zc&&Eh(Zc,n)||(Zc=n,n=ap(Gm,"onSelect"),0gu||(t.current=Ym[gu],Ym[gu]=null,gu--)}function xr(t,e){gu++,Ym[gu]=t.current,t.current=e}var Ta={},Mn=La(Ta),ei=La(!1),kl=Ta;function Tf(t,e){var r=t.type.contextTypes;if(!r)return Ta;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ti(t){return t=t.childContextTypes,t!=null}function up(){wr(ei),wr(Mn)}function qv(t,e,r){if(Mn.current!==Ta)throw Error(Te(168));xr(Mn,e),xr(ei,r)}function O6(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Te(108,RF(t)||"Unknown",i));return Nr({},r,n)}function fp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ta,kl=Mn.current,xr(Mn,t),xr(ei,ei.current),!0}function Xv(t,e,r){var n=t.stateNode;if(!n)throw Error(Te(169));r?(t=O6(t,e,kl),n.__reactInternalMemoizedMergedChildContext=t,wr(ei),wr(Mn),xr(Mn,t)):wr(ei),xr(ei,r)}var so=null,y1=!1,Cg=!1;function U6(t){so===null?so=[t]:so.push(t)}function J7(t){y1=!0,U6(t)}function za(){if(!Cg&&so!==null){Cg=!0;var t=0,e=mr;try{var r=so;for(mr=1;t>=o,i-=o,bo=1<<32-cs(e)+i|r<G?($=D,D=null):$=D.sibling;var ne=p(x,D,C[G],F);if(ne===null){D===null&&(D=$);break}t&&D&&ne.alternate===null&&e(x,D),A=s(ne,A,G),T===null?z=ne:T.sibling=ne,T=ne,D=$}if(G===C.length)return r(x,D),br&&Qa(x,G),z;if(D===null){for(;GG?($=D,D=null):$=D.sibling;var te=p(x,D,ne.value,F);if(te===null){D===null&&(D=$);break}t&&D&&te.alternate===null&&e(x,D),A=s(te,A,G),T===null?z=te:T.sibling=te,T=te,D=$}if(ne.done)return r(x,D),br&&Qa(x,G),z;if(D===null){for(;!ne.done;G++,ne=C.next())ne=c(x,ne.value,F),ne!==null&&(A=s(ne,A,G),T===null?z=ne:T.sibling=ne,T=ne);return br&&Qa(x,G),z}for(D=n(x,D);!ne.done;G++,ne=C.next())ne=y(D,x,G,ne.value,F),ne!==null&&(t&&ne.alternate!==null&&D.delete(ne.key===null?G:ne.key),A=s(ne,A,G),T===null?z=ne:T.sibling=ne,T=ne);return t&&D.forEach(function(de){return e(x,de)}),br&&Qa(x,G),z}function N(x,A,C,F){if(typeof C=="object"&&C!==null&&C.type===fu&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case M0:e:{for(var z=C.key,T=A;T!==null;){if(T.key===z){if(z=C.type,z===fu){if(T.tag===7){r(x,T.sibling),A=i(T,C.props.children),A.return=x,x=A;break e}}else if(T.elementType===z||typeof z=="object"&&z!==null&&z.$$typeof===Xo&&sw(z)===T.type){r(x,T.sibling),A=i(T,C.props),A.ref=bc(x,T,C),A.return=x,x=A;break e}r(x,T);break}else e(x,T);T=T.sibling}C.type===fu?(A=wl(C.props.children,x.mode,F,C.key),A.return=x,x=A):(F=Rd(C.type,C.key,C.props,null,x.mode,F),F.ref=bc(x,A,C),F.return=x,x=F)}return o(x);case uu:e:{for(T=C.key;A!==null;){if(A.key===T)if(A.tag===4&&A.stateNode.containerInfo===C.containerInfo&&A.stateNode.implementation===C.implementation){r(x,A.sibling),A=i(A,C.children||[]),A.return=x,x=A;break e}else{r(x,A);break}else e(x,A);A=A.sibling}A=Mg(C,x.mode,F),A.return=x,x=A}return o(x);case Xo:return T=C._init,N(x,A,T(C._payload),F)}if(Oc(C))return v(x,A,C,F);if(mc(C))return b(x,A,C,F);Q0(x,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,A!==null&&A.tag===6?(r(x,A.sibling),A=i(A,C),A.return=x,x=A):(r(x,A),A=Ig(C,x.mode,F),A.return=x,x=A),o(x)):r(x,A)}return N}var Mf=Q6(!0),$6=Q6(!1),y0={},zs=La(y0),kh=La(y0),_h=La(y0);function qa(t){if(t===y0)throw Error(Te(174));return t}function Y2(t,e){switch(xr(_h,e),xr(kh,t),xr(zs,y0),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Im(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Im(e,t)}wr(zs),xr(zs,e)}function Bf(){wr(zs),wr(kh),wr(_h)}function K6(t){qa(_h.current);var e=qa(zs.current),r=Im(e,t.type);e!==r&&(xr(kh,t),xr(zs,r))}function q2(t){kh.current===t&&(wr(zs),wr(kh))}var Cr=La(0);function mp(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var kg=[];function X2(){for(var t=0;tr?r:4,t(!0);var n=_g.transition;_g.transition={};try{t(!1),e()}finally{mr=r,_g.transition=n}}function u5(){return ji().memoizedState}function X7(t,e,r){var n=Ca(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},f5(t))c5(e,r);else if(r=j6(t,e,r,n),r!==null){var i=jn();hs(r,t,n,i),h5(r,e,n)}}function Z7(t,e,r){var n=Ca(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(f5(t))c5(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,gs(a,o)){var l=e.interleaved;l===null?(i.next=i,J2(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=j6(t,e,i,n),r!==null&&(i=jn(),hs(r,t,n,i),h5(r,e,n))}}function f5(t){var e=t.alternate;return t===Pr||e!==null&&e===Pr}function c5(t,e){eh=yp=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function h5(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,M2(t,r)}}var xp={readContext:zi,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},eC={readContext:zi,useCallback:function(t,e){return Ss().memoizedState=[t,e===void 0?null:e],t},useContext:zi,useEffect:aw,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,kd(4194308,4,i5.bind(null,e,t),r)},useLayoutEffect:function(t,e){return kd(4194308,4,t,e)},useInsertionEffect:function(t,e){return kd(4,2,t,e)},useMemo:function(t,e){var r=Ss();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Ss();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=X7.bind(null,Pr,t),[n.memoizedState,t]},useRef:function(t){var e=Ss();return t={current:t},e.memoizedState=t},useState:ow,useDebugValue:nx,useDeferredValue:function(t){return Ss().memoizedState=t},useTransition:function(){var t=ow(!1),e=t[0];return t=q7.bind(null,t[1]),Ss().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Pr,i=Ss();if(br){if(r===void 0)throw Error(Te(407));r=r()}else{if(r=e(),nn===null)throw Error(Te(349));Pl&30||Y6(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,aw(X6.bind(null,n,s,t),[t]),n.flags|=2048,Rh(9,q6.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Ss(),e=nn.identifierPrefix;if(br){var r=Ao,n=bo;r=(n&~(1<<32-cs(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Ph++,0")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{cg=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Bc(t):""}function NF(t){switch(t.tag){case 5:return Bc(t.type);case 16:return Bc("Lazy");case 13:return Bc("Suspense");case 19:return Bc("SuspenseList");case 0:case 2:case 15:return t=hg(t.type,!1),t;case 11:return t=hg(t.type.render,!1),t;case 1:return t=hg(t.type,!0),t;default:return""}}function _m(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case fu:return"Fragment";case uu:return"Portal";case Fm:return"Profiler";case P2:return"StrictMode";case Cm:return"Suspense";case km:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case VA:return(t.displayName||"Context")+".Consumer";case GA:return(t._context.displayName||"Context")+".Provider";case N2:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case R2:return e=t.displayName||null,e!==null?e:_m(t.type)||"Memo";case Xo:e=t._payload,t=t._init;try{return _m(t(e))}catch{}}return null}function RF(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _m(e);case 8:return e===P2?"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(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ra(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function KA(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function TF(t){var e=KA(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function B0(t){t._valueTracker||(t._valueTracker=TF(t))}function $A(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=KA(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function ep(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Pm(t,e){var r=e.checked;return Nr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Sv(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Ra(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function WA(t,e){e=e.checked,e!=null&&_2(t,"checked",e,!1)}function Nm(t,e){WA(t,e);var r=Ra(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Rm(t,e.type,r):e.hasOwnProperty("defaultValue")&&Rm(t,e.type,Ra(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Fv(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Rm(t,e,r){(e!=="number"||ep(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Oc=Array.isArray;function Tu(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=O0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yh(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Jc={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},IF=["Webkit","ms","Moz","O"];Object.keys(Jc).forEach(function(t){IF.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Jc[e]=Jc[t]})});function XA(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Jc.hasOwnProperty(t)&&Jc[t]?(""+e).trim():e+"px"}function ZA(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=XA(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var MF=Nr({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 Mm(t,e){if(e){if(MF[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Te(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Te(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Te(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Te(62))}}function Bm(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Om=null;function T2(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Um=null,Iu=null,Mu=null;function _v(t){if(t=m0(t)){if(typeof Um!="function")throw Error(Te(280));var e=t.stateNode;e&&(e=m1(e),Um(t.stateNode,t.type,e))}}function e6(t){Iu?Mu?Mu.push(t):Mu=[t]:Iu=t}function t6(){if(Iu){var t=Iu,e=Mu;if(Mu=Iu=null,_v(t),e)for(t=0;t>>=0,t===0?32:31-(QF(t)/KF|0)|0}var U0=64,D0=4194304;function Uc(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ip(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Uc(a):(s&=o,s!==0&&(n=Uc(s)))}else o=r&~i,o!==0?n=Uc(o):s!==0&&(n=Uc(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function p0(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-hs(e),t[e]=r}function YF(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=qc),Uv=String.fromCharCode(32),Dv=!1;function b6(t,e){switch(t){case"keyup":return S7.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A6(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cu=!1;function C7(t,e){switch(t){case"compositionend":return A6(e);case"keypress":return e.which!==32?null:(Dv=!0,Uv);case"textInput":return t=e.data,t===Uv&&Dv?null:t;default:return null}}function k7(t,e){if(cu)return t==="compositionend"||!z2&&b6(t,e)?(t=v6(),Ed=U2=ma=null,cu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Hv(r)}}function C6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?C6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function k6(){for(var t=window,e=ep();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=ep(t.document)}return e}function j2(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function O7(t){var e=k6(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&C6(r.ownerDocument.documentElement,r)){if(n!==null&&j2(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=Gv(r,s);var o=Gv(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,hu=null,Gm=null,Zc=null,Vm=!1;function Vv(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Vm||hu==null||hu!==ep(n)||(n=hu,"selectionStart"in n&&j2(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Zc&&Eh(Zc,n)||(Zc=n,n=ap(Gm,"onSelect"),0gu||(t.current=Ym[gu],Ym[gu]=null,gu--)}function xr(t,e){gu++,Ym[gu]=t.current,t.current=e}var Ta={},Bn=La(Ta),ti=La(!1),kl=Ta;function Tf(t,e){var r=t.type.contextTypes;if(!r)return Ta;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ri(t){return t=t.childContextTypes,t!=null}function up(){wr(ti),wr(Bn)}function qv(t,e,r){if(Bn.current!==Ta)throw Error(Te(168));xr(Bn,e),xr(ti,r)}function O6(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Te(108,RF(t)||"Unknown",i));return Nr({},r,n)}function fp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ta,kl=Bn.current,xr(Bn,t),xr(ti,ti.current),!0}function Xv(t,e,r){var n=t.stateNode;if(!n)throw Error(Te(169));r?(t=O6(t,e,kl),n.__reactInternalMemoizedMergedChildContext=t,wr(ti),wr(Bn),xr(Bn,t)):wr(ti),xr(ti,r)}var oo=null,y1=!1,Cg=!1;function U6(t){oo===null?oo=[t]:oo.push(t)}function W7(t){y1=!0,U6(t)}function za(){if(!Cg&&oo!==null){Cg=!0;var t=0,e=mr;try{var r=oo;for(mr=1;t>=o,i-=o,Ao=1<<32-hs(e)+i|r<H?(K=z,z=null):K=z.sibling;var ne=p(x,z,C[H],F);if(ne===null){z===null&&(z=K);break}t&&z&&ne.alternate===null&&e(x,z),A=s(ne,A,H),T===null?L=ne:T.sibling=ne,T=ne,z=K}if(H===C.length)return r(x,z),br&&Qa(x,H),L;if(z===null){for(;HH?(K=z,z=null):K=z.sibling;var te=p(x,z,ne.value,F);if(te===null){z===null&&(z=K);break}t&&z&&te.alternate===null&&e(x,z),A=s(te,A,H),T===null?L=te:T.sibling=te,T=te,z=K}if(ne.done)return r(x,z),br&&Qa(x,H),L;if(z===null){for(;!ne.done;H++,ne=C.next())ne=c(x,ne.value,F),ne!==null&&(A=s(ne,A,H),T===null?L=ne:T.sibling=ne,T=ne);return br&&Qa(x,H),L}for(z=n(x,z);!ne.done;H++,ne=C.next())ne=y(z,x,H,ne.value,F),ne!==null&&(t&&ne.alternate!==null&&z.delete(ne.key===null?H:ne.key),A=s(ne,A,H),T===null?L=ne:T.sibling=ne,T=ne);return t&&z.forEach(function(de){return e(x,de)}),br&&Qa(x,H),L}function N(x,A,C,F){if(typeof C=="object"&&C!==null&&C.type===fu&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case M0:e:{for(var L=C.key,T=A;T!==null;){if(T.key===L){if(L=C.type,L===fu){if(T.tag===7){r(x,T.sibling),A=i(T,C.props.children),A.return=x,x=A;break e}}else if(T.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Xo&&sw(L)===T.type){r(x,T.sibling),A=i(T,C.props),A.ref=bc(x,T,C),A.return=x,x=A;break e}r(x,T);break}else e(x,T);T=T.sibling}C.type===fu?(A=wl(C.props.children,x.mode,F,C.key),A.return=x,x=A):(F=Rd(C.type,C.key,C.props,null,x.mode,F),F.ref=bc(x,A,C),F.return=x,x=F)}return o(x);case uu:e:{for(T=C.key;A!==null;){if(A.key===T)if(A.tag===4&&A.stateNode.containerInfo===C.containerInfo&&A.stateNode.implementation===C.implementation){r(x,A.sibling),A=i(A,C.children||[]),A.return=x,x=A;break e}else{r(x,A);break}else e(x,A);A=A.sibling}A=Mg(C,x.mode,F),A.return=x,x=A}return o(x);case Xo:return T=C._init,N(x,A,T(C._payload),F)}if(Oc(C))return v(x,A,C,F);if(mc(C))return b(x,A,C,F);Q0(x,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,A!==null&&A.tag===6?(r(x,A.sibling),A=i(A,C),A.return=x,x=A):(r(x,A),A=Ig(C,x.mode,F),A.return=x,x=A),o(x)):r(x,A)}return N}var Mf=Q6(!0),K6=Q6(!1),y0={},js=La(y0),kh=La(y0),_h=La(y0);function qa(t){if(t===y0)throw Error(Te(174));return t}function Y2(t,e){switch(xr(_h,e),xr(kh,t),xr(js,y0),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Im(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Im(e,t)}wr(js),xr(js,e)}function Bf(){wr(js),wr(kh),wr(_h)}function $6(t){qa(_h.current);var e=qa(js.current),r=Im(e,t.type);e!==r&&(xr(kh,t),xr(js,r))}function q2(t){kh.current===t&&(wr(js),wr(kh))}var Cr=La(0);function mp(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var kg=[];function X2(){for(var t=0;tr?r:4,t(!0);var n=_g.transition;_g.transition={};try{t(!1),e()}finally{mr=r,_g.transition=n}}function u5(){return Hi().memoizedState}function X7(t,e,r){var n=Ca(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},f5(t))c5(e,r);else if(r=j6(t,e,r,n),r!==null){var i=Hn();ds(r,t,n,i),h5(r,e,n)}}function Z7(t,e,r){var n=Ca(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(f5(t))c5(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,ms(a,o)){var l=e.interleaved;l===null?(i.next=i,W2(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=j6(t,e,i,n),r!==null&&(i=Hn(),ds(r,t,n,i),h5(r,e,n))}}function f5(t){var e=t.alternate;return t===Pr||e!==null&&e===Pr}function c5(t,e){eh=yp=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function h5(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,M2(t,r)}}var xp={readContext:ji,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useInsertionEffect:bn,useLayoutEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useMutableSource:bn,useSyncExternalStore:bn,useId:bn,unstable_isNewReconciler:!1},eC={readContext:ji,useCallback:function(t,e){return Fs().memoizedState=[t,e===void 0?null:e],t},useContext:ji,useEffect:aw,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,kd(4194308,4,i5.bind(null,e,t),r)},useLayoutEffect:function(t,e){return kd(4194308,4,t,e)},useInsertionEffect:function(t,e){return kd(4,2,t,e)},useMemo:function(t,e){var r=Fs();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Fs();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=X7.bind(null,Pr,t),[n.memoizedState,t]},useRef:function(t){var e=Fs();return t={current:t},e.memoizedState=t},useState:ow,useDebugValue:nx,useDeferredValue:function(t){return Fs().memoizedState=t},useTransition:function(){var t=ow(!1),e=t[0];return t=q7.bind(null,t[1]),Fs().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Pr,i=Fs();if(br){if(r===void 0)throw Error(Te(407));r=r()}else{if(r=e(),nn===null)throw Error(Te(349));Pl&30||Y6(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,aw(X6.bind(null,n,s,t),[t]),n.flags|=2048,Rh(9,q6.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Fs(),e=nn.identifierPrefix;if(br){var r=Eo,n=Ao;r=(n&~(1<<32-hs(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Ph++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Ms]=e,t[Ch]=n,b5(t,e,!1,!1),e.stateNode=t;e:{switch(o=Bm(r,n),r){case"dialog":vr("cancel",t),vr("close",t),i=n;break;case"iframe":case"object":case"embed":vr("load",t),i=n;break;case"video":case"audio":for(i=0;iUf&&(e.flags|=128,n=!0,Ac(s,!1),e.lanes=4194304)}else{if(!n)if(t=mp(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Ac(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!br)return bn(e),null}else 2*Gr()-s.renderingStartTime>Uf&&r!==1073741824&&(e.flags|=128,n=!0,Ac(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Gr(),e.sibling=null,r=Cr.current,xr(Cr,n?r&1|2:r&1),e):(bn(e),null);case 22:case 23:return ux(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?fi&1073741824&&(bn(e),e.subtreeFlags&6&&(e.flags|=8192)):bn(e),null;case 24:return null;case 25:return null}throw Error(Te(156,e.tag))}function lC(t,e){switch(G2(e),e.tag){case 1:return ti(e.type)&&up(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bf(),wr(ei),wr(Mn),X2(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return q2(e),null;case 13:if(wr(Cr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Te(340));If()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wr(Cr),null;case 4:return Bf(),null;case 10:return K2(e.type._context),null;case 22:case 23:return ux(),null;case 24:return null;default:return null}}var K0=!1,_n=!1,uC=typeof WeakSet=="function"?WeakSet:Set,it=null;function vu(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Or(t,e,n)}else r.current=null}function ly(t,e,r){try{r()}catch(n){Or(t,e,n)}}var mw=!1;function fC(t,e){if(Qm=sp,t=k6(),j2(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,f=0,c=t,p=null;t:for(;;){for(var y;c!==r||i!==0&&c.nodeType!==3||(a=o+i),c!==s||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(y=c.firstChild)!==null;)p=c,c=y;for(;;){if(c===t)break t;if(p===r&&++u===i&&(a=o),p===s&&++f===n&&(l=o),(y=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=y}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for($m={focusedElem:t,selectionRange:r},sp=!1,it=e;it!==null;)if(e=it,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,it=t;else for(;it!==null;){e=it;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,N=v.memoizedState,x=e.stateNode,A=x.getSnapshotBeforeUpdate(e.elementType===e.type?b:Zi(e.type,b),N);x.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var C=e.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Te(163))}}catch(F){Or(e,e.return,F)}if(t=e.sibling,t!==null){t.return=e.return,it=t;break}it=e.return}return v=mw,mw=!1,v}function th(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&ly(e,r,s)}i=i.next}while(i!==n)}}function w1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function uy(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function S5(t){var e=t.alternate;e!==null&&(t.alternate=null,S5(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ms],delete e[Ch],delete e[Wm],delete e[$7],delete e[K7])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function F5(t){return t.tag===5||t.tag===3||t.tag===4}function yw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||F5(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function fy(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=lp));else if(n!==4&&(t=t.child,t!==null))for(fy(t,e,r),t=t.sibling;t!==null;)fy(t,e,r),t=t.sibling}function cy(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(cy(t,e,r),t=t.sibling;t!==null;)cy(t,e,r),t=t.sibling}var un=null,os=!1;function Go(t,e,r){for(r=r.child;r!==null;)C5(t,e,r),r=r.sibling}function C5(t,e,r){if(Ls&&typeof Ls.onCommitFiberUnmount=="function")try{Ls.onCommitFiberUnmount(h1,r)}catch{}switch(r.tag){case 5:_n||vu(r,e);case 6:var n=un,i=os;un=null,Go(t,e,r),un=n,os=i,un!==null&&(os?(t=un,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):un.removeChild(r.stateNode));break;case 18:un!==null&&(os?(t=un,r=r.stateNode,t.nodeType===8?Fg(t.parentNode,r):t.nodeType===1&&Fg(t,r),bh(t)):Fg(un,r.stateNode));break;case 4:n=un,i=os,un=r.stateNode.containerInfo,os=!0,Go(t,e,r),un=n,os=i;break;case 0:case 11:case 14:case 15:if(!_n&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ly(r,e,o),i=i.next}while(i!==n)}Go(t,e,r);break;case 1:if(!_n&&(vu(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Or(r,e,a)}Go(t,e,r);break;case 21:Go(t,e,r);break;case 22:r.mode&1?(_n=(n=_n)||r.memoizedState!==null,Go(t,e,r),_n=n):Go(t,e,r);break;default:Go(t,e,r)}}function xw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new uC),e.forEach(function(n){var i=vC.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function $i(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Gr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*hC(n/1960))-n,10t?16:t,ya===null)var n=!1;else{if(t=ya,ya=null,bp=0,lr&6)throw Error(Te(331));var i=lr;for(lr|=4,it=t.current;it!==null;){var s=it,o=s.child;if(it.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lGr()-ax?vl(t,0):ox|=r),ri(t,e)}function M5(t,e){e===0&&(t.mode&1?(e=D0,D0<<=1,!(D0&130023424)&&(D0=4194304)):e=1);var r=jn();t=Po(t,e),t!==null&&(p0(t,e,r),ri(t,r))}function xC(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),M5(t,r)}function vC(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Te(314))}n!==null&&n.delete(e),M5(t,r)}var B5;B5=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ei.current)Zn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Zn=!1,oC(t,e,r);Zn=!!(t.flags&131072)}else Zn=!1,br&&e.flags&1048576&&D6(e,hp,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;_d(t,e),t=e.pendingProps;var i=Tf(e,Mn.current);Ou(e,r),i=ex(null,e,n,t,i,r);var s=tx();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ti(n)?(s=!0,fp(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,W2(e),i.updater=x1,e.stateNode=i,i._reactInternals=e,ty(e,n,t,r),e=iy(null,e,n,!0,s,r)):(e.tag=0,br&&s&&H2(e),Bn(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(_d(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=bC(n),t=Zi(n,t),i){case 0:e=ny(null,e,n,t,r);break e;case 1:e=dw(null,e,n,t,r);break e;case 11:e=cw(null,e,n,t,r);break e;case 14:e=hw(null,e,n,Zi(n.type,t),r);break e}throw Error(Te(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zi(n,i),ny(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zi(n,i),dw(t,e,n,i,r);case 3:e:{if(x5(e),t===null)throw Error(Te(387));n=e.pendingProps,s=e.memoizedState,i=s.element,H6(t,e),gp(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Of(Error(Te(423)),e),e=pw(t,e,n,r,i);break e}else if(n!==i){i=Of(Error(Te(424)),e),e=pw(t,e,n,r,i);break e}else for(di=Ea(e.stateNode.containerInfo.firstChild),mi=e,br=!0,ls=null,r=$6(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(If(),n===i){e=No(t,e,r);break e}Bn(t,e,n,r)}e=e.child}return e;case 5:return K6(e),t===null&&Xm(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Km(n,i)?o=null:s!==null&&Km(n,s)&&(e.flags|=32),y5(t,e),Bn(t,e,o,r),e.child;case 6:return t===null&&Xm(e),null;case 13:return v5(t,e,r);case 4:return Y2(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Mf(e,null,n,r):Bn(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zi(n,i),cw(t,e,n,i,r);case 7:return Bn(t,e,e.pendingProps,r),e.child;case 8:return Bn(t,e,e.pendingProps.children,r),e.child;case 12:return Bn(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,xr(dp,n._currentValue),n._currentValue=o,s!==null)if(gs(s.value,o)){if(s.children===i.children&&!ei.current){e=No(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=So(-1,r&-r),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Zm(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Te(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Zm(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Bn(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Ou(e,r),i=zi(i),n=n(i),e.flags|=1,Bn(t,e,n,r),e.child;case 14:return n=e.type,i=Zi(n,e.pendingProps),i=Zi(n.type,i),hw(t,e,n,i,r);case 15:return g5(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zi(n,i),_d(t,e),e.tag=1,ti(n)?(t=!0,fp(e)):t=!1,Ou(e,r),V6(e,n,i),ty(e,n,i,r),iy(null,e,n,!0,t,r);case 19:return w5(t,e,r);case 22:return m5(t,e,r)}throw Error(Te(156,e.tag))};function O5(t,e){return l6(t,e)}function wC(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ui(t,e,r,n){return new wC(t,e,r,n)}function cx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function bC(t){if(typeof t=="function")return cx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===N2)return 11;if(t===R2)return 14}return 2}function ka(t,e){var r=t.alternate;return r===null?(r=Ui(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Rd(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")cx(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case fu:return wl(r.children,i,s,e);case P2:o=8,i|=8;break;case Fm:return t=Ui(12,r,e,i|2),t.elementType=Fm,t.lanes=s,t;case Cm:return t=Ui(13,r,e,i),t.elementType=Cm,t.lanes=s,t;case km:return t=Ui(19,r,e,i),t.elementType=km,t.lanes=s,t;case QA:return A1(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case GA:o=10;break e;case VA:o=9;break e;case N2:o=11;break e;case R2:o=14;break e;case Xo:o=16,n=null;break e}throw Error(Te(130,t==null?t:typeof t,""))}return e=Ui(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function wl(t,e,r,n){return t=Ui(7,t,n,e),t.lanes=r,t}function A1(t,e,r,n){return t=Ui(22,t,n,e),t.elementType=QA,t.lanes=r,t.stateNode={isHidden:!1},t}function Ig(t,e,r){return t=Ui(6,t,null,e),t.lanes=r,t}function Mg(t,e,r){return e=Ui(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function AC(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pg(0),this.expirationTimes=pg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pg(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hx(t,e,r,n,i,s,o,a,l){return t=new AC(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ui(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},W2(s),t}function EC(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z5)}catch(t){console.error(t)}}z5(),DA.exports=xi;var _C=DA.exports,j5,Cw=_C;j5=Cw.createRoot,Cw.hydrateRoot;/** +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Rg(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function ry(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var nC=typeof WeakMap=="function"?WeakMap:Map;function d5(t,e,r){r=Fo(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){wp||(wp=!0,hy=n),ry(t,e)},r}function p5(t,e,r){r=Fo(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){ry(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){ry(t,e),typeof n!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function lw(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new nC;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=yC.bind(null,t,e,r),e.then(t,t))}function uw(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function fw(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Fo(-1,1),e.tag=2,Sa(r,e,1))),r.lanes|=1),t)}var iC=Do.ReactCurrentOwner,ei=!1;function On(t,e,r,n){e.child=t===null?K6(e,null,r,n):Mf(e,t.child,r,n)}function cw(t,e,r,n,i){r=r.render;var s=e.ref;return Ou(e,i),n=ex(t,e,r,n,s,i),r=tx(),t!==null&&!ei?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,No(t,e,i)):(br&&r&&H2(e),e.flags|=1,On(t,e,n,i),e.child)}function hw(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!cx(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,g5(t,e,s,n,i)):(t=Rd(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:Eh,r(o,n)&&t.ref===e.ref)return No(t,e,i)}return e.flags|=1,t=ka(s,n),t.ref=e.ref,t.return=e,e.child=t}function g5(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Eh(s,n)&&t.ref===e.ref)if(ei=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(ei=!0);else return e.lanes=t.lanes,No(t,e,i)}return ny(t,e,r,n,i)}function m5(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},xr(wu,ci),ci|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,xr(wu,ci),ci|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,xr(wu,ci),ci|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,xr(wu,ci),ci|=n;return On(t,e,i,r),e.child}function y5(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function ny(t,e,r,n,i){var s=ri(r)?kl:Bn.current;return s=Tf(e,s),Ou(e,i),r=ex(t,e,r,n,s,i),n=tx(),t!==null&&!ei?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,No(t,e,i)):(br&&n&&H2(e),e.flags|=1,On(t,e,r,i),e.child)}function dw(t,e,r,n,i){if(ri(r)){var s=!0;fp(e)}else s=!1;if(Ou(e,i),e.stateNode===null)_d(t,e),V6(e,r,n),ty(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=ji(u):(u=ri(r)?kl:Bn.current,u=Tf(e,u));var f=r.getDerivedStateFromProps,c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&iw(e,o,n,u),Zo=!1;var p=e.memoizedState;o.state=p,gp(e,n,o,i),l=e.memoizedState,a!==n||p!==l||ti.current||Zo?(typeof f=="function"&&(ey(e,r,f,n),l=e.memoizedState),(a=Zo||nw(e,r,a,n,p,l,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,H6(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:es(e.type,a),o.props=u,c=e.pendingProps,p=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=ji(l):(l=ri(r)?kl:Bn.current,l=Tf(e,l));var y=r.getDerivedStateFromProps;(f=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==c||p!==l)&&iw(e,o,n,l),Zo=!1,p=e.memoizedState,o.state=p,gp(e,n,o,i);var v=e.memoizedState;a!==c||p!==v||ti.current||Zo?(typeof y=="function"&&(ey(e,r,y,n),v=e.memoizedState),(u=Zo||nw(e,r,u,n,p,v,l)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=v),o.props=n,o.state=v,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return iy(t,e,r,n,s,i)}function iy(t,e,r,n,i,s){y5(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&Xv(e,r,!1),No(t,e,s);n=e.stateNode,iC.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Mf(e,t.child,null,s),e.child=Mf(e,null,a,s)):On(t,e,a,s),e.memoizedState=n.state,i&&Xv(e,r,!0),e.child}function x5(t){var e=t.stateNode;e.pendingContext?qv(t,e.pendingContext,e.pendingContext!==e.context):e.context&&qv(t,e.context,!1),Y2(t,e.containerInfo)}function pw(t,e,r,n,i){return If(),V2(i),e.flags|=256,On(t,e,r,n),e.child}var sy={dehydrated:null,treeContext:null,retryLane:0};function oy(t){return{baseLanes:t,cachePool:null,transitions:null}}function v5(t,e,r){var n=e.pendingProps,i=Cr.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),xr(Cr,i&1),t===null)return Xm(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=A1(o,n,0,null),t=wl(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=oy(r),e.memoizedState=sy,t):ix(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return sC(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=ka(i,l),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ka(a,s):(s=wl(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?oy(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=sy,n}return s=t.child,t=s.sibling,n=ka(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function ix(t,e){return e=A1({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function K0(t,e,r,n){return n!==null&&V2(n),Mf(e,t.child,null,r),t=ix(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function sC(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Rg(Error(Te(422))),K0(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=A1({mode:"visible",children:n.children},i,0,null),s=wl(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&Mf(e,t.child,null,o),e.child.memoizedState=oy(o),e.memoizedState=sy,s);if(!(e.mode&1))return K0(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(Te(419)),n=Rg(s,n,void 0),K0(t,e,o,n)}if(a=(o&t.childLanes)!==0,ei||a){if(n=nn,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Po(t,i),ds(n,t,i,-1))}return fx(),n=Rg(Error(Te(421))),K0(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=xC.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,pi=Ea(i.nextSibling),yi=e,br=!0,us=null,t!==null&&(Oi[Ui++]=Ao,Oi[Ui++]=Eo,Oi[Ui++]=_l,Ao=t.id,Eo=t.overflow,_l=e),e=ix(e,n.children),e.flags|=4096,e)}function gw(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Zm(t.return,e,r)}function Tg(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function w5(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(On(t,e,n.children,r),n=Cr.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&gw(t,r,e);else if(t.tag===19)gw(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(xr(Cr,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&mp(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Tg(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&mp(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Tg(e,!0,r,null,s);break;case"together":Tg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function _d(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function No(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Nl|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Te(153));if(e.child!==null){for(t=e.child,r=ka(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=ka(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function oC(t,e,r){switch(e.tag){case 3:x5(e),If();break;case 5:$6(e);break;case 1:ri(e.type)&&fp(e);break;case 4:Y2(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;xr(dp,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(xr(Cr,Cr.current&1),e.flags|=128,null):r&e.child.childLanes?v5(t,e,r):(xr(Cr,Cr.current&1),t=No(t,e,r),t!==null?t.sibling:null);xr(Cr,Cr.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return w5(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),xr(Cr,Cr.current),n)break;return null;case 22:case 23:return e.lanes=0,m5(t,e,r)}return No(t,e,r)}var b5,ay,A5,E5;b5=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};ay=function(){};A5=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,qa(js.current);var s=null;switch(r){case"input":i=Pm(t,i),n=Pm(t,n),s=[];break;case"select":i=Nr({},i,{value:void 0}),n=Nr({},n,{value:void 0}),s=[];break;case"textarea":i=Tm(t,i),n=Tm(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=lp)}Mm(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(mh.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var l=n[u];if(a=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(s||(s=[]),s.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(mh.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&vr("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}r&&(s=s||[]).push("style",r);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};E5=function(t,e,r,n){r!==n&&(e.flags|=4)};function Ac(t,e){if(!br)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function An(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function aC(t,e,r){var n=e.pendingProps;switch(G2(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return An(e),null;case 1:return ri(e.type)&&up(),An(e),null;case 3:return n=e.stateNode,Bf(),wr(ti),wr(Bn),X2(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(V0(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,us!==null&&(gy(us),us=null))),ay(t,e),An(e),null;case 5:q2(e);var i=qa(_h.current);if(r=e.type,t!==null&&e.stateNode!=null)A5(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Te(166));return An(e),null}if(t=qa(js.current),V0(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Bs]=e,n[Ch]=s,t=(e.mode&1)!==0,r){case"dialog":vr("cancel",n),vr("close",n);break;case"iframe":case"object":case"embed":vr("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Bs]=e,t[Ch]=n,b5(t,e,!1,!1),e.stateNode=t;e:{switch(o=Bm(r,n),r){case"dialog":vr("cancel",t),vr("close",t),i=n;break;case"iframe":case"object":case"embed":vr("load",t),i=n;break;case"video":case"audio":for(i=0;iUf&&(e.flags|=128,n=!0,Ac(s,!1),e.lanes=4194304)}else{if(!n)if(t=mp(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Ac(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!br)return An(e),null}else 2*Gr()-s.renderingStartTime>Uf&&r!==1073741824&&(e.flags|=128,n=!0,Ac(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Gr(),e.sibling=null,r=Cr.current,xr(Cr,n?r&1|2:r&1),e):(An(e),null);case 22:case 23:return ux(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ci&1073741824&&(An(e),e.subtreeFlags&6&&(e.flags|=8192)):An(e),null;case 24:return null;case 25:return null}throw Error(Te(156,e.tag))}function lC(t,e){switch(G2(e),e.tag){case 1:return ri(e.type)&&up(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bf(),wr(ti),wr(Bn),X2(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return q2(e),null;case 13:if(wr(Cr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Te(340));If()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wr(Cr),null;case 4:return Bf(),null;case 10:return $2(e.type._context),null;case 22:case 23:return ux(),null;case 24:return null;default:return null}}var $0=!1,Pn=!1,uC=typeof WeakSet=="function"?WeakSet:Set,it=null;function vu(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Or(t,e,n)}else r.current=null}function ly(t,e,r){try{r()}catch(n){Or(t,e,n)}}var mw=!1;function fC(t,e){if(Qm=sp,t=k6(),j2(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,f=0,c=t,p=null;t:for(;;){for(var y;c!==r||i!==0&&c.nodeType!==3||(a=o+i),c!==s||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(y=c.firstChild)!==null;)p=c,c=y;for(;;){if(c===t)break t;if(p===r&&++u===i&&(a=o),p===s&&++f===n&&(l=o),(y=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=y}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Km={focusedElem:t,selectionRange:r},sp=!1,it=e;it!==null;)if(e=it,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,it=t;else for(;it!==null;){e=it;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,N=v.memoizedState,x=e.stateNode,A=x.getSnapshotBeforeUpdate(e.elementType===e.type?b:es(e.type,b),N);x.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var C=e.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Te(163))}}catch(F){Or(e,e.return,F)}if(t=e.sibling,t!==null){t.return=e.return,it=t;break}it=e.return}return v=mw,mw=!1,v}function th(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&ly(e,r,s)}i=i.next}while(i!==n)}}function w1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function uy(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function S5(t){var e=t.alternate;e!==null&&(t.alternate=null,S5(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Bs],delete e[Ch],delete e[Jm],delete e[K7],delete e[$7])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function F5(t){return t.tag===5||t.tag===3||t.tag===4}function yw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||F5(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function fy(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=lp));else if(n!==4&&(t=t.child,t!==null))for(fy(t,e,r),t=t.sibling;t!==null;)fy(t,e,r),t=t.sibling}function cy(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(cy(t,e,r),t=t.sibling;t!==null;)cy(t,e,r),t=t.sibling}var un=null,as=!1;function Go(t,e,r){for(r=r.child;r!==null;)C5(t,e,r),r=r.sibling}function C5(t,e,r){if(zs&&typeof zs.onCommitFiberUnmount=="function")try{zs.onCommitFiberUnmount(h1,r)}catch{}switch(r.tag){case 5:Pn||vu(r,e);case 6:var n=un,i=as;un=null,Go(t,e,r),un=n,as=i,un!==null&&(as?(t=un,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):un.removeChild(r.stateNode));break;case 18:un!==null&&(as?(t=un,r=r.stateNode,t.nodeType===8?Fg(t.parentNode,r):t.nodeType===1&&Fg(t,r),bh(t)):Fg(un,r.stateNode));break;case 4:n=un,i=as,un=r.stateNode.containerInfo,as=!0,Go(t,e,r),un=n,as=i;break;case 0:case 11:case 14:case 15:if(!Pn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ly(r,e,o),i=i.next}while(i!==n)}Go(t,e,r);break;case 1:if(!Pn&&(vu(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Or(r,e,a)}Go(t,e,r);break;case 21:Go(t,e,r);break;case 22:r.mode&1?(Pn=(n=Pn)||r.memoizedState!==null,Go(t,e,r),Pn=n):Go(t,e,r);break;default:Go(t,e,r)}}function xw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new uC),e.forEach(function(n){var i=vC.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function $i(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Gr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*hC(n/1960))-n,10t?16:t,ya===null)var n=!1;else{if(t=ya,ya=null,bp=0,lr&6)throw Error(Te(331));var i=lr;for(lr|=4,it=t.current;it!==null;){var s=it,o=s.child;if(it.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lGr()-ax?vl(t,0):ox|=r),ni(t,e)}function M5(t,e){e===0&&(t.mode&1?(e=D0,D0<<=1,!(D0&130023424)&&(D0=4194304)):e=1);var r=Hn();t=Po(t,e),t!==null&&(p0(t,e,r),ni(t,r))}function xC(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),M5(t,r)}function vC(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Te(314))}n!==null&&n.delete(e),M5(t,r)}var B5;B5=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ti.current)ei=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return ei=!1,oC(t,e,r);ei=!!(t.flags&131072)}else ei=!1,br&&e.flags&1048576&&D6(e,hp,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;_d(t,e),t=e.pendingProps;var i=Tf(e,Bn.current);Ou(e,r),i=ex(null,e,n,t,i,r);var s=tx();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ri(n)?(s=!0,fp(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,J2(e),i.updater=x1,e.stateNode=i,i._reactInternals=e,ty(e,n,t,r),e=iy(null,e,n,!0,s,r)):(e.tag=0,br&&s&&H2(e),On(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(_d(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=bC(n),t=es(n,t),i){case 0:e=ny(null,e,n,t,r);break e;case 1:e=dw(null,e,n,t,r);break e;case 11:e=cw(null,e,n,t,r);break e;case 14:e=hw(null,e,n,es(n.type,t),r);break e}throw Error(Te(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:es(n,i),ny(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:es(n,i),dw(t,e,n,i,r);case 3:e:{if(x5(e),t===null)throw Error(Te(387));n=e.pendingProps,s=e.memoizedState,i=s.element,H6(t,e),gp(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Of(Error(Te(423)),e),e=pw(t,e,n,r,i);break e}else if(n!==i){i=Of(Error(Te(424)),e),e=pw(t,e,n,r,i);break e}else for(pi=Ea(e.stateNode.containerInfo.firstChild),yi=e,br=!0,us=null,r=K6(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(If(),n===i){e=No(t,e,r);break e}On(t,e,n,r)}e=e.child}return e;case 5:return $6(e),t===null&&Xm(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,$m(n,i)?o=null:s!==null&&$m(n,s)&&(e.flags|=32),y5(t,e),On(t,e,o,r),e.child;case 6:return t===null&&Xm(e),null;case 13:return v5(t,e,r);case 4:return Y2(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Mf(e,null,n,r):On(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:es(n,i),cw(t,e,n,i,r);case 7:return On(t,e,e.pendingProps,r),e.child;case 8:return On(t,e,e.pendingProps.children,r),e.child;case 12:return On(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,xr(dp,n._currentValue),n._currentValue=o,s!==null)if(ms(s.value,o)){if(s.children===i.children&&!ti.current){e=No(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=Fo(-1,r&-r),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Zm(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Te(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Zm(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}On(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Ou(e,r),i=ji(i),n=n(i),e.flags|=1,On(t,e,n,r),e.child;case 14:return n=e.type,i=es(n,e.pendingProps),i=es(n.type,i),hw(t,e,n,i,r);case 15:return g5(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:es(n,i),_d(t,e),e.tag=1,ri(n)?(t=!0,fp(e)):t=!1,Ou(e,r),V6(e,n,i),ty(e,n,i,r),iy(null,e,n,!0,t,r);case 19:return w5(t,e,r);case 22:return m5(t,e,r)}throw Error(Te(156,e.tag))};function O5(t,e){return l6(t,e)}function wC(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(t,e,r,n){return new wC(t,e,r,n)}function cx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function bC(t){if(typeof t=="function")return cx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===N2)return 11;if(t===R2)return 14}return 2}function ka(t,e){var r=t.alternate;return r===null?(r=Di(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Rd(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")cx(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case fu:return wl(r.children,i,s,e);case P2:o=8,i|=8;break;case Fm:return t=Di(12,r,e,i|2),t.elementType=Fm,t.lanes=s,t;case Cm:return t=Di(13,r,e,i),t.elementType=Cm,t.lanes=s,t;case km:return t=Di(19,r,e,i),t.elementType=km,t.lanes=s,t;case QA:return A1(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case GA:o=10;break e;case VA:o=9;break e;case N2:o=11;break e;case R2:o=14;break e;case Xo:o=16,n=null;break e}throw Error(Te(130,t==null?t:typeof t,""))}return e=Di(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function wl(t,e,r,n){return t=Di(7,t,n,e),t.lanes=r,t}function A1(t,e,r,n){return t=Di(22,t,n,e),t.elementType=QA,t.lanes=r,t.stateNode={isHidden:!1},t}function Ig(t,e,r){return t=Di(6,t,null,e),t.lanes=r,t}function Mg(t,e,r){return e=Di(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function AC(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pg(0),this.expirationTimes=pg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pg(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hx(t,e,r,n,i,s,o,a,l){return t=new AC(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Di(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},J2(s),t}function EC(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z5)}catch(t){console.error(t)}}z5(),DA.exports=vi;var _C=DA.exports,j5,Cw=_C;j5=Cw.createRoot,Cw.hydrateRoot;/** * @remix-run/router v1.11.0 * * Copyright (c) Remix Software Inc. @@ -46,8 +46,8 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ur(){return Ur=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Ia(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function NC(){return Math.random().toString(36).substr(2,8)}function _w(t,e){return{usr:t.state,key:t.key,idx:e}}function Ih(t,e,r,n){return r===void 0&&(r=null),Ur({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ys(e):e,{state:r,key:e&&e.key||n||NC()})}function x0(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ys(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function RC(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=zr.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(Ur({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){a=zr.Pop;let N=f(),x=N==null?null:N-u;u=N,l&&l({action:a,location:b.location,delta:x})}function p(N,x){a=zr.Push;let A=Ih(b.location,N,x);r&&r(A,N),u=f()+1;let C=_w(A,u),F=b.createHref(A);try{o.pushState(C,"",F)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;i.location.assign(F)}s&&l&&l({action:a,location:b.location,delta:1})}function y(N,x){a=zr.Replace;let A=Ih(b.location,N,x);r&&r(A,N),u=f();let C=_w(A,u),F=b.createHref(A);o.replaceState(C,"",F),s&&l&&l({action:a,location:b.location,delta:0})}function v(N){let x=i.location.origin!=="null"?i.location.origin:i.location.href,A=typeof N=="string"?N:x0(N);return qt(x,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,x)}let b={get action(){return a},get location(){return t(i,o)},listen(N){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(kw,c),l=N,()=>{i.removeEventListener(kw,c),l=null}},createHref(N){return e(i,N)},createURL:v,encodeLocation(N){let x=v(N);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:y,go(N){return o.go(N)}};return b}var jr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(jr||(jr={}));const TC=new Set(["lazy","caseSensitive","path","id","index","children"]);function IC(t){return t.index===!0}function my(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((i,s)=>{let o=[...r,s],a=typeof i.id=="string"?i.id:o.join("-");if(qt(i.index!==!0||!i.children,"Cannot specify children on an index route"),qt(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),IC(i)){let l=Ur({},i,e(i),{id:a});return n[a]=l,l}else{let l=Ur({},i,e(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=my(i.children,e,o,n)),l}})}function bu(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Ys(e):e,i=v0(n.pathname||"/",r);if(i==null)return null;let s=H5(t);BC(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(qt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=_a([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&(qt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),H5(s.children,e,f,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:HC(u,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of G5(s.path))i(s,o,l)}),e}function G5(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=G5(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function BC(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:GC(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const OC=/^:\w+$/,UC=3,DC=2,LC=1,zC=10,jC=-2,Pw=t=>t==="*";function HC(t,e){let r=t.split("/"),n=r.length;return r.some(Pw)&&(n+=jC),e&&(n+=DC),r.filter(i=>!Pw(i)).reduce((i,s)=>i+(OC.test(s)?UC:s===""?LC:zC),n)}function GC(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function VC(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o{let{paramName:p,isOptional:y}=f;if(p==="*"){let b=a[c]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const v=a[c];return y&&!v?u[p]=void 0:u[p]=JC(v||"",p),u},{}),pathname:s,pathnameBase:o,pattern:t}}function $C(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Ia(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function KC(t){try{return decodeURI(t)}catch(e){return Ia(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function JC(t,e){try{return decodeURIComponent(t)}catch(r){return Ia(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function v0(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function WC(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Ys(t):t;return{pathname:r?r.startsWith("/")?r:YC(r,e):e,search:XC(n),hash:ZC(i)}}function YC(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Bg(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function mx(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function V5(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Ys(t):(i=Ur({},t),qt(!i.pathname||!i.pathname.includes("?"),Bg("?","pathname","search",i)),qt(!i.pathname||!i.pathname.includes("#"),Bg("#","pathname","hash",i)),qt(!i.search||!i.search.includes("#"),Bg("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(n||o==null)a=r;else{let c=e.length-1;if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;i.pathname=p.join("/")}a=c>=0?e[c]:"/"}let l=WC(i,a),u=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const _a=t=>t.join("/").replace(/\/\/+/g,"/"),qC=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),XC=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,ZC=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class yx{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Q5(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const $5=["post","put","patch","delete"],ek=new Set($5),tk=["get",...$5],rk=new Set(tk),nk=new Set([301,302,303,307,308]),ik=new Set([307,308]),Og={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},K5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ok=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),J5="remix-router-transitions";function ak(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;qt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let q=t.detectErrorBoundary;i=re=>({hasErrorBoundary:q(re)})}else i=ok;let s={},o=my(t.routes,i,void 0,s),a,l=t.basename||"/",u=Ur({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),f=null,c=new Set,p=null,y=null,v=null,b=t.hydrationData!=null,N=bu(o,t.history.location,l),x=null;if(N==null){let q=Ti(404,{pathname:t.history.location.pathname}),{matches:re,route:ae}=Uw(o);N=re,x={[ae.id]:q}}let A=!N.some(q=>q.route.lazy)&&(!N.some(q=>q.route.loader)||t.hydrationData!=null),C,F={historyAction:t.history.action,location:t.history.location,matches:N,initialized:A,navigation:Og,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},z=zr.Pop,T=!1,D,G=!1,$=new Map,ne=null,te=!1,de=!1,_=[],h=[],m=new Map,S=0,M=-1,R=new Map,U=new Set,H=new Map,B=new Map,g=new Set,O=new Map,ve=new Map,E=!1;function W(){if(f=t.history.listen(q=>{let{action:re,location:ae,delta:ke}=q;if(E){E=!1;return}Ia(ve.size===0||ke!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ie=kt({currentLocation:F.location,nextLocation:ae,historyAction:re});if(Ie&&ke!=null){E=!0,t.history.go(ke*-1),Et(Ie,{state:"blocked",location:ae,proceed(){Et(Ie,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),t.history.go(ke)},reset(){let Le=new Map(F.blockers);Le.set(Ie,Sc),K({blockers:Le})}});return}return Ue(re,ae)}),r){xk(e,$);let q=()=>vk(e,$);e.addEventListener("pagehide",q),ne=()=>e.removeEventListener("pagehide",q)}return F.initialized||Ue(zr.Pop,F.location),C}function oe(){f&&f(),ne&&ne(),c.clear(),D&&D.abort(),F.fetchers.forEach((q,re)=>tt(re)),F.blockers.forEach((q,re)=>Wt(re))}function J(q){return c.add(q),()=>c.delete(q)}function K(q,re){F=Ur({},F,q);let ae=[],ke=[];u.v7_fetcherPersist&&F.fetchers.forEach((Ie,Le)=>{Ie.state==="idle"&&(g.has(Le)?ke.push(Le):ae.push(Le))}),c.forEach(Ie=>Ie(F,{deletedFetchers:ke,unstable_viewTransitionOpts:re})),u.v7_fetcherPersist&&(ae.forEach(Ie=>F.fetchers.delete(Ie)),ke.forEach(Ie=>tt(Ie)))}function V(q,re){var ae,ke;let Ie=F.actionData!=null&&F.navigation.formMethod!=null&&as(F.navigation.formMethod)&&F.navigation.state==="loading"&&((ae=q.state)==null?void 0:ae._isRedirect)!==!0,Le;re.actionData?Object.keys(re.actionData).length>0?Le=re.actionData:Le=null:Ie?Le=F.actionData:Le=null;let ht=re.loaderData?Ow(F.loaderData,re.loaderData,re.matches||[],re.errors):F.loaderData,He=F.blockers;He.size>0&&(He=new Map(He),He.forEach((wt,Je)=>He.set(Je,Sc)));let je=T===!0||F.navigation.formMethod!=null&&as(F.navigation.formMethod)&&((ke=q.state)==null?void 0:ke._isRedirect)!==!0;a&&(o=a,a=void 0),te||z===zr.Pop||(z===zr.Push?t.history.push(q,q.state):z===zr.Replace&&t.history.replace(q,q.state));let Gt;if(z===zr.Pop){let wt=$.get(F.location.pathname);wt&&wt.has(q.pathname)?Gt={currentLocation:F.location,nextLocation:q}:$.has(q.pathname)&&(Gt={currentLocation:q,nextLocation:F.location})}else if(G){let wt=$.get(F.location.pathname);wt?wt.add(q.pathname):(wt=new Set([q.pathname]),$.set(F.location.pathname,wt)),Gt={currentLocation:F.location,nextLocation:q}}K(Ur({},re,{actionData:Le,loaderData:ht,historyAction:z,location:q,initialized:!0,navigation:Og,revalidation:"idle",restoreScrollPosition:St(q,re.matches||F.matches),preventScrollReset:je,blockers:He}),Gt),z=zr.Pop,T=!1,G=!1,te=!1,de=!1,_=[],h=[]}async function Z(q,re){if(typeof q=="number"){t.history.go(q);return}let ae=yy(F.location,F.matches,l,u.v7_prependBasename,q,re==null?void 0:re.fromRouteId,re==null?void 0:re.relative),{path:ke,submission:Ie,error:Le}=Nw(u.v7_normalizeFormMethod,!1,ae,re),ht=F.location,He=Ih(F.location,ke,re&&re.state);He=Ur({},He,t.history.encodeLocation(He));let je=re&&re.replace!=null?re.replace:void 0,Gt=zr.Push;je===!0?Gt=zr.Replace:je===!1||Ie!=null&&as(Ie.formMethod)&&Ie.formAction===F.location.pathname+F.location.search&&(Gt=zr.Replace);let wt=re&&"preventScrollReset"in re?re.preventScrollReset===!0:void 0,Je=kt({currentLocation:ht,nextLocation:He,historyAction:Gt});if(Je){Et(Je,{state:"blocked",location:He,proceed(){Et(Je,{state:"proceeding",proceed:void 0,reset:void 0,location:He}),Z(q,re)},reset(){let Ht=new Map(F.blockers);Ht.set(Je,Sc),K({blockers:Ht})}});return}return await Ue(Gt,He,{submission:Ie,pendingError:Le,preventScrollReset:wt,replace:re&&re.replace,enableViewTransition:re&&re.unstable_viewTransition})}function he(){if(De(),K({revalidation:"loading"}),F.navigation.state!=="submitting"){if(F.navigation.state==="idle"){Ue(F.historyAction,F.location,{startUninterruptedRevalidation:!0});return}Ue(z||F.historyAction,F.navigation.location,{overrideNavigation:F.navigation})}}async function Ue(q,re,ae){D&&D.abort(),D=null,z=q,te=(ae&&ae.startUninterruptedRevalidation)===!0,ir(F.location,F.matches),T=(ae&&ae.preventScrollReset)===!0,G=(ae&&ae.enableViewTransition)===!0;let ke=a||o,Ie=ae&&ae.overrideNavigation,Le=bu(ke,re,l);if(!Le){let Ht=Ti(404,{pathname:re.pathname}),{matches:w,route:k}=Uw(ke);$t(),V(re,{matches:w,loaderData:{},errors:{[k.id]:Ht}});return}if(F.initialized&&!de&&hk(F.location,re)&&!(ae&&ae.submission&&as(ae.submission.formMethod))){V(re,{matches:Le});return}D=new AbortController;let ht=Cc(t.history,re,D.signal,ae&&ae.submission),He,je;if(ae&&ae.pendingError)je={[ih(Le).route.id]:ae.pendingError};else if(ae&&ae.submission&&as(ae.submission.formMethod)){let Ht=await pe(ht,re,ae.submission,Le,{replace:ae.replace});if(Ht.shortCircuited)return;He=Ht.pendingActionData,je=Ht.pendingActionError,Ie=Ug(re,ae.submission),ht=new Request(ht.url,{signal:ht.signal})}let{shortCircuited:Gt,loaderData:wt,errors:Je}=await Be(ht,re,Le,Ie,ae&&ae.submission,ae&&ae.fetcherSubmission,ae&&ae.replace,He,je);Gt||(D=null,V(re,Ur({matches:Le},He?{actionData:He}:{},{loaderData:wt,errors:Je})))}async function pe(q,re,ae,ke,Ie){Ie===void 0&&(Ie={}),De();let Le=mk(re,ae);K({navigation:Le});let ht,He=vy(ke,re);if(!He.route.action&&!He.route.lazy)ht={type:jr.error,error:Ti(405,{method:q.method,pathname:re.pathname,routeId:He.route.id})};else if(ht=await Fc("action",q,He,ke,s,i,l),q.signal.aborted)return{shortCircuited:!0};if(Du(ht)){let je;return Ie&&Ie.replace!=null?je=Ie.replace:je=ht.location===F.location.pathname+F.location.search,await ze(F,ht,{submission:ae,replace:je}),{shortCircuited:!0}}if(sh(ht)){let je=ih(ke,He.route.id);return(Ie&&Ie.replace)!==!0&&(z=zr.Push),{pendingActionData:{},pendingActionError:{[je.route.id]:ht.error}}}if(Xa(ht))throw Ti(400,{type:"defer-action"});return{pendingActionData:{[He.route.id]:ht.data}}}async function Be(q,re,ae,ke,Ie,Le,ht,He,je){let Gt=ke||Ug(re,Ie),wt=Ie||Le||zw(Gt),Je=a||o,[Ht,w]=Rw(t.history,F,ae,wt,re,de,_,h,H,U,Je,l,He,je);if($t(qe=>!(ae&&ae.some(Me=>Me.route.id===qe))||Ht&&Ht.some(Me=>Me.route.id===qe)),M=++S,Ht.length===0&&w.length===0){let qe=fr();return V(re,Ur({matches:ae,loaderData:{},errors:je||null},He?{actionData:He}:{},qe?{fetchers:new Map(F.fetchers)}:{})),{shortCircuited:!0}}if(!te){w.forEach(Me=>{let rt=F.fetchers.get(Me.key),Ve=kc(void 0,rt?rt.data:void 0);F.fetchers.set(Me.key,Ve)});let qe=He||F.actionData;K(Ur({navigation:Gt},qe?Object.keys(qe).length===0?{actionData:null}:{actionData:qe}:{},w.length>0?{fetchers:new Map(F.fetchers)}:{}))}w.forEach(qe=>{m.has(qe.key)&&yt(qe.key),qe.controller&&m.set(qe.key,qe.controller)});let k=()=>w.forEach(qe=>yt(qe.key));D&&D.signal.addEventListener("abort",k);let{results:P,loaderResults:d,fetcherResults:I}=await ye(F.matches,ae,Ht,w,q);if(q.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",k),w.forEach(qe=>m.delete(qe.key));let X=Dw(P);if(X){if(X.idx>=Ht.length){let qe=w[X.idx-Ht.length].key;U.add(qe)}return await ze(F,X.result,{replace:ht}),{shortCircuited:!0}}let{loaderData:Y,errors:ue}=Bw(F,ae,Ht,d,je,w,I,O);O.forEach((qe,Me)=>{qe.subscribe(rt=>{(rt||qe.done)&&O.delete(Me)})});let Se=fr(),Re=Tt(M),Fe=Se||Re||w.length>0;return Ur({loaderData:Y,errors:ue},Fe?{fetchers:new Map(F.fetchers)}:{})}function ut(q){return u.v7_fetcherPersist&&(B.set(q,(B.get(q)||0)+1),g.has(q)&&g.delete(q)),F.fetchers.get(q)||sk}function We(q,re,ae,ke){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");m.has(q)&&yt(q);let Ie=a||o,Le=yy(F.location,F.matches,l,u.v7_prependBasename,ae,re,ke==null?void 0:ke.relative),ht=bu(Ie,Le,l);if(!ht){Ce(q,re,Ti(404,{pathname:Le}));return}let{path:He,submission:je,error:Gt}=Nw(u.v7_normalizeFormMethod,!0,Le,ke);if(Gt){Ce(q,re,Gt);return}let wt=vy(ht,He);if(T=(ke&&ke.preventScrollReset)===!0,je&&as(je.formMethod)){Ye(q,re,He,wt,ht,je);return}H.set(q,{routeId:re,path:He}),pt(q,re,He,wt,ht,je)}async function Ye(q,re,ae,ke,Ie,Le){if(De(),H.delete(q),!ke.route.action&&!ke.route.lazy){let Ve=Ti(405,{method:Le.formMethod,pathname:ae,routeId:re});Ce(q,re,Ve);return}let ht=F.fetchers.get(q),He=yk(Le,ht);F.fetchers.set(q,He),K({fetchers:new Map(F.fetchers)});let je=new AbortController,Gt=Cc(t.history,ae,je.signal,Le);m.set(q,je);let wt=S,Je=await Fc("action",Gt,ke,Ie,s,i,l);if(Gt.signal.aborted){m.get(q)===je&&m.delete(q);return}if(g.has(q)){F.fetchers.set(q,Wo(void 0)),K({fetchers:new Map(F.fetchers)});return}if(Du(Je))if(m.delete(q),M>wt){let Ve=Wo(void 0);F.fetchers.set(q,Ve),K({fetchers:new Map(F.fetchers)});return}else{U.add(q);let Ve=kc(Le);return F.fetchers.set(q,Ve),K({fetchers:new Map(F.fetchers)}),ze(F,Je,{fetcherSubmission:Le})}if(sh(Je)){Ce(q,re,Je.error);return}if(Xa(Je))throw Ti(400,{type:"defer-action"});let Ht=F.navigation.location||F.location,w=Cc(t.history,Ht,je.signal),k=a||o,P=F.navigation.state!=="idle"?bu(k,F.navigation.location,l):F.matches;qt(P,"Didn't find any matches after fetcher action");let d=++S;R.set(q,d);let I=kc(Le,Je.data);F.fetchers.set(q,I);let[X,Y]=Rw(t.history,F,P,Le,Ht,de,_,h,H,U,k,l,{[ke.route.id]:Je.data},void 0);Y.filter(Ve=>Ve.key!==q).forEach(Ve=>{let dt=Ve.key,Ft=F.fetchers.get(dt),gt=kc(void 0,Ft?Ft.data:void 0);F.fetchers.set(dt,gt),m.has(dt)&&yt(dt),Ve.controller&&m.set(dt,Ve.controller)}),K({fetchers:new Map(F.fetchers)});let ue=()=>Y.forEach(Ve=>yt(Ve.key));je.signal.addEventListener("abort",ue);let{results:Se,loaderResults:Re,fetcherResults:Fe}=await ye(F.matches,P,X,Y,w);if(je.signal.aborted)return;je.signal.removeEventListener("abort",ue),R.delete(q),m.delete(q),Y.forEach(Ve=>m.delete(Ve.key));let qe=Dw(Se);if(qe){if(qe.idx>=X.length){let Ve=Y[qe.idx-X.length].key;U.add(Ve)}return ze(F,qe.result)}let{loaderData:Me,errors:rt}=Bw(F,F.matches,X,Re,void 0,Y,Fe,O);if(F.fetchers.has(q)){let Ve=Wo(Je.data);F.fetchers.set(q,Ve)}Tt(d),F.navigation.state==="loading"&&d>M?(qt(z,"Expected pending action"),D&&D.abort(),V(F.navigation.location,{matches:P,loaderData:Me,errors:rt,fetchers:new Map(F.fetchers)})):(K({errors:rt,loaderData:Ow(F.loaderData,Me,P,rt),fetchers:new Map(F.fetchers)}),de=!1)}async function pt(q,re,ae,ke,Ie,Le){let ht=F.fetchers.get(q),He=kc(Le,ht?ht.data:void 0);F.fetchers.set(q,He),K({fetchers:new Map(F.fetchers)});let je=new AbortController,Gt=Cc(t.history,ae,je.signal);m.set(q,je);let wt=S,Je=await Fc("loader",Gt,ke,Ie,s,i,l);if(Xa(Je)&&(Je=await q5(Je,Gt.signal,!0)||Je),m.get(q)===je&&m.delete(q),Gt.signal.aborted)return;if(g.has(q)){F.fetchers.set(q,Wo(void 0)),K({fetchers:new Map(F.fetchers)});return}if(Du(Je))if(M>wt){let w=Wo(void 0);F.fetchers.set(q,w),K({fetchers:new Map(F.fetchers)});return}else{U.add(q),await ze(F,Je);return}if(sh(Je)){Ce(q,re,Je.error);return}qt(!Xa(Je),"Unhandled fetcher deferred data");let Ht=Wo(Je.data);F.fetchers.set(q,Ht),K({fetchers:new Map(F.fetchers)})}async function ze(q,re,ae){let{submission:ke,fetcherSubmission:Ie,replace:Le}=ae===void 0?{}:ae;re.revalidate&&(de=!0);let ht=Ih(q.location,re.location,{_isRedirect:!0});if(qt(ht,"Expected a location on the redirect navigation"),r){let Ht=!1;if(re.reloadDocument)Ht=!0;else if(K5.test(re.location)){const w=t.history.createURL(re.location);Ht=w.origin!==e.location.origin||v0(w.pathname,l)==null}if(Ht){Le?e.location.replace(re.location):e.location.assign(re.location);return}}D=null;let He=Le===!0?zr.Replace:zr.Push,{formMethod:je,formAction:Gt,formEncType:wt}=q.navigation;!ke&&!Ie&&je&&Gt&&wt&&(ke=zw(q.navigation));let Je=ke||Ie;if(ik.has(re.status)&&Je&&as(Je.formMethod))await Ue(He,ht,{submission:Ur({},Je,{formAction:re.location}),preventScrollReset:T});else{let Ht=Ug(ht,ke);await Ue(He,ht,{overrideNavigation:Ht,fetcherSubmission:Ie,preventScrollReset:T})}}async function ye(q,re,ae,ke,Ie){let Le=await Promise.all([...ae.map(je=>Fc("loader",Ie,je,re,s,i,l)),...ke.map(je=>je.matches&&je.match&&je.controller?Fc("loader",Cc(t.history,je.path,je.controller.signal),je.match,je.matches,s,i,l):{type:jr.error,error:Ti(404,{pathname:je.path})})]),ht=Le.slice(0,ae.length),He=Le.slice(ae.length);return await Promise.all([Lw(q,ae,ht,ht.map(()=>Ie.signal),!1,F.loaderData),Lw(q,ke.map(je=>je.match),He,ke.map(je=>je.controller?je.controller.signal:null),!0)]),{results:Le,loaderResults:ht,fetcherResults:He}}function De(){de=!0,_.push(...$t()),H.forEach((q,re)=>{m.has(re)&&(h.push(re),yt(re))})}function Ce(q,re,ae){let ke=ih(F.matches,re);tt(q),K({errors:{[ke.route.id]:ae},fetchers:new Map(F.fetchers)})}function tt(q){let re=F.fetchers.get(q);m.has(q)&&!(re&&re.state==="loading"&&R.has(q))&&yt(q),H.delete(q),R.delete(q),U.delete(q),g.delete(q),F.fetchers.delete(q)}function Dt(q){if(u.v7_fetcherPersist){let re=(B.get(q)||0)-1;re<=0?(B.delete(q),g.add(q)):B.set(q,re)}else tt(q);K({fetchers:new Map(F.fetchers)})}function yt(q){let re=m.get(q);qt(re,"Expected fetch controller: "+q),re.abort(),m.delete(q)}function Ct(q){for(let re of q){let ae=ut(re),ke=Wo(ae.data);F.fetchers.set(re,ke)}}function fr(){let q=[],re=!1;for(let ae of U){let ke=F.fetchers.get(ae);qt(ke,"Expected fetcher: "+ae),ke.state==="loading"&&(U.delete(ae),q.push(ae),re=!0)}return Ct(q),re}function Tt(q){let re=[];for(let[ae,ke]of R)if(ke0}function It(q,re){let ae=F.blockers.get(q)||Sc;return ve.get(q)!==re&&ve.set(q,re),ae}function Wt(q){F.blockers.delete(q),ve.delete(q)}function Et(q,re){let ae=F.blockers.get(q)||Sc;qt(ae.state==="unblocked"&&re.state==="blocked"||ae.state==="blocked"&&re.state==="blocked"||ae.state==="blocked"&&re.state==="proceeding"||ae.state==="blocked"&&re.state==="unblocked"||ae.state==="proceeding"&&re.state==="unblocked","Invalid blocker state transition: "+ae.state+" -> "+re.state);let ke=new Map(F.blockers);ke.set(q,re),K({blockers:ke})}function kt(q){let{currentLocation:re,nextLocation:ae,historyAction:ke}=q;if(ve.size===0)return;ve.size>1&&Ia(!1,"A router only supports one blocker at a time");let Ie=Array.from(ve.entries()),[Le,ht]=Ie[Ie.length-1],He=F.blockers.get(Le);if(!(He&&He.state==="proceeding")&&ht({currentLocation:re,nextLocation:ae,historyAction:ke}))return Le}function $t(q){let re=[];return O.forEach((ae,ke)=>{(!q||q(ke))&&(ae.cancel(),re.push(ke),O.delete(ke))}),re}function xt(q,re,ae){if(p=q,v=re,y=ae||null,!b&&F.navigation===Og){b=!0;let ke=St(F.location,F.matches);ke!=null&&K({restoreScrollPosition:ke})}return()=>{p=null,v=null,y=null}}function vt(q,re){return y&&y(q,re.map(ke=>MC(ke,F.loaderData)))||q.key}function ir(q,re){if(p&&v){let ae=vt(q,re);p[ae]=v()}}function St(q,re){if(p){let ae=vt(q,re),ke=p[ae];if(typeof ke=="number")return ke}return null}function _t(q){s={},a=my(q,i,void 0,s)}return C={get basename(){return l},get state(){return F},get routes(){return o},get window(){return e},initialize:W,subscribe:J,enableScrollRestoration:xt,navigate:Z,fetch:We,revalidate:he,createHref:q=>t.history.createHref(q),encodeLocation:q=>t.history.encodeLocation(q),getFetcher:ut,deleteFetcher:Dt,dispose:oe,getBlocker:It,deleteBlocker:Wt,_internalFetchControllers:m,_internalActiveDeferreds:O,_internalSetRoutes:_t},C}function lk(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function yy(t,e,r,n,i,s,o){let a,l;if(s!=null&&o!=="path"){a=[];for(let f of e)if(a.push(f),f.route.id===s){l=f;break}}else a=e,l=e[e.length-1];let u=V5(i||".",mx(a).map(f=>f.pathnameBase),v0(t.pathname,r)||t.pathname,o==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&l&&l.route.index&&!xx(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:_a([r,u.pathname])),x0(u)}function Nw(t,e,r,n){if(!n||!lk(n))return{path:r};if(n.formMethod&&!gk(n.formMethod))return{path:r,error:Ti(405,{method:n.formMethod})};let i=()=>({path:r,error:Ti(400,{type:"invalid-body"})}),s=n.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=Y5(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!as(o))return i();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,v)=>{let[b,N]=v;return""+y+b+"="+N+` -`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!as(o))return i();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}qt(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=xy(n.formData),u=n.formData;else if(n.body instanceof FormData)l=xy(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=Mw(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=Mw(l)}catch{return i()}let f={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(as(f.formMethod))return{path:r,submission:f};let c=Ys(r);return e&&c.search&&xx(c.search)&&l.append("index",""),c.search="?"+l,{path:x0(c),submission:f}}function uk(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function Rw(t,e,r,n,i,s,o,a,l,u,f,c,p,y){let v=y?Object.values(y)[0]:p?Object.values(p)[0]:void 0,b=t.createURL(e.location),N=t.createURL(i),x=y?Object.keys(y)[0]:void 0,C=uk(r,x).filter((z,T)=>{if(z.route.lazy)return!0;if(z.route.loader==null)return!1;if(fk(e.loaderData,e.matches[T],z)||o.some($=>$===z.route.id))return!0;let D=e.matches[T],G=z;return Tw(z,Ur({currentUrl:b,currentParams:D.params,nextUrl:N,nextParams:G.params},n,{actionResult:v,defaultShouldRevalidate:s||b.pathname+b.search===N.pathname+N.search||b.search!==N.search||W5(D,G)}))}),F=[];return l.forEach((z,T)=>{if(!r.some(te=>te.route.id===z.routeId))return;let D=bu(f,z.path,c);if(!D){F.push({key:T,routeId:z.routeId,path:z.path,matches:null,match:null,controller:null});return}let G=e.fetchers.get(T),$=vy(D,z.path),ne=!1;u.has(T)?ne=!1:a.includes(T)?ne=!0:G&&G.state!=="idle"&&G.data===void 0?ne=s:ne=Tw($,Ur({currentUrl:b,currentParams:e.matches[e.matches.length-1].params,nextUrl:N,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:s})),ne&&F.push({key:T,routeId:z.routeId,path:z.path,matches:D,match:$,controller:new AbortController})}),[C,F]}function fk(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function W5(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Tw(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function Iw(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let i=r[t.id];qt(i,"No route found in manifest");let s={};for(let o in n){let l=i[o]!==void 0&&o!=="hasErrorBoundary";Ia(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!TC.has(o)&&(s[o]=n[o])}Object.assign(i,s),Object.assign(i,Ur({},e(i),{lazy:void 0}))}async function Fc(t,e,r,n,i,s,o,a){a===void 0&&(a={});let l,u,f,c=v=>{let b,N=new Promise((x,A)=>b=A);return f=()=>b(),e.signal.addEventListener("abort",f),Promise.race([v({request:e,params:r.params,context:a.requestContext}),N])};try{let v=r.route[t];if(r.route.lazy)if(v){let b,N=await Promise.all([c(v).catch(x=>{b=x}),Iw(r.route,s,i)]);if(b)throw b;u=N[0]}else if(await Iw(r.route,s,i),v=r.route[t],v)u=await c(v);else if(t==="action"){let b=new URL(e.url),N=b.pathname+b.search;throw Ti(405,{method:e.method,pathname:N,routeId:r.route.id})}else return{type:jr.data,data:void 0};else if(v)u=await c(v);else{let b=new URL(e.url),N=b.pathname+b.search;throw Ti(404,{pathname:N})}qt(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(v){l=jr.error,u=v}finally{f&&e.signal.removeEventListener("abort",f)}if(pk(u)){let v=u.status;if(nk.has(v)){let x=u.headers.get("Location");if(qt(x,"Redirects returned/thrown from loaders/actions must have a Location header"),!K5.test(x))x=yy(new URL(e.url),n.slice(0,n.indexOf(r)+1),o,!0,x);else if(!a.isStaticRequest){let A=new URL(e.url),C=x.startsWith("//")?new URL(A.protocol+x):new URL(x),F=v0(C.pathname,o)!=null;C.origin===A.origin&&F&&(x=C.pathname+C.search+C.hash)}if(a.isStaticRequest)throw u.headers.set("Location",x),u;return{type:jr.redirect,status:v,location:x,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:l===jr.error?jr.error:jr.data,response:u};let b,N=u.headers.get("Content-Type");return N&&/\bapplication\/json\b/.test(N)?b=await u.json():b=await u.text(),l===jr.error?{type:l,error:new yx(v,u.statusText,b),headers:u.headers}:{type:jr.data,data:b,statusCode:u.status,headers:u.headers}}if(l===jr.error)return{type:l,error:u};if(dk(u)){var p,y;return{type:jr.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((y=u.init)==null?void 0:y.headers)&&new Headers(u.init.headers)}}return{type:jr.data,data:u}}function Cc(t,e,r,n){let i=t.createURL(Y5(e)).toString(),s={signal:r};if(n&&as(n.formMethod)){let{formMethod:o,formEncType:a}=n;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(n.json)):a==="text/plain"?s.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?s.body=xy(n.formData):s.body=n.formData}return new Request(i,s)}function xy(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function Mw(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function ck(t,e,r,n,i){let s={},o=null,a,l=!1,u={};return r.forEach((f,c)=>{let p=e[c].route.id;if(qt(!Du(f),"Cannot handle redirect results in processLoaderData"),sh(f)){let y=ih(t,p),v=f.error;n&&(v=Object.values(n)[0],n=void 0),o=o||{},o[y.route.id]==null&&(o[y.route.id]=v),s[p]=void 0,l||(l=!0,a=Q5(f.error)?f.error.status:500),f.headers&&(u[p]=f.headers)}else Xa(f)?(i.set(p,f.deferredData),s[p]=f.deferredData.data):s[p]=f.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(a=f.statusCode),f.headers&&(u[p]=f.headers)}),n&&(o=n,s[Object.keys(n)[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function Bw(t,e,r,n,i,s,o,a){let{loaderData:l,errors:u}=ck(e,r,n,i,a);for(let f=0;fn.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function Uw(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ti(t,e){let{pathname:r,routeId:n,method:i,type:s}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":s==="defer-action"?a="defer() is not supported in actions":s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new yx(t||500,o,new Error(a),!0)}function Dw(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(Du(r))return{result:r,idx:e}}}function Y5(t){let e=typeof t=="string"?Ys(t):t;return x0(Ur({},e,{hash:""}))}function hk(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Xa(t){return t.type===jr.deferred}function sh(t){return t.type===jr.error}function Du(t){return(t&&t.type)===jr.redirect}function dk(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function pk(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function gk(t){return rk.has(t.toLowerCase())}function as(t){return ek.has(t.toLowerCase())}async function Lw(t,e,r,n,i,s){for(let o=0;oc.route.id===l.route.id),f=u!=null&&!W5(u,l)&&(s&&s[l.route.id])!==void 0;if(Xa(a)&&(i||f)){let c=n[o];qt(c,"Expected an AbortSignal for revalidating fetcher deferred result"),await q5(a,c,i).then(p=>{p&&(r[o]=p||r[o])})}}}async function q5(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:jr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:jr.error,error:i}}return{type:jr.data,data:t.deferredData.data}}}function xx(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function vy(t,e){let r=typeof e=="string"?Ys(e).search:e.search;if(t[t.length-1].route.index&&xx(r||""))return t[t.length-1];let n=mx(t);return n[n.length-1]}function zw(t){let{formMethod:e,formAction:r,formEncType:n,text:i,formData:s,json:o}=t;if(!(!e||!r||!n)){if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Ug(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function mk(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function kc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function yk(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Wo(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function xk(t,e){try{let r=t.sessionStorage.getItem(J5);if(r){let n=JSON.parse(r);for(let[i,s]of Object.entries(n||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function vk(t,e){if(e.size>0){let r={};for(let[n,i]of e)r[n]=[...i];try{t.sessionStorage.setItem(J5,JSON.stringify(r))}catch(n){Ia(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** + */function Ur(){return Ur=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Ia(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function NC(){return Math.random().toString(36).substr(2,8)}function _w(t,e){return{usr:t.state,key:t.key,idx:e}}function Ih(t,e,r,n){return r===void 0&&(r=null),Ur({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?qs(e):e,{state:r,key:e&&e.key||n||NC()})}function x0(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qs(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function RC(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=zr.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(Ur({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){a=zr.Pop;let N=f(),x=N==null?null:N-u;u=N,l&&l({action:a,location:b.location,delta:x})}function p(N,x){a=zr.Push;let A=Ih(b.location,N,x);r&&r(A,N),u=f()+1;let C=_w(A,u),F=b.createHref(A);try{o.pushState(C,"",F)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(F)}s&&l&&l({action:a,location:b.location,delta:1})}function y(N,x){a=zr.Replace;let A=Ih(b.location,N,x);r&&r(A,N),u=f();let C=_w(A,u),F=b.createHref(A);o.replaceState(C,"",F),s&&l&&l({action:a,location:b.location,delta:0})}function v(N){let x=i.location.origin!=="null"?i.location.origin:i.location.href,A=typeof N=="string"?N:x0(N);return qt(x,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,x)}let b={get action(){return a},get location(){return t(i,o)},listen(N){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(kw,c),l=N,()=>{i.removeEventListener(kw,c),l=null}},createHref(N){return e(i,N)},createURL:v,encodeLocation(N){let x=v(N);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:y,go(N){return o.go(N)}};return b}var jr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(jr||(jr={}));const TC=new Set(["lazy","caseSensitive","path","id","index","children"]);function IC(t){return t.index===!0}function my(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((i,s)=>{let o=[...r,s],a=typeof i.id=="string"?i.id:o.join("-");if(qt(i.index!==!0||!i.children,"Cannot specify children on an index route"),qt(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),IC(i)){let l=Ur({},i,e(i),{id:a});return n[a]=l,l}else{let l=Ur({},i,e(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=my(i.children,e,o,n)),l}})}function bu(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?qs(e):e,i=v0(n.pathname||"/",r);if(i==null)return null;let s=H5(t);BC(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(qt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=_a([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&(qt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),H5(s.children,e,f,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:HC(u,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of G5(s.path))i(s,o,l)}),e}function G5(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=G5(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function BC(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:GC(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const OC=/^:\w+$/,UC=3,DC=2,LC=1,zC=10,jC=-2,Pw=t=>t==="*";function HC(t,e){let r=t.split("/"),n=r.length;return r.some(Pw)&&(n+=jC),e&&(n+=DC),r.filter(i=>!Pw(i)).reduce((i,s)=>i+(OC.test(s)?UC:s===""?LC:zC),n)}function GC(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function VC(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o{let{paramName:p,isOptional:y}=f;if(p==="*"){let b=a[c]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const v=a[c];return y&&!v?u[p]=void 0:u[p]=WC(v||"",p),u},{}),pathname:s,pathnameBase:o,pattern:t}}function KC(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Ia(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function $C(t){try{return decodeURI(t)}catch(e){return Ia(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function WC(t,e){try{return decodeURIComponent(t)}catch(r){return Ia(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function v0(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function JC(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?qs(t):t;return{pathname:r?r.startsWith("/")?r:YC(r,e):e,search:XC(n),hash:ZC(i)}}function YC(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Bg(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function mx(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function V5(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=qs(t):(i=Ur({},t),qt(!i.pathname||!i.pathname.includes("?"),Bg("?","pathname","search",i)),qt(!i.pathname||!i.pathname.includes("#"),Bg("#","pathname","hash",i)),qt(!i.search||!i.search.includes("#"),Bg("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(n||o==null)a=r;else{let c=e.length-1;if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;i.pathname=p.join("/")}a=c>=0?e[c]:"/"}let l=JC(i,a),u=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const _a=t=>t.join("/").replace(/\/\/+/g,"/"),qC=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),XC=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,ZC=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class yx{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Q5(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const K5=["post","put","patch","delete"],ek=new Set(K5),tk=["get",...K5],rk=new Set(tk),nk=new Set([301,302,303,307,308]),ik=new Set([307,308]),Og={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ok=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),W5="remix-router-transitions";function ak(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;qt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let q=t.detectErrorBoundary;i=re=>({hasErrorBoundary:q(re)})}else i=ok;let s={},o=my(t.routes,i,void 0,s),a,l=t.basename||"/",u=Ur({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),f=null,c=new Set,p=null,y=null,v=null,b=t.hydrationData!=null,N=bu(o,t.history.location,l),x=null;if(N==null){let q=Ii(404,{pathname:t.history.location.pathname}),{matches:re,route:ae}=Uw(o);N=re,x={[ae.id]:q}}let A=!N.some(q=>q.route.lazy)&&(!N.some(q=>q.route.loader)||t.hydrationData!=null),C,F={historyAction:t.history.action,location:t.history.location,matches:N,initialized:A,navigation:Og,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},L=zr.Pop,T=!1,z,H=!1,K=new Map,ne=null,te=!1,de=!1,_=[],h=[],m=new Map,S=0,M=-1,R=new Map,U=new Set,G=new Map,B=new Map,g=new Set,O=new Map,ve=new Map,E=!1;function J(){if(f=t.history.listen(q=>{let{action:re,location:ae,delta:ke}=q;if(E){E=!1;return}Ia(ve.size===0||ke!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ie=kt({currentLocation:F.location,nextLocation:ae,historyAction:re});if(Ie&&ke!=null){E=!0,t.history.go(ke*-1),Et(Ie,{state:"blocked",location:ae,proceed(){Et(Ie,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),t.history.go(ke)},reset(){let Le=new Map(F.blockers);Le.set(Ie,Sc),$({blockers:Le})}});return}return Ue(re,ae)}),r){xk(e,K);let q=()=>vk(e,K);e.addEventListener("pagehide",q),ne=()=>e.removeEventListener("pagehide",q)}return F.initialized||Ue(zr.Pop,F.location),C}function oe(){f&&f(),ne&&ne(),c.clear(),z&&z.abort(),F.fetchers.forEach((q,re)=>tt(re)),F.blockers.forEach((q,re)=>Jt(re))}function W(q){return c.add(q),()=>c.delete(q)}function $(q,re){F=Ur({},F,q);let ae=[],ke=[];u.v7_fetcherPersist&&F.fetchers.forEach((Ie,Le)=>{Ie.state==="idle"&&(g.has(Le)?ke.push(Le):ae.push(Le))}),c.forEach(Ie=>Ie(F,{deletedFetchers:ke,unstable_viewTransitionOpts:re})),u.v7_fetcherPersist&&(ae.forEach(Ie=>F.fetchers.delete(Ie)),ke.forEach(Ie=>tt(Ie)))}function V(q,re){var ae,ke;let Ie=F.actionData!=null&&F.navigation.formMethod!=null&&ls(F.navigation.formMethod)&&F.navigation.state==="loading"&&((ae=q.state)==null?void 0:ae._isRedirect)!==!0,Le;re.actionData?Object.keys(re.actionData).length>0?Le=re.actionData:Le=null:Ie?Le=F.actionData:Le=null;let ht=re.loaderData?Ow(F.loaderData,re.loaderData,re.matches||[],re.errors):F.loaderData,He=F.blockers;He.size>0&&(He=new Map(He),He.forEach((wt,We)=>He.set(We,Sc)));let je=T===!0||F.navigation.formMethod!=null&&ls(F.navigation.formMethod)&&((ke=q.state)==null?void 0:ke._isRedirect)!==!0;a&&(o=a,a=void 0),te||L===zr.Pop||(L===zr.Push?t.history.push(q,q.state):L===zr.Replace&&t.history.replace(q,q.state));let Gt;if(L===zr.Pop){let wt=K.get(F.location.pathname);wt&&wt.has(q.pathname)?Gt={currentLocation:F.location,nextLocation:q}:K.has(q.pathname)&&(Gt={currentLocation:q,nextLocation:F.location})}else if(H){let wt=K.get(F.location.pathname);wt?wt.add(q.pathname):(wt=new Set([q.pathname]),K.set(F.location.pathname,wt)),Gt={currentLocation:F.location,nextLocation:q}}$(Ur({},re,{actionData:Le,loaderData:ht,historyAction:L,location:q,initialized:!0,navigation:Og,revalidation:"idle",restoreScrollPosition:St(q,re.matches||F.matches),preventScrollReset:je,blockers:He}),Gt),L=zr.Pop,T=!1,H=!1,te=!1,de=!1,_=[],h=[]}async function Z(q,re){if(typeof q=="number"){t.history.go(q);return}let ae=yy(F.location,F.matches,l,u.v7_prependBasename,q,re==null?void 0:re.fromRouteId,re==null?void 0:re.relative),{path:ke,submission:Ie,error:Le}=Nw(u.v7_normalizeFormMethod,!1,ae,re),ht=F.location,He=Ih(F.location,ke,re&&re.state);He=Ur({},He,t.history.encodeLocation(He));let je=re&&re.replace!=null?re.replace:void 0,Gt=zr.Push;je===!0?Gt=zr.Replace:je===!1||Ie!=null&&ls(Ie.formMethod)&&Ie.formAction===F.location.pathname+F.location.search&&(Gt=zr.Replace);let wt=re&&"preventScrollReset"in re?re.preventScrollReset===!0:void 0,We=kt({currentLocation:ht,nextLocation:He,historyAction:Gt});if(We){Et(We,{state:"blocked",location:He,proceed(){Et(We,{state:"proceeding",proceed:void 0,reset:void 0,location:He}),Z(q,re)},reset(){let Ht=new Map(F.blockers);Ht.set(We,Sc),$({blockers:Ht})}});return}return await Ue(Gt,He,{submission:Ie,pendingError:Le,preventScrollReset:wt,replace:re&&re.replace,enableViewTransition:re&&re.unstable_viewTransition})}function he(){if(De(),$({revalidation:"loading"}),F.navigation.state!=="submitting"){if(F.navigation.state==="idle"){Ue(F.historyAction,F.location,{startUninterruptedRevalidation:!0});return}Ue(L||F.historyAction,F.navigation.location,{overrideNavigation:F.navigation})}}async function Ue(q,re,ae){z&&z.abort(),z=null,L=q,te=(ae&&ae.startUninterruptedRevalidation)===!0,ir(F.location,F.matches),T=(ae&&ae.preventScrollReset)===!0,H=(ae&&ae.enableViewTransition)===!0;let ke=a||o,Ie=ae&&ae.overrideNavigation,Le=bu(ke,re,l);if(!Le){let Ht=Ii(404,{pathname:re.pathname}),{matches:w,route:k}=Uw(ke);Kt(),V(re,{matches:w,loaderData:{},errors:{[k.id]:Ht}});return}if(F.initialized&&!de&&hk(F.location,re)&&!(ae&&ae.submission&&ls(ae.submission.formMethod))){V(re,{matches:Le});return}z=new AbortController;let ht=Cc(t.history,re,z.signal,ae&&ae.submission),He,je;if(ae&&ae.pendingError)je={[ih(Le).route.id]:ae.pendingError};else if(ae&&ae.submission&&ls(ae.submission.formMethod)){let Ht=await pe(ht,re,ae.submission,Le,{replace:ae.replace});if(Ht.shortCircuited)return;He=Ht.pendingActionData,je=Ht.pendingActionError,Ie=Ug(re,ae.submission),ht=new Request(ht.url,{signal:ht.signal})}let{shortCircuited:Gt,loaderData:wt,errors:We}=await Be(ht,re,Le,Ie,ae&&ae.submission,ae&&ae.fetcherSubmission,ae&&ae.replace,He,je);Gt||(z=null,V(re,Ur({matches:Le},He?{actionData:He}:{},{loaderData:wt,errors:We})))}async function pe(q,re,ae,ke,Ie){Ie===void 0&&(Ie={}),De();let Le=mk(re,ae);$({navigation:Le});let ht,He=vy(ke,re);if(!He.route.action&&!He.route.lazy)ht={type:jr.error,error:Ii(405,{method:q.method,pathname:re.pathname,routeId:He.route.id})};else if(ht=await Fc("action",q,He,ke,s,i,l),q.signal.aborted)return{shortCircuited:!0};if(Du(ht)){let je;return Ie&&Ie.replace!=null?je=Ie.replace:je=ht.location===F.location.pathname+F.location.search,await ze(F,ht,{submission:ae,replace:je}),{shortCircuited:!0}}if(sh(ht)){let je=ih(ke,He.route.id);return(Ie&&Ie.replace)!==!0&&(L=zr.Push),{pendingActionData:{},pendingActionError:{[je.route.id]:ht.error}}}if(Xa(ht))throw Ii(400,{type:"defer-action"});return{pendingActionData:{[He.route.id]:ht.data}}}async function Be(q,re,ae,ke,Ie,Le,ht,He,je){let Gt=ke||Ug(re,Ie),wt=Ie||Le||zw(Gt),We=a||o,[Ht,w]=Rw(t.history,F,ae,wt,re,de,_,h,G,U,We,l,He,je);if(Kt(qe=>!(ae&&ae.some(Me=>Me.route.id===qe))||Ht&&Ht.some(Me=>Me.route.id===qe)),M=++S,Ht.length===0&&w.length===0){let qe=fr();return V(re,Ur({matches:ae,loaderData:{},errors:je||null},He?{actionData:He}:{},qe?{fetchers:new Map(F.fetchers)}:{})),{shortCircuited:!0}}if(!te){w.forEach(Me=>{let rt=F.fetchers.get(Me.key),Ve=kc(void 0,rt?rt.data:void 0);F.fetchers.set(Me.key,Ve)});let qe=He||F.actionData;$(Ur({navigation:Gt},qe?Object.keys(qe).length===0?{actionData:null}:{actionData:qe}:{},w.length>0?{fetchers:new Map(F.fetchers)}:{}))}w.forEach(qe=>{m.has(qe.key)&&yt(qe.key),qe.controller&&m.set(qe.key,qe.controller)});let k=()=>w.forEach(qe=>yt(qe.key));z&&z.signal.addEventListener("abort",k);let{results:P,loaderResults:d,fetcherResults:I}=await ye(F.matches,ae,Ht,w,q);if(q.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",k),w.forEach(qe=>m.delete(qe.key));let X=Dw(P);if(X){if(X.idx>=Ht.length){let qe=w[X.idx-Ht.length].key;U.add(qe)}return await ze(F,X.result,{replace:ht}),{shortCircuited:!0}}let{loaderData:Y,errors:ue}=Bw(F,ae,Ht,d,je,w,I,O);O.forEach((qe,Me)=>{qe.subscribe(rt=>{(rt||qe.done)&&O.delete(Me)})});let Se=fr(),Re=Tt(M),Fe=Se||Re||w.length>0;return Ur({loaderData:Y,errors:ue},Fe?{fetchers:new Map(F.fetchers)}:{})}function ut(q){return u.v7_fetcherPersist&&(B.set(q,(B.get(q)||0)+1),g.has(q)&&g.delete(q)),F.fetchers.get(q)||sk}function Je(q,re,ae,ke){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");m.has(q)&&yt(q);let Ie=a||o,Le=yy(F.location,F.matches,l,u.v7_prependBasename,ae,re,ke==null?void 0:ke.relative),ht=bu(Ie,Le,l);if(!ht){Ce(q,re,Ii(404,{pathname:Le}));return}let{path:He,submission:je,error:Gt}=Nw(u.v7_normalizeFormMethod,!0,Le,ke);if(Gt){Ce(q,re,Gt);return}let wt=vy(ht,He);if(T=(ke&&ke.preventScrollReset)===!0,je&&ls(je.formMethod)){Ye(q,re,He,wt,ht,je);return}G.set(q,{routeId:re,path:He}),pt(q,re,He,wt,ht,je)}async function Ye(q,re,ae,ke,Ie,Le){if(De(),G.delete(q),!ke.route.action&&!ke.route.lazy){let Ve=Ii(405,{method:Le.formMethod,pathname:ae,routeId:re});Ce(q,re,Ve);return}let ht=F.fetchers.get(q),He=yk(Le,ht);F.fetchers.set(q,He),$({fetchers:new Map(F.fetchers)});let je=new AbortController,Gt=Cc(t.history,ae,je.signal,Le);m.set(q,je);let wt=S,We=await Fc("action",Gt,ke,Ie,s,i,l);if(Gt.signal.aborted){m.get(q)===je&&m.delete(q);return}if(g.has(q)){F.fetchers.set(q,Jo(void 0)),$({fetchers:new Map(F.fetchers)});return}if(Du(We))if(m.delete(q),M>wt){let Ve=Jo(void 0);F.fetchers.set(q,Ve),$({fetchers:new Map(F.fetchers)});return}else{U.add(q);let Ve=kc(Le);return F.fetchers.set(q,Ve),$({fetchers:new Map(F.fetchers)}),ze(F,We,{fetcherSubmission:Le})}if(sh(We)){Ce(q,re,We.error);return}if(Xa(We))throw Ii(400,{type:"defer-action"});let Ht=F.navigation.location||F.location,w=Cc(t.history,Ht,je.signal),k=a||o,P=F.navigation.state!=="idle"?bu(k,F.navigation.location,l):F.matches;qt(P,"Didn't find any matches after fetcher action");let d=++S;R.set(q,d);let I=kc(Le,We.data);F.fetchers.set(q,I);let[X,Y]=Rw(t.history,F,P,Le,Ht,de,_,h,G,U,k,l,{[ke.route.id]:We.data},void 0);Y.filter(Ve=>Ve.key!==q).forEach(Ve=>{let dt=Ve.key,Ft=F.fetchers.get(dt),gt=kc(void 0,Ft?Ft.data:void 0);F.fetchers.set(dt,gt),m.has(dt)&&yt(dt),Ve.controller&&m.set(dt,Ve.controller)}),$({fetchers:new Map(F.fetchers)});let ue=()=>Y.forEach(Ve=>yt(Ve.key));je.signal.addEventListener("abort",ue);let{results:Se,loaderResults:Re,fetcherResults:Fe}=await ye(F.matches,P,X,Y,w);if(je.signal.aborted)return;je.signal.removeEventListener("abort",ue),R.delete(q),m.delete(q),Y.forEach(Ve=>m.delete(Ve.key));let qe=Dw(Se);if(qe){if(qe.idx>=X.length){let Ve=Y[qe.idx-X.length].key;U.add(Ve)}return ze(F,qe.result)}let{loaderData:Me,errors:rt}=Bw(F,F.matches,X,Re,void 0,Y,Fe,O);if(F.fetchers.has(q)){let Ve=Jo(We.data);F.fetchers.set(q,Ve)}Tt(d),F.navigation.state==="loading"&&d>M?(qt(L,"Expected pending action"),z&&z.abort(),V(F.navigation.location,{matches:P,loaderData:Me,errors:rt,fetchers:new Map(F.fetchers)})):($({errors:rt,loaderData:Ow(F.loaderData,Me,P,rt),fetchers:new Map(F.fetchers)}),de=!1)}async function pt(q,re,ae,ke,Ie,Le){let ht=F.fetchers.get(q),He=kc(Le,ht?ht.data:void 0);F.fetchers.set(q,He),$({fetchers:new Map(F.fetchers)});let je=new AbortController,Gt=Cc(t.history,ae,je.signal);m.set(q,je);let wt=S,We=await Fc("loader",Gt,ke,Ie,s,i,l);if(Xa(We)&&(We=await q5(We,Gt.signal,!0)||We),m.get(q)===je&&m.delete(q),Gt.signal.aborted)return;if(g.has(q)){F.fetchers.set(q,Jo(void 0)),$({fetchers:new Map(F.fetchers)});return}if(Du(We))if(M>wt){let w=Jo(void 0);F.fetchers.set(q,w),$({fetchers:new Map(F.fetchers)});return}else{U.add(q),await ze(F,We);return}if(sh(We)){Ce(q,re,We.error);return}qt(!Xa(We),"Unhandled fetcher deferred data");let Ht=Jo(We.data);F.fetchers.set(q,Ht),$({fetchers:new Map(F.fetchers)})}async function ze(q,re,ae){let{submission:ke,fetcherSubmission:Ie,replace:Le}=ae===void 0?{}:ae;re.revalidate&&(de=!0);let ht=Ih(q.location,re.location,{_isRedirect:!0});if(qt(ht,"Expected a location on the redirect navigation"),r){let Ht=!1;if(re.reloadDocument)Ht=!0;else if($5.test(re.location)){const w=t.history.createURL(re.location);Ht=w.origin!==e.location.origin||v0(w.pathname,l)==null}if(Ht){Le?e.location.replace(re.location):e.location.assign(re.location);return}}z=null;let He=Le===!0?zr.Replace:zr.Push,{formMethod:je,formAction:Gt,formEncType:wt}=q.navigation;!ke&&!Ie&&je&&Gt&&wt&&(ke=zw(q.navigation));let We=ke||Ie;if(ik.has(re.status)&&We&&ls(We.formMethod))await Ue(He,ht,{submission:Ur({},We,{formAction:re.location}),preventScrollReset:T});else{let Ht=Ug(ht,ke);await Ue(He,ht,{overrideNavigation:Ht,fetcherSubmission:Ie,preventScrollReset:T})}}async function ye(q,re,ae,ke,Ie){let Le=await Promise.all([...ae.map(je=>Fc("loader",Ie,je,re,s,i,l)),...ke.map(je=>je.matches&&je.match&&je.controller?Fc("loader",Cc(t.history,je.path,je.controller.signal),je.match,je.matches,s,i,l):{type:jr.error,error:Ii(404,{pathname:je.path})})]),ht=Le.slice(0,ae.length),He=Le.slice(ae.length);return await Promise.all([Lw(q,ae,ht,ht.map(()=>Ie.signal),!1,F.loaderData),Lw(q,ke.map(je=>je.match),He,ke.map(je=>je.controller?je.controller.signal:null),!0)]),{results:Le,loaderResults:ht,fetcherResults:He}}function De(){de=!0,_.push(...Kt()),G.forEach((q,re)=>{m.has(re)&&(h.push(re),yt(re))})}function Ce(q,re,ae){let ke=ih(F.matches,re);tt(q),$({errors:{[ke.route.id]:ae},fetchers:new Map(F.fetchers)})}function tt(q){let re=F.fetchers.get(q);m.has(q)&&!(re&&re.state==="loading"&&R.has(q))&&yt(q),G.delete(q),R.delete(q),U.delete(q),g.delete(q),F.fetchers.delete(q)}function Dt(q){if(u.v7_fetcherPersist){let re=(B.get(q)||0)-1;re<=0?(B.delete(q),g.add(q)):B.set(q,re)}else tt(q);$({fetchers:new Map(F.fetchers)})}function yt(q){let re=m.get(q);qt(re,"Expected fetch controller: "+q),re.abort(),m.delete(q)}function Ct(q){for(let re of q){let ae=ut(re),ke=Jo(ae.data);F.fetchers.set(re,ke)}}function fr(){let q=[],re=!1;for(let ae of U){let ke=F.fetchers.get(ae);qt(ke,"Expected fetcher: "+ae),ke.state==="loading"&&(U.delete(ae),q.push(ae),re=!0)}return Ct(q),re}function Tt(q){let re=[];for(let[ae,ke]of R)if(ke0}function It(q,re){let ae=F.blockers.get(q)||Sc;return ve.get(q)!==re&&ve.set(q,re),ae}function Jt(q){F.blockers.delete(q),ve.delete(q)}function Et(q,re){let ae=F.blockers.get(q)||Sc;qt(ae.state==="unblocked"&&re.state==="blocked"||ae.state==="blocked"&&re.state==="blocked"||ae.state==="blocked"&&re.state==="proceeding"||ae.state==="blocked"&&re.state==="unblocked"||ae.state==="proceeding"&&re.state==="unblocked","Invalid blocker state transition: "+ae.state+" -> "+re.state);let ke=new Map(F.blockers);ke.set(q,re),$({blockers:ke})}function kt(q){let{currentLocation:re,nextLocation:ae,historyAction:ke}=q;if(ve.size===0)return;ve.size>1&&Ia(!1,"A router only supports one blocker at a time");let Ie=Array.from(ve.entries()),[Le,ht]=Ie[Ie.length-1],He=F.blockers.get(Le);if(!(He&&He.state==="proceeding")&&ht({currentLocation:re,nextLocation:ae,historyAction:ke}))return Le}function Kt(q){let re=[];return O.forEach((ae,ke)=>{(!q||q(ke))&&(ae.cancel(),re.push(ke),O.delete(ke))}),re}function xt(q,re,ae){if(p=q,v=re,y=ae||null,!b&&F.navigation===Og){b=!0;let ke=St(F.location,F.matches);ke!=null&&$({restoreScrollPosition:ke})}return()=>{p=null,v=null,y=null}}function vt(q,re){return y&&y(q,re.map(ke=>MC(ke,F.loaderData)))||q.key}function ir(q,re){if(p&&v){let ae=vt(q,re);p[ae]=v()}}function St(q,re){if(p){let ae=vt(q,re),ke=p[ae];if(typeof ke=="number")return ke}return null}function _t(q){s={},a=my(q,i,void 0,s)}return C={get basename(){return l},get state(){return F},get routes(){return o},get window(){return e},initialize:J,subscribe:W,enableScrollRestoration:xt,navigate:Z,fetch:Je,revalidate:he,createHref:q=>t.history.createHref(q),encodeLocation:q=>t.history.encodeLocation(q),getFetcher:ut,deleteFetcher:Dt,dispose:oe,getBlocker:It,deleteBlocker:Jt,_internalFetchControllers:m,_internalActiveDeferreds:O,_internalSetRoutes:_t},C}function lk(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function yy(t,e,r,n,i,s,o){let a,l;if(s!=null&&o!=="path"){a=[];for(let f of e)if(a.push(f),f.route.id===s){l=f;break}}else a=e,l=e[e.length-1];let u=V5(i||".",mx(a).map(f=>f.pathnameBase),v0(t.pathname,r)||t.pathname,o==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&l&&l.route.index&&!xx(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:_a([r,u.pathname])),x0(u)}function Nw(t,e,r,n){if(!n||!lk(n))return{path:r};if(n.formMethod&&!gk(n.formMethod))return{path:r,error:Ii(405,{method:n.formMethod})};let i=()=>({path:r,error:Ii(400,{type:"invalid-body"})}),s=n.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=Y5(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ls(o))return i();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,v)=>{let[b,N]=v;return""+y+b+"="+N+` +`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!ls(o))return i();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}qt(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=xy(n.formData),u=n.formData;else if(n.body instanceof FormData)l=xy(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=Mw(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=Mw(l)}catch{return i()}let f={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ls(f.formMethod))return{path:r,submission:f};let c=qs(r);return e&&c.search&&xx(c.search)&&l.append("index",""),c.search="?"+l,{path:x0(c),submission:f}}function uk(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function Rw(t,e,r,n,i,s,o,a,l,u,f,c,p,y){let v=y?Object.values(y)[0]:p?Object.values(p)[0]:void 0,b=t.createURL(e.location),N=t.createURL(i),x=y?Object.keys(y)[0]:void 0,C=uk(r,x).filter((L,T)=>{if(L.route.lazy)return!0;if(L.route.loader==null)return!1;if(fk(e.loaderData,e.matches[T],L)||o.some(K=>K===L.route.id))return!0;let z=e.matches[T],H=L;return Tw(L,Ur({currentUrl:b,currentParams:z.params,nextUrl:N,nextParams:H.params},n,{actionResult:v,defaultShouldRevalidate:s||b.pathname+b.search===N.pathname+N.search||b.search!==N.search||J5(z,H)}))}),F=[];return l.forEach((L,T)=>{if(!r.some(te=>te.route.id===L.routeId))return;let z=bu(f,L.path,c);if(!z){F.push({key:T,routeId:L.routeId,path:L.path,matches:null,match:null,controller:null});return}let H=e.fetchers.get(T),K=vy(z,L.path),ne=!1;u.has(T)?ne=!1:a.includes(T)?ne=!0:H&&H.state!=="idle"&&H.data===void 0?ne=s:ne=Tw(K,Ur({currentUrl:b,currentParams:e.matches[e.matches.length-1].params,nextUrl:N,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:s})),ne&&F.push({key:T,routeId:L.routeId,path:L.path,matches:z,match:K,controller:new AbortController})}),[C,F]}function fk(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function J5(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Tw(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function Iw(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let i=r[t.id];qt(i,"No route found in manifest");let s={};for(let o in n){let l=i[o]!==void 0&&o!=="hasErrorBoundary";Ia(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!TC.has(o)&&(s[o]=n[o])}Object.assign(i,s),Object.assign(i,Ur({},e(i),{lazy:void 0}))}async function Fc(t,e,r,n,i,s,o,a){a===void 0&&(a={});let l,u,f,c=v=>{let b,N=new Promise((x,A)=>b=A);return f=()=>b(),e.signal.addEventListener("abort",f),Promise.race([v({request:e,params:r.params,context:a.requestContext}),N])};try{let v=r.route[t];if(r.route.lazy)if(v){let b,N=await Promise.all([c(v).catch(x=>{b=x}),Iw(r.route,s,i)]);if(b)throw b;u=N[0]}else if(await Iw(r.route,s,i),v=r.route[t],v)u=await c(v);else if(t==="action"){let b=new URL(e.url),N=b.pathname+b.search;throw Ii(405,{method:e.method,pathname:N,routeId:r.route.id})}else return{type:jr.data,data:void 0};else if(v)u=await c(v);else{let b=new URL(e.url),N=b.pathname+b.search;throw Ii(404,{pathname:N})}qt(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(v){l=jr.error,u=v}finally{f&&e.signal.removeEventListener("abort",f)}if(pk(u)){let v=u.status;if(nk.has(v)){let x=u.headers.get("Location");if(qt(x,"Redirects returned/thrown from loaders/actions must have a Location header"),!$5.test(x))x=yy(new URL(e.url),n.slice(0,n.indexOf(r)+1),o,!0,x);else if(!a.isStaticRequest){let A=new URL(e.url),C=x.startsWith("//")?new URL(A.protocol+x):new URL(x),F=v0(C.pathname,o)!=null;C.origin===A.origin&&F&&(x=C.pathname+C.search+C.hash)}if(a.isStaticRequest)throw u.headers.set("Location",x),u;return{type:jr.redirect,status:v,location:x,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:l===jr.error?jr.error:jr.data,response:u};let b,N=u.headers.get("Content-Type");return N&&/\bapplication\/json\b/.test(N)?b=await u.json():b=await u.text(),l===jr.error?{type:l,error:new yx(v,u.statusText,b),headers:u.headers}:{type:jr.data,data:b,statusCode:u.status,headers:u.headers}}if(l===jr.error)return{type:l,error:u};if(dk(u)){var p,y;return{type:jr.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((y=u.init)==null?void 0:y.headers)&&new Headers(u.init.headers)}}return{type:jr.data,data:u}}function Cc(t,e,r,n){let i=t.createURL(Y5(e)).toString(),s={signal:r};if(n&&ls(n.formMethod)){let{formMethod:o,formEncType:a}=n;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(n.json)):a==="text/plain"?s.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?s.body=xy(n.formData):s.body=n.formData}return new Request(i,s)}function xy(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function Mw(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function ck(t,e,r,n,i){let s={},o=null,a,l=!1,u={};return r.forEach((f,c)=>{let p=e[c].route.id;if(qt(!Du(f),"Cannot handle redirect results in processLoaderData"),sh(f)){let y=ih(t,p),v=f.error;n&&(v=Object.values(n)[0],n=void 0),o=o||{},o[y.route.id]==null&&(o[y.route.id]=v),s[p]=void 0,l||(l=!0,a=Q5(f.error)?f.error.status:500),f.headers&&(u[p]=f.headers)}else Xa(f)?(i.set(p,f.deferredData),s[p]=f.deferredData.data):s[p]=f.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(a=f.statusCode),f.headers&&(u[p]=f.headers)}),n&&(o=n,s[Object.keys(n)[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function Bw(t,e,r,n,i,s,o,a){let{loaderData:l,errors:u}=ck(e,r,n,i,a);for(let f=0;fn.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function Uw(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ii(t,e){let{pathname:r,routeId:n,method:i,type:s}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":s==="defer-action"?a="defer() is not supported in actions":s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new yx(t||500,o,new Error(a),!0)}function Dw(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(Du(r))return{result:r,idx:e}}}function Y5(t){let e=typeof t=="string"?qs(t):t;return x0(Ur({},e,{hash:""}))}function hk(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Xa(t){return t.type===jr.deferred}function sh(t){return t.type===jr.error}function Du(t){return(t&&t.type)===jr.redirect}function dk(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function pk(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function gk(t){return rk.has(t.toLowerCase())}function ls(t){return ek.has(t.toLowerCase())}async function Lw(t,e,r,n,i,s){for(let o=0;oc.route.id===l.route.id),f=u!=null&&!J5(u,l)&&(s&&s[l.route.id])!==void 0;if(Xa(a)&&(i||f)){let c=n[o];qt(c,"Expected an AbortSignal for revalidating fetcher deferred result"),await q5(a,c,i).then(p=>{p&&(r[o]=p||r[o])})}}}async function q5(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:jr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:jr.error,error:i}}return{type:jr.data,data:t.deferredData.data}}}function xx(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function vy(t,e){let r=typeof e=="string"?qs(e).search:e.search;if(t[t.length-1].route.index&&xx(r||""))return t[t.length-1];let n=mx(t);return n[n.length-1]}function zw(t){let{formMethod:e,formAction:r,formEncType:n,text:i,formData:s,json:o}=t;if(!(!e||!r||!n)){if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Ug(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function mk(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function kc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function yk(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Jo(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function xk(t,e){try{let r=t.sessionStorage.getItem(W5);if(r){let n=JSON.parse(r);for(let[i,s]of Object.entries(n||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function vk(t,e){if(e.size>0){let r={};for(let[n,i]of e)r[n]=[...i];try{t.sessionStorage.setItem(W5,JSON.stringify(r))}catch(n){Ia(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** * React Router v6.18.0 * * Copyright (c) Remix Software Inc. @@ -56,7 +56,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Sp(){return Sp=Object.assign?Object.assign.bind():function(t){for(var e=1;el.pathnameBase)),o=we.useRef(!1);return eE(()=>{o.current=!0}),we.useCallback(function(l,u){if(u===void 0&&(u={}),!o.current)return;if(typeof l=="number"){r.go(l);return}let f=V5(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:_a([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,i,t])}const bk=we.createContext(null);function Ak(t){let e=we.useContext(ja).outlet;return e&&we.createElement(bk.Provider,{value:t},e)}function Ek(){let{matches:t}=we.useContext(ja),e=t[t.length-1];return e?e.params:{}}function Sk(t,e,r){N1()||qt(!1);let{navigator:n}=we.useContext(_1),{matches:i}=we.useContext(ja),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=R1(),u;if(e){var f;let b=typeof e=="string"?Ys(e):e;a==="/"||(f=b.pathname)!=null&&f.startsWith(a)||qt(!1),u=b}else u=l;let c=u.pathname||"/",p=a==="/"?c:c.slice(a.length)||"/",y=bu(t,{pathname:p}),v=Pk(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:_a([a,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?a:_a([a,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r);return e&&v?we.createElement(P1.Provider,{value:{location:Sp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zr.Pop}},v):v}function Fk(){let t=Ik(),e=Q5(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return we.createElement(we.Fragment,null,we.createElement("h2",null,"Unexpected Application Error!"),we.createElement("h3",{style:{fontStyle:"italic"}},e),r?we.createElement("pre",{style:i},r):null,s)}const Ck=we.createElement(Fk,null);class kk extends we.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?we.createElement(ja.Provider,{value:this.props.routeContext},we.createElement(Z5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _k(t){let{routeContext:e,match:r,children:n}=t,i=we.useContext(k1);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),we.createElement(ja.Provider,{value:e},n)}function Pk(t,e,r){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),t==null){var i;if((i=r)!=null&&i.errors)t=r.matches;else return null}let s=t,o=(n=r)==null?void 0:n.errors;if(o!=null){let a=s.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));a>=0||qt(!1),s=s.slice(0,Math.min(s.length,a+1))}return s.reduceRight((a,l,u)=>{let f=l.route.id?o==null?void 0:o[l.route.id]:null,c=null;r&&(c=l.route.errorElement||Ck);let p=e.concat(s.slice(0,u+1)),y=()=>{let v;return f?v=c:l.route.Component?v=we.createElement(l.route.Component,null):l.route.element?v=l.route.element:v=a,we.createElement(_k,{match:l,routeContext:{outlet:a,matches:p,isDataRoute:r!=null},children:v})};return r&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?we.createElement(kk,{location:r.location,revalidation:r.revalidation,component:c,error:f,children:y(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):y()},null)}var tE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(tE||{}),Fp=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Fp||{});function Nk(t){let e=we.useContext(k1);return e||qt(!1),e}function Rk(t){let e=we.useContext(X5);return e||qt(!1),e}function Tk(t){let e=we.useContext(ja);return e||qt(!1),e}function rE(t){let e=Tk(),r=e.matches[e.matches.length-1];return r.route.id||qt(!1),r.route.id}function Ik(){var t;let e=we.useContext(Z5),r=Rk(Fp.UseRouteError),n=rE(Fp.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function Mk(){let{router:t}=Nk(tE.UseNavigateStable),e=rE(Fp.UseNavigateStable),r=we.useRef(!1);return eE(()=>{r.current=!0}),we.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Sp({fromRouteId:e},s)))},[t,e])}function Bk(t){return Ak(t.context)}function Ok(t){let{basename:e="/",children:r=null,location:n,navigationType:i=zr.Pop,navigator:s,static:o=!1}=t;N1()&&qt(!1);let a=e.replace(/^\/*/,"/"),l=we.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof n=="string"&&(n=Ys(n));let{pathname:u="/",search:f="",hash:c="",state:p=null,key:y="default"}=n,v=we.useMemo(()=>{let b=v0(u,a);return b==null?null:{location:{pathname:b,search:f,hash:c,state:p,key:y},navigationType:i}},[a,u,f,c,p,y,i]);return v==null?null:we.createElement(_1.Provider,{value:l},we.createElement(P1.Provider,{children:r,value:v}))}new Promise(()=>{});function Uk(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:we.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:we.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function Sp(){return Sp=Object.assign?Object.assign.bind():function(t){for(var e=1;el.pathnameBase)),o=we.useRef(!1);return eE(()=>{o.current=!0}),we.useCallback(function(l,u){if(u===void 0&&(u={}),!o.current)return;if(typeof l=="number"){r.go(l);return}let f=V5(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:_a([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,i,t])}const bk=we.createContext(null);function Ak(t){let e=we.useContext(ja).outlet;return e&&we.createElement(bk.Provider,{value:t},e)}function Ek(){let{matches:t}=we.useContext(ja),e=t[t.length-1];return e?e.params:{}}function Sk(t,e,r){N1()||qt(!1);let{navigator:n}=we.useContext(_1),{matches:i}=we.useContext(ja),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=R1(),u;if(e){var f;let b=typeof e=="string"?qs(e):e;a==="/"||(f=b.pathname)!=null&&f.startsWith(a)||qt(!1),u=b}else u=l;let c=u.pathname||"/",p=a==="/"?c:c.slice(a.length)||"/",y=bu(t,{pathname:p}),v=Pk(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:_a([a,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?a:_a([a,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r);return e&&v?we.createElement(P1.Provider,{value:{location:Sp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zr.Pop}},v):v}function Fk(){let t=Ik(),e=Q5(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return we.createElement(we.Fragment,null,we.createElement("h2",null,"Unexpected Application Error!"),we.createElement("h3",{style:{fontStyle:"italic"}},e),r?we.createElement("pre",{style:i},r):null,s)}const Ck=we.createElement(Fk,null);class kk extends we.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?we.createElement(ja.Provider,{value:this.props.routeContext},we.createElement(Z5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _k(t){let{routeContext:e,match:r,children:n}=t,i=we.useContext(k1);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),we.createElement(ja.Provider,{value:e},n)}function Pk(t,e,r){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),t==null){var i;if((i=r)!=null&&i.errors)t=r.matches;else return null}let s=t,o=(n=r)==null?void 0:n.errors;if(o!=null){let a=s.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));a>=0||qt(!1),s=s.slice(0,Math.min(s.length,a+1))}return s.reduceRight((a,l,u)=>{let f=l.route.id?o==null?void 0:o[l.route.id]:null,c=null;r&&(c=l.route.errorElement||Ck);let p=e.concat(s.slice(0,u+1)),y=()=>{let v;return f?v=c:l.route.Component?v=we.createElement(l.route.Component,null):l.route.element?v=l.route.element:v=a,we.createElement(_k,{match:l,routeContext:{outlet:a,matches:p,isDataRoute:r!=null},children:v})};return r&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?we.createElement(kk,{location:r.location,revalidation:r.revalidation,component:c,error:f,children:y(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):y()},null)}var tE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(tE||{}),Fp=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Fp||{});function Nk(t){let e=we.useContext(k1);return e||qt(!1),e}function Rk(t){let e=we.useContext(X5);return e||qt(!1),e}function Tk(t){let e=we.useContext(ja);return e||qt(!1),e}function rE(t){let e=Tk(),r=e.matches[e.matches.length-1];return r.route.id||qt(!1),r.route.id}function Ik(){var t;let e=we.useContext(Z5),r=Rk(Fp.UseRouteError),n=rE(Fp.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function Mk(){let{router:t}=Nk(tE.UseNavigateStable),e=rE(Fp.UseNavigateStable),r=we.useRef(!1);return eE(()=>{r.current=!0}),we.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Sp({fromRouteId:e},s)))},[t,e])}function Bk(t){return Ak(t.context)}function Ok(t){let{basename:e="/",children:r=null,location:n,navigationType:i=zr.Pop,navigator:s,static:o=!1}=t;N1()&&qt(!1);let a=e.replace(/^\/*/,"/"),l=we.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof n=="string"&&(n=qs(n));let{pathname:u="/",search:f="",hash:c="",state:p=null,key:y="default"}=n,v=we.useMemo(()=>{let b=v0(u,a);return b==null?null:{location:{pathname:b,search:f,hash:c,state:p,key:y},navigationType:i}},[a,u,f,c,p,y,i]);return v==null?null:we.createElement(_1.Provider,{value:l},we.createElement(P1.Provider,{children:r,value:v}))}new Promise(()=>{});function Uk(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:we.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:we.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.18.0 * * Copyright (c) Remix Software Inc. @@ -65,32 +65,32 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Cp(){return Cp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let n=t[r];return e.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function Dk(t,e){let r=wy(t);return e&&e.forEach((n,i)=>{r.has(i)||e.getAll(i).forEach(s=>{r.append(i,s)})}),r}function Lk(t,e){return ak({basename:e==null?void 0:e.basename,future:Cp({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:PC({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||zk(),routes:t,mapRouteProperties:Uk,window:e==null?void 0:e.window}).initialize()}function zk(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=Cp({},e,{errors:jk(e.errors)})),e}function jk(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,i]of e)if(i&&i.__type==="RouteErrorResponse")r[n]=new yx(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let o=new s(i.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let s=new Error(i.message);s.stack="",r[n]=s}}else r[n]=i;return r}const Hk=we.createContext({isTransitioning:!1}),Gk=we.createContext(new Map),Vk="startTransition",jw=xF[Vk];function Qk(t){jw?jw(t):t()}class $k{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function Kk(t){let{fallbackElement:e,router:r,future:n}=t,[i,s]=we.useState(r.state),[o,a]=we.useState(),[l,u]=we.useState({isTransitioning:!1}),[f,c]=we.useState(),[p,y]=we.useState(),[v,b]=we.useState(),N=we.useRef(new Map),{v7_startTransition:x}=n||{},A=we.useCallback(D=>{x?Qk(D):D()},[x]),C=we.useCallback((D,G)=>{let{deletedFetchers:$,unstable_viewTransitionOpts:ne}=G;$.forEach(te=>N.current.delete(te)),D.fetchers.forEach((te,de)=>{te.data!==void 0&&N.current.set(de,te.data)}),!ne||r.window==null||typeof r.window.document.startViewTransition!="function"?A(()=>s(D)):p&&f?(f.resolve(),p.skipTransition(),b({state:D,currentLocation:ne.currentLocation,nextLocation:ne.nextLocation})):(a(D),u({isTransitioning:!0,currentLocation:ne.currentLocation,nextLocation:ne.nextLocation}))},[r.window,p,f,N,A]);we.useLayoutEffect(()=>r.subscribe(C),[r,C]),we.useEffect(()=>{l.isTransitioning&&c(new $k)},[l.isTransitioning]),we.useEffect(()=>{if(f&&o&&r.window){let D=o,G=f.promise,$=r.window.document.startViewTransition(async()=>{A(()=>s(D)),await G});$.finished.finally(()=>{c(void 0),y(void 0),a(void 0),u({isTransitioning:!1})}),y($)}},[A,o,f,r.window]),we.useEffect(()=>{f&&o&&i.location.key===o.location.key&&f.resolve()},[f,p,i.location,o]),we.useEffect(()=>{!l.isTransitioning&&v&&(a(v.state),u({isTransitioning:!0,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[l.isTransitioning,v]);let F=we.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:D=>r.navigate(D),push:(D,G,$)=>r.navigate(D,{state:G,preventScrollReset:$==null?void 0:$.preventScrollReset}),replace:(D,G,$)=>r.navigate(D,{replace:!0,state:G,preventScrollReset:$==null?void 0:$.preventScrollReset})}),[r]),z=r.basename||"/",T=we.useMemo(()=>({router:r,navigator:F,static:!1,basename:z}),[r,F,z]);return we.createElement(we.Fragment,null,we.createElement(k1.Provider,{value:T},we.createElement(X5.Provider,{value:i},we.createElement(Gk.Provider,{value:N.current},we.createElement(Hk.Provider,{value:l},we.createElement(Ok,{basename:z,location:i.location,navigationType:i.historyAction,navigator:F},i.initialized?we.createElement(Jk,{routes:r.routes,state:i}):e))))),null)}function Jk(t){let{routes:e,state:r}=t;return Sk(e,void 0,r)}var Hw;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Hw||(Hw={}));var Gw;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Gw||(Gw={}));function Wk(t){let e=we.useRef(wy(t)),r=we.useRef(!1),n=R1(),i=we.useMemo(()=>Dk(n.search,r.current?null:e.current),[n.search]),s=T1(),o=we.useCallback((a,l)=>{const u=wy(typeof a=="function"?a(i):a);r.current=!0,s("?"+u,l)},[s,i]);return[i,o]}const Yk="_layout_fdlct_1",qk="_header_fdlct_7",Vw={layout:Yk,header:qk};var vx={exports:{}};const Xk={},Zk=Object.freeze(Object.defineProperty({__proto__:null,default:Xk},Symbol.toStringTag,{value:"Module"})),nE=tF(Zk);vx.exports;(function(t){(function(e,r){function n(_,h){if(!_)throw new Error(h||"Assertion failed")}function i(_,h){_.super_=h;var m=function(){};m.prototype=h.prototype,_.prototype=new m,_.prototype.constructor=_}function s(_,h,m){if(s.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((h==="le"||h==="be")&&(m=h,h=10),this._init(_||0,h||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=nE.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,m){return h.cmp(m)>0?h:m},s.min=function(h,m){return h.cmp(m)<0?h:m},s.prototype._init=function(h,m,S){if(typeof h=="number")return this._initNumber(h,m,S);if(typeof h=="object")return this._initArray(h,m,S);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),h=h.toString().replace(/\s+/g,"");var M=0;h[0]==="-"&&(M++,this.negative=1),M=0;M-=3)U=h[M]|h[M-1]<<8|h[M-2]<<16,this.words[R]|=U<>>26-H&67108863,H+=24,H>=26&&(H-=26,R++);else if(S==="le")for(M=0,R=0;M>>26-H&67108863,H+=24,H>=26&&(H-=26,R++);return this._strip()};function a(_,h){var m=_.charCodeAt(h);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+_)}function l(_,h,m){var S=a(_,m);return m-1>=h&&(S|=a(_,m-1)<<4),S}s.prototype._parseHex=function(h,m,S){this.length=Math.ceil((h.length-m)/6),this.words=new Array(this.length);for(var M=0;M=m;M-=2)H=l(h,m,M)<=18?(R-=18,U+=1,this.words[U]|=H>>>26):R+=8;else{var B=h.length-m;for(M=B%2===0?m+1:m;M=18?(R-=18,U+=1,this.words[U]|=H>>>26):R+=8}this._strip()};function u(_,h,m,S){for(var M=0,R=0,U=Math.min(_.length,m),H=h;H=49?R=B-49+10:B>=17?R=B-17+10:R=B,n(B>=0&&R1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(h,m){h=h||10,m=m|0||1;var S;if(h===16||h==="hex"){S="";for(var M=0,R=0,U=0;U>>24-M&16777215,M+=2,M>=26&&(M-=26,U--),R!==0||U!==this.length-1?S=p[6-B.length]+B+S:S=B+S}for(R!==0&&(S=R.toString(16)+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],O=v[h];S="";var ve=this.clone();for(ve.negative=0;!ve.isZero();){var E=ve.modrn(O).toString(h);ve=ve.idivn(O),ve.isZero()?S=E+S:S=p[g-E.length]+E+S}for(this.isZero()&&(S="0"+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,m){return this.toArrayLike(o,h,m)}),s.prototype.toArray=function(h,m){return this.toArrayLike(Array,h,m)};var b=function(h,m){return h.allocUnsafe?h.allocUnsafe(m):new h(m)};s.prototype.toArrayLike=function(h,m,S){this._strip();var M=this.byteLength(),R=S||Math.max(1,M);n(M<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0");var U=b(h,R),H=m==="le"?"LE":"BE";return this["_toArrayLike"+H](U,M),U},s.prototype._toArrayLikeLE=function(h,m){for(var S=0,M=0,R=0,U=0;R>8&255),S>16&255),U===6?(S>24&255),M=0,U=0):(M=H>>>24,U+=2)}if(S=0&&(h[S--]=H>>8&255),S>=0&&(h[S--]=H>>16&255),U===6?(S>=0&&(h[S--]=H>>24&255),M=0,U=0):(M=H>>>24,U+=2)}if(S>=0)for(h[S--]=M;S>=0;)h[S--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var m=h,S=0;return m>=4096&&(S+=13,m>>>=13),m>=64&&(S+=7,m>>>=7),m>=8&&(S+=4,m>>>=4),m>=2&&(S+=2,m>>>=2),S+m},s.prototype._zeroBits=function(h){if(h===0)return 26;var m=h,S=0;return m&8191||(S+=13,m>>>=13),m&127||(S+=7,m>>>=7),m&15||(S+=4,m>>>=4),m&3||(S+=2,m>>>=2),m&1||S++,S},s.prototype.bitLength=function(){var h=this.words[this.length-1],m=this._countBits(h);return(this.length-1)*26+m};function N(_){for(var h=new Array(_.bitLength()),m=0;m>>M&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,m=0;mh.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var m;this.length>h.length?m=h:m=this;for(var S=0;Sh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var m,S;this.length>h.length?(m=this,S=h):(m=h,S=this);for(var M=0;Mh.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var m=Math.ceil(h/26)|0,S=h%26;this._expand(m),S>0&&m--;for(var M=0;M0&&(this.words[M]=~this.words[M]&67108863>>26-S),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,m){n(typeof h=="number"&&h>=0);var S=h/26|0,M=h%26;return this._expand(S+1),m?this.words[S]=this.words[S]|1<h.length?(S=this,M=h):(S=h,M=this);for(var R=0,U=0;U>>26;for(;R!==0&&U>>26;if(this.length=S.length,R!==0)this.words[this.length]=R,this.length++;else if(S!==this)for(;Uh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var m=this.iadd(h);return h.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var S=this.cmp(h);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,R;S>0?(M=this,R=h):(M=h,R=this);for(var U=0,H=0;H>26,this.words[H]=m&67108863;for(;U!==0&&H>26,this.words[H]=m&67108863;if(U===0&&H>>26,ve=B&67108863,E=Math.min(g,h.length-1),W=Math.max(0,g-_.length+1);W<=E;W++){var oe=g-W|0;M=_.words[oe]|0,R=h.words[W]|0,U=M*R+ve,O+=U/67108864|0,ve=U&67108863}m.words[g]=ve|0,B=O|0}return B!==0?m.words[g]=B|0:m.length--,m._strip()}var A=function(h,m,S){var M=h.words,R=m.words,U=S.words,H=0,B,g,O,ve=M[0]|0,E=ve&8191,W=ve>>>13,oe=M[1]|0,J=oe&8191,K=oe>>>13,V=M[2]|0,Z=V&8191,he=V>>>13,Ue=M[3]|0,pe=Ue&8191,Be=Ue>>>13,ut=M[4]|0,We=ut&8191,Ye=ut>>>13,pt=M[5]|0,ze=pt&8191,ye=pt>>>13,De=M[6]|0,Ce=De&8191,tt=De>>>13,Dt=M[7]|0,yt=Dt&8191,Ct=Dt>>>13,fr=M[8]|0,Tt=fr&8191,It=fr>>>13,Wt=M[9]|0,Et=Wt&8191,kt=Wt>>>13,$t=R[0]|0,xt=$t&8191,vt=$t>>>13,ir=R[1]|0,St=ir&8191,_t=ir>>>13,q=R[2]|0,re=q&8191,ae=q>>>13,ke=R[3]|0,Ie=ke&8191,Le=ke>>>13,ht=R[4]|0,He=ht&8191,je=ht>>>13,Gt=R[5]|0,wt=Gt&8191,Je=Gt>>>13,Ht=R[6]|0,w=Ht&8191,k=Ht>>>13,P=R[7]|0,d=P&8191,I=P>>>13,X=R[8]|0,Y=X&8191,ue=X>>>13,Se=R[9]|0,Re=Se&8191,Fe=Se>>>13;S.negative=h.negative^m.negative,S.length=19,B=Math.imul(E,xt),g=Math.imul(E,vt),g=g+Math.imul(W,xt)|0,O=Math.imul(W,vt);var qe=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(qe>>>26)|0,qe&=67108863,B=Math.imul(J,xt),g=Math.imul(J,vt),g=g+Math.imul(K,xt)|0,O=Math.imul(K,vt),B=B+Math.imul(E,St)|0,g=g+Math.imul(E,_t)|0,g=g+Math.imul(W,St)|0,O=O+Math.imul(W,_t)|0;var Me=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Me>>>26)|0,Me&=67108863,B=Math.imul(Z,xt),g=Math.imul(Z,vt),g=g+Math.imul(he,xt)|0,O=Math.imul(he,vt),B=B+Math.imul(J,St)|0,g=g+Math.imul(J,_t)|0,g=g+Math.imul(K,St)|0,O=O+Math.imul(K,_t)|0,B=B+Math.imul(E,re)|0,g=g+Math.imul(E,ae)|0,g=g+Math.imul(W,re)|0,O=O+Math.imul(W,ae)|0;var rt=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(rt>>>26)|0,rt&=67108863,B=Math.imul(pe,xt),g=Math.imul(pe,vt),g=g+Math.imul(Be,xt)|0,O=Math.imul(Be,vt),B=B+Math.imul(Z,St)|0,g=g+Math.imul(Z,_t)|0,g=g+Math.imul(he,St)|0,O=O+Math.imul(he,_t)|0,B=B+Math.imul(J,re)|0,g=g+Math.imul(J,ae)|0,g=g+Math.imul(K,re)|0,O=O+Math.imul(K,ae)|0,B=B+Math.imul(E,Ie)|0,g=g+Math.imul(E,Le)|0,g=g+Math.imul(W,Ie)|0,O=O+Math.imul(W,Le)|0;var Ve=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,B=Math.imul(We,xt),g=Math.imul(We,vt),g=g+Math.imul(Ye,xt)|0,O=Math.imul(Ye,vt),B=B+Math.imul(pe,St)|0,g=g+Math.imul(pe,_t)|0,g=g+Math.imul(Be,St)|0,O=O+Math.imul(Be,_t)|0,B=B+Math.imul(Z,re)|0,g=g+Math.imul(Z,ae)|0,g=g+Math.imul(he,re)|0,O=O+Math.imul(he,ae)|0,B=B+Math.imul(J,Ie)|0,g=g+Math.imul(J,Le)|0,g=g+Math.imul(K,Ie)|0,O=O+Math.imul(K,Le)|0,B=B+Math.imul(E,He)|0,g=g+Math.imul(E,je)|0,g=g+Math.imul(W,He)|0,O=O+Math.imul(W,je)|0;var dt=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(dt>>>26)|0,dt&=67108863,B=Math.imul(ze,xt),g=Math.imul(ze,vt),g=g+Math.imul(ye,xt)|0,O=Math.imul(ye,vt),B=B+Math.imul(We,St)|0,g=g+Math.imul(We,_t)|0,g=g+Math.imul(Ye,St)|0,O=O+Math.imul(Ye,_t)|0,B=B+Math.imul(pe,re)|0,g=g+Math.imul(pe,ae)|0,g=g+Math.imul(Be,re)|0,O=O+Math.imul(Be,ae)|0,B=B+Math.imul(Z,Ie)|0,g=g+Math.imul(Z,Le)|0,g=g+Math.imul(he,Ie)|0,O=O+Math.imul(he,Le)|0,B=B+Math.imul(J,He)|0,g=g+Math.imul(J,je)|0,g=g+Math.imul(K,He)|0,O=O+Math.imul(K,je)|0,B=B+Math.imul(E,wt)|0,g=g+Math.imul(E,Je)|0,g=g+Math.imul(W,wt)|0,O=O+Math.imul(W,Je)|0;var Ft=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,B=Math.imul(Ce,xt),g=Math.imul(Ce,vt),g=g+Math.imul(tt,xt)|0,O=Math.imul(tt,vt),B=B+Math.imul(ze,St)|0,g=g+Math.imul(ze,_t)|0,g=g+Math.imul(ye,St)|0,O=O+Math.imul(ye,_t)|0,B=B+Math.imul(We,re)|0,g=g+Math.imul(We,ae)|0,g=g+Math.imul(Ye,re)|0,O=O+Math.imul(Ye,ae)|0,B=B+Math.imul(pe,Ie)|0,g=g+Math.imul(pe,Le)|0,g=g+Math.imul(Be,Ie)|0,O=O+Math.imul(Be,Le)|0,B=B+Math.imul(Z,He)|0,g=g+Math.imul(Z,je)|0,g=g+Math.imul(he,He)|0,O=O+Math.imul(he,je)|0,B=B+Math.imul(J,wt)|0,g=g+Math.imul(J,Je)|0,g=g+Math.imul(K,wt)|0,O=O+Math.imul(K,Je)|0,B=B+Math.imul(E,w)|0,g=g+Math.imul(E,k)|0,g=g+Math.imul(W,w)|0,O=O+Math.imul(W,k)|0;var gt=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(gt>>>26)|0,gt&=67108863,B=Math.imul(yt,xt),g=Math.imul(yt,vt),g=g+Math.imul(Ct,xt)|0,O=Math.imul(Ct,vt),B=B+Math.imul(Ce,St)|0,g=g+Math.imul(Ce,_t)|0,g=g+Math.imul(tt,St)|0,O=O+Math.imul(tt,_t)|0,B=B+Math.imul(ze,re)|0,g=g+Math.imul(ze,ae)|0,g=g+Math.imul(ye,re)|0,O=O+Math.imul(ye,ae)|0,B=B+Math.imul(We,Ie)|0,g=g+Math.imul(We,Le)|0,g=g+Math.imul(Ye,Ie)|0,O=O+Math.imul(Ye,Le)|0,B=B+Math.imul(pe,He)|0,g=g+Math.imul(pe,je)|0,g=g+Math.imul(Be,He)|0,O=O+Math.imul(Be,je)|0,B=B+Math.imul(Z,wt)|0,g=g+Math.imul(Z,Je)|0,g=g+Math.imul(he,wt)|0,O=O+Math.imul(he,Je)|0,B=B+Math.imul(J,w)|0,g=g+Math.imul(J,k)|0,g=g+Math.imul(K,w)|0,O=O+Math.imul(K,k)|0,B=B+Math.imul(E,d)|0,g=g+Math.imul(E,I)|0,g=g+Math.imul(W,d)|0,O=O+Math.imul(W,I)|0;var Pt=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,B=Math.imul(Tt,xt),g=Math.imul(Tt,vt),g=g+Math.imul(It,xt)|0,O=Math.imul(It,vt),B=B+Math.imul(yt,St)|0,g=g+Math.imul(yt,_t)|0,g=g+Math.imul(Ct,St)|0,O=O+Math.imul(Ct,_t)|0,B=B+Math.imul(Ce,re)|0,g=g+Math.imul(Ce,ae)|0,g=g+Math.imul(tt,re)|0,O=O+Math.imul(tt,ae)|0,B=B+Math.imul(ze,Ie)|0,g=g+Math.imul(ze,Le)|0,g=g+Math.imul(ye,Ie)|0,O=O+Math.imul(ye,Le)|0,B=B+Math.imul(We,He)|0,g=g+Math.imul(We,je)|0,g=g+Math.imul(Ye,He)|0,O=O+Math.imul(Ye,je)|0,B=B+Math.imul(pe,wt)|0,g=g+Math.imul(pe,Je)|0,g=g+Math.imul(Be,wt)|0,O=O+Math.imul(Be,Je)|0,B=B+Math.imul(Z,w)|0,g=g+Math.imul(Z,k)|0,g=g+Math.imul(he,w)|0,O=O+Math.imul(he,k)|0,B=B+Math.imul(J,d)|0,g=g+Math.imul(J,I)|0,g=g+Math.imul(K,d)|0,O=O+Math.imul(K,I)|0,B=B+Math.imul(E,Y)|0,g=g+Math.imul(E,ue)|0,g=g+Math.imul(W,Y)|0,O=O+Math.imul(W,ue)|0;var Nt=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,B=Math.imul(Et,xt),g=Math.imul(Et,vt),g=g+Math.imul(kt,xt)|0,O=Math.imul(kt,vt),B=B+Math.imul(Tt,St)|0,g=g+Math.imul(Tt,_t)|0,g=g+Math.imul(It,St)|0,O=O+Math.imul(It,_t)|0,B=B+Math.imul(yt,re)|0,g=g+Math.imul(yt,ae)|0,g=g+Math.imul(Ct,re)|0,O=O+Math.imul(Ct,ae)|0,B=B+Math.imul(Ce,Ie)|0,g=g+Math.imul(Ce,Le)|0,g=g+Math.imul(tt,Ie)|0,O=O+Math.imul(tt,Le)|0,B=B+Math.imul(ze,He)|0,g=g+Math.imul(ze,je)|0,g=g+Math.imul(ye,He)|0,O=O+Math.imul(ye,je)|0,B=B+Math.imul(We,wt)|0,g=g+Math.imul(We,Je)|0,g=g+Math.imul(Ye,wt)|0,O=O+Math.imul(Ye,Je)|0,B=B+Math.imul(pe,w)|0,g=g+Math.imul(pe,k)|0,g=g+Math.imul(Be,w)|0,O=O+Math.imul(Be,k)|0,B=B+Math.imul(Z,d)|0,g=g+Math.imul(Z,I)|0,g=g+Math.imul(he,d)|0,O=O+Math.imul(he,I)|0,B=B+Math.imul(J,Y)|0,g=g+Math.imul(J,ue)|0,g=g+Math.imul(K,Y)|0,O=O+Math.imul(K,ue)|0,B=B+Math.imul(E,Re)|0,g=g+Math.imul(E,Fe)|0,g=g+Math.imul(W,Re)|0,O=O+Math.imul(W,Fe)|0;var Xe=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,B=Math.imul(Et,St),g=Math.imul(Et,_t),g=g+Math.imul(kt,St)|0,O=Math.imul(kt,_t),B=B+Math.imul(Tt,re)|0,g=g+Math.imul(Tt,ae)|0,g=g+Math.imul(It,re)|0,O=O+Math.imul(It,ae)|0,B=B+Math.imul(yt,Ie)|0,g=g+Math.imul(yt,Le)|0,g=g+Math.imul(Ct,Ie)|0,O=O+Math.imul(Ct,Le)|0,B=B+Math.imul(Ce,He)|0,g=g+Math.imul(Ce,je)|0,g=g+Math.imul(tt,He)|0,O=O+Math.imul(tt,je)|0,B=B+Math.imul(ze,wt)|0,g=g+Math.imul(ze,Je)|0,g=g+Math.imul(ye,wt)|0,O=O+Math.imul(ye,Je)|0,B=B+Math.imul(We,w)|0,g=g+Math.imul(We,k)|0,g=g+Math.imul(Ye,w)|0,O=O+Math.imul(Ye,k)|0,B=B+Math.imul(pe,d)|0,g=g+Math.imul(pe,I)|0,g=g+Math.imul(Be,d)|0,O=O+Math.imul(Be,I)|0,B=B+Math.imul(Z,Y)|0,g=g+Math.imul(Z,ue)|0,g=g+Math.imul(he,Y)|0,O=O+Math.imul(he,ue)|0,B=B+Math.imul(J,Re)|0,g=g+Math.imul(J,Fe)|0,g=g+Math.imul(K,Re)|0,O=O+Math.imul(K,Fe)|0;var st=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(st>>>26)|0,st&=67108863,B=Math.imul(Et,re),g=Math.imul(Et,ae),g=g+Math.imul(kt,re)|0,O=Math.imul(kt,ae),B=B+Math.imul(Tt,Ie)|0,g=g+Math.imul(Tt,Le)|0,g=g+Math.imul(It,Ie)|0,O=O+Math.imul(It,Le)|0,B=B+Math.imul(yt,He)|0,g=g+Math.imul(yt,je)|0,g=g+Math.imul(Ct,He)|0,O=O+Math.imul(Ct,je)|0,B=B+Math.imul(Ce,wt)|0,g=g+Math.imul(Ce,Je)|0,g=g+Math.imul(tt,wt)|0,O=O+Math.imul(tt,Je)|0,B=B+Math.imul(ze,w)|0,g=g+Math.imul(ze,k)|0,g=g+Math.imul(ye,w)|0,O=O+Math.imul(ye,k)|0,B=B+Math.imul(We,d)|0,g=g+Math.imul(We,I)|0,g=g+Math.imul(Ye,d)|0,O=O+Math.imul(Ye,I)|0,B=B+Math.imul(pe,Y)|0,g=g+Math.imul(pe,ue)|0,g=g+Math.imul(Be,Y)|0,O=O+Math.imul(Be,ue)|0,B=B+Math.imul(Z,Re)|0,g=g+Math.imul(Z,Fe)|0,g=g+Math.imul(he,Re)|0,O=O+Math.imul(he,Fe)|0;var Qe=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,B=Math.imul(Et,Ie),g=Math.imul(Et,Le),g=g+Math.imul(kt,Ie)|0,O=Math.imul(kt,Le),B=B+Math.imul(Tt,He)|0,g=g+Math.imul(Tt,je)|0,g=g+Math.imul(It,He)|0,O=O+Math.imul(It,je)|0,B=B+Math.imul(yt,wt)|0,g=g+Math.imul(yt,Je)|0,g=g+Math.imul(Ct,wt)|0,O=O+Math.imul(Ct,Je)|0,B=B+Math.imul(Ce,w)|0,g=g+Math.imul(Ce,k)|0,g=g+Math.imul(tt,w)|0,O=O+Math.imul(tt,k)|0,B=B+Math.imul(ze,d)|0,g=g+Math.imul(ze,I)|0,g=g+Math.imul(ye,d)|0,O=O+Math.imul(ye,I)|0,B=B+Math.imul(We,Y)|0,g=g+Math.imul(We,ue)|0,g=g+Math.imul(Ye,Y)|0,O=O+Math.imul(Ye,ue)|0,B=B+Math.imul(pe,Re)|0,g=g+Math.imul(pe,Fe)|0,g=g+Math.imul(Be,Re)|0,O=O+Math.imul(Be,Fe)|0;var Ze=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,B=Math.imul(Et,He),g=Math.imul(Et,je),g=g+Math.imul(kt,He)|0,O=Math.imul(kt,je),B=B+Math.imul(Tt,wt)|0,g=g+Math.imul(Tt,Je)|0,g=g+Math.imul(It,wt)|0,O=O+Math.imul(It,Je)|0,B=B+Math.imul(yt,w)|0,g=g+Math.imul(yt,k)|0,g=g+Math.imul(Ct,w)|0,O=O+Math.imul(Ct,k)|0,B=B+Math.imul(Ce,d)|0,g=g+Math.imul(Ce,I)|0,g=g+Math.imul(tt,d)|0,O=O+Math.imul(tt,I)|0,B=B+Math.imul(ze,Y)|0,g=g+Math.imul(ze,ue)|0,g=g+Math.imul(ye,Y)|0,O=O+Math.imul(ye,ue)|0,B=B+Math.imul(We,Re)|0,g=g+Math.imul(We,Fe)|0,g=g+Math.imul(Ye,Re)|0,O=O+Math.imul(Ye,Fe)|0;var et=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(et>>>26)|0,et&=67108863,B=Math.imul(Et,wt),g=Math.imul(Et,Je),g=g+Math.imul(kt,wt)|0,O=Math.imul(kt,Je),B=B+Math.imul(Tt,w)|0,g=g+Math.imul(Tt,k)|0,g=g+Math.imul(It,w)|0,O=O+Math.imul(It,k)|0,B=B+Math.imul(yt,d)|0,g=g+Math.imul(yt,I)|0,g=g+Math.imul(Ct,d)|0,O=O+Math.imul(Ct,I)|0,B=B+Math.imul(Ce,Y)|0,g=g+Math.imul(Ce,ue)|0,g=g+Math.imul(tt,Y)|0,O=O+Math.imul(tt,ue)|0,B=B+Math.imul(ze,Re)|0,g=g+Math.imul(ze,Fe)|0,g=g+Math.imul(ye,Re)|0,O=O+Math.imul(ye,Fe)|0;var Ge=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,B=Math.imul(Et,w),g=Math.imul(Et,k),g=g+Math.imul(kt,w)|0,O=Math.imul(kt,k),B=B+Math.imul(Tt,d)|0,g=g+Math.imul(Tt,I)|0,g=g+Math.imul(It,d)|0,O=O+Math.imul(It,I)|0,B=B+Math.imul(yt,Y)|0,g=g+Math.imul(yt,ue)|0,g=g+Math.imul(Ct,Y)|0,O=O+Math.imul(Ct,ue)|0,B=B+Math.imul(Ce,Re)|0,g=g+Math.imul(Ce,Fe)|0,g=g+Math.imul(tt,Re)|0,O=O+Math.imul(tt,Fe)|0;var fe=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(fe>>>26)|0,fe&=67108863,B=Math.imul(Et,d),g=Math.imul(Et,I),g=g+Math.imul(kt,d)|0,O=Math.imul(kt,I),B=B+Math.imul(Tt,Y)|0,g=g+Math.imul(Tt,ue)|0,g=g+Math.imul(It,Y)|0,O=O+Math.imul(It,ue)|0,B=B+Math.imul(yt,Re)|0,g=g+Math.imul(yt,Fe)|0,g=g+Math.imul(Ct,Re)|0,O=O+Math.imul(Ct,Fe)|0;var ce=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(ce>>>26)|0,ce&=67108863,B=Math.imul(Et,Y),g=Math.imul(Et,ue),g=g+Math.imul(kt,Y)|0,O=Math.imul(kt,ue),B=B+Math.imul(Tt,Re)|0,g=g+Math.imul(Tt,Fe)|0,g=g+Math.imul(It,Re)|0,O=O+Math.imul(It,Fe)|0;var Ae=(H+B|0)+((g&8191)<<13)|0;H=(O+(g>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,B=Math.imul(Et,Re),g=Math.imul(Et,Fe),g=g+Math.imul(kt,Re)|0,O=Math.imul(kt,Fe);var ge=(H+B|0)+((g&8191)<<13)|0;return H=(O+(g>>>13)|0)+(ge>>>26)|0,ge&=67108863,U[0]=qe,U[1]=Me,U[2]=rt,U[3]=Ve,U[4]=dt,U[5]=Ft,U[6]=gt,U[7]=Pt,U[8]=Nt,U[9]=Xe,U[10]=st,U[11]=Qe,U[12]=Ze,U[13]=et,U[14]=Ge,U[15]=fe,U[16]=ce,U[17]=Ae,U[18]=ge,H!==0&&(U[19]=H,S.length++),S};Math.imul||(A=x);function C(_,h,m){m.negative=h.negative^_.negative,m.length=_.length+h.length;for(var S=0,M=0,R=0;R>>26)|0,M+=U>>>26,U&=67108863}m.words[R]=H,S=U,U=M}return S!==0?m.words[R]=S:m.length--,m._strip()}function F(_,h,m){return C(_,h,m)}s.prototype.mulTo=function(h,m){var S,M=this.length+h.length;return this.length===10&&h.length===10?S=A(this,h,m):M<63?S=x(this,h,m):M<1024?S=C(this,h,m):S=F(this,h,m),S},s.prototype.mul=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),this.mulTo(h,m)},s.prototype.mulf=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),F(this,h,m)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var m=h<0;m&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var S=0,M=0;M>=26,S+=R/67108864|0,S+=U>>>26,this.words[M]=U&67108863}return S!==0&&(this.words[M]=S,this.length++),m?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var m=N(h);if(m.length===0)return new s(1);for(var S=this,M=0;M=0);var m=h%26,S=(h-m)/26,M=67108863>>>26-m<<26-m,R;if(m!==0){var U=0;for(R=0;R>>26-m}U&&(this.words[R]=U,this.length++)}if(S!==0){for(R=this.length-1;R>=0;R--)this.words[R+S]=this.words[R];for(R=0;R=0);var M;m?M=(m-m%26)/26:M=0;var R=h%26,U=Math.min((h-R)/26,this.length),H=67108863^67108863>>>R<U)for(this.length-=U,g=0;g=0&&(O!==0||g>=M);g--){var ve=this.words[g]|0;this.words[g]=O<<26-R|ve>>>R,O=ve&H}return B&&O!==0&&(B.words[B.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,m,S){return n(this.negative===0),this.iushrn(h,m,S)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var m=h%26,S=(h-m)/26,M=1<=0);var m=h%26,S=(h-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(m!==0&&S++,this.length=Math.min(S,this.length),m!==0){var M=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(B/67108864|0),this.words[R+S]=U&67108863}for(;R>26,this.words[R+S]=U&67108863;if(H===0)return this._strip();for(n(H===-1),H=0,R=0;R>26,this.words[R]=U&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,m){var S=this.length-h.length,M=this.clone(),R=h,U=R.words[R.length-1]|0,H=this._countBits(U);S=26-H,S!==0&&(R=R.ushln(S),M.iushln(S),U=R.words[R.length-1]|0);var B=M.length-R.length,g;if(m!=="mod"){g=new s(null),g.length=B+1,g.words=new Array(g.length);for(var O=0;O=0;E--){var W=(M.words[R.length+E]|0)*67108864+(M.words[R.length+E-1]|0);for(W=Math.min(W/U|0,67108863),M._ishlnsubmul(R,W,E);M.negative!==0;)W--,M.negative=0,M._ishlnsubmul(R,1,E),M.isZero()||(M.negative^=1);g&&(g.words[E]=W)}return g&&g._strip(),M._strip(),m!=="div"&&S!==0&&M.iushrn(S),{div:g||null,mod:M}},s.prototype.divmod=function(h,m,S){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var M,R,U;return this.negative!==0&&h.negative===0?(U=this.neg().divmod(h,m),m!=="mod"&&(M=U.div.neg()),m!=="div"&&(R=U.mod.neg(),S&&R.negative!==0&&R.iadd(h)),{div:M,mod:R}):this.negative===0&&h.negative!==0?(U=this.divmod(h.neg(),m),m!=="mod"&&(M=U.div.neg()),{div:M,mod:U.mod}):this.negative&h.negative?(U=this.neg().divmod(h.neg(),m),m!=="div"&&(R=U.mod.neg(),S&&R.negative!==0&&R.isub(h)),{div:U.div,mod:R}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?m==="div"?{div:this.divn(h.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,m)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var m=this.divmod(h);if(m.mod.isZero())return m.div;var S=m.div.negative!==0?m.mod.isub(h):m.mod,M=h.ushrn(1),R=h.andln(1),U=S.cmp(M);return U<0||R===1&&U===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var S=(1<<26)%h,M=0,R=this.length-1;R>=0;R--)M=(S*M+(this.words[R]|0))%h;return m?-M:M},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var S=0,M=this.length-1;M>=0;M--){var R=(this.words[M]|0)+S*67108864;this.words[M]=R/h|0,S=R%h}return this._strip(),m?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var m=this,S=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var M=new s(1),R=new s(0),U=new s(0),H=new s(1),B=0;m.isEven()&&S.isEven();)m.iushrn(1),S.iushrn(1),++B;for(var g=S.clone(),O=m.clone();!m.isZero();){for(var ve=0,E=1;!(m.words[0]&E)&&ve<26;++ve,E<<=1);if(ve>0)for(m.iushrn(ve);ve-- >0;)(M.isOdd()||R.isOdd())&&(M.iadd(g),R.isub(O)),M.iushrn(1),R.iushrn(1);for(var W=0,oe=1;!(S.words[0]&oe)&&W<26;++W,oe<<=1);if(W>0)for(S.iushrn(W);W-- >0;)(U.isOdd()||H.isOdd())&&(U.iadd(g),H.isub(O)),U.iushrn(1),H.iushrn(1);m.cmp(S)>=0?(m.isub(S),M.isub(U),R.isub(H)):(S.isub(m),U.isub(M),H.isub(R))}return{a:U,b:H,gcd:S.iushln(B)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var m=this,S=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var M=new s(1),R=new s(0),U=S.clone();m.cmpn(1)>0&&S.cmpn(1)>0;){for(var H=0,B=1;!(m.words[0]&B)&&H<26;++H,B<<=1);if(H>0)for(m.iushrn(H);H-- >0;)M.isOdd()&&M.iadd(U),M.iushrn(1);for(var g=0,O=1;!(S.words[0]&O)&&g<26;++g,O<<=1);if(g>0)for(S.iushrn(g);g-- >0;)R.isOdd()&&R.iadd(U),R.iushrn(1);m.cmp(S)>=0?(m.isub(S),M.isub(R)):(S.isub(m),R.isub(M))}var ve;return m.cmpn(1)===0?ve=M:ve=R,ve.cmpn(0)<0&&ve.iadd(h),ve},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var m=this.clone(),S=h.clone();m.negative=0,S.negative=0;for(var M=0;m.isEven()&&S.isEven();M++)m.iushrn(1),S.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;S.isEven();)S.iushrn(1);var R=m.cmp(S);if(R<0){var U=m;m=S,S=U}else if(R===0||S.cmpn(1)===0)break;m.isub(S)}while(!0);return S.iushln(M)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var m=h%26,S=(h-m)/26,M=1<>>26,H&=67108863,this.words[U]=H}return R!==0&&(this.words[U]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var m=h<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var S;if(this.length>1)S=1;else{m&&(h=-h),n(h<=67108863,"Number is too big");var M=this.words[0]|0;S=M===h?0:Mh.length)return 1;if(this.length=0;S--){var M=this.words[S]|0,R=h.words[S]|0;if(M!==R){MR&&(m=1);break}}return m},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new te(h)},s.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var z={k256:null,p224:null,p192:null,p25519:null};function T(_,h){this.name=_,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},T.prototype.ireduce=function(h){var m=h,S;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),S=m.bitLength();while(S>this.n);var M=S0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},T.prototype.split=function(h,m){h.iushrn(this.n,0,m)},T.prototype.imulK=function(h){return h.imul(this.k)};function D(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(D,T),D.prototype.split=function(h,m){for(var S=4194303,M=Math.min(h.length,9),R=0;R>>22,U=H}U>>>=22,h.words[R-10]=U,U===0&&h.length>10?h.length-=10:h.length-=9},D.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var m=0,S=0;S>>=26,h.words[S]=R,m=M}return m!==0&&(h.words[h.length++]=m),h},s._prime=function(h){if(z[h])return z[h];var m;if(h==="k256")m=new D;else if(h==="p224")m=new G;else if(h==="p192")m=new $;else if(h==="p25519")m=new ne;else throw new Error("Unknown prime "+h);return z[h]=m,m};function te(_){if(typeof _=="string"){var h=s._prime(_);this.m=h.p,this.prime=h}else n(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}te.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},te.prototype._verify2=function(h,m){n((h.negative|m.negative)===0,"red works only with positives"),n(h.red&&h.red===m.red,"red works only with red numbers")},te.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},te.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},te.prototype.add=function(h,m){this._verify2(h,m);var S=h.add(m);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},te.prototype.iadd=function(h,m){this._verify2(h,m);var S=h.iadd(m);return S.cmp(this.m)>=0&&S.isub(this.m),S},te.prototype.sub=function(h,m){this._verify2(h,m);var S=h.sub(m);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},te.prototype.isub=function(h,m){this._verify2(h,m);var S=h.isub(m);return S.cmpn(0)<0&&S.iadd(this.m),S},te.prototype.shl=function(h,m){return this._verify1(h),this.imod(h.ushln(m))},te.prototype.imul=function(h,m){return this._verify2(h,m),this.imod(h.imul(m))},te.prototype.mul=function(h,m){return this._verify2(h,m),this.imod(h.mul(m))},te.prototype.isqr=function(h){return this.imul(h,h.clone())},te.prototype.sqr=function(h){return this.mul(h,h)},te.prototype.sqrt=function(h){if(h.isZero())return h.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var S=this.m.add(new s(1)).iushrn(2);return this.pow(h,S)}for(var M=this.m.subn(1),R=0;!M.isZero()&&M.andln(1)===0;)R++,M.iushrn(1);n(!M.isZero());var U=new s(1).toRed(this),H=U.redNeg(),B=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new s(2*g*g).toRed(this);this.pow(g,B).cmp(H)!==0;)g.redIAdd(H);for(var O=this.pow(g,M),ve=this.pow(h,M.addn(1).iushrn(1)),E=this.pow(h,M),W=R;E.cmp(U)!==0;){for(var oe=E,J=0;oe.cmp(U)!==0;J++)oe=oe.redSqr();n(J=0;R--){for(var O=m.words[R],ve=g-1;ve>=0;ve--){var E=O>>ve&1;if(U!==M[0]&&(U=this.sqr(U)),E===0&&H===0){B=0;continue}H<<=1,H|=E,B++,!(B!==S&&(R!==0||ve!==0))&&(U=this.mul(U,M[H]),B=0,H=0)}g=26}return U},te.prototype.convertTo=function(h){var m=h.umod(this.m);return m===h?m.clone():m},te.prototype.convertFrom=function(h){var m=h.clone();return m.red=null,m},s.mont=function(h){return new de(h)};function de(_){te.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(de,te),de.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},de.prototype.convertFrom=function(h){var m=this.imod(h.mul(this.rinv));return m.red=null,m},de.prototype.imul=function(h,m){if(h.isZero()||m.isZero())return h.words[0]=0,h.length=1,h;var S=h.imul(m),M=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=S.isub(M).iushrn(this.shift),U=R;return R.cmp(this.m)>=0?U=R.isub(this.m):R.cmpn(0)<0&&(U=R.iadd(this.m)),U._forceRed(this)},de.prototype.mul=function(h,m){if(h.isZero()||m.isZero())return new s(0)._forceRed(this);var S=h.mul(m),M=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=S.isub(M).iushrn(this.shift),U=R;return R.cmp(this.m)>=0?U=R.isub(this.m):R.cmpn(0)<0&&(U=R.iadd(this.m)),U._forceRed(this)},de.prototype.invm=function(h){var m=this.imod(h._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,f1)})(vx);var e9=vx.exports;const zt=Uo(e9),t9="logger/5.7.0";let Qw=!1,$w=!1;const Td={debug:1,default:2,info:2,warning:3,error:4,off:5};let Kw=Td.default,Dg=null;function r9(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Jw=r9();var by;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(by||(by={}));var es;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(es||(es={}));const Ww="0123456789abcdef";class ie{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Td[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Kw>Td[n])&&console.log.apply(console,r)}debug(...e){this._log(ie.levels.DEBUG,e)}info(...e){this._log(ie.levels.INFO,e)}warn(...e){this._log(ie.levels.WARNING,e)}makeError(e,r,n){if($w)return this.makeError("censored error",r,{});r||(r=ie.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let f="";for(let c=0;c>4],f+=Ww[u[c]&15];i.push(l+"=Uint8Array(0x"+f+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case es.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case es.CALL_EXCEPTION:case es.INSUFFICIENT_FUNDS:case es.MISSING_NEW:case es.NONCE_EXPIRED:case es.REPLACEMENT_UNDERPRICED:case es.TRANSACTION_REPLACED:case es.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,ie.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Jw&&this.throwError("platform missing String.prototype.normalize",ie.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Jw})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ie.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ie.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,ie.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ie.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ie.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ie.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Dg||(Dg=new ie(t9)),Dg}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ie.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Qw){if(!e)return;this.globalLogger().throwError("error censorship permanent",ie.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}$w=!!e,Qw=!!r}static setLogLevel(e){const r=Td[e.toLowerCase()];if(r==null){ie.globalLogger().warn("invalid log level - "+e);return}Kw=r}static from(e){return new ie(e)}}ie.errors=es;ie.levels=by;const n9="bytes/5.7.0",Mr=new ie(n9);function iE(t){return!!t.toHexString}function Lu(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Lu(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Df(t){return dr(t)&&!(t.length%2)||ic(t)}function Yw(t){return typeof t=="number"&&t==t&&t%1===0}function ic(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Yw(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ct(t,e){if(e||(e={}),typeof t=="number"){Mr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Lu(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),iE(t)&&(t=t.toHexString()),dr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Mr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ict(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Lu(n)}function Lf(t){let e=ct(t);if(e.length===0)return e;let r=0;for(;re&&Mr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Lu(r)}function dr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Lg="0123456789abcdef";function lt(t,e){if(e||(e={}),typeof t=="number"){Mr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Lg[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),iE(t))return t.toHexString();if(dr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Mr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(ic(t)){let r="0x";for(let n=0;n>4]+Lg[i&15]}return r}return Mr.throwArgumentError("invalid hexlify value","value",t)}function Tl(t){if(typeof t!="string")t=lt(t);else if(!dr(t)||t.length%2)return null;return(t.length-2)/2}function kn(t,e,r){return typeof t!="string"?t=lt(t):(!dr(t)||t.length%2)&&Mr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Xn(t){let e="0x";return t.forEach(r=>{e+=lt(r).substring(2)}),e}function wx(t){const e=s9(lt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function s9(t){typeof t!="string"&&(t=lt(t)),dr(t)||Mr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Mr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function I1(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Df(t)){let r=ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=lt(r.slice(0,32)),e.s=lt(r.slice(32,64))):r.length===65?(e.r=lt(r.slice(0,32)),e.s=lt(r.slice(32,64)),e.v=r[64]):Mr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Mr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=lt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=i9(ct(e._vs),32);e._vs=lt(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Mr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=lt(i);e.s==null?e.s=o:e.s!==o&&Mr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Mr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Mr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!dr(e.r)?Mr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ar(e.r,32),e.s==null||!dr(e.s)?Mr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ar(e.s,32);const r=ct(e.s);r[0]>=128&&Mr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=lt(r);e._vs&&(dr(e._vs)||Mr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ar(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Mr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const sE="bignumber/5.7.0";var kp=zt.BN;const to=new ie(sE),zg={},qw=9007199254740991;function o9(t){return t!=null&&(Ee.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||dr(t)||typeof t=="bigint"||ic(t))}let Xw=!1;class Ee{constructor(e,r){e!==zg&&to.throwError("cannot call constructor directly; use BigNumber.from",ie.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vn(Yt(this).fromTwos(e))}toTwos(e){return Vn(Yt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Ee.from(this._hex.substring(1)):this}add(e){return Vn(Yt(this).add(Yt(e)))}sub(e){return Vn(Yt(this).sub(Yt(e)))}div(e){return Ee.from(e).isZero()&&bi("division-by-zero","div"),Vn(Yt(this).div(Yt(e)))}mul(e){return Vn(Yt(this).mul(Yt(e)))}mod(e){const r=Yt(e);return r.isNeg()&&bi("division-by-zero","mod"),Vn(Yt(this).umod(r))}pow(e){const r=Yt(e);return r.isNeg()&&bi("negative-power","pow"),Vn(Yt(this).pow(r))}and(e){const r=Yt(e);return(this.isNegative()||r.isNeg())&&bi("unbound-bitwise-result","and"),Vn(Yt(this).and(r))}or(e){const r=Yt(e);return(this.isNegative()||r.isNeg())&&bi("unbound-bitwise-result","or"),Vn(Yt(this).or(r))}xor(e){const r=Yt(e);return(this.isNegative()||r.isNeg())&&bi("unbound-bitwise-result","xor"),Vn(Yt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&bi("negative-width","mask"),Vn(Yt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&bi("negative-width","shl"),Vn(Yt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&bi("negative-width","shr"),Vn(Yt(this).shrn(e))}eq(e){return Yt(this).eq(Yt(e))}lt(e){return Yt(this).lt(Yt(e))}lte(e){return Yt(this).lte(Yt(e))}gt(e){return Yt(this).gt(Yt(e))}gte(e){return Yt(this).gte(Yt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Yt(this).isZero()}toNumber(){try{return Yt(this).toNumber()}catch{bi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return to.throwError("this platform does not support BigInt",ie.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Xw||(Xw=!0,to.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?to.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ie.errors.UNEXPECTED_ARGUMENT,{}):to.throwError("BigNumber.toString does not accept parameters",ie.errors.UNEXPECTED_ARGUMENT,{})),Yt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Ee)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Ee(zg,Mh(e)):e.match(/^-?[0-9]+$/)?new Ee(zg,Mh(new kp(e))):to.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&bi("underflow","BigNumber.from",e),(e>=qw||e<=-qw)&&bi("overflow","BigNumber.from",e),Ee.from(String(e));const r=e;if(typeof r=="bigint")return Ee.from(r.toString());if(ic(r))return Ee.from(lt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Ee.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(dr(n)||n[0]==="-"&&dr(n.substring(1))))return Ee.from(n)}return to.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Mh(t){if(typeof t!="string")return Mh(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&to.throwArgumentError("invalid hex","value",t),t=Mh(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Vn(t){return Ee.from(Mh(t))}function Yt(t){const e=Ee.from(t).toHexString();return e[0]==="-"?new kp("-"+e.substring(3),16):new kp(e.substring(2),16)}function bi(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),to.throwError(t,ie.errors.NUMERIC_FAULT,n)}function a9(t){return new kp(t,36).toString(16)}const Dn=new ie(sE),oh={},oE=Ee.from(0),aE=Ee.from(-1);function lE(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Dn.throwError(t,ie.errors.NUMERIC_FAULT,i)}let ah="0";for(;ah.length<256;)ah+=ah;function bx(t){if(typeof t!="number")try{t=Ee.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+ah.substring(0,t):Dn.throwArgumentError("invalid decimal size","decimals",t)}function Id(t,e){e==null&&(e=0);const r=bx(e);t=Ee.from(t);const n=t.lt(oE);n&&(t=t.mul(aE));let i=t.mod(r).toString();for(;i.length2&&Dn.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&lE("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Dn.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Dn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Dn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new zu(oh,r,n,i)}}class an{constructor(e,r,n,i){e!==oh&&Dn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ie.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Dn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Es(this._value,this.format.decimals),n=Es(e._value,e.format.decimals);return an.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Es(this._value,this.format.decimals),n=Es(e._value,e.format.decimals);return an.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Es(this._value,this.format.decimals),n=Es(e._value,e.format.decimals);return an.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Es(this._value,this.format.decimals),n=Es(e._value,e.format.decimals);return an.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=an.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Zw.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=an.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Zw.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Dn.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=an.from("1"+ah.substring(0,e),this.format),i=l9.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Dn.throwArgumentError("invalid byte width","width",e);const r=Ee.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Ar(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return an.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!o9(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),an.fromString(Id(e,r),zu.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=zu.from(r),i=Es(e,n.decimals);!n.signed&&i.lt(oE)&&lE("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=Ar(s,n.width/8));const o=Id(i,n.decimals);return new an(oh,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=zu.from(r);if(ct(e).length>n.width/8)throw new Error("overflow");let i=Ee.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Id(i,n.decimals);return new an(oh,s,o,n)}static from(e,r){if(typeof e=="string")return an.fromString(e,r);if(ic(e))return an.fromBytes(e,r);try{return an.fromValue(e,0,r)}catch(n){if(n.code!==ie.errors.INVALID_ARGUMENT)throw n}return Dn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Zw=an.from(1),l9=an.from("0.5"),u9="properties/5.7.0";var f9=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const _p=new ie(u9);function Oe(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Us(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Qr(t){return f9(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function c9(t,e){(!t||typeof t!="object")&&_p.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||_p.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Xr(t){const e={};for(const r in t)e[r]=t[r];return e}const h9={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function uE(t){if(t==null||h9[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rRo(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&Oe(e,r,Ro(n))}return e}return _p.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Ro(t){return d9(t)}class w0{constructor(e){for(const r in e)this[r]=Ro(e[r])}}const b0="abi/5.7.0",tr=new ie(b0),Il={};let eb={calldata:!0,memory:!0,storage:!0},p9={calldata:!0,memory:!0};function Y0(t,e){if(t==="bytes"||t==="string"){if(eb[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&p9[e])return!0;return(eb[e]||e==="payable")&&tr.throwArgumentError("invalid modifier","name",e),!1}function g9(t,e){let r=t;function n(a){tr.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==hr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===hr.full?", ":",")+")"):r+=this.type,e!==hr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===hr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Yo.fromString(e,r):Yo.fromObject(e)}static fromObject(e){return Yo.isParamType(e)?e:new Yo(Il,{name:e.name||null,type:nu(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Yo.fromObject):null})}static fromString(e,r){function n(i){return Yo.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(g9(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}};function Bh(t,e){return x9(t).map(r=>js.fromString(r,e))}let M1=class Lc{constructor(e,r){e!==Il&&tr.throwError("use a static from method",ie.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Md(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Lc.isFragment(e)?e:typeof e=="string"?Lc.fromString(e):Lc.fromObject(e)}static fromObject(e){if(Lc.isFragment(e))return e;switch(e.type){case"function":return Np.fromObject(e);case"event":return Ay.fromObject(e);case"constructor":return Pp.fromObject(e);case"error":return rb.fromObject(e);case"fallback":case"receive":return null}return tr.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Ay.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Np.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Pp.fromString(e.trim()):e.split(" ")[0]==="error"?rb.fromString(e.substring(5).trim()):tr.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}},Ay=class Zl extends M1{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==hr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ",e!==hr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Zl.fromString(e):Zl.fromObject(e)}static fromObject(e){if(Zl.isEventFragment(e))return e;e.type!=="event"&&tr.throwArgumentError("invalid event object","value",e);const r={name:Oh(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(js.fromObject):[],type:"event"};return new Zl(Il,r)}static fromString(e){let r=e.match(Uh);r||tr.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:tr.warn("unknown modifier: "+i)}}),Zl.fromObject({name:r[1].trim(),anonymous:n,inputs:Bh(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function fE(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&tr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||tr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=Ee.from(r[1]),r[0]):t}function cE(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function hE(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&tr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&tr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&tr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&tr.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&tr.throwArgumentError("unable to determine stateMutability","value",t),e}let Pp=class eu extends M1{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===hr.sighash&&tr.throwError("cannot format a constructor for sighash",ie.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?eu.fromString(e):eu.fromObject(e)}static fromObject(e){if(eu.isConstructorFragment(e))return e;e.type!=="constructor"&&tr.throwArgumentError("invalid constructor object","value",e);let r=hE(e);r.constant&&tr.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(js.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Ee.from(e.gas):null};return new eu(Il,n)}static fromString(e){let r={type:"constructor"};e=fE(e,r);let n=e.match(Uh);return(!n||n[1].trim()!=="constructor")&&tr.throwArgumentError("invalid constructor string","value",e),r.inputs=Bh(n[2].trim(),!1),cE(n[3].trim(),r),eu.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},Np=class tu extends Pp{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==hr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ",e!==hr.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?tu.fromString(e):tu.fromObject(e)}static fromObject(e){if(tu.isFunctionFragment(e))return e;e.type!=="function"&&tr.throwArgumentError("invalid function object","value",e);let r=hE(e);const n={type:e.type,name:Oh(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(js.fromObject):[],outputs:e.outputs?e.outputs.map(js.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Ee.from(e.gas):null};return new tu(Il,n)}static fromString(e){let r={type:"function"};e=fE(e,r);let n=e.split(" returns ");n.length>2&&tr.throwArgumentError("invalid function string","value",e);let i=n[0].match(Uh);if(i||tr.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Oh(r.name),r.inputs=Bh(i[2],!1),cE(i[3].trim(),r),n.length>1){let s=n[1].match(Uh);(s[1].trim()!=""||s[3].trim()!="")&&tr.throwArgumentError("unexpected tokens","value",e),r.outputs=Bh(s[2],!1)}else r.outputs=[];return tu.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function tb(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&tr.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}let rb=class ru extends M1{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==hr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?ru.fromString(e):ru.fromObject(e)}static fromObject(e){if(ru.isErrorFragment(e))return e;e.type!=="error"&&tr.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Oh(e.name),inputs:e.inputs?e.inputs.map(js.fromObject):[]};return tb(new ru(Il,r))}static fromString(e){let r={type:"error"},n=e.match(Uh);return n||tr.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Oh(r.name),r.inputs=Bh(n[2],!1),tb(ru.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function nu(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const y9=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Oh(t){return(!t||!t.match(y9))&&tr.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Uh=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function x9(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&Ax.throwError("value out-of-bounds",ie.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=pi([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}},w9=class Sy{constructor(e,r,n,i){Oe(this,"_data",ct(e)),Oe(this,"wordSize",r||32),Oe(this,"_coerceFunc",n),Oe(this,"allowLoose",i),this._offset=0}get data(){return lt(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):Sy.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Ax.throwError("data out-of-bounds",ie.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new Sy(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return Ee.from(this.readBytes(this.wordSize))}};var dE={exports:{}};/** + */function Cp(){return Cp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let n=t[r];return e.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function Dk(t,e){let r=wy(t);return e&&e.forEach((n,i)=>{r.has(i)||e.getAll(i).forEach(s=>{r.append(i,s)})}),r}function Lk(t,e){return ak({basename:e==null?void 0:e.basename,future:Cp({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:PC({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||zk(),routes:t,mapRouteProperties:Uk,window:e==null?void 0:e.window}).initialize()}function zk(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=Cp({},e,{errors:jk(e.errors)})),e}function jk(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,i]of e)if(i&&i.__type==="RouteErrorResponse")r[n]=new yx(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let o=new s(i.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let s=new Error(i.message);s.stack="",r[n]=s}}else r[n]=i;return r}const Hk=we.createContext({isTransitioning:!1}),Gk=we.createContext(new Map),Vk="startTransition",jw=xF[Vk];function Qk(t){jw?jw(t):t()}class Kk{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function $k(t){let{fallbackElement:e,router:r,future:n}=t,[i,s]=we.useState(r.state),[o,a]=we.useState(),[l,u]=we.useState({isTransitioning:!1}),[f,c]=we.useState(),[p,y]=we.useState(),[v,b]=we.useState(),N=we.useRef(new Map),{v7_startTransition:x}=n||{},A=we.useCallback(z=>{x?Qk(z):z()},[x]),C=we.useCallback((z,H)=>{let{deletedFetchers:K,unstable_viewTransitionOpts:ne}=H;K.forEach(te=>N.current.delete(te)),z.fetchers.forEach((te,de)=>{te.data!==void 0&&N.current.set(de,te.data)}),!ne||r.window==null||typeof r.window.document.startViewTransition!="function"?A(()=>s(z)):p&&f?(f.resolve(),p.skipTransition(),b({state:z,currentLocation:ne.currentLocation,nextLocation:ne.nextLocation})):(a(z),u({isTransitioning:!0,currentLocation:ne.currentLocation,nextLocation:ne.nextLocation}))},[r.window,p,f,N,A]);we.useLayoutEffect(()=>r.subscribe(C),[r,C]),we.useEffect(()=>{l.isTransitioning&&c(new Kk)},[l.isTransitioning]),we.useEffect(()=>{if(f&&o&&r.window){let z=o,H=f.promise,K=r.window.document.startViewTransition(async()=>{A(()=>s(z)),await H});K.finished.finally(()=>{c(void 0),y(void 0),a(void 0),u({isTransitioning:!1})}),y(K)}},[A,o,f,r.window]),we.useEffect(()=>{f&&o&&i.location.key===o.location.key&&f.resolve()},[f,p,i.location,o]),we.useEffect(()=>{!l.isTransitioning&&v&&(a(v.state),u({isTransitioning:!0,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[l.isTransitioning,v]);let F=we.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:z=>r.navigate(z),push:(z,H,K)=>r.navigate(z,{state:H,preventScrollReset:K==null?void 0:K.preventScrollReset}),replace:(z,H,K)=>r.navigate(z,{replace:!0,state:H,preventScrollReset:K==null?void 0:K.preventScrollReset})}),[r]),L=r.basename||"/",T=we.useMemo(()=>({router:r,navigator:F,static:!1,basename:L}),[r,F,L]);return we.createElement(we.Fragment,null,we.createElement(k1.Provider,{value:T},we.createElement(X5.Provider,{value:i},we.createElement(Gk.Provider,{value:N.current},we.createElement(Hk.Provider,{value:l},we.createElement(Ok,{basename:L,location:i.location,navigationType:i.historyAction,navigator:F},i.initialized?we.createElement(Wk,{routes:r.routes,state:i}):e))))),null)}function Wk(t){let{routes:e,state:r}=t;return Sk(e,void 0,r)}var Hw;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Hw||(Hw={}));var Gw;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Gw||(Gw={}));function Jk(t){let e=we.useRef(wy(t)),r=we.useRef(!1),n=R1(),i=we.useMemo(()=>Dk(n.search,r.current?null:e.current),[n.search]),s=T1(),o=we.useCallback((a,l)=>{const u=wy(typeof a=="function"?a(i):a);r.current=!0,s("?"+u,l)},[s,i]);return[i,o]}const Yk="_layout_1ybug_1",qk="_header_1ybug_7",Vw={layout:Yk,header:qk},Xk="_account_yrsie_1",Zk="_accountDetails_yrsie_15",e9="_accountAddress_yrsie_27",t9="_network_yrsie_37",Y0={account:Xk,accountDetails:Zk,accountAddress:e9,network:t9},r9=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class Lu{}le(Lu,"truncateAddress",e=>{const r=e.match(r9);if(!r||(r==null?void 0:r.length)<=0)return e;const[,n,i]=r;return`${n}…${i}`}),le(Lu,"getTransactionUrl",(e,r)=>`${e}/tx/${r}`),le(Lu,"getAccountUrl",(e,r)=>`${e}/address/${r}`);var Lo=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Lo.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Lo.prototype.init_by_array=function(t,e){var r,n,i;for(this.init_seed(19650218),r=1,n=0,i=this.N>e?this.N:e;i;i--){var s=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+t[n]+n,this.mt[r]>>>=0,r++,n++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1),n>=e&&(n=0)}for(i=this.N-1;i;i--){var s=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-r,this.mt[r]>>>=0,r++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1)}this.mt[0]=2147483648};Lo.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_seed(5489),r=0;r>>1^e[t&1];for(;r>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Lo.prototype.random_int31=function(){return this.random_int()>>>1};Lo.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Lo.prototype.random=function(){return this.random_int()*(1/4294967296)};Lo.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Lo.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var n9=Lo;function i9(t,e){var r=document.createElement("div");return r.style.borderRadius="50px",r.style.overflow="hidden",r.style.padding="0px",r.style.margin="0px",r.style.width=""+t+"px",r.style.height=""+t+"px",r.style.display="inline-block",r.style.background=e,{container:r}}var s9=i9,nE={exports:{}};(function(t){var e=function(){function r(l,u,f,c){typeof u=="object"&&(f=u.depth,c=u.prototype,u.filter,u=u.circular);var p=[],y=[],v=typeof Buffer<"u";typeof u>"u"&&(u=!0),typeof f>"u"&&(f=1/0);function b(N,x){if(N===null)return null;if(x==0)return N;var A,C;if(typeof N!="object")return N;if(r.__isArray(N))A=[];else if(r.__isRegExp(N))A=new RegExp(N.source,a(N)),N.lastIndex&&(A.lastIndex=N.lastIndex);else if(r.__isDate(N))A=new Date(N.getTime());else{if(v&&Buffer.isBuffer(N))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(N.length):A=new Buffer(N.length),N.copy(A),A;typeof c>"u"?(C=Object.getPrototypeOf(N),A=Object.create(C)):(A=Object.create(c),C=c)}if(u){var F=p.indexOf(N);if(F!=-1)return y[F];p.push(N),y.push(A)}for(var L in N){var T;C&&(T=Object.getOwnPropertyDescriptor(C,L)),!(T&&T.set==null)&&(A[L]=b(N[L],x-1))}return A}return b(l,f)}r.clonePrototype=function(u){if(u===null)return null;var f=function(){};return f.prototype=u,new f};function n(l){return Object.prototype.toString.call(l)}r.__objToStr=n;function i(l){return typeof l=="object"&&n(l)==="[object Date]"}r.__isDate=i;function s(l){return typeof l=="object"&&n(l)==="[object Array]"}r.__isArray=s;function o(l){return typeof l=="object"&&n(l)==="[object RegExp]"}r.__isRegExp=o;function a(l){var u="";return l.global&&(u+="g"),l.ignoreCase&&(u+="i"),l.multiline&&(u+="m"),u}return r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)})(nE);var o9=nE.exports,iE={exports:{}},a9={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},bl=a9,sE={};for(var Dg in bl)bl.hasOwnProperty(Dg)&&(sE[bl[Dg]]=Dg);var ft=iE.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Qn in ft)if(ft.hasOwnProperty(Qn)){if(!("channels"in ft[Qn]))throw new Error("missing channels property: "+Qn);if(!("labels"in ft[Qn]))throw new Error("missing channel labels property: "+Qn);if(ft[Qn].labels.length!==ft[Qn].channels)throw new Error("channel and label counts mismatch: "+Qn);var l9=ft[Qn].channels,u9=ft[Qn].labels;delete ft[Qn].channels,delete ft[Qn].labels,Object.defineProperty(ft[Qn],"channels",{value:l9}),Object.defineProperty(ft[Qn],"labels",{value:u9})}ft.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=s-i,a,l,u;return s===i?a=0:e===s?a=(r-n)/o:r===s?a=2+(n-e)/o:n===s&&(a=4+(e-r)/o),a=Math.min(a*60,360),a<0&&(a+=360),u=(i+s)/2,s===i?l=0:u<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,u*100]};ft.rgb.hsv=function(t){var e,r,n,i,s,o=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(o,a,l),f=u-Math.min(o,a,l),c=function(p){return(u-p)/6/f+1/2};return f===0?i=s=0:(s=f/u,e=c(o),r=c(a),n=c(l),o===u?i=n-r:a===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,u*100]};ft.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2],i=ft.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,s*100,n*100]};ft.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i,s,o,a;return a=Math.min(1-e,1-r,1-n),i=(1-e-a)/(1-a)||0,s=(1-r-a)/(1-a)||0,o=(1-n-a)/(1-a)||0,[i*100,s*100,o*100,a*100]};function f9(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}ft.rgb.keyword=function(t){var e=sE[t];if(e)return e;var r=1/0,n;for(var i in bl)if(bl.hasOwnProperty(i)){var s=bl[i],o=f9(t,s);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+r*.3576+n*.1805,s=e*.2126+r*.7152+n*.0722,o=e*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};ft.rgb.lab=function(t){var e=ft.rgb.xyz(t),r=e[0],n=e[1],i=e[2],s,o,a;return r/=95.047,n/=100,i/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*n-16,o=500*(r-n),a=200*(n-i),[s,o,a]};ft.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i,s,o,a,l;if(r===0)return l=n*255,[l,l,l];n<.5?s=n*(1+r):s=n+r-n*r,i=2*n-s,a=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(s-i)*6*o:2*o<1?l=s:3*o<2?l=i+(s-i)*(2/3-o)*6:l=i,a[u]=l*255;return a};ft.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,s=Math.max(n,.01),o,a;return n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s,a=(n+r)/2,o=n===0?2*i/(s+i):2*r/(n+r),[e,o*100,a*100]};ft.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-r),a=255*n*(1-r*s),l=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};ft.hsv.hsl=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),s,o,a;return a=(2-r)*n,s=(2-r)*i,o=r*i,o/=s<=1?s:2-s,o=o||0,a/=2,[e,o*100,a*100]};ft.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,s,o,a,l;i>1&&(r/=i,n/=i),s=Math.floor(6*e),o=1-n,a=6*e-s,s&1&&(a=1-a),l=r+a*(o-r);var u,f,c;switch(s){default:case 6:case 0:u=o,f=l,c=r;break;case 1:u=l,f=o,c=r;break;case 2:u=r,f=o,c=l;break;case 3:u=r,f=l,c=o;break;case 4:u=l,f=r,c=o;break;case 5:u=o,f=r,c=l;break}return[u*255,f*255,c*255]};ft.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,s,o,a;return s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),[s*255,o*255,a*255]};ft.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i,s,o;return i=e*3.2406+r*-1.5372+n*-.4986,s=e*-.9689+r*1.8758+n*.0415,o=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};ft.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return e/=95.047,r/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*r-16,s=500*(e-r),o=200*(r-n),[i,s,o]};ft.lab.xyz=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;s=(e+16)/116,i=r/500+s,o=s-n/200;var a=Math.pow(s,3),l=Math.pow(i,3),u=Math.pow(o,3);return s=a>.008856?a:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};ft.lab.lch=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return i=Math.atan2(n,r),s=i*360/2/Math.PI,s<0&&(s+=360),o=Math.sqrt(r*r+n*n),[e,o,s]};ft.lch.lab=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return o=n/360*2*Math.PI,i=r*Math.cos(o),s=r*Math.sin(o),[e,i,s]};ft.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:ft.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return i===2&&(s+=60),s};ft.hsv.ansi16=function(t){return ft.rgb.ansi16(ft.hsv.rgb(t),t[2])};ft.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];if(e===r&&r===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};ft.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[n,i,s]};ft.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var r,n=Math.floor(t/36)/5*255,i=Math.floor((r=t%36)/6)/5*255,s=r%6/5*255;return[n,i,s]};ft.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};ft.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(a){return a+a}).join(""));var n=parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};ft.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),s=Math.min(Math.min(e,r),n),o=i-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:i===e?l=(r-n)/o%6:i===r?l=2+(n-e)/o:l=4+(e-r)/o+4,l/=6,l%=1,[l*360,o*100,a*100]};ft.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return r<.5?n=2*e*r:n=2*e*(1-r),n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};ft.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};ft.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];var i=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};ft.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};ft.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,n=r*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};ft.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};ft.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1-r,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[t[0],i*100,s*100]};ft.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ft.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ft.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ft.gray.hsl=ft.gray.hsv=function(t){return[0,0,t[0]]};ft.gray.hwb=function(t){return[0,100,t[0]]};ft.gray.cmyk=function(t){return[0,0,0,t[0]]};ft.gray.lab=function(t){return[t[0],0,0]};ft.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};ft.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var oE=iE.exports,kp=oE;function c9(){for(var t={},e=Object.keys(kp),r=e.length,n=0;n1&&(r=Array.prototype.slice.call(arguments)),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function v9(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=t(r);if(typeof n=="object")for(var i=n.length,s=0;sr?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var r=this,n=t,i=e===void 0?.5:e,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,l=1-a;return this.rgb(a*r.red()+l*n.red(),a*r.green()+l*n.green(),a*r.blue()+l*n.blue()).alpha(r.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new Hs;return t.values=T9(this.values),t}};Hs.prototype.getValues=function(t){for(var e={},r=0;r{const r=we.useRef(null);return we.useEffect(()=>{var n;if(r!=null&&r.current){const i=Td.jsNumberForAddress(t),s=Q9(e,i);(n=r.current)==null||n.replaceChildren(s)}},[e,r,t]),Pe.jsx("div",{ref:r,style:{width:e,height:e},className:$9.jazzIcon})},J9=we.memo(W9);var pE={exports:{}};(function(t,e){(function(n,i){t.exports=i(we)})(f1,r=>(()=>{var n={"./node_modules/css-mediaquery/index.js":(a,l)=>{l.match=v,l.parse=b;var u=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,f=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,c=/^(?:(min|max)-)?(.+)/,p=/(em|rem|px|cm|mm|in|pt|pc)?$/,y=/(dpi|dpcm|dppx)?$/;function v(C,F){return b(C).some(function(L){var T=L.inverse,z=L.type==="all"||F.type===L.type;if(z&&T||!(z||T))return!1;var H=L.expressions.every(function(K){var ne=K.feature,te=K.modifier,de=K.value,_=F[ne];if(!_)return!1;switch(ne){case"orientation":case"scan":return _.toLowerCase()===de.toLowerCase();case"width":case"height":case"device-width":case"device-height":de=A(de),_=A(_);break;case"resolution":de=x(de),_=x(_);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":de=N(de),_=N(_);break;case"grid":case"color":case"color-index":case"monochrome":de=parseInt(de,10)||1,_=parseInt(_,10)||0;break}switch(te){case"min":return _>=de;case"max":return _<=de;default:return _===de}});return H&&!T||!H&&T})}function b(C){return C.split(",").map(function(F){F=F.trim();var L=F.match(u),T=L[1],z=L[2],H=L[3]||"",K={};return K.inverse=!!T&&T.toLowerCase()==="not",K.type=z?z.toLowerCase():"all",H=H.match(/\([^\)]+\)/g)||[],K.expressions=H.map(function(ne){var te=ne.match(f),de=te[1].toLowerCase().match(c);return{modifier:de[1],feature:de[2],value:te[2]}}),K})}function N(C){var F=Number(C),L;return F||(L=C.match(/^(\d+)\s*\/\s*(\d+)$/),F=L[1]/L[2]),F}function x(C){var F=parseFloat(C),L=String(C).match(y)[1];switch(L){case"dpcm":return F/2.54;case"dppx":return F*96;default:return F}}function A(C){var F=parseFloat(C),L=String(C).match(p)[1];switch(L){case"em":return F*16;case"rem":return F*16;case"cm":return F*96/2.54;case"mm":return F*96/2.54/10;case"in":return F*96;case"pt":return F*72;case"pc":return F*72/12;default:return F}}},"./node_modules/hyphenate-style-name/index.js":(a,l,u)=>{u.r(l),u.d(l,{default:()=>b});var f=/[A-Z]/g,c=/^ms-/,p={};function y(N){return"-"+N.toLowerCase()}function v(N){if(p.hasOwnProperty(N))return p[N];var x=N.replace(f,y);return p[N]=c.test(x)?"-"+x:x}const b=v},"./node_modules/matchmediaquery/index.js":(a,l,u)=>{var f=u("./node_modules/css-mediaquery/index.js").match,c=typeof window<"u"?window.matchMedia:null;function p(v,b,N){var x=this;if(c&&!N){var A=c.call(window,v);this.matches=A.matches,this.media=A.media,A.addListener(L)}else this.matches=f(v,b),this.media=v;this.addListener=C,this.removeListener=F,this.dispose=T;function C(z){A&&A.addListener(z)}function F(z){A&&A.removeListener(z)}function L(z){x.matches=z.matches,x.media=z.media}function T(){A&&A.removeListener(L)}}function y(v,b,N){return new p(v,b,N)}a.exports=y},"./node_modules/object-assign/index.js":a=>{/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;function c(y){if(y==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(y)}function p(){try{if(!Object.assign)return!1;var y=new String("abc");if(y[5]="de",Object.getOwnPropertyNames(y)[0]==="5")return!1;for(var v={},b=0;b<10;b++)v["_"+String.fromCharCode(b)]=b;var N=Object.getOwnPropertyNames(v).map(function(A){return v[A]});if(N.join("")!=="0123456789")return!1;var x={};return"abcdefghijklmnopqrst".split("").forEach(function(A){x[A]=A}),Object.keys(Object.assign({},x)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}a.exports=p()?Object.assign:function(y,v){for(var b,N=c(y),x,A=1;A{var f=function(){};{var c=u("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),p={},y=u("./node_modules/prop-types/lib/has.js");f=function(b){var N="Warning: "+b;typeof console<"u"&&console.error(N);try{throw new Error(N)}catch{}}}function v(b,N,x,A,C){for(var F in b)if(y(b,F)){var L;try{if(typeof b[F]!="function"){var T=Error((A||"React class")+": "+x+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof b[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}L=b[F](N,F,A,x,null,c)}catch(H){L=H}if(L&&!(L instanceof Error)&&f((A||"React class")+": type specification of "+x+" `"+F+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof L+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),L instanceof Error&&!(L.message in p)){p[L.message]=!0;var z=C?C():"";f("Failed "+x+" type: "+L.message+(z??""))}}}v.resetWarningCache=function(){p={}},a.exports=v},"./node_modules/prop-types/factoryWithTypeCheckers.js":(a,l,u)=>{var f=u("./node_modules/react-is/index.js"),c=u("./node_modules/object-assign/index.js"),p=u("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),y=u("./node_modules/prop-types/lib/has.js"),v=u("./node_modules/prop-types/checkPropTypes.js"),b=function(){};b=function(x){var A="Warning: "+x;typeof console<"u"&&console.error(A);try{throw new Error(A)}catch{}};function N(){return null}a.exports=function(x,A){var C=typeof Symbol=="function"&&Symbol.iterator,F="@@iterator";function L(V){var Z=V&&(C&&V[C]||V[F]);if(typeof Z=="function")return Z}var T="<>",z={array:te("array"),bigint:te("bigint"),bool:te("boolean"),func:te("function"),number:te("number"),object:te("object"),string:te("string"),symbol:te("symbol"),any:de(),arrayOf:_,element:h(),elementType:m(),instanceOf:S,node:G(),objectOf:R,oneOf:M,oneOfType:U,shape:g,exact:O};function H(V,Z){return V===Z?V!==0||1/V===1/Z:V!==V&&Z!==Z}function K(V,Z){this.message=V,this.data=Z&&typeof Z=="object"?Z:{},this.stack=""}K.prototype=Error.prototype;function ne(V){var Z={},he=0;function Ue(Be,ut,Je,Ye,pt,ze,ye){if(Ye=Ye||T,ze=ze||Je,ye!==p){if(A){var De=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw De.name="Invariant Violation",De}else if(typeof console<"u"){var Ce=Ye+":"+Je;!Z[Ce]&&he<3&&(b("You are manually calling a React.PropTypes validation function for the `"+ze+"` prop on `"+Ye+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Z[Ce]=!0,he++)}}return ut[Je]==null?Be?ut[Je]===null?new K("The "+pt+" `"+ze+"` is marked as required "+("in `"+Ye+"`, but its value is `null`.")):new K("The "+pt+" `"+ze+"` is marked as required in "+("`"+Ye+"`, but its value is `undefined`.")):null:V(ut,Je,Ye,pt,ze)}var pe=Ue.bind(null,!1);return pe.isRequired=Ue.bind(null,!0),pe}function te(V){function Z(he,Ue,pe,Be,ut,Je){var Ye=he[Ue],pt=J(Ye);if(pt!==V){var ze=oe(Ye);return new K("Invalid "+Be+" `"+ut+"` of type "+("`"+ze+"` supplied to `"+pe+"`, expected ")+("`"+V+"`."),{expectedType:V})}return null}return ne(Z)}function de(){return ne(N)}function _(V){function Z(he,Ue,pe,Be,ut){if(typeof V!="function")return new K("Property `"+ut+"` of component `"+pe+"` has invalid PropType notation inside arrayOf.");var Je=he[Ue];if(!Array.isArray(Je)){var Ye=J(Je);return new K("Invalid "+Be+" `"+ut+"` of type "+("`"+Ye+"` supplied to `"+pe+"`, expected an array."))}for(var pt=0;pt1?b("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):b("Invalid argument supplied to oneOf, expected an array."),N;function Z(he,Ue,pe,Be,ut){for(var Je=he[Ue],Ye=0;Ye0?", expected one of type ["+pt.join(", ")+"]":"";return new K("Invalid "+Je+" `"+Ye+"` supplied to "+("`"+ut+"`"+Ce+"."))}return ne(Ue)}function G(){function V(Z,he,Ue,pe,Be){return ve(Z[he])?null:new K("Invalid "+pe+" `"+Be+"` supplied to "+("`"+Ue+"`, expected a ReactNode."))}return ne(V)}function B(V,Z,he,Ue,pe){return new K((V||"React class")+": "+Z+" type `"+he+"."+Ue+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+pe+"`.")}function g(V){function Z(he,Ue,pe,Be,ut){var Je=he[Ue],Ye=J(Je);if(Ye!=="object")return new K("Invalid "+Be+" `"+ut+"` of type `"+Ye+"` "+("supplied to `"+pe+"`, expected `object`."));for(var pt in V){var ze=V[pt];if(typeof ze!="function")return B(pe,Be,ut,pt,oe(ze));var ye=ze(Je,pt,pe,Be,ut+"."+pt,p);if(ye)return ye}return null}return ne(Z)}function O(V){function Z(he,Ue,pe,Be,ut){var Je=he[Ue],Ye=J(Je);if(Ye!=="object")return new K("Invalid "+Be+" `"+ut+"` of type `"+Ye+"` "+("supplied to `"+pe+"`, expected `object`."));var pt=c({},he[Ue],V);for(var ze in pt){var ye=V[ze];if(y(V,ze)&&typeof ye!="function")return B(pe,Be,ut,ze,oe(ye));if(!ye)return new K("Invalid "+Be+" `"+ut+"` key `"+ze+"` supplied to `"+pe+"`.\nBad object: "+JSON.stringify(he[Ue],null," ")+` +Valid keys: `+JSON.stringify(Object.keys(V),null," "));var De=ye(Je,ze,pe,Be,ut+"."+ze,p);if(De)return De}return null}return ne(Z)}function ve(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(ve);if(V===null||x(V))return!0;var Z=L(V);if(Z){var he=Z.call(V),Ue;if(Z!==V.entries){for(;!(Ue=he.next()).done;)if(!ve(Ue.value))return!1}else for(;!(Ue=he.next()).done;){var pe=Ue.value;if(pe&&!ve(pe[1]))return!1}}else return!1;return!0;default:return!1}}function E(V,Z){return V==="symbol"?!0:Z?Z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Z instanceof Symbol:!1}function J(V){var Z=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":E(Z,V)?"symbol":Z}function oe(V){if(typeof V>"u"||V===null)return""+V;var Z=J(V);if(Z==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return Z}function W(V){var Z=oe(V);switch(Z){case"array":case"object":return"an "+Z;case"boolean":case"date":case"regexp":return"a "+Z;default:return Z}}function $(V){return!V.constructor||!V.constructor.name?T:V.constructor.name}return z.checkPropTypes=v,z.resetWarningCache=v.resetWarningCache,z.PropTypes=z,z}},"./node_modules/prop-types/index.js":(a,l,u)=>{{var f=u("./node_modules/react-is/index.js"),c=!0;a.exports=u("./node_modules/prop-types/factoryWithTypeCheckers.js")(f.isElement,c)}},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":a=>{var l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";a.exports=l},"./node_modules/prop-types/lib/has.js":a=>{a.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(a,l)=>{/** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(){var u=typeof Symbol=="function"&&Symbol.for,f=u?Symbol.for("react.element"):60103,c=u?Symbol.for("react.portal"):60106,p=u?Symbol.for("react.fragment"):60107,y=u?Symbol.for("react.strict_mode"):60108,v=u?Symbol.for("react.profiler"):60114,b=u?Symbol.for("react.provider"):60109,N=u?Symbol.for("react.context"):60110,x=u?Symbol.for("react.async_mode"):60111,A=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,F=u?Symbol.for("react.suspense"):60113,L=u?Symbol.for("react.suspense_list"):60120,T=u?Symbol.for("react.memo"):60115,z=u?Symbol.for("react.lazy"):60116,H=u?Symbol.for("react.block"):60121,K=u?Symbol.for("react.fundamental"):60117,ne=u?Symbol.for("react.responder"):60118,te=u?Symbol.for("react.scope"):60119;function de(ye){return typeof ye=="string"||typeof ye=="function"||ye===p||ye===A||ye===v||ye===y||ye===F||ye===L||typeof ye=="object"&&ye!==null&&(ye.$$typeof===z||ye.$$typeof===T||ye.$$typeof===b||ye.$$typeof===N||ye.$$typeof===C||ye.$$typeof===K||ye.$$typeof===ne||ye.$$typeof===te||ye.$$typeof===H)}function _(ye){if(typeof ye=="object"&&ye!==null){var De=ye.$$typeof;switch(De){case f:var Ce=ye.type;switch(Ce){case x:case A:case p:case v:case y:case F:return Ce;default:var tt=Ce&&Ce.$$typeof;switch(tt){case N:case C:case z:case T:case b:return tt;default:return De}}case c:return De}}}var h=x,m=A,S=N,M=b,R=f,U=C,G=p,B=z,g=T,O=c,ve=v,E=y,J=F,oe=!1;function W(ye){return oe||(oe=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(ye)||_(ye)===x}function $(ye){return _(ye)===A}function V(ye){return _(ye)===N}function Z(ye){return _(ye)===b}function he(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===f}function Ue(ye){return _(ye)===C}function pe(ye){return _(ye)===p}function Be(ye){return _(ye)===z}function ut(ye){return _(ye)===T}function Je(ye){return _(ye)===c}function Ye(ye){return _(ye)===v}function pt(ye){return _(ye)===y}function ze(ye){return _(ye)===F}l.AsyncMode=h,l.ConcurrentMode=m,l.ContextConsumer=S,l.ContextProvider=M,l.Element=R,l.ForwardRef=U,l.Fragment=G,l.Lazy=B,l.Memo=g,l.Portal=O,l.Profiler=ve,l.StrictMode=E,l.Suspense=J,l.isAsyncMode=W,l.isConcurrentMode=$,l.isContextConsumer=V,l.isContextProvider=Z,l.isElement=he,l.isForwardRef=Ue,l.isFragment=pe,l.isLazy=Be,l.isMemo=ut,l.isPortal=Je,l.isProfiler=Ye,l.isStrictMode=pt,l.isSuspense=ze,l.isValidElementType=de,l.typeOf=_})()},"./node_modules/react-is/index.js":(a,l,u)=>{a.exports=u("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(a,l,u)=>{u.r(l),u.d(l,{shallowEqualArrays:()=>c,shallowEqualObjects:()=>f});function f(p,y){if(p===y)return!0;if(!p||!y)return!1;var v=Object.keys(p),b=Object.keys(y),N=v.length;if(b.length!==N)return!1;for(var x=0;x{Object.defineProperty(l,"__esModule",{value:!0});var f=u("react"),c=(0,f.createContext)(void 0);l.default=c},"./src/index.ts":function(a,l,u){var f=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(l,"__esModule",{value:!0}),l.Context=l.toQuery=l.useMediaQuery=l.default=void 0;var c=f(u("./src/useMediaQuery.ts"));l.useMediaQuery=c.default;var p=f(u("./src/Component.ts"));l.default=p.default;var y=f(u("./src/toQuery.ts"));l.toQuery=y.default;var v=f(u("./src/Context.ts"));l.Context=v.default},"./src/mediaQuery.ts":function(a,l,u){var f=this&&this.__assign||function(){return f=Object.assign||function(F){for(var L,T=1,z=arguments.length;T{a.exports=r}},i={};function s(a){var l=i[a];if(l!==void 0)return l.exports;var u=i[a]={exports:{}};return n[a].call(u.exports,u,u.exports,s),u.exports}s.d=(a,l)=>{for(var u in l)s.o(l,u)&&!s.o(a,u)&&Object.defineProperty(a,u,{enumerable:!0,get:l[u]})},s.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),s.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var o=s("./src/index.ts");return o})())})(pE);var Y9=pE.exports,bx={exports:{}};const q9={},X9=Object.freeze(Object.defineProperty({__proto__:null,default:q9},Symbol.toStringTag,{value:"Module"})),gE=tF(X9);bx.exports;(function(t){(function(e,r){function n(_,h){if(!_)throw new Error(h||"Assertion failed")}function i(_,h){_.super_=h;var m=function(){};m.prototype=h.prototype,_.prototype=new m,_.prototype.constructor=_}function s(_,h,m){if(s.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((h==="le"||h==="be")&&(m=h,h=10),this._init(_||0,h||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=gE.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,m){return h.cmp(m)>0?h:m},s.min=function(h,m){return h.cmp(m)<0?h:m},s.prototype._init=function(h,m,S){if(typeof h=="number")return this._initNumber(h,m,S);if(typeof h=="object")return this._initArray(h,m,S);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),h=h.toString().replace(/\s+/g,"");var M=0;h[0]==="-"&&(M++,this.negative=1),M=0;M-=3)U=h[M]|h[M-1]<<8|h[M-2]<<16,this.words[R]|=U<>>26-G&67108863,G+=24,G>=26&&(G-=26,R++);else if(S==="le")for(M=0,R=0;M>>26-G&67108863,G+=24,G>=26&&(G-=26,R++);return this._strip()};function a(_,h){var m=_.charCodeAt(h);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+_)}function l(_,h,m){var S=a(_,m);return m-1>=h&&(S|=a(_,m-1)<<4),S}s.prototype._parseHex=function(h,m,S){this.length=Math.ceil((h.length-m)/6),this.words=new Array(this.length);for(var M=0;M=m;M-=2)G=l(h,m,M)<=18?(R-=18,U+=1,this.words[U]|=G>>>26):R+=8;else{var B=h.length-m;for(M=B%2===0?m+1:m;M=18?(R-=18,U+=1,this.words[U]|=G>>>26):R+=8}this._strip()};function u(_,h,m,S){for(var M=0,R=0,U=Math.min(_.length,m),G=h;G=49?R=B-49+10:B>=17?R=B-17+10:R=B,n(B>=0&&R1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(h,m){h=h||10,m=m|0||1;var S;if(h===16||h==="hex"){S="";for(var M=0,R=0,U=0;U>>24-M&16777215,M+=2,M>=26&&(M-=26,U--),R!==0||U!==this.length-1?S=p[6-B.length]+B+S:S=B+S}for(R!==0&&(S=R.toString(16)+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],O=v[h];S="";var ve=this.clone();for(ve.negative=0;!ve.isZero();){var E=ve.modrn(O).toString(h);ve=ve.idivn(O),ve.isZero()?S=E+S:S=p[g-E.length]+E+S}for(this.isZero()&&(S="0"+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,m){return this.toArrayLike(o,h,m)}),s.prototype.toArray=function(h,m){return this.toArrayLike(Array,h,m)};var b=function(h,m){return h.allocUnsafe?h.allocUnsafe(m):new h(m)};s.prototype.toArrayLike=function(h,m,S){this._strip();var M=this.byteLength(),R=S||Math.max(1,M);n(M<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0");var U=b(h,R),G=m==="le"?"LE":"BE";return this["_toArrayLike"+G](U,M),U},s.prototype._toArrayLikeLE=function(h,m){for(var S=0,M=0,R=0,U=0;R>8&255),S>16&255),U===6?(S>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(S=0&&(h[S--]=G>>8&255),S>=0&&(h[S--]=G>>16&255),U===6?(S>=0&&(h[S--]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(S>=0)for(h[S--]=M;S>=0;)h[S--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var m=h,S=0;return m>=4096&&(S+=13,m>>>=13),m>=64&&(S+=7,m>>>=7),m>=8&&(S+=4,m>>>=4),m>=2&&(S+=2,m>>>=2),S+m},s.prototype._zeroBits=function(h){if(h===0)return 26;var m=h,S=0;return m&8191||(S+=13,m>>>=13),m&127||(S+=7,m>>>=7),m&15||(S+=4,m>>>=4),m&3||(S+=2,m>>>=2),m&1||S++,S},s.prototype.bitLength=function(){var h=this.words[this.length-1],m=this._countBits(h);return(this.length-1)*26+m};function N(_){for(var h=new Array(_.bitLength()),m=0;m>>M&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,m=0;mh.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var m;this.length>h.length?m=h:m=this;for(var S=0;Sh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var m,S;this.length>h.length?(m=this,S=h):(m=h,S=this);for(var M=0;Mh.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var m=Math.ceil(h/26)|0,S=h%26;this._expand(m),S>0&&m--;for(var M=0;M0&&(this.words[M]=~this.words[M]&67108863>>26-S),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,m){n(typeof h=="number"&&h>=0);var S=h/26|0,M=h%26;return this._expand(S+1),m?this.words[S]=this.words[S]|1<h.length?(S=this,M=h):(S=h,M=this);for(var R=0,U=0;U>>26;for(;R!==0&&U>>26;if(this.length=S.length,R!==0)this.words[this.length]=R,this.length++;else if(S!==this)for(;Uh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var m=this.iadd(h);return h.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var S=this.cmp(h);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,R;S>0?(M=this,R=h):(M=h,R=this);for(var U=0,G=0;G>26,this.words[G]=m&67108863;for(;U!==0&&G>26,this.words[G]=m&67108863;if(U===0&&G>>26,ve=B&67108863,E=Math.min(g,h.length-1),J=Math.max(0,g-_.length+1);J<=E;J++){var oe=g-J|0;M=_.words[oe]|0,R=h.words[J]|0,U=M*R+ve,O+=U/67108864|0,ve=U&67108863}m.words[g]=ve|0,B=O|0}return B!==0?m.words[g]=B|0:m.length--,m._strip()}var A=function(h,m,S){var M=h.words,R=m.words,U=S.words,G=0,B,g,O,ve=M[0]|0,E=ve&8191,J=ve>>>13,oe=M[1]|0,W=oe&8191,$=oe>>>13,V=M[2]|0,Z=V&8191,he=V>>>13,Ue=M[3]|0,pe=Ue&8191,Be=Ue>>>13,ut=M[4]|0,Je=ut&8191,Ye=ut>>>13,pt=M[5]|0,ze=pt&8191,ye=pt>>>13,De=M[6]|0,Ce=De&8191,tt=De>>>13,Dt=M[7]|0,yt=Dt&8191,Ct=Dt>>>13,fr=M[8]|0,Tt=fr&8191,It=fr>>>13,Jt=M[9]|0,Et=Jt&8191,kt=Jt>>>13,Kt=R[0]|0,xt=Kt&8191,vt=Kt>>>13,ir=R[1]|0,St=ir&8191,_t=ir>>>13,q=R[2]|0,re=q&8191,ae=q>>>13,ke=R[3]|0,Ie=ke&8191,Le=ke>>>13,ht=R[4]|0,He=ht&8191,je=ht>>>13,Gt=R[5]|0,wt=Gt&8191,We=Gt>>>13,Ht=R[6]|0,w=Ht&8191,k=Ht>>>13,P=R[7]|0,d=P&8191,I=P>>>13,X=R[8]|0,Y=X&8191,ue=X>>>13,Se=R[9]|0,Re=Se&8191,Fe=Se>>>13;S.negative=h.negative^m.negative,S.length=19,B=Math.imul(E,xt),g=Math.imul(E,vt),g=g+Math.imul(J,xt)|0,O=Math.imul(J,vt);var qe=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(qe>>>26)|0,qe&=67108863,B=Math.imul(W,xt),g=Math.imul(W,vt),g=g+Math.imul($,xt)|0,O=Math.imul($,vt),B=B+Math.imul(E,St)|0,g=g+Math.imul(E,_t)|0,g=g+Math.imul(J,St)|0,O=O+Math.imul(J,_t)|0;var Me=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Me>>>26)|0,Me&=67108863,B=Math.imul(Z,xt),g=Math.imul(Z,vt),g=g+Math.imul(he,xt)|0,O=Math.imul(he,vt),B=B+Math.imul(W,St)|0,g=g+Math.imul(W,_t)|0,g=g+Math.imul($,St)|0,O=O+Math.imul($,_t)|0,B=B+Math.imul(E,re)|0,g=g+Math.imul(E,ae)|0,g=g+Math.imul(J,re)|0,O=O+Math.imul(J,ae)|0;var rt=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(rt>>>26)|0,rt&=67108863,B=Math.imul(pe,xt),g=Math.imul(pe,vt),g=g+Math.imul(Be,xt)|0,O=Math.imul(Be,vt),B=B+Math.imul(Z,St)|0,g=g+Math.imul(Z,_t)|0,g=g+Math.imul(he,St)|0,O=O+Math.imul(he,_t)|0,B=B+Math.imul(W,re)|0,g=g+Math.imul(W,ae)|0,g=g+Math.imul($,re)|0,O=O+Math.imul($,ae)|0,B=B+Math.imul(E,Ie)|0,g=g+Math.imul(E,Le)|0,g=g+Math.imul(J,Ie)|0,O=O+Math.imul(J,Le)|0;var Ve=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,B=Math.imul(Je,xt),g=Math.imul(Je,vt),g=g+Math.imul(Ye,xt)|0,O=Math.imul(Ye,vt),B=B+Math.imul(pe,St)|0,g=g+Math.imul(pe,_t)|0,g=g+Math.imul(Be,St)|0,O=O+Math.imul(Be,_t)|0,B=B+Math.imul(Z,re)|0,g=g+Math.imul(Z,ae)|0,g=g+Math.imul(he,re)|0,O=O+Math.imul(he,ae)|0,B=B+Math.imul(W,Ie)|0,g=g+Math.imul(W,Le)|0,g=g+Math.imul($,Ie)|0,O=O+Math.imul($,Le)|0,B=B+Math.imul(E,He)|0,g=g+Math.imul(E,je)|0,g=g+Math.imul(J,He)|0,O=O+Math.imul(J,je)|0;var dt=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(dt>>>26)|0,dt&=67108863,B=Math.imul(ze,xt),g=Math.imul(ze,vt),g=g+Math.imul(ye,xt)|0,O=Math.imul(ye,vt),B=B+Math.imul(Je,St)|0,g=g+Math.imul(Je,_t)|0,g=g+Math.imul(Ye,St)|0,O=O+Math.imul(Ye,_t)|0,B=B+Math.imul(pe,re)|0,g=g+Math.imul(pe,ae)|0,g=g+Math.imul(Be,re)|0,O=O+Math.imul(Be,ae)|0,B=B+Math.imul(Z,Ie)|0,g=g+Math.imul(Z,Le)|0,g=g+Math.imul(he,Ie)|0,O=O+Math.imul(he,Le)|0,B=B+Math.imul(W,He)|0,g=g+Math.imul(W,je)|0,g=g+Math.imul($,He)|0,O=O+Math.imul($,je)|0,B=B+Math.imul(E,wt)|0,g=g+Math.imul(E,We)|0,g=g+Math.imul(J,wt)|0,O=O+Math.imul(J,We)|0;var Ft=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,B=Math.imul(Ce,xt),g=Math.imul(Ce,vt),g=g+Math.imul(tt,xt)|0,O=Math.imul(tt,vt),B=B+Math.imul(ze,St)|0,g=g+Math.imul(ze,_t)|0,g=g+Math.imul(ye,St)|0,O=O+Math.imul(ye,_t)|0,B=B+Math.imul(Je,re)|0,g=g+Math.imul(Je,ae)|0,g=g+Math.imul(Ye,re)|0,O=O+Math.imul(Ye,ae)|0,B=B+Math.imul(pe,Ie)|0,g=g+Math.imul(pe,Le)|0,g=g+Math.imul(Be,Ie)|0,O=O+Math.imul(Be,Le)|0,B=B+Math.imul(Z,He)|0,g=g+Math.imul(Z,je)|0,g=g+Math.imul(he,He)|0,O=O+Math.imul(he,je)|0,B=B+Math.imul(W,wt)|0,g=g+Math.imul(W,We)|0,g=g+Math.imul($,wt)|0,O=O+Math.imul($,We)|0,B=B+Math.imul(E,w)|0,g=g+Math.imul(E,k)|0,g=g+Math.imul(J,w)|0,O=O+Math.imul(J,k)|0;var gt=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(gt>>>26)|0,gt&=67108863,B=Math.imul(yt,xt),g=Math.imul(yt,vt),g=g+Math.imul(Ct,xt)|0,O=Math.imul(Ct,vt),B=B+Math.imul(Ce,St)|0,g=g+Math.imul(Ce,_t)|0,g=g+Math.imul(tt,St)|0,O=O+Math.imul(tt,_t)|0,B=B+Math.imul(ze,re)|0,g=g+Math.imul(ze,ae)|0,g=g+Math.imul(ye,re)|0,O=O+Math.imul(ye,ae)|0,B=B+Math.imul(Je,Ie)|0,g=g+Math.imul(Je,Le)|0,g=g+Math.imul(Ye,Ie)|0,O=O+Math.imul(Ye,Le)|0,B=B+Math.imul(pe,He)|0,g=g+Math.imul(pe,je)|0,g=g+Math.imul(Be,He)|0,O=O+Math.imul(Be,je)|0,B=B+Math.imul(Z,wt)|0,g=g+Math.imul(Z,We)|0,g=g+Math.imul(he,wt)|0,O=O+Math.imul(he,We)|0,B=B+Math.imul(W,w)|0,g=g+Math.imul(W,k)|0,g=g+Math.imul($,w)|0,O=O+Math.imul($,k)|0,B=B+Math.imul(E,d)|0,g=g+Math.imul(E,I)|0,g=g+Math.imul(J,d)|0,O=O+Math.imul(J,I)|0;var Pt=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,B=Math.imul(Tt,xt),g=Math.imul(Tt,vt),g=g+Math.imul(It,xt)|0,O=Math.imul(It,vt),B=B+Math.imul(yt,St)|0,g=g+Math.imul(yt,_t)|0,g=g+Math.imul(Ct,St)|0,O=O+Math.imul(Ct,_t)|0,B=B+Math.imul(Ce,re)|0,g=g+Math.imul(Ce,ae)|0,g=g+Math.imul(tt,re)|0,O=O+Math.imul(tt,ae)|0,B=B+Math.imul(ze,Ie)|0,g=g+Math.imul(ze,Le)|0,g=g+Math.imul(ye,Ie)|0,O=O+Math.imul(ye,Le)|0,B=B+Math.imul(Je,He)|0,g=g+Math.imul(Je,je)|0,g=g+Math.imul(Ye,He)|0,O=O+Math.imul(Ye,je)|0,B=B+Math.imul(pe,wt)|0,g=g+Math.imul(pe,We)|0,g=g+Math.imul(Be,wt)|0,O=O+Math.imul(Be,We)|0,B=B+Math.imul(Z,w)|0,g=g+Math.imul(Z,k)|0,g=g+Math.imul(he,w)|0,O=O+Math.imul(he,k)|0,B=B+Math.imul(W,d)|0,g=g+Math.imul(W,I)|0,g=g+Math.imul($,d)|0,O=O+Math.imul($,I)|0,B=B+Math.imul(E,Y)|0,g=g+Math.imul(E,ue)|0,g=g+Math.imul(J,Y)|0,O=O+Math.imul(J,ue)|0;var Nt=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,B=Math.imul(Et,xt),g=Math.imul(Et,vt),g=g+Math.imul(kt,xt)|0,O=Math.imul(kt,vt),B=B+Math.imul(Tt,St)|0,g=g+Math.imul(Tt,_t)|0,g=g+Math.imul(It,St)|0,O=O+Math.imul(It,_t)|0,B=B+Math.imul(yt,re)|0,g=g+Math.imul(yt,ae)|0,g=g+Math.imul(Ct,re)|0,O=O+Math.imul(Ct,ae)|0,B=B+Math.imul(Ce,Ie)|0,g=g+Math.imul(Ce,Le)|0,g=g+Math.imul(tt,Ie)|0,O=O+Math.imul(tt,Le)|0,B=B+Math.imul(ze,He)|0,g=g+Math.imul(ze,je)|0,g=g+Math.imul(ye,He)|0,O=O+Math.imul(ye,je)|0,B=B+Math.imul(Je,wt)|0,g=g+Math.imul(Je,We)|0,g=g+Math.imul(Ye,wt)|0,O=O+Math.imul(Ye,We)|0,B=B+Math.imul(pe,w)|0,g=g+Math.imul(pe,k)|0,g=g+Math.imul(Be,w)|0,O=O+Math.imul(Be,k)|0,B=B+Math.imul(Z,d)|0,g=g+Math.imul(Z,I)|0,g=g+Math.imul(he,d)|0,O=O+Math.imul(he,I)|0,B=B+Math.imul(W,Y)|0,g=g+Math.imul(W,ue)|0,g=g+Math.imul($,Y)|0,O=O+Math.imul($,ue)|0,B=B+Math.imul(E,Re)|0,g=g+Math.imul(E,Fe)|0,g=g+Math.imul(J,Re)|0,O=O+Math.imul(J,Fe)|0;var Xe=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,B=Math.imul(Et,St),g=Math.imul(Et,_t),g=g+Math.imul(kt,St)|0,O=Math.imul(kt,_t),B=B+Math.imul(Tt,re)|0,g=g+Math.imul(Tt,ae)|0,g=g+Math.imul(It,re)|0,O=O+Math.imul(It,ae)|0,B=B+Math.imul(yt,Ie)|0,g=g+Math.imul(yt,Le)|0,g=g+Math.imul(Ct,Ie)|0,O=O+Math.imul(Ct,Le)|0,B=B+Math.imul(Ce,He)|0,g=g+Math.imul(Ce,je)|0,g=g+Math.imul(tt,He)|0,O=O+Math.imul(tt,je)|0,B=B+Math.imul(ze,wt)|0,g=g+Math.imul(ze,We)|0,g=g+Math.imul(ye,wt)|0,O=O+Math.imul(ye,We)|0,B=B+Math.imul(Je,w)|0,g=g+Math.imul(Je,k)|0,g=g+Math.imul(Ye,w)|0,O=O+Math.imul(Ye,k)|0,B=B+Math.imul(pe,d)|0,g=g+Math.imul(pe,I)|0,g=g+Math.imul(Be,d)|0,O=O+Math.imul(Be,I)|0,B=B+Math.imul(Z,Y)|0,g=g+Math.imul(Z,ue)|0,g=g+Math.imul(he,Y)|0,O=O+Math.imul(he,ue)|0,B=B+Math.imul(W,Re)|0,g=g+Math.imul(W,Fe)|0,g=g+Math.imul($,Re)|0,O=O+Math.imul($,Fe)|0;var st=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(st>>>26)|0,st&=67108863,B=Math.imul(Et,re),g=Math.imul(Et,ae),g=g+Math.imul(kt,re)|0,O=Math.imul(kt,ae),B=B+Math.imul(Tt,Ie)|0,g=g+Math.imul(Tt,Le)|0,g=g+Math.imul(It,Ie)|0,O=O+Math.imul(It,Le)|0,B=B+Math.imul(yt,He)|0,g=g+Math.imul(yt,je)|0,g=g+Math.imul(Ct,He)|0,O=O+Math.imul(Ct,je)|0,B=B+Math.imul(Ce,wt)|0,g=g+Math.imul(Ce,We)|0,g=g+Math.imul(tt,wt)|0,O=O+Math.imul(tt,We)|0,B=B+Math.imul(ze,w)|0,g=g+Math.imul(ze,k)|0,g=g+Math.imul(ye,w)|0,O=O+Math.imul(ye,k)|0,B=B+Math.imul(Je,d)|0,g=g+Math.imul(Je,I)|0,g=g+Math.imul(Ye,d)|0,O=O+Math.imul(Ye,I)|0,B=B+Math.imul(pe,Y)|0,g=g+Math.imul(pe,ue)|0,g=g+Math.imul(Be,Y)|0,O=O+Math.imul(Be,ue)|0,B=B+Math.imul(Z,Re)|0,g=g+Math.imul(Z,Fe)|0,g=g+Math.imul(he,Re)|0,O=O+Math.imul(he,Fe)|0;var Qe=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,B=Math.imul(Et,Ie),g=Math.imul(Et,Le),g=g+Math.imul(kt,Ie)|0,O=Math.imul(kt,Le),B=B+Math.imul(Tt,He)|0,g=g+Math.imul(Tt,je)|0,g=g+Math.imul(It,He)|0,O=O+Math.imul(It,je)|0,B=B+Math.imul(yt,wt)|0,g=g+Math.imul(yt,We)|0,g=g+Math.imul(Ct,wt)|0,O=O+Math.imul(Ct,We)|0,B=B+Math.imul(Ce,w)|0,g=g+Math.imul(Ce,k)|0,g=g+Math.imul(tt,w)|0,O=O+Math.imul(tt,k)|0,B=B+Math.imul(ze,d)|0,g=g+Math.imul(ze,I)|0,g=g+Math.imul(ye,d)|0,O=O+Math.imul(ye,I)|0,B=B+Math.imul(Je,Y)|0,g=g+Math.imul(Je,ue)|0,g=g+Math.imul(Ye,Y)|0,O=O+Math.imul(Ye,ue)|0,B=B+Math.imul(pe,Re)|0,g=g+Math.imul(pe,Fe)|0,g=g+Math.imul(Be,Re)|0,O=O+Math.imul(Be,Fe)|0;var Ze=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,B=Math.imul(Et,He),g=Math.imul(Et,je),g=g+Math.imul(kt,He)|0,O=Math.imul(kt,je),B=B+Math.imul(Tt,wt)|0,g=g+Math.imul(Tt,We)|0,g=g+Math.imul(It,wt)|0,O=O+Math.imul(It,We)|0,B=B+Math.imul(yt,w)|0,g=g+Math.imul(yt,k)|0,g=g+Math.imul(Ct,w)|0,O=O+Math.imul(Ct,k)|0,B=B+Math.imul(Ce,d)|0,g=g+Math.imul(Ce,I)|0,g=g+Math.imul(tt,d)|0,O=O+Math.imul(tt,I)|0,B=B+Math.imul(ze,Y)|0,g=g+Math.imul(ze,ue)|0,g=g+Math.imul(ye,Y)|0,O=O+Math.imul(ye,ue)|0,B=B+Math.imul(Je,Re)|0,g=g+Math.imul(Je,Fe)|0,g=g+Math.imul(Ye,Re)|0,O=O+Math.imul(Ye,Fe)|0;var et=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(et>>>26)|0,et&=67108863,B=Math.imul(Et,wt),g=Math.imul(Et,We),g=g+Math.imul(kt,wt)|0,O=Math.imul(kt,We),B=B+Math.imul(Tt,w)|0,g=g+Math.imul(Tt,k)|0,g=g+Math.imul(It,w)|0,O=O+Math.imul(It,k)|0,B=B+Math.imul(yt,d)|0,g=g+Math.imul(yt,I)|0,g=g+Math.imul(Ct,d)|0,O=O+Math.imul(Ct,I)|0,B=B+Math.imul(Ce,Y)|0,g=g+Math.imul(Ce,ue)|0,g=g+Math.imul(tt,Y)|0,O=O+Math.imul(tt,ue)|0,B=B+Math.imul(ze,Re)|0,g=g+Math.imul(ze,Fe)|0,g=g+Math.imul(ye,Re)|0,O=O+Math.imul(ye,Fe)|0;var Ge=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,B=Math.imul(Et,w),g=Math.imul(Et,k),g=g+Math.imul(kt,w)|0,O=Math.imul(kt,k),B=B+Math.imul(Tt,d)|0,g=g+Math.imul(Tt,I)|0,g=g+Math.imul(It,d)|0,O=O+Math.imul(It,I)|0,B=B+Math.imul(yt,Y)|0,g=g+Math.imul(yt,ue)|0,g=g+Math.imul(Ct,Y)|0,O=O+Math.imul(Ct,ue)|0,B=B+Math.imul(Ce,Re)|0,g=g+Math.imul(Ce,Fe)|0,g=g+Math.imul(tt,Re)|0,O=O+Math.imul(tt,Fe)|0;var fe=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(fe>>>26)|0,fe&=67108863,B=Math.imul(Et,d),g=Math.imul(Et,I),g=g+Math.imul(kt,d)|0,O=Math.imul(kt,I),B=B+Math.imul(Tt,Y)|0,g=g+Math.imul(Tt,ue)|0,g=g+Math.imul(It,Y)|0,O=O+Math.imul(It,ue)|0,B=B+Math.imul(yt,Re)|0,g=g+Math.imul(yt,Fe)|0,g=g+Math.imul(Ct,Re)|0,O=O+Math.imul(Ct,Fe)|0;var ce=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(ce>>>26)|0,ce&=67108863,B=Math.imul(Et,Y),g=Math.imul(Et,ue),g=g+Math.imul(kt,Y)|0,O=Math.imul(kt,ue),B=B+Math.imul(Tt,Re)|0,g=g+Math.imul(Tt,Fe)|0,g=g+Math.imul(It,Re)|0,O=O+Math.imul(It,Fe)|0;var Ae=(G+B|0)+((g&8191)<<13)|0;G=(O+(g>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,B=Math.imul(Et,Re),g=Math.imul(Et,Fe),g=g+Math.imul(kt,Re)|0,O=Math.imul(kt,Fe);var ge=(G+B|0)+((g&8191)<<13)|0;return G=(O+(g>>>13)|0)+(ge>>>26)|0,ge&=67108863,U[0]=qe,U[1]=Me,U[2]=rt,U[3]=Ve,U[4]=dt,U[5]=Ft,U[6]=gt,U[7]=Pt,U[8]=Nt,U[9]=Xe,U[10]=st,U[11]=Qe,U[12]=Ze,U[13]=et,U[14]=Ge,U[15]=fe,U[16]=ce,U[17]=Ae,U[18]=ge,G!==0&&(U[19]=G,S.length++),S};Math.imul||(A=x);function C(_,h,m){m.negative=h.negative^_.negative,m.length=_.length+h.length;for(var S=0,M=0,R=0;R>>26)|0,M+=U>>>26,U&=67108863}m.words[R]=G,S=U,U=M}return S!==0?m.words[R]=S:m.length--,m._strip()}function F(_,h,m){return C(_,h,m)}s.prototype.mulTo=function(h,m){var S,M=this.length+h.length;return this.length===10&&h.length===10?S=A(this,h,m):M<63?S=x(this,h,m):M<1024?S=C(this,h,m):S=F(this,h,m),S},s.prototype.mul=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),this.mulTo(h,m)},s.prototype.mulf=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),F(this,h,m)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var m=h<0;m&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var S=0,M=0;M>=26,S+=R/67108864|0,S+=U>>>26,this.words[M]=U&67108863}return S!==0&&(this.words[M]=S,this.length++),m?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var m=N(h);if(m.length===0)return new s(1);for(var S=this,M=0;M=0);var m=h%26,S=(h-m)/26,M=67108863>>>26-m<<26-m,R;if(m!==0){var U=0;for(R=0;R>>26-m}U&&(this.words[R]=U,this.length++)}if(S!==0){for(R=this.length-1;R>=0;R--)this.words[R+S]=this.words[R];for(R=0;R=0);var M;m?M=(m-m%26)/26:M=0;var R=h%26,U=Math.min((h-R)/26,this.length),G=67108863^67108863>>>R<U)for(this.length-=U,g=0;g=0&&(O!==0||g>=M);g--){var ve=this.words[g]|0;this.words[g]=O<<26-R|ve>>>R,O=ve&G}return B&&O!==0&&(B.words[B.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,m,S){return n(this.negative===0),this.iushrn(h,m,S)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var m=h%26,S=(h-m)/26,M=1<=0);var m=h%26,S=(h-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(m!==0&&S++,this.length=Math.min(S,this.length),m!==0){var M=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(B/67108864|0),this.words[R+S]=U&67108863}for(;R>26,this.words[R+S]=U&67108863;if(G===0)return this._strip();for(n(G===-1),G=0,R=0;R>26,this.words[R]=U&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,m){var S=this.length-h.length,M=this.clone(),R=h,U=R.words[R.length-1]|0,G=this._countBits(U);S=26-G,S!==0&&(R=R.ushln(S),M.iushln(S),U=R.words[R.length-1]|0);var B=M.length-R.length,g;if(m!=="mod"){g=new s(null),g.length=B+1,g.words=new Array(g.length);for(var O=0;O=0;E--){var J=(M.words[R.length+E]|0)*67108864+(M.words[R.length+E-1]|0);for(J=Math.min(J/U|0,67108863),M._ishlnsubmul(R,J,E);M.negative!==0;)J--,M.negative=0,M._ishlnsubmul(R,1,E),M.isZero()||(M.negative^=1);g&&(g.words[E]=J)}return g&&g._strip(),M._strip(),m!=="div"&&S!==0&&M.iushrn(S),{div:g||null,mod:M}},s.prototype.divmod=function(h,m,S){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var M,R,U;return this.negative!==0&&h.negative===0?(U=this.neg().divmod(h,m),m!=="mod"&&(M=U.div.neg()),m!=="div"&&(R=U.mod.neg(),S&&R.negative!==0&&R.iadd(h)),{div:M,mod:R}):this.negative===0&&h.negative!==0?(U=this.divmod(h.neg(),m),m!=="mod"&&(M=U.div.neg()),{div:M,mod:U.mod}):this.negative&h.negative?(U=this.neg().divmod(h.neg(),m),m!=="div"&&(R=U.mod.neg(),S&&R.negative!==0&&R.isub(h)),{div:U.div,mod:R}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?m==="div"?{div:this.divn(h.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,m)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var m=this.divmod(h);if(m.mod.isZero())return m.div;var S=m.div.negative!==0?m.mod.isub(h):m.mod,M=h.ushrn(1),R=h.andln(1),U=S.cmp(M);return U<0||R===1&&U===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var S=(1<<26)%h,M=0,R=this.length-1;R>=0;R--)M=(S*M+(this.words[R]|0))%h;return m?-M:M},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var S=0,M=this.length-1;M>=0;M--){var R=(this.words[M]|0)+S*67108864;this.words[M]=R/h|0,S=R%h}return this._strip(),m?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var m=this,S=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var M=new s(1),R=new s(0),U=new s(0),G=new s(1),B=0;m.isEven()&&S.isEven();)m.iushrn(1),S.iushrn(1),++B;for(var g=S.clone(),O=m.clone();!m.isZero();){for(var ve=0,E=1;!(m.words[0]&E)&&ve<26;++ve,E<<=1);if(ve>0)for(m.iushrn(ve);ve-- >0;)(M.isOdd()||R.isOdd())&&(M.iadd(g),R.isub(O)),M.iushrn(1),R.iushrn(1);for(var J=0,oe=1;!(S.words[0]&oe)&&J<26;++J,oe<<=1);if(J>0)for(S.iushrn(J);J-- >0;)(U.isOdd()||G.isOdd())&&(U.iadd(g),G.isub(O)),U.iushrn(1),G.iushrn(1);m.cmp(S)>=0?(m.isub(S),M.isub(U),R.isub(G)):(S.isub(m),U.isub(M),G.isub(R))}return{a:U,b:G,gcd:S.iushln(B)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var m=this,S=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var M=new s(1),R=new s(0),U=S.clone();m.cmpn(1)>0&&S.cmpn(1)>0;){for(var G=0,B=1;!(m.words[0]&B)&&G<26;++G,B<<=1);if(G>0)for(m.iushrn(G);G-- >0;)M.isOdd()&&M.iadd(U),M.iushrn(1);for(var g=0,O=1;!(S.words[0]&O)&&g<26;++g,O<<=1);if(g>0)for(S.iushrn(g);g-- >0;)R.isOdd()&&R.iadd(U),R.iushrn(1);m.cmp(S)>=0?(m.isub(S),M.isub(R)):(S.isub(m),R.isub(M))}var ve;return m.cmpn(1)===0?ve=M:ve=R,ve.cmpn(0)<0&&ve.iadd(h),ve},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var m=this.clone(),S=h.clone();m.negative=0,S.negative=0;for(var M=0;m.isEven()&&S.isEven();M++)m.iushrn(1),S.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;S.isEven();)S.iushrn(1);var R=m.cmp(S);if(R<0){var U=m;m=S,S=U}else if(R===0||S.cmpn(1)===0)break;m.isub(S)}while(!0);return S.iushln(M)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var m=h%26,S=(h-m)/26,M=1<>>26,G&=67108863,this.words[U]=G}return R!==0&&(this.words[U]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var m=h<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var S;if(this.length>1)S=1;else{m&&(h=-h),n(h<=67108863,"Number is too big");var M=this.words[0]|0;S=M===h?0:Mh.length)return 1;if(this.length=0;S--){var M=this.words[S]|0,R=h.words[S]|0;if(M!==R){MR&&(m=1);break}}return m},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new te(h)},s.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var L={k256:null,p224:null,p192:null,p25519:null};function T(_,h){this.name=_,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},T.prototype.ireduce=function(h){var m=h,S;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),S=m.bitLength();while(S>this.n);var M=S0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},T.prototype.split=function(h,m){h.iushrn(this.n,0,m)},T.prototype.imulK=function(h){return h.imul(this.k)};function z(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(z,T),z.prototype.split=function(h,m){for(var S=4194303,M=Math.min(h.length,9),R=0;R>>22,U=G}U>>>=22,h.words[R-10]=U,U===0&&h.length>10?h.length-=10:h.length-=9},z.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var m=0,S=0;S>>=26,h.words[S]=R,m=M}return m!==0&&(h.words[h.length++]=m),h},s._prime=function(h){if(L[h])return L[h];var m;if(h==="k256")m=new z;else if(h==="p224")m=new H;else if(h==="p192")m=new K;else if(h==="p25519")m=new ne;else throw new Error("Unknown prime "+h);return L[h]=m,m};function te(_){if(typeof _=="string"){var h=s._prime(_);this.m=h.p,this.prime=h}else n(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}te.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},te.prototype._verify2=function(h,m){n((h.negative|m.negative)===0,"red works only with positives"),n(h.red&&h.red===m.red,"red works only with red numbers")},te.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},te.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},te.prototype.add=function(h,m){this._verify2(h,m);var S=h.add(m);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},te.prototype.iadd=function(h,m){this._verify2(h,m);var S=h.iadd(m);return S.cmp(this.m)>=0&&S.isub(this.m),S},te.prototype.sub=function(h,m){this._verify2(h,m);var S=h.sub(m);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},te.prototype.isub=function(h,m){this._verify2(h,m);var S=h.isub(m);return S.cmpn(0)<0&&S.iadd(this.m),S},te.prototype.shl=function(h,m){return this._verify1(h),this.imod(h.ushln(m))},te.prototype.imul=function(h,m){return this._verify2(h,m),this.imod(h.imul(m))},te.prototype.mul=function(h,m){return this._verify2(h,m),this.imod(h.mul(m))},te.prototype.isqr=function(h){return this.imul(h,h.clone())},te.prototype.sqr=function(h){return this.mul(h,h)},te.prototype.sqrt=function(h){if(h.isZero())return h.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var S=this.m.add(new s(1)).iushrn(2);return this.pow(h,S)}for(var M=this.m.subn(1),R=0;!M.isZero()&&M.andln(1)===0;)R++,M.iushrn(1);n(!M.isZero());var U=new s(1).toRed(this),G=U.redNeg(),B=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new s(2*g*g).toRed(this);this.pow(g,B).cmp(G)!==0;)g.redIAdd(G);for(var O=this.pow(g,M),ve=this.pow(h,M.addn(1).iushrn(1)),E=this.pow(h,M),J=R;E.cmp(U)!==0;){for(var oe=E,W=0;oe.cmp(U)!==0;W++)oe=oe.redSqr();n(W=0;R--){for(var O=m.words[R],ve=g-1;ve>=0;ve--){var E=O>>ve&1;if(U!==M[0]&&(U=this.sqr(U)),E===0&&G===0){B=0;continue}G<<=1,G|=E,B++,!(B!==S&&(R!==0||ve!==0))&&(U=this.mul(U,M[G]),B=0,G=0)}g=26}return U},te.prototype.convertTo=function(h){var m=h.umod(this.m);return m===h?m.clone():m},te.prototype.convertFrom=function(h){var m=h.clone();return m.red=null,m},s.mont=function(h){return new de(h)};function de(_){te.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(de,te),de.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},de.prototype.convertFrom=function(h){var m=this.imod(h.mul(this.rinv));return m.red=null,m},de.prototype.imul=function(h,m){if(h.isZero()||m.isZero())return h.words[0]=0,h.length=1,h;var S=h.imul(m),M=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=S.isub(M).iushrn(this.shift),U=R;return R.cmp(this.m)>=0?U=R.isub(this.m):R.cmpn(0)<0&&(U=R.iadd(this.m)),U._forceRed(this)},de.prototype.mul=function(h,m){if(h.isZero()||m.isZero())return new s(0)._forceRed(this);var S=h.mul(m),M=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=S.isub(M).iushrn(this.shift),U=R;return R.cmp(this.m)>=0?U=R.isub(this.m):R.cmpn(0)<0&&(U=R.iadd(this.m)),U._forceRed(this)},de.prototype.invm=function(h){var m=this.imod(h._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,f1)})(bx);var Z9=bx.exports;const zt=Uo(Z9),e_="logger/5.7.0";let $w=!1,Ww=!1;const Id={debug:1,default:2,info:2,warning:3,error:4,off:5};let Jw=Id.default,zg=null;function t_(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Yw=t_();var Ey;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Ey||(Ey={}));var rs;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(rs||(rs={}));const qw="0123456789abcdef";class ie{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Id[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Jw>Id[n])&&console.log.apply(console,r)}debug(...e){this._log(ie.levels.DEBUG,e)}info(...e){this._log(ie.levels.INFO,e)}warn(...e){this._log(ie.levels.WARNING,e)}makeError(e,r,n){if(Ww)return this.makeError("censored error",r,{});r||(r=ie.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let f="";for(let c=0;c>4],f+=qw[u[c]&15];i.push(l+"=Uint8Array(0x"+f+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case rs.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case rs.CALL_EXCEPTION:case rs.INSUFFICIENT_FUNDS:case rs.MISSING_NEW:case rs.NONCE_EXPIRED:case rs.REPLACEMENT_UNDERPRICED:case rs.TRANSACTION_REPLACED:case rs.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,ie.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Yw&&this.throwError("platform missing String.prototype.normalize",ie.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Yw})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ie.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ie.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,ie.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ie.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ie.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ie.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return zg||(zg=new ie(e_)),zg}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ie.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),$w){if(!e)return;this.globalLogger().throwError("error censorship permanent",ie.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Ww=!!e,$w=!!r}static setLogLevel(e){const r=Id[e.toLowerCase()];if(r==null){ie.globalLogger().warn("invalid log level - "+e);return}Jw=r}static from(e){return new ie(e)}}ie.errors=rs;ie.levels=Ey;const r_="bytes/5.7.0",Mr=new ie(r_);function mE(t){return!!t.toHexString}function zu(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return zu(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Df(t){return dr(t)&&!(t.length%2)||ic(t)}function Xw(t){return typeof t=="number"&&t==t&&t%1===0}function ic(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Xw(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ct(t,e){if(e||(e={}),typeof t=="number"){Mr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),zu(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),mE(t)&&(t=t.toHexString()),dr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Mr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ict(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),zu(n)}function Lf(t){let e=ct(t);if(e.length===0)return e;let r=0;for(;re&&Mr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),zu(r)}function dr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const jg="0123456789abcdef";function lt(t,e){if(e||(e={}),typeof t=="number"){Mr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=jg[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),mE(t))return t.toHexString();if(dr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Mr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(ic(t)){let r="0x";for(let n=0;n>4]+jg[i&15]}return r}return Mr.throwArgumentError("invalid hexlify value","value",t)}function Tl(t){if(typeof t!="string")t=lt(t);else if(!dr(t)||t.length%2)return null;return(t.length-2)/2}function _n(t,e,r){return typeof t!="string"?t=lt(t):(!dr(t)||t.length%2)&&Mr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Zn(t){let e="0x";return t.forEach(r=>{e+=lt(r).substring(2)}),e}function Ax(t){const e=i_(lt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function i_(t){typeof t!="string"&&(t=lt(t)),dr(t)||Mr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Mr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function I1(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Df(t)){let r=ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=lt(r.slice(0,32)),e.s=lt(r.slice(32,64))):r.length===65?(e.r=lt(r.slice(0,32)),e.s=lt(r.slice(32,64)),e.v=r[64]):Mr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Mr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=lt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=n_(ct(e._vs),32);e._vs=lt(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Mr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=lt(i);e.s==null?e.s=o:e.s!==o&&Mr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Mr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Mr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!dr(e.r)?Mr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ar(e.r,32),e.s==null||!dr(e.s)?Mr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ar(e.s,32);const r=ct(e.s);r[0]>=128&&Mr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=lt(r);e._vs&&(dr(e._vs)||Mr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ar(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Mr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const yE="bignumber/5.7.0";var _p=zt.BN;const ro=new ie(yE),Hg={},Zw=9007199254740991;function s_(t){return t!=null&&(Ee.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||dr(t)||typeof t=="bigint"||ic(t))}let eb=!1;class Ee{constructor(e,r){e!==Hg&&ro.throwError("cannot call constructor directly; use BigNumber.from",ie.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Kn(Yt(this).fromTwos(e))}toTwos(e){return Kn(Yt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Ee.from(this._hex.substring(1)):this}add(e){return Kn(Yt(this).add(Yt(e)))}sub(e){return Kn(Yt(this).sub(Yt(e)))}div(e){return Ee.from(e).isZero()&&Ai("division-by-zero","div"),Kn(Yt(this).div(Yt(e)))}mul(e){return Kn(Yt(this).mul(Yt(e)))}mod(e){const r=Yt(e);return r.isNeg()&&Ai("division-by-zero","mod"),Kn(Yt(this).umod(r))}pow(e){const r=Yt(e);return r.isNeg()&&Ai("negative-power","pow"),Kn(Yt(this).pow(r))}and(e){const r=Yt(e);return(this.isNegative()||r.isNeg())&&Ai("unbound-bitwise-result","and"),Kn(Yt(this).and(r))}or(e){const r=Yt(e);return(this.isNegative()||r.isNeg())&&Ai("unbound-bitwise-result","or"),Kn(Yt(this).or(r))}xor(e){const r=Yt(e);return(this.isNegative()||r.isNeg())&&Ai("unbound-bitwise-result","xor"),Kn(Yt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Ai("negative-width","mask"),Kn(Yt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Ai("negative-width","shl"),Kn(Yt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Ai("negative-width","shr"),Kn(Yt(this).shrn(e))}eq(e){return Yt(this).eq(Yt(e))}lt(e){return Yt(this).lt(Yt(e))}lte(e){return Yt(this).lte(Yt(e))}gt(e){return Yt(this).gt(Yt(e))}gte(e){return Yt(this).gte(Yt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Yt(this).isZero()}toNumber(){try{return Yt(this).toNumber()}catch{Ai("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return ro.throwError("this platform does not support BigInt",ie.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?eb||(eb=!0,ro.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ro.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ie.errors.UNEXPECTED_ARGUMENT,{}):ro.throwError("BigNumber.toString does not accept parameters",ie.errors.UNEXPECTED_ARGUMENT,{})),Yt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Ee)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Ee(Hg,Mh(e)):e.match(/^-?[0-9]+$/)?new Ee(Hg,Mh(new _p(e))):ro.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Ai("underflow","BigNumber.from",e),(e>=Zw||e<=-Zw)&&Ai("overflow","BigNumber.from",e),Ee.from(String(e));const r=e;if(typeof r=="bigint")return Ee.from(r.toString());if(ic(r))return Ee.from(lt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Ee.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(dr(n)||n[0]==="-"&&dr(n.substring(1))))return Ee.from(n)}return ro.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Mh(t){if(typeof t!="string")return Mh(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&ro.throwArgumentError("invalid hex","value",t),t=Mh(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Kn(t){return Ee.from(Mh(t))}function Yt(t){const e=Ee.from(t).toHexString();return e[0]==="-"?new _p("-"+e.substring(3),16):new _p(e.substring(2),16)}function Ai(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),ro.throwError(t,ie.errors.NUMERIC_FAULT,n)}function o_(t){return new _p(t,36).toString(16)}const Ln=new ie(yE),oh={},xE=Ee.from(0),vE=Ee.from(-1);function wE(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Ln.throwError(t,ie.errors.NUMERIC_FAULT,i)}let ah="0";for(;ah.length<256;)ah+=ah;function Ex(t){if(typeof t!="number")try{t=Ee.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+ah.substring(0,t):Ln.throwArgumentError("invalid decimal size","decimals",t)}function Md(t,e){e==null&&(e=0);const r=Ex(e);t=Ee.from(t);const n=t.lt(xE);n&&(t=t.mul(vE));let i=t.mod(r).toString();for(;i.length2&&Ln.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&wE("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Ln.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Ln.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Ln.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new ju(oh,r,n,i)}}class an{constructor(e,r,n,i){e!==oh&&Ln.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ie.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Ln.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Ss(this._value,this.format.decimals),n=Ss(e._value,e.format.decimals);return an.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Ss(this._value,this.format.decimals),n=Ss(e._value,e.format.decimals);return an.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Ss(this._value,this.format.decimals),n=Ss(e._value,e.format.decimals);return an.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Ss(this._value,this.format.decimals),n=Ss(e._value,e.format.decimals);return an.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=an.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(tb.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=an.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(tb.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Ln.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=an.from("1"+ah.substring(0,e),this.format),i=a_.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Ln.throwArgumentError("invalid byte width","width",e);const r=Ee.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Ar(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return an.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!s_(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),an.fromString(Md(e,r),ju.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=ju.from(r),i=Ss(e,n.decimals);!n.signed&&i.lt(xE)&&wE("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=Ar(s,n.width/8));const o=Md(i,n.decimals);return new an(oh,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=ju.from(r);if(ct(e).length>n.width/8)throw new Error("overflow");let i=Ee.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Md(i,n.decimals);return new an(oh,s,o,n)}static from(e,r){if(typeof e=="string")return an.fromString(e,r);if(ic(e))return an.fromBytes(e,r);try{return an.fromValue(e,0,r)}catch(n){if(n.code!==ie.errors.INVALID_ARGUMENT)throw n}return Ln.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const tb=an.from(1),a_=an.from("0.5"),l_="properties/5.7.0";var u_=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Pp=new ie(l_);function Oe(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Ls(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Qr(t){return u_(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function f_(t,e){(!t||typeof t!="object")&&Pp.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Pp.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Xr(t){const e={};for(const r in t)e[r]=t[r];return e}const c_={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function bE(t){if(t==null||c_[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rRo(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&Oe(e,r,Ro(n))}return e}return Pp.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Ro(t){return h_(t)}class w0{constructor(e){for(const r in e)this[r]=Ro(e[r])}}const b0="abi/5.7.0",tr=new ie(b0),Il={};let rb={calldata:!0,memory:!0,storage:!0},d_={calldata:!0,memory:!0};function q0(t,e){if(t==="bytes"||t==="string"){if(rb[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&d_[e])return!0;return(rb[e]||e==="payable")&&tr.throwArgumentError("invalid modifier","name",e),!1}function p_(t,e){let r=t;function n(a){tr.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==hr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===hr.full?", ":",")+")"):r+=this.type,e!==hr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===hr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Yo.fromString(e,r):Yo.fromObject(e)}static fromObject(e){return Yo.isParamType(e)?e:new Yo(Il,{name:e.name||null,type:iu(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Yo.fromObject):null})}static fromString(e,r){function n(i){return Yo.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(p_(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}};function Bh(t,e){return y_(t).map(r=>Gs.fromString(r,e))}let M1=class Lc{constructor(e,r){e!==Il&&tr.throwError("use a static from method",ie.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Bd(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Lc.isFragment(e)?e:typeof e=="string"?Lc.fromString(e):Lc.fromObject(e)}static fromObject(e){if(Lc.isFragment(e))return e;switch(e.type){case"function":return Rp.fromObject(e);case"event":return Sy.fromObject(e);case"constructor":return Np.fromObject(e);case"error":return ib.fromObject(e);case"fallback":case"receive":return null}return tr.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Sy.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Rp.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Np.fromString(e.trim()):e.split(" ")[0]==="error"?ib.fromString(e.substring(5).trim()):tr.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}},Sy=class eu extends M1{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==hr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ",e!==hr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?eu.fromString(e):eu.fromObject(e)}static fromObject(e){if(eu.isEventFragment(e))return e;e.type!=="event"&&tr.throwArgumentError("invalid event object","value",e);const r={name:Oh(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Gs.fromObject):[],type:"event"};return new eu(Il,r)}static fromString(e){let r=e.match(Uh);r||tr.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:tr.warn("unknown modifier: "+i)}}),eu.fromObject({name:r[1].trim(),anonymous:n,inputs:Bh(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function AE(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&tr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||tr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=Ee.from(r[1]),r[0]):t}function EE(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function SE(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&tr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&tr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&tr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&tr.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&tr.throwArgumentError("unable to determine stateMutability","value",t),e}let Np=class tu extends M1{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===hr.sighash&&tr.throwError("cannot format a constructor for sighash",ie.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?tu.fromString(e):tu.fromObject(e)}static fromObject(e){if(tu.isConstructorFragment(e))return e;e.type!=="constructor"&&tr.throwArgumentError("invalid constructor object","value",e);let r=SE(e);r.constant&&tr.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Gs.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Ee.from(e.gas):null};return new tu(Il,n)}static fromString(e){let r={type:"constructor"};e=AE(e,r);let n=e.match(Uh);return(!n||n[1].trim()!=="constructor")&&tr.throwArgumentError("invalid constructor string","value",e),r.inputs=Bh(n[2].trim(),!1),EE(n[3].trim(),r),tu.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},Rp=class ru extends Np{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==hr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ",e!==hr.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?ru.fromString(e):ru.fromObject(e)}static fromObject(e){if(ru.isFunctionFragment(e))return e;e.type!=="function"&&tr.throwArgumentError("invalid function object","value",e);let r=SE(e);const n={type:e.type,name:Oh(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Gs.fromObject):[],outputs:e.outputs?e.outputs.map(Gs.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Ee.from(e.gas):null};return new ru(Il,n)}static fromString(e){let r={type:"function"};e=AE(e,r);let n=e.split(" returns ");n.length>2&&tr.throwArgumentError("invalid function string","value",e);let i=n[0].match(Uh);if(i||tr.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Oh(r.name),r.inputs=Bh(i[2],!1),EE(i[3].trim(),r),n.length>1){let s=n[1].match(Uh);(s[1].trim()!=""||s[3].trim()!="")&&tr.throwArgumentError("unexpected tokens","value",e),r.outputs=Bh(s[2],!1)}else r.outputs=[];return ru.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function nb(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&tr.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}let ib=class nu extends M1{format(e){if(e||(e=hr.sighash),hr[e]||tr.throwArgumentError("invalid format type","format",e),e===hr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==hr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===hr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?nu.fromString(e):nu.fromObject(e)}static fromObject(e){if(nu.isErrorFragment(e))return e;e.type!=="error"&&tr.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Oh(e.name),inputs:e.inputs?e.inputs.map(Gs.fromObject):[]};return nb(new nu(Il,r))}static fromString(e){let r={type:"error"},n=e.match(Uh);return n||tr.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Oh(r.name),r.inputs=Bh(n[2],!1),nb(nu.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function iu(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const m_=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Oh(t){return(!t||!t.match(m_))&&tr.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Uh=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function y_(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&Sx.throwError("value out-of-bounds",ie.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=gi([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}},v_=class Cy{constructor(e,r,n,i){Oe(this,"_data",ct(e)),Oe(this,"wordSize",r||32),Oe(this,"_coerceFunc",n),Oe(this,"allowLoose",i),this._offset=0}get data(){return lt(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):Cy.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Sx.throwError("data out-of-bounds",ie.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new Cy(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return Ee.from(this.readBytes(this.wordSize))}};var FE={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=f1:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],c=[4,1024,262144,67108864],p=[1,256,65536,16777216],y=[6,1536,393216,100663296],v=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],N=[224,256,384,512],x=[128,256],A=["hex","buffer","arrayBuffer","array","digest"],C={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(E){return Object.prototype.toString.call(E)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(E){return typeof E=="object"&&E.buffer&&E.buffer.constructor===ArrayBuffer});for(var F=function(E,W,oe){return function(J){return new g(E,W,E).update(J)[oe]()}},z=function(E,W,oe){return function(J,K){return new g(E,W,K).update(J)[oe]()}},T=function(E,W,oe){return function(J,K,V,Z){return h["cshake"+E].update(J,K,V,Z)[oe]()}},D=function(E,W,oe){return function(J,K,V,Z){return h["kmac"+E].update(J,K,V,Z)[oe]()}},G=function(E,W,oe,J){for(var K=0;K>5,this.byteCount=this.blockCount<<2,this.outputBlocks=oe>>5,this.extraBytes=(oe&31)>>3;for(var J=0;J<50;++J)this.s[J]=0}g.prototype.update=function(E){if(this.finalized)throw new Error(r);var W,oe=typeof E;if(oe!=="string"){if(oe==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);W=!0}for(var J=this.blocks,K=this.byteCount,V=E.length,Z=this.blockCount,he=0,Ue=this.s,pe,Be;he>2]|=E[he]<>2]|=Be<>2]|=(192|Be>>6)<>2]|=(128|Be&63)<=57344?(J[pe>>2]|=(224|Be>>12)<>2]|=(128|Be>>6&63)<>2]|=(128|Be&63)<>2]|=(240|Be>>18)<>2]|=(128|Be>>12&63)<>2]|=(128|Be>>6&63)<>2]|=(128|Be&63)<=K){for(this.start=pe-K,this.block=J[Z],pe=0;pe>8,oe=E&255;oe>0;)K.unshift(oe),E=E>>8,oe=E&255,++J;return W?K.push(J):K.unshift(J),this.update(K),K.length},g.prototype.encodeString=function(E){var W,oe=typeof E;if(oe!=="string"){if(oe==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);W=!0}var J=0,K=E.length;if(W)J=K;else for(var V=0;V=57344?J+=3:(Z=65536+((Z&1023)<<10|E.charCodeAt(++V)&1023),J+=4)}return J+=this.encode(J*8),this.update(E),J},g.prototype.bytepad=function(E,W){for(var oe=this.encode(W),J=0;J>2]|=this.padding[W&3],this.lastByteIndex===this.byteCount)for(E[0]=E[oe],W=1;W>4&15]+u[he&15]+u[he>>12&15]+u[he>>8&15]+u[he>>20&15]+u[he>>16&15]+u[he>>28&15]+u[he>>24&15];V%E===0&&(ve(W),K=0)}return J&&(he=W[K],Z+=u[he>>4&15]+u[he&15],J>1&&(Z+=u[he>>12&15]+u[he>>8&15]),J>2&&(Z+=u[he>>20&15]+u[he>>16&15])),Z},g.prototype.arrayBuffer=function(){this.finalize();var E=this.blockCount,W=this.s,oe=this.outputBlocks,J=this.extraBytes,K=0,V=0,Z=this.outputBits>>3,he;J?he=new ArrayBuffer(oe+1<<2):he=new ArrayBuffer(Z);for(var Ue=new Uint32Array(he);V>8&255,Z[he+2]=Ue>>16&255,Z[he+3]=Ue>>24&255;V%E===0&&ve(W)}return J&&(he=V<<2,Ue=W[K],Z[he]=Ue&255,J>1&&(Z[he+1]=Ue>>8&255),J>2&&(Z[he+2]=Ue>>16&255)),Z};function O(E,W,oe){g.call(this,E,W,oe)}O.prototype=new g,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),g.prototype.finalize.call(this)};var ve=function(E){var W,oe,J,K,V,Z,he,Ue,pe,Be,ut,We,Ye,pt,ze,ye,De,Ce,tt,Dt,yt,Ct,fr,Tt,It,Wt,Et,kt,$t,xt,vt,ir,St,_t,q,re,ae,ke,Ie,Le,ht,He,je,Gt,wt,Je,Ht,w,k,P,d,I,X,Y,ue,Se,Re,Fe,qe,Me,rt,Ve,dt;for(J=0;J<48;J+=2)K=E[0]^E[10]^E[20]^E[30]^E[40],V=E[1]^E[11]^E[21]^E[31]^E[41],Z=E[2]^E[12]^E[22]^E[32]^E[42],he=E[3]^E[13]^E[23]^E[33]^E[43],Ue=E[4]^E[14]^E[24]^E[34]^E[44],pe=E[5]^E[15]^E[25]^E[35]^E[45],Be=E[6]^E[16]^E[26]^E[36]^E[46],ut=E[7]^E[17]^E[27]^E[37]^E[47],We=E[8]^E[18]^E[28]^E[38]^E[48],Ye=E[9]^E[19]^E[29]^E[39]^E[49],W=We^(Z<<1|he>>>31),oe=Ye^(he<<1|Z>>>31),E[0]^=W,E[1]^=oe,E[10]^=W,E[11]^=oe,E[20]^=W,E[21]^=oe,E[30]^=W,E[31]^=oe,E[40]^=W,E[41]^=oe,W=K^(Ue<<1|pe>>>31),oe=V^(pe<<1|Ue>>>31),E[2]^=W,E[3]^=oe,E[12]^=W,E[13]^=oe,E[22]^=W,E[23]^=oe,E[32]^=W,E[33]^=oe,E[42]^=W,E[43]^=oe,W=Z^(Be<<1|ut>>>31),oe=he^(ut<<1|Be>>>31),E[4]^=W,E[5]^=oe,E[14]^=W,E[15]^=oe,E[24]^=W,E[25]^=oe,E[34]^=W,E[35]^=oe,E[44]^=W,E[45]^=oe,W=Ue^(We<<1|Ye>>>31),oe=pe^(Ye<<1|We>>>31),E[6]^=W,E[7]^=oe,E[16]^=W,E[17]^=oe,E[26]^=W,E[27]^=oe,E[36]^=W,E[37]^=oe,E[46]^=W,E[47]^=oe,W=Be^(K<<1|V>>>31),oe=ut^(V<<1|K>>>31),E[8]^=W,E[9]^=oe,E[18]^=W,E[19]^=oe,E[28]^=W,E[29]^=oe,E[38]^=W,E[39]^=oe,E[48]^=W,E[49]^=oe,pt=E[0],ze=E[1],Je=E[11]<<4|E[10]>>>28,Ht=E[10]<<4|E[11]>>>28,kt=E[20]<<3|E[21]>>>29,$t=E[21]<<3|E[20]>>>29,Me=E[31]<<9|E[30]>>>23,rt=E[30]<<9|E[31]>>>23,He=E[40]<<18|E[41]>>>14,je=E[41]<<18|E[40]>>>14,_t=E[2]<<1|E[3]>>>31,q=E[3]<<1|E[2]>>>31,ye=E[13]<<12|E[12]>>>20,De=E[12]<<12|E[13]>>>20,w=E[22]<<10|E[23]>>>22,k=E[23]<<10|E[22]>>>22,xt=E[33]<<13|E[32]>>>19,vt=E[32]<<13|E[33]>>>19,Ve=E[42]<<2|E[43]>>>30,dt=E[43]<<2|E[42]>>>30,Y=E[5]<<30|E[4]>>>2,ue=E[4]<<30|E[5]>>>2,re=E[14]<<6|E[15]>>>26,ae=E[15]<<6|E[14]>>>26,Ce=E[25]<<11|E[24]>>>21,tt=E[24]<<11|E[25]>>>21,P=E[34]<<15|E[35]>>>17,d=E[35]<<15|E[34]>>>17,ir=E[45]<<29|E[44]>>>3,St=E[44]<<29|E[45]>>>3,Tt=E[6]<<28|E[7]>>>4,It=E[7]<<28|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Et,E[28]=He^~_t&re,E[29]=je^~q&ae,E[38]=I^~Gt&Je,E[39]=X^~wt&Ht,E[48]=Ve^~Y&Se,E[49]=dt^~ue&Re,E[0]^=b[J],E[1]^=b[J+1]};if(a)t.exports=h;else for(S=0;S>=8;return e}function ib(t,e,r){let n=0;for(let i=0;ie+1+n&&Cs.throwError("child data too short",ie.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function gE(t,e){if(t.length===0&&Cs.throwError("data too short",ie.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Cs.throwError("data short segment too short",ie.errors.BUFFER_OVERRUN,{});const n=ib(t,e+1,r);return e+1+r+n>t.length&&Cs.throwError("data long segment too short",ie.errors.BUFFER_OVERRUN,{}),sb(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Cs.throwError("data array too short",ie.errors.BUFFER_OVERRUN,{}),sb(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Cs.throwError("data array too short",ie.errors.BUFFER_OVERRUN,{});const n=ib(t,e+1,r);e+1+r+n>t.length&&Cs.throwError("data array too short",ie.errors.BUFFER_OVERRUN,{});const i=lt(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Cs.throwError("data too short",ie.errors.BUFFER_OVERRUN,{});const n=lt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:lt(t[e])}}function O1(t){const e=ct(t),r=gE(e,0);return r.consumed!==e.length&&Cs.throwArgumentError("invalid rlp data","data",t),r.result}const S9="address/5.7.0",Au=new ie(S9);function ob(t){dr(t,20)||Au.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ct(Yr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const F9=9007199254740991;function C9(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Ex={};for(let t=0;t<10;t++)Ex[String(t)]=String(t);for(let t=0;t<26;t++)Ex[String.fromCharCode(65+t)]=String(10+t);const ab=Math.floor(C9(F9));function k9(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Ex[n]).join("");for(;e.length>=ab;){let n=e.substring(0,ab);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function gn(t){let e=null;if(typeof t!="string"&&Au.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=ob(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Au.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==k9(t)&&Au.throwArgumentError("bad icap checksum","address",t),e=a9(t.substring(4));e.length<40;)e="0"+e;e=ob("0x"+e)}else Au.throwArgumentError("invalid address","address",t);return e}function mE(t){let e=null;try{e=gn(t.from)}catch{Au.throwArgumentError("missing from address","transaction",t)}const r=Lf(ct(Ee.from(t.nonce).toHexString()));return gn(kn(Yr(B1([e,r])),12))}let _9=class extends Lo{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=gn(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return gn(Ar(e.readValue().toHexString(),20))}},P9=class extends Lo{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};const Eu=new ie(b0);function yE(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return f||Eu.throwError("cannot encode object for signature with missing names",ie.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]&&Eu.throwError("cannot encode object for signature with duplicate names",ie.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]=!0,r[f]})}else Eu.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Eu.throwArgumentError("types/value length mismatch","tuple",r);let i=new Ey(t.wordSize),s=new Ey(t.wordSize),o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let p=i.writeUpdatableValue();o.push(y=>{p(y+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function xE(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(u){if(u.code===ie.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ie.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}let N9=class extends Lo{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Eu.throwError("insufficient data length",ie.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===ci.OVERRUN?r.length-e-1:0}function G9(t,e,r,n,i){return t===ci.OVERLONG?(n.push(i),0):(n.push(65533),AE(t,e,r))}const V9=Object.freeze({error:H9,ignore:AE,replace:G9});function EE(t,e){e==null&&(e=V9.error),t=ct(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(ci.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(ci.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(ci.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(ci.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(ci.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(ci.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function $s(t,e=Dh.current){e!=Dh.current&&(bE.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ct(r)}function Q9(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function A0(t,e){return Q9(EE(t,e))}function $9(t,e=Dh.current){return EE($s(t,e))}let K9=class extends vE{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,$s(r))}decode(e){return A0(super.decode(e))}},q0=class extends Lo{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return yE(e,this.coders,r)}decode(e){return e.coerce(this.name,xE(e,this.coders))}};const X0=new ie(b0),J9=new RegExp(/^bytes([0-9]*)$/),W9=new RegExp(/^(u?int)([0-9]*)$/);let Y9=class{constructor(e){Oe(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new _9(e.name);case"bool":return new R9(e.name);case"string":return new K9(e.name);case"bytes":return new T9(e.name);case"array":return new N9(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new q0((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new M9(e.name)}let r=e.type.match(W9);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&X0.throwArgumentError("invalid "+r[1]+" bit length","param",e),new z9(n/8,r[1]==="int",e.name)}if(r=e.type.match(J9),r){let n=parseInt(r[1]);return(n===0||n>32)&&X0.throwArgumentError("invalid bytes length","param",e),new I9(n,e.name)}return X0.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new w9(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Ey(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(js.from(i)));return new q0(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&X0.throwError("types/values length mismatch",ie.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(js.from(o))),i=new q0(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(js.from(o)));return new q0(i,"_").decode(this._getReader(ct(r),n))}};const q9=new Y9;function Su(t){return Yr($s(t))}const SE="hash/5.7.0";function FE(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function X9(t){const e={};for(let r=0;r>--l&1}const c=31,p=Math.pow(2,c),y=p>>>1,v=y>>1,b=p-1;let N=0;for(let z=0;z1;){let ne=T+D>>>1;z>>1|f(),G=G<<1^y,$=($^y)<<1|y|1;A=G,C=1+$-G}let F=n-4;return x.map(z=>{switch(z-F){case 3:return F+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return F+256+(t[a++]<<8|t[a++]);case 1:return F+t[a++];default:return z-1}})}function e_(t){let e=0;return()=>t[e++]}function t_(t){return e_(Z9(t))}function r_(t){return t&1?~t>>1:t>>1}function n_(t,e){let r=Array(t);for(let n=0;ne[o]):r}function s_(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(a_(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(l_(r,t))}return X9(kE(e))}function o_(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function _E(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function a_(t,e){let r=1+e(),n=e(),i=o_(e),s=_E(i.length,1+t,e);return kE(s.map((o,a)=>{const l=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((f,c)=>{let p=c*n;return[l+c*r,u.map(y=>y+p)]})}))}function l_(t,e){let r=1+e();return _E(r,1+t,e).map(i=>[i[0],i.slice(1)])}function u_(t){let e=Rp(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=Rp(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,f)=>f.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function f_(){return t_(FE("AEQF2AO2DEsA2wIrAGsBRABxAN8A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85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const U1=f_(),c_=new Set(Rp(U1)),h_=new Set(Rp(U1)),d_=s_(U1),p_=u_(U1),ub=45,fb=95;function PE(t){return $9(t)}function g_(t){return t.filter(e=>e!=65039)}function NE(t){for(let e of t.split(".")){let r=PE(e);try{for(let n=r.lastIndexOf(fb)-1;n>=0;n--)if(r[n]!==fb)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===ub&&r[3]===ub)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function m_(t){return NE(y_(t,g_))}function y_(t,e){let r=PE(t).reverse(),n=[];for(;r.length;){let i=v_(r);if(i){n.push(...e(i));continue}let s=r.pop();if(c_.has(s)){n.push(s);continue}if(h_.has(s))continue;let o=d_[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return NE(x_(String.fromCodePoint(...n)))}function x_(t){return t.normalize("NFC")}function v_(t,e){var r;let n=p_,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const w_=new ie(SE),RE=new Uint8Array(32);RE.fill(0);function cb(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function TE(t){const e=$s(m_(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(cb(e.slice(n))),r}function Bd(t){typeof t!="string"&&w_.throwArgumentError("invalid ENS name; not a string","name",t);let e=RE;const r=TE(t);for(;r.length;)e=Yr(pi([e,Yr(r.pop())]));return lt(e)}function b_(t){return lt(pi(TE(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var A_=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Sr=new ie(SE),IE=new Uint8Array(32);IE.fill(0);const E_=Ee.from(-1),ME=Ee.from(0),BE=Ee.from(1),S_=Ee.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function F_(t){const e=ct(t),r=e.length%32;return r?Xn([e,IE.slice(r)]):lt(e)}const C_=Ar(BE.toHexString(),32),k_=Ar(ME.toHexString(),32),hb={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},jg=["name","version","chainId","verifyingContract","salt"];function db(t){return function(e){return typeof e!="string"&&Sr.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const __={name:db("name"),version:db("version"),chainId:function(t){try{return Ee.from(t).toString()}catch{}return Sr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return gn(t).toLowerCase()}catch{}return Sr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=ct(t);if(e.length!==32)throw new Error("bad length");return lt(e)}catch{}return Sr.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Hg(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Sr.throwArgumentError("invalid numeric width","type",t);const i=S_.mask(r?n-1:n),s=r?i.add(BE).mul(E_):ME;return function(o){const a=Ee.from(o);return(a.lt(s)||a.gt(i))&&Sr.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),Ar(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Sr.throwArgumentError("invalid bytes width","type",t),function(n){return ct(n).length!==r&&Sr.throwArgumentError(`invalid length for ${t}`,"value",n),F_(n)}}}switch(t){case"address":return function(e){return Ar(gn(e),32)};case"bool":return function(e){return e?C_:k_};case"bytes":return function(e){return Yr(e)};case"string":return function(e){return Su(e)}}return null}function pb(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}let gb=class Wi{constructor(e){Oe(this,"types",Object.freeze(Ro(e))),Oe(this,"_encoderCache",{}),Oe(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&&Sr.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];f===a&&Sr.throwArgumentError(`circular type reference to ${JSON.stringify(f)}`,"types",e),!Hg(f)&&(n[f]||Sr.throwArgumentError(`unknown type ${JSON.stringify(f)}`,"types",e),n[f].push(a),r[a][f]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?Sr.throwArgumentError("missing primary type","types",e):s.length>1&&Sr.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Oe(this,"primaryType",s[0]);function o(a,l){l[a]&&Sr.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(f=>{i[f][u]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=pb(a,e[a])+l.map(u=>pb(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Hg(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&Sr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(Yr)),Yr(Xn(l))}}const n=this.types[e];if(n){const i=Su(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return this._types[l]?Yr(u):u});return o.unshift(i),Xn(o)}}return Sr.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Sr.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Yr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Hg(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&Sr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):Sr.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Wi(e)}static getPrimaryType(e){return Wi.from(e).primaryType}static hashStruct(e,r,n){return Wi.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=hb[n];i||Sr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>jg.indexOf(n.name)-jg.indexOf(i.name)),Wi.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Xn(["0x1901",Wi.hashDomain(e),Wi.from(r).hash(n)])}static hash(e,r,n){return Yr(Wi.encode(e,r,n))}static resolveNames(e,r,n,i){return A_(this,void 0,void 0,function*(){e=Xr(e);const s={};e.verifyingContract&&!dr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Wi.from(r);o.visit(n,(a,l)=>(a==="address"&&!dr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){Wi.hashDomain(e);const i={},s=[];jg.forEach(l=>{const u=e[l];u!=null&&(i[l]=__[l](u),s.push({name:l,type:hb[l]}))});const o=Wi.from(r),a=Xr(r);return a.EIP712Domain?Sr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return lt(ct(u));if(l.match(/^u?int/))return Ee.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&Sr.throwArgumentError("invalid string","value",u),u}return Sr.throwArgumentError("unsupported type","type",l)})}}};const Er=new ie(b0);let P_=class extends w0{},N_=class extends w0{},R_=class extends w0{},Fy=class extends w0{static isIndexed(e){return!!(e&&e._isIndexed)}};const T_={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function mb(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}let yb=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Oe(this,"fragments",r.map(n=>M1.from(n)).filter(n=>n!=null)),Oe(this,"_abiCoder",Us(new.target,"getAbiCoder")()),Oe(this,"functions",{}),Oe(this,"errors",{}),Oe(this,"events",{}),Oe(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Er.warn("duplicate definition - constructor");return}Oe(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){Er.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||Oe(this,"deploy",Pp.from({payable:!1,type:"constructor"})),Oe(this,"_isInterface",!0)}format(e){e||(e=hr.full),e===hr.sighash&&Er.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===hr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return q9}static getAddress(e){return gn(e)}static getSighash(e){return kn(Su(e.format()),0,4)}static getEventTopic(e){return Su(e.format())}getFunction(e){if(dr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Er.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Er.throwArgumentError("no matching function","name",n):i.length>1&&Er.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Np.fromString(e).format()];return r||Er.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(dr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Er.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Er.throwArgumentError("no matching event","name",n):i.length>1&&Er.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ay.fromString(e).format()];return r||Er.throwArgumentError("no matching event","signature",e),r}getError(e){if(dr(e)){const n=Us(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Er.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Er.throwArgumentError("no matching error","name",n):i.length>1&&Er.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Np.fromString(e).format()];return r||Er.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Us(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Us(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=ct(r);return lt(n.slice(0,4))!==this.getSighash(e)&&Er.throwArgumentError(`data signature does not match error ${e.name}.`,"data",lt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),lt(pi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=ct(r);return lt(n.slice(0,4))!==this.getSighash(e)&&Er.throwArgumentError(`data signature does not match function ${e.name}.`,"data",lt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),lt(pi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=ct(r),i=null,s="",o=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=lt(n.slice(0,4)),f=T_[u];if(f)o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,l=f.signature,f.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const c=this.getError(u);o=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.format()}catch{}break}}return Er.throwError("call revert exception"+s,ie.errors.CALL_EXCEPTION,{method:e.format(),data:lt(r),errorArgs:o,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),lt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Er.throwError("too many arguments for "+e.format(),ie.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?Su(o):s.type==="bytes"?Yr(lt(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=Ee.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),Ar(lt(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&Er.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?Er.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Er.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(Su(l));else if(o.type==="bytes")n.push(Yr(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let p=this.getEventTopic(e);(!dr(n[0],32)||n[0].toLowerCase()!==p)&&Er.throwError("fragment/topic mismatch",ie.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:p,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((p,y)=>{p.indexed?p.type==="string"||p.type==="bytes"||p.baseType==="tuple"||p.baseType==="array"?(i.push(js.fromObject({type:"bytes32",name:p.name})),o.push(!0)):(i.push(p),o.push(!1)):(s.push(p),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,pi(n)):null,l=this._abiCoder.decode(s,r,!0),u=[],f=0,c=0;e.inputs.forEach((p,y)=>{if(p.indexed)if(a==null)u[y]=new Fy({_isIndexed:!0,hash:null});else if(o[y])u[y]=new Fy({_isIndexed:!0,hash:a[c++]});else try{u[y]=a[c++]}catch(v){u[y]=v}else try{u[y]=l[f++]}catch(v){u[y]=v}if(p.name&&u[p.name]==null){const v=u[y];v instanceof Error?Object.defineProperty(u,p.name,{enumerable:!0,get:()=>{throw mb(`property ${JSON.stringify(p.name)}`,v)}}):u[p.name]=v}});for(let p=0;p{throw mb(`index ${p}`,y)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new N_({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Ee.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new P_({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=lt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new R_({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}};const I_="abstract-provider/5.7.0";var M_=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const B_=new ie(I_);class O_ extends w0{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class E0{constructor(){B_.checkAbstract(new.target,E0),Oe(this,"_isProvider",!0)}getFeeData(){return M_(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield Qr({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=Ee.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const U_="abstract-signer/5.7.0";var Ki=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ei=new ie(U_),D_=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],L_=[ie.errors.INSUFFICIENT_FUNDS,ie.errors.NONCE_EXPIRED,ie.errors.REPLACEMENT_UNDERPRICED];class sc{constructor(){Ei.checkAbstract(new.target,sc),Oe(this,"_isSigner",!0)}getBalance(e){return Ki(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Ki(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Ki(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield Qr(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Ki(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield Qr(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Ki(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Ki(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Ki(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Ki(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Ki(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)D_.indexOf(n)===-1&&Ei.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Xr(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Ei.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Ki(this,void 0,void 0,function*(){const r=yield Qr(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Ki(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Ei.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ei.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ei.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ei.throwError("network does not support EIP-1559",ie.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ei.throwError("failed to get consistent fee data",ie.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(L_.indexOf(i.code)>=0)throw i;return Ei.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ie.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Ei.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Qr(r)})}_checkProvider(e){this.provider||Ei.throwError("missing provider",ie.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class Lh extends sc{constructor(e,r){super(),Oe(this,"address",e),Oe(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ei.throwError(e,ie.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Lh(this.address,e)}}var OE={},er={},S0=UE;function UE(t,e){if(!t)throw new Error(e||"Assertion failed")}UE.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Cy={exports:{}};typeof Object.create=="function"?Cy.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Cy.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var z_=Cy.exports,j_=S0,H_=z_;er.inherits=H_;function G_(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function V_(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):G_(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}er.htonl=DE;function $_(t,e){for(var r="",n=0;n>>0}return s}er.join32=K_;function J_(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}er.split32=J_;function W_(t,e){return t>>>e|t<<32-e}er.rotr32=W_;function Y_(t,e){return t<>>32-e}er.rotl32=Y_;function q_(t,e){return t+e>>>0}er.sum32=q_;function X_(t,e,r){return t+e+r>>>0}er.sum32_3=X_;function Z_(t,e,r,n){return t+e+r+n>>>0}er.sum32_4=Z_;function eP(t,e,r,n,i){return t+e+r+n+i>>>0}er.sum32_5=eP;function tP(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}er.sum64=tP;function rP(t,e,r,n){var i=e+n>>>0,s=(i>>0}er.sum64_hi=rP;function nP(t,e,r,n){var i=e+n;return i>>>0}er.sum64_lo=nP;function iP(t,e,r,n,i,s,o,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}er.sum64_4_hi=iP;function sP(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}er.sum64_4_lo=sP;function oP(t,e,r,n,i,s,o,a,l,u){var f=0,c=e;c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0,f+=c>>0}er.sum64_5_hi=oP;function aP(t,e,r,n,i,s,o,a,l,u){var f=e+n+s+a+u;return f>>>0}er.sum64_5_lo=aP;function lP(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}er.rotr64_hi=lP;function uP(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}er.rotr64_lo=uP;function fP(t,e,r){return t>>>r}er.shr64_hi=fP;function cP(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}er.shr64_lo=cP;var oc={},xb=er,hP=S0;function D1(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}oc.BlockHash=D1;D1.prototype.update=function(e,r){if(e=xb.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=xb.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}qs.g0_256=yP;function xP(t){return Hs(t,17)^Hs(t,19)^t>>>10}qs.g1_256=xP;var zf=er,vP=oc,wP=qs,Gg=zf.rotl32,_c=zf.sum32,bP=zf.sum32_5,AP=wP.ft_1,VE=vP.BlockHash,EP=[1518500249,1859775393,2400959708,3395469782];function Ks(){if(!(this instanceof Ks))return new Ks;VE.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}zf.inherits(Ks,VE);var SP=Ks;Ks.blockSize=512;Ks.outSize=160;Ks.hmacStrength=80;Ks.padLength=64;Ks.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),cN(e.length<=this.blockSize);for(var r=e.length;r>8,p=f&255;c?l.push(c,p):l.push(p)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(p>>1)-1?b=(p>>1)-N:b=N,y.isubn(b)):b=0,c[v]=b,y.iushrn(1)}return c}r.getNAF=n;function i(l,u){var f=[[],[]];l=l.clone(),u=u.clone();for(var c=0,p=0,y;l.cmpn(-c)>0||u.cmpn(-p)>0;){var v=l.andln(3)+c&3,b=u.andln(3)+p&3;v===3&&(v=-1),b===3&&(b=-1);var N;v&1?(y=l.andln(7)+c&7,(y===3||y===5)&&b===2?N=-v:N=v):N=0,f[0].push(N);var x;b&1?(y=u.andln(7)+p&7,(y===3||y===5)&&v===2?x=-b:x=b):x=0,f[1].push(x),2*c===N+1&&(c=1-c),2*p===x+1&&(p=1-p),l.iushrn(1),u.iushrn(1)}return f}r.getJSF=i;function s(l,u,f){var c="_"+u;l.prototype[u]=function(){return this[c]!==void 0?this[c]:this[c]=f.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new zt(l,"hex","le")}r.intFromLE=a}),Tp=wi.getNAF,pN=wi.getJSF,Ip=wi.assert;function Ha(t,e){this.type=t,this.p=new zt(e.p,16),this.red=e.prime?zt.red(e.prime):zt.mont(this.p),this.zero=new zt(0).toRed(this.red),this.one=new zt(1).toRed(this.red),this.two=new zt(2).toRed(this.red),this.n=e.n&&new zt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Gl=Ha;Ha.prototype.point=function(){throw new Error("Not implemented")};Ha.prototype.validate=function(){throw new Error("Not implemented")};Ha.prototype._fixedNafMul=function(e,r){Ip(e.precomputed);var n=e._getDoubles(),i=Tp(r,1,this._bitLength),s=(1<=a;u--)l=(l<<1)+i[u];o.push(l)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var f=o[l];Ip(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Ha.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,f,c,p;for(f=0;f=1;f-=2){var v=f-1,b=f;if(o[v]!==1||o[b]!==1){l[v]=Tp(n[v],o[v],this._bitLength),l[b]=Tp(n[b],o[b],this._bitLength),u=Math.max(l[v].length,u),u=Math.max(l[b].length,u);continue}var N=[r[v],null,null,r[b]];r[v].y.cmp(r[b].y)===0?(N[1]=r[v].add(r[b]),N[2]=r[v].toJ().mixedAdd(r[b].neg())):r[v].y.cmp(r[b].y.redNeg())===0?(N[1]=r[v].toJ().mixedAdd(r[b]),N[2]=r[v].add(r[b].neg())):(N[1]=r[v].toJ().mixedAdd(r[b]),N[2]=r[v].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],A=pN(n[v],n[b]);for(u=Math.max(A[0].length,u),l[v]=new Array(u),l[b]=new Array(u),c=0;c=0;f--){for(var D=0;f>=0;){var G=!0;for(c=0;c=0&&D++,z=z.dblp(D),f<0)break;for(c=0;c0?p=a[c][$-1>>1]:$<0&&(p=a[c][-$-1>>1].neg()),p.type==="affine"?z=z.mixedAdd(p):z=z.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};Gi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(y=u,v=f),c.negative&&(c=c.neg(),p=p.neg()),y.negative&&(y=y.neg(),v=v.neg()),[{a:c,b:p},{a:y,b:v}]};Vi.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),u=s.mul(n.b),f=o.mul(i.b),c=e.sub(a).sub(l),p=u.add(f).neg();return{k1:c,k2:p}};Vi.prototype.pointFromX=function(e,r){e=new zt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Vi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Vi.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};on.prototype.isInfinity=function(){return this.inf};on.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};on.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};on.prototype.getX=function(){return this.x.fromRed()};on.prototype.getY=function(){return this.y.fromRed()};on.prototype.mul=function(e){return e=new zt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};on.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};on.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};on.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};on.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};on.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function mn(t,e,r,n){Gl.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new zt(0)):(this.x=new zt(e,16),this.y=new zt(r,16),this.z=new zt(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Fx(mn,Gl.BasePoint);Vi.prototype.jpoint=function(e,r,n){return new mn(this,e,r,n)};mn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};mn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};mn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),u=o.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=l.redSqr(),c=f.redMul(l),p=i.redMul(f),y=u.redSqr().redIAdd(c).redISub(p).redISub(p),v=u.redMul(p.redISub(y)).redISub(o.redMul(c)),b=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(y,v,b)};mn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=n.redMul(u),p=l.redSqr().redIAdd(f).redISub(c).redISub(c),y=l.redMul(c.redISub(p)).redISub(s.redMul(f)),v=this.z.redMul(a);return this.curve.jpoint(p,y,v)};mn.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};mn.prototype.inspect=function(){return this.isInfinity()?"":""};mn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Od=uc(function(t,e){var r=e;r.base=Gl,r.short=mN,r.mont=null,r.edwards=null}),Ud=uc(function(t,e){var r=e,n=wi.assert;function i(a){a.type==="short"?this.curve=new Od.short(a):a.type==="edwards"?this.curve=new Od.edwards(a):this.curve=new Od.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Fs.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Fs.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Fs.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Fs.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Fs.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Fs.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Fs.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Fs.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Ma(t){if(!(this instanceof Ma))return new Ma(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=fs.toArray(t.entropy,t.entropyEnc||"hex"),r=fs.toArray(t.nonce,t.nonceEnc||"hex"),n=fs.toArray(t.pers,t.persEnc||"hex");Sx(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var r4=Ma;Ma.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ma.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=fs.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var yN=wi.assert;function L1(t,e){if(t instanceof L1)return t;this._importDER(t,e)||(yN(t.r&&t.s,"Signature without r or s"),this.r=new zt(t.r,16),this.s=new zt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var z1=L1;function xN(){this.place=0}function $g(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Ab(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}L1.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Ab(r),n=Ab(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Kg(i,r.length),i=i.concat(r),i.push(2),Kg(i,n.length);var s=i.concat(n),o=[48];return Kg(o,s.length),o=o.concat(s),wi.encode(o,e)};var vN=function(){throw new Error("unsupported")},n4=wi.assert;function Hi(t){if(!(this instanceof Hi))return new Hi(t);typeof t=="string"&&(n4(Object.prototype.hasOwnProperty.call(Ud,t),"Unknown curve "+t),t=Ud[t]),t instanceof Ud.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var wN=Hi;Hi.prototype.keyPair=function(e){return new Cx(this,e)};Hi.prototype.keyFromPrivate=function(e,r){return Cx.fromPrivate(this,e,r)};Hi.prototype.keyFromPublic=function(e,r){return Cx.fromPublic(this,e,r)};Hi.prototype.genKeyPair=function(e){e||(e={});for(var r=new r4({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||vN(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new zt(2));;){var s=new zt(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Hi.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Hi.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new zt(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new r4({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new zt(1)),f=0;;f++){var c=i.k?i.k(f):new zt(l.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),!(c.cmpn(1)<=0||c.cmp(u)>=0)){var p=this.g.mul(c);if(!p.isInfinity()){var y=p.getX(),v=y.umod(this.n);if(v.cmpn(0)!==0){var b=c.invm(this.n).mul(v.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var N=(p.getY().isOdd()?1:0)|(y.cmp(v)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),N^=1),new z1({r:v,s:b,recoveryParam:N})}}}}}};Hi.prototype.verify=function(e,r,n,i){e=this._truncateToN(new zt(e,16)),n=this.keyFromPublic(n,i),r=new z1(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};Hi.prototype.recoverPubKey=function(t,e,r,n){n4((3&r)===r,"The recovery param is more than two bits"),e=new z1(e,n);var i=this.n,s=new zt(t),o=e.r,a=e.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var f=e.r.invm(i),c=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(c,o,p)};Hi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new z1(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var bN=uc(function(t,e){var r=e;r.version="6.5.4",r.utils=wi,r.rand=function(){throw new Error("unsupported")},r.curve=Od,r.curves=Ud,r.ec=wN,r.eddsa=null}),AN=bN.ec;const EN="signing-key/5.7.0",Ny=new ie(EN);let Jg=null;function Ts(){return Jg||(Jg=new AN("secp256k1")),Jg}let SN=class{constructor(e){Oe(this,"curve","secp256k1"),Oe(this,"privateKey",lt(e)),Tl(this.privateKey)!==32&&Ny.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Ts().keyFromPrivate(ct(this.privateKey));Oe(this,"publicKey","0x"+r.getPublic(!1,"hex")),Oe(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Oe(this,"_isSigningKey",!0)}_addPoint(e){const r=Ts().keyFromPublic(ct(this.publicKey)),n=Ts().keyFromPublic(ct(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Ts().keyFromPrivate(ct(this.privateKey)),n=ct(e);n.length!==32&&Ny.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return I1({recoveryParam:i.recoveryParam,r:Ar("0x"+i.r.toString(16),32),s:Ar("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Ts().keyFromPrivate(ct(this.privateKey)),n=Ts().keyFromPublic(ct(i4(e)));return Ar("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function FN(t,e){const r=I1(e),n={r:ct(r.r),s:ct(r.s)};return"0x"+Ts().recoverPubKey(ct(t),n,r.recoveryParam).encode("hex",!1)}function i4(t,e){const r=ct(t);if(r.length===32){const n=new SN(r);return e?"0x"+Ts().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?lt(r):"0x"+Ts().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Ts().keyFromPublic(r).getPublic(!0,"hex"):lt(r)}return Ny.throwArgumentError("invalid public or private key","key","[REDACTED]")}const CN="transactions/5.7.0",zo=new ie(CN);var Eb;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Eb||(Eb={}));function kx(t){return t==="0x"?null:gn(t)}function Pn(t){return t==="0x"?wE:Ee.from(t)}function kN(t){const e=i4(t);return gn(kn(Yr(kn(e,1)),12))}function s4(t,e){return kN(FN(ct(t),e))}function hi(t,e){const r=Lf(Ee.from(t).toHexString());return r.length>32&&zo.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Wg(t,e){return{address:gn(t),storageKeys:(e||[]).map((r,n)=>(Tl(r)!==32&&zo.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function fc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&zo.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Wg(r[0],r[1])):Wg(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Wg(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function o4(t){return fc(t).map(e=>[e.address,e.storageKeys])}function _N(t,e){if(t.gasPrice!=null){const n=Ee.from(t.gasPrice),i=Ee.from(t.maxFeePerGas||0);n.eq(i)||zo.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[hi(t.chainId||0,"chainId"),hi(t.nonce||0,"nonce"),hi(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),hi(t.maxFeePerGas||0,"maxFeePerGas"),hi(t.gasLimit||0,"gasLimit"),t.to!=null?gn(t.to):"0x",hi(t.value||0,"value"),t.data||"0x",o4(t.accessList||[])];if(e){const n=I1(e);r.push(hi(n.recoveryParam,"recoveryParam")),r.push(Lf(n.r)),r.push(Lf(n.s))}return Xn(["0x02",B1(r)])}function PN(t,e){const r=[hi(t.chainId||0,"chainId"),hi(t.nonce||0,"nonce"),hi(t.gasPrice||0,"gasPrice"),hi(t.gasLimit||0,"gasLimit"),t.to!=null?gn(t.to):"0x",hi(t.value||0,"value"),t.data||"0x",o4(t.accessList||[])];if(e){const n=I1(e);r.push(hi(n.recoveryParam,"recoveryParam")),r.push(Lf(n.r)),r.push(Lf(n.s))}return Xn(["0x01",B1(r)])}function a4(t,e,r){try{const n=Pn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{zo.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Ar(e[1],32),t.s=Ar(e[2],32);try{const n=Yr(r(t));t.from=s4(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function NN(t){const e=O1(t.slice(1));e.length!==9&&e.length!==12&&zo.throwArgumentError("invalid component count for transaction type: 2","payload",lt(t));const r=Pn(e[2]),n=Pn(e[3]),i={type:2,chainId:Pn(e[0]).toNumber(),nonce:Pn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Pn(e[4]),to:kx(e[5]),value:Pn(e[6]),data:e[7],accessList:fc(e[8])};return e.length===9||(i.hash=Yr(t),a4(i,e.slice(9),_N)),i}function RN(t){const e=O1(t.slice(1));e.length!==8&&e.length!==11&&zo.throwArgumentError("invalid component count for transaction type: 1","payload",lt(t));const r={type:1,chainId:Pn(e[0]).toNumber(),nonce:Pn(e[1]).toNumber(),gasPrice:Pn(e[2]),gasLimit:Pn(e[3]),to:kx(e[4]),value:Pn(e[5]),data:e[6],accessList:fc(e[7])};return e.length===8||(r.hash=Yr(t),a4(r,e.slice(8),PN)),r}function TN(t){const e=O1(t);e.length!==9&&e.length!==6&&zo.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Pn(e[0]).toNumber(),gasPrice:Pn(e[1]),gasLimit:Pn(e[2]),to:kx(e[3]),value:Pn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=Ee.from(e[6]).toNumber()}catch{return r}if(r.r=Ar(e[7],32),r.s=Ar(e[8],32),Ee.from(r.r).isZero()&&Ee.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(lt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Yr(B1(i));try{r.from=s4(s,{r:lt(r.r),s:lt(r.s),recoveryParam:n})}catch{}r.hash=Yr(t)}return r.type=null,r}function IN(t){const e=ct(t);if(e[0]>127)return TN(e);switch(e[0]){case 1:return RN(e);case 2:return NN(e)}return zo.throwError(`unsupported transaction type: ${e[0]}`,ie.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const MN="contracts/5.7.0";var Bl=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Hr=new ie(MN);function Mp(t,e){return Bl(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&Hr.throwArgumentError("invalid address or ENS name","name",r);try{return gn(r)}catch{}t||Hr.throwError("a provider or signer is needed to resolve ENS names",ie.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&Hr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Dd(t,e,r){return Bl(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Dd(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield Mp(t,e):r.type==="tuple"?yield Dd(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Dd(t,n,r.arrayChildren))):Promise.reject(Hr.makeError("invalid value for array",ie.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function j1(t,e,r){return Bl(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Xr(r.pop())),Hr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=Qr({override:Mp(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>Bl(this,void 0,void 0,function*(){return gn(u.signer)!==u.override&&Hr.throwError("Contract with a Signer cannot override from",ie.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=Mp(t.provider,n.from));const i=yield Qr({args:Dd(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Qr(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=Ee.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=Ee.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=Ee.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=Ee.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=Ee.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=fc(a.accessList)),o.gasLimit==null&&e.gas!=null){let u=21e3;const f=ct(s);for(let c=0;cn[u]!=null);return l.length&&Hr.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,ie.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function BN(t,e){return function(...r){return j1(t,e,r)}}function ON(t,e){const r=t.signer||t.provider;return function(...n){return Bl(this,void 0,void 0,function*(){r||Hr.throwError("estimate require a provider or signer",ie.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield j1(t,e,n);return yield r.estimateGas(i)})}}function UN(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=Ro(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function l4(t,e,r){const n=t.signer||t.provider;return function(...i){return Bl(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Xr(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield j1(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===ie.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function DN(t,e){return function(...r){return Bl(this,void 0,void 0,function*(){t.signer||Hr.throwError("sending a transaction requires a signer",ie.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield j1(t,e,r),i=yield t.signer.sendTransaction(n);return UN(t,i),i})}}function Sb(t,e,r){return e.constant?l4(t,e,r):DN(t,e)}function u4(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class zh{constructor(e,r){Oe(this,"tag",e),Oe(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class LN extends zh{constructor(){super("error",null)}}class Fb extends zh{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&Hr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(u4(s),s),Oe(this,"address",e),Oe(this,"interface",r),Oe(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=v9(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class Cb extends zh{constructor(e,r){super("*",{address:e}),Oe(this,"address",e),Oe(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}let zN=class{constructor(e,r,n){Oe(this,"interface",Us(new.target,"getInterface")(r)),n==null?(Oe(this,"provider",null),Oe(this,"signer",null)):sc.isSigner(n)?(Oe(this,"provider",n.provider||null),Oe(this,"signer",n)):E0.isProvider(n)?(Oe(this,"provider",n),Oe(this,"signer",null)):Hr.throwArgumentError("invalid signer or provider","signerOrProvider",n),Oe(this,"callStatic",{}),Oe(this,"estimateGas",{}),Oe(this,"functions",{}),Oe(this,"populateTransaction",{}),Oe(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];Oe(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?Oe(this.filters,a,this.filters[l[0]]):Hr.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(Oe(this,"_runningEvents",{}),Oe(this,"_wrappedEmits",{}),e==null&&Hr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Oe(this,"address",e),this.provider)Oe(this,"resolvedAddress",Mp(this.provider,e));else try{Oe(this,"resolvedAddress",Promise.resolve(gn(e)))}catch{Hr.throwError("provider is required to use ENS name as contract address",ie.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){Hr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&Oe(this,o,Sb(this,a,!0)),this.functions[o]==null&&Oe(this.functions,o,Sb(this,a,!1)),this.callStatic[o]==null&&Oe(this.callStatic,o,l4(this,a,!0)),this.populateTransaction[o]==null&&Oe(this.populateTransaction,o,BN(this,a)),this.estimateGas[o]==null&&Oe(this.estimateGas,o,ON(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&Oe(this,o,this[l])}catch{}this.functions[o]==null&&Oe(this.functions,o,this.functions[l]),this.callStatic[o]==null&&Oe(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&Oe(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&Oe(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return mE(e)}static getInterface(e){return yb.isInterface(e)?e:new yb(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&Hr.throwError("contract not deployed",ie.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Hr.throwError("sending a transactions require a signer",ie.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Xr(e||{});return["from","to"].forEach(function(n){r[n]!=null&&Hr.throwError("cannot override "+n,ie.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new Lh(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Oe(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Fy.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new LN);if(e==="event")return this._normalizeRunningEvent(new zh("event",null));if(e==="*")return this._normalizeRunningEvent(new Cb(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new Fb(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new Fb(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new zh(u4(r),r))}return this._normalizeRunningEvent(new Cb(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Ro(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||Hr.throwError("events require a provider or a signer with a provider",ie.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Xr(i.filter);return typeof r=="string"&&dr(r,32)?(n!=null&&Hr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}},jN=class extends zN{};class f4{constructor(e){Oe(this,"alphabet",e),Oe(this,"base",e.length),Oe(this,"_alphabetMap",{}),Oe(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:ct(new Uint8Array(i))}})}var JN=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Yi=new ie(QN);function Tb(t){return new Promise(e=>{setTimeout(e,t)})}function Qo(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Df(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return A0(t)}catch{}return lt(t)}return t}function WN(t){return $s(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function YN(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Yi.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Yi.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let f=!1,c=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&Yi.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(c=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&Yi.throwError("basic authentication requires a secure https url",ie.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+CE($s(x))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=Xr(t.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=l?l.match(p):null;if(y)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?FE(y[3]):WN(y[3])};let A=x.body;return r&&(A=r(x.body,x)),Promise.resolve(A)}catch(x){Yi.throwError("processing response error",ie.errors.SERVER_ERROR,{body:Qo(y[1],y[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const v={};Object.keys(a).forEach(x=>{const A=a[x];v[A.key]=A.value}),u.headers=v;const b=function(){let x=null;return{promise:new Promise(function(F,z){c&&(x=setTimeout(()=>{x!=null&&(x=null,z(Yi.makeError("timeout",ie.errors.TIMEOUT,{requestBody:Qo(u.body,v["content-type"]),requestMethod:u.method,timeout:c,url:l})))},c))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),N=function(){return JN(this,void 0,void 0,function*(){for(let x=0;x=300)&&(b.cancel(),Yi.throwError("bad response",ie.errors.SERVER_ERROR,{status:A.statusCode,headers:A.headers,body:Qo(C,A.headers?A.headers["content-type"]:null),requestBody:Qo(u.body,v["content-type"]),requestMethod:u.method,url:l})),r)try{const F=yield r(C,A);return b.cancel(),F}catch(F){if(F.throttleRetry&&x{let a=null;if(s!=null)try{a=JSON.parse(A0(s))}catch(l){Yi.throwError("invalid JSON",ie.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=$s(e);const s=typeof t=="string"?{url:t}:Xr(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Xr(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return YN(t,i,n)}function zc(t,e){return e||(e={}),e=Xr(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let c=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));ce.ceiling&&(c=e.ceiling),setTimeout(u,c)}return null},function(f){o()&&n(f)})}u()})}var Op="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Ty={};for(var td=0;td>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function c4(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=ju(e)^n>>5}for(e=ju(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=c4(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=ju(n)^o,i+=Op.charAt(o)}for(s=0;s<6;++s)n=ju(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Op.charAt(a)}return i}function h4(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=c4(s);if(typeof a=="string")return a;for(var l=[],u=0;u=o.length)&&l.push(c)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function XN(){var t=h4.apply(null,arguments);if(typeof t=="object")return t}function ZN(t){var e=h4.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function H1(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(c,!0);return e.transaction={hash:o,type:u,accessList:at.allowNull(this.accessList.bind(this),null),blockHash:at.allowNull(o,null),blockNumber:at.allowNull(l,null),transactionIndex:at.allowNull(l,null),confirmations:at.allowNull(l,null),from:r,gasPrice:at.allowNull(n),maxPriorityFeePerGas:at.allowNull(n),maxFeePerGas:at.allowNull(n),gasLimit:n,to:at.allowNull(r,null),value:n,nonce:l,data:s,r:at.allowNull(this.uint256),s:at.allowNull(this.uint256),v:at.allowNull(l),creates:at.allowNull(r,null),raw:at.allowNull(s)},e.transactionRequest={from:at.allowNull(r),nonce:at.allowNull(l),gasLimit:at.allowNull(n),gasPrice:at.allowNull(n),maxPriorityFeePerGas:at.allowNull(n),maxFeePerGas:at.allowNull(n),to:at.allowNull(r),value:at.allowNull(n),data:at.allowNull(f),type:at.allowNull(l),accessList:at.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:at.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:at.allowNull(this.address,null),from:at.allowNull(this.address,null),contractAddress:at.allowNull(r,null),transactionIndex:l,root:at.allowNull(a),gasUsed:n,logsBloom:at.allowNull(s),blockHash:o,transactionHash:o,logs:at.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:at.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:at.allowNull(n),status:at.allowNull(l),type:u},e.block={hash:at.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:at.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:at.allowNull(r),extraData:s,transactions:at.allowNull(at.arrayOf(o)),baseFeePerGas:at.allowNull(n)},e.blockWithTransactions=Xr(e.block),e.blockWithTransactions.transactions=at.allowNull(at.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:at.allowNull(i,void 0),toBlock:at.allowNull(i,void 0),blockHash:at.allowNull(o,void 0),address:at.allowNull(r,void 0),topics:at.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:at.allowNull(l),blockHash:at.allowNull(o),transactionIndex:l,removed:at.allowNull(this.boolean.bind(this)),address:r,data:at.allowFalsish(s,"0x"),topics:at.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return fc(e||[])}number(e){return e==="0x"?0:Ee.from(e).toNumber()}type(e){return e==="0x"||e==null?0:Ee.from(e).toNumber()}bigNumber(e){return Ee.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),dr(e))?e.toLowerCase():Nc.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return gn(e)}callAddress(e){if(!dr(e,32))return null;const r=gn(kn(e,12));return r===B9?null:r}contractAddress(e){return mE(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||dr(e))return wx(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Tl(n)!==32?Nc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=Ee.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!dr(e))throw new Error("invalid uint256");return Ar(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=at.check(r,e);return i._difficulty=n==null?null:Ee.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return at.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&Ee.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=at.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;dr(n)&&(n=Ee.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),dr(n)&&(n=Ee.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return IN(e)}receiptLog(e){return at.check(this.formats.receiptLog,e)}receipt(e){const r=at.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=Ee.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&Nc.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Nc.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Nc.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return at.check(this.formats.filter,e)}filterLog(e){return at.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var Ut=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Kt=new ie(G1),sR=10;function Mb(t){return t==null?"null":(Tl(t)!==32&&Kt.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Bb(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[Mb(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Mb(e)}).join("&")}function oR(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Yl(t){if(typeof t=="string"){if(t=t.toLowerCase(),Tl(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+Bb(t);if(O_.isForkEvent(t))throw Kt.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+Bb(t.topics||[])}throw new Error("invalid event - "+t)}function Rc(){return new Date().getTime()}function Ob(t){return new Promise(e=>{setTimeout(e,t)})}const aR=["block","network","pending","poll"];let lR=class{constructor(e,r,n){Oe(this,"tag",e),Oe(this,"listener",r),Oe(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=oR(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||aR.indexOf(this.tag)>=0}};const uR={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function qg(t){return Ar(Ee.from(t).toHexString(),32)}function Ub(t){return Ry.encode(pi([t,kn(kb(kb(t)),0,4)]))}const d4=new RegExp("^(ipfs)://(.*)$","i"),Db=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),d4,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ld(t,e){try{return A0(jh(t,e))}catch{}return null}function jh(t,e){if(t==="0x")return null;const r=Ee.from(kn(t,e,e+32)).toNumber(),n=Ee.from(kn(t,r,r+32)).toNumber();return kn(t,r+32,r+32+n)}function Xg(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Kt.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Lb(t){const e=ct(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function fR(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function p4(t){const e=[];let r=0;for(let n=0;nEe.from(e).eq(1)).catch(e=>{if(e.code===ie.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Ut(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Xn([e,Bd(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Xn(["0x9061b923",p4([b_(this.name),n.data])]));try{let s=yield this.provider.call(n);return ct(s).length%32===4&&Kt.throwError("resolver threw error",ie.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=jh(s,0)),s}catch(s){if(s.code===ie.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Ut(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?jh(n,0):null})}_getAddress(e,r){const n=uR[String(e)];if(n==null&&Kt.throwError(`unsupported coin type: ${e}`,ie.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=ct(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Ub(pi([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Ub(pi([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=Ib.toWords(i.slice(2));return a.unshift(o),Ib.encode(n.prefix,a)}}return null}getAddress(e){return Ut(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===L9?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ie.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",qg(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Kt.throwError("invalid or unsupported coin data",ie.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Ut(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return Kt.throwError("invalid or unsupported content hash data",ie.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Ut(this,void 0,void 0,function*(){let r=$s(e);r=pi([qg(64),qg(r.length),r]),r.length%32!==0&&(r=pi([r,Ar("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",lt(r));return n==null||n==="0x"?null:A0(n)})}}let Zg=null,cR=1;class hR extends E0{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Oe(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Us(new.target,"getNetwork")(e);r?(Oe(this,"_network",r),this.emit("network",r,null)):Kt.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Ut(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Kt.throwError("no network detected",ie.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:Oe(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return zc(()=>this._ready().then(e=>e,e=>{if(!(e.code===ie.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return Zg==null&&(Zg=new at),Zg}static getNetwork(e){return VN(e??"homestead")}ccipReadFetch(e,r,n){return Ut(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),c=yield _x({url:u,errorPassThrough:!0},f,(y,v)=>(y.status=v.statusCode,y));if(c.data)return c.data;const p=c.message||"unknown error";if(c.status>=400&&c.status<500)return Kt.throwError(`response not found during CCIP fetch: ${p}`,ie.errors.SERVER_ERROR,{url:l,errorMessage:p});o.push(p)}return Kt.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ie.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Ut(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(Rc()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=Rc(),n=Qr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=Rc();return i=Ee.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Ut(this,void 0,void 0,function*(){const e=cR++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Kt.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Kt.makeError("network block skew detected",ie.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Ut(this,void 0,void 0,function*(){return Kt.throwError("provider does not support network detection",ie.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Ut(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield Ob(0),this._network;const n=Kt.makeError("underlying network changed",ie.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=Rc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Ut(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Ut(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let u=!1;const f=function(){return u?!0:(u=!0,l.forEach(p=>{p()}),!1)},c=p=>{p.confirmations{this.removeListener(e,c)}),i){let p=i.startBlock,y=null;const v=b=>Ut(this,void 0,void 0,function*(){u||(yield Ob(1e3),this.getTransactionCount(i.from).then(N=>Ut(this,void 0,void 0,function*(){if(!u){if(N<=i.nonce)p=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(y==null&&(y=p-3,y{u||this.once("block",v)}))});if(u)return;this.once("block",v),l.push(()=>{this.removeListener("block",v)})}if(typeof n=="number"&&n>0){const p=setTimeout(()=>{f()||a(Kt.makeError("timeout exceeded",ie.errors.TIMEOUT,{timeout:n}))},n);p.unref&&p.unref(),l.push(()=>{clearTimeout(p)})}})})}getBlockNumber(){return Ut(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Ee.from(e)}catch(r){return Kt.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return Ee.from(i)}catch(s){return Kt.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return Ee.from(i).toNumber()}catch(s){return Kt.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return lt(i)}catch(s){return Kt.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>wx(o))}),s=yield this.perform("getStorageAt",i);try{return lt(s)}catch(o){return Kt.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Tl(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Kt.throwError("Transaction hash mismatch from Provider.sendTransaction.",ie.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Ut(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Kt.throwError("transaction failed",ie.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>lt(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Ut(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Ee.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?lt(s):null))}),this.formatter.transactionRequest(yield Qr(n))})}_getFilter(e){return Ut(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield Qr(r))})}_call(e,r,n){return Ut(this,void 0,void 0,function*(){n>=sR&&Kt.throwError("CCIP read exceeded maximum redirections",ie.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Tl(s)%32===4)try{const o=kn(s,4),a=kn(o,0,32);Ee.from(a).eq(i)||Kt.throwError("CCIP Read sender did not match",ie.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],u=Ee.from(kn(o,32,64)).toNumber(),f=Ee.from(kn(o,u,u+32)).toNumber(),c=kn(o,u+32);for(let x=0;xUt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return zc(()=>Ut(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return zc(()=>Ut(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Qr({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),at.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Ut(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Ut(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Kt.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Ut(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new zb(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Ut(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Kt.throwError("network does not support ENS",ie.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Bd(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Ut(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(dr(e))throw n}typeof e!="string"&&Kt.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Ut(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Ld(yield this.call({to:n,data:"0x691f3431"+Bd(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Ut(this,void 0,void 0,function*(){let r=null;if(dr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new zb(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ie.errors.CALL_EXCEPTION)throw a}try{const a=Ld(yield this.call({to:o,data:"0x691f3431"+Bd(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ie.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Kt.throwError(e+" not implemented",ie.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new lR(Yl(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Yl(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Yl(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Yl(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Yl(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Yl(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var ro=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const $r=new ie(G1),dR=["call","estimateGas"];function lh(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=dr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=lh(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return lh(JSON.parse(t),e)}catch{}return null}function g4(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=lh(e,!0);if(s)return s.data;$r.throwError("missing revert data in call exception; Transaction reverted without a reason string",ie.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=lh(e.body,!1);s==null&&(s=lh(e,!1)),s&&$r.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ie.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ie.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&$r.throwError("insufficient funds for intrinsic transaction cost",ie.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&$r.throwError("nonce has already been used",ie.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&$r.throwError("replacement fee too low",ie.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&$r.throwError("legacy pre-eip-155 transactions not supported",ie.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),dR.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&$r.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ie.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function jb(t){return new Promise(function(e){setTimeout(e,t)})}function pR(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Tc(t){return t&&t.toLowerCase()}const Iy={};class m4 extends sc{constructor(e,r,n){if(super(),e!==Iy)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Oe(this,"provider",r),n==null&&(n=0),typeof n=="string"?(Oe(this,"_address",this.provider.formatter.address(n)),Oe(this,"_index",null)):typeof n=="number"?(Oe(this,"_index",n),Oe(this,"_address",null)):$r.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return $r.throwError("cannot alter JSON-RPC Signer connection",ie.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new gR(Iy,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&$r.throwError("unknown account #"+this._index,ie.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Xr(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Xr(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>ro(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&$r.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),Qr({tx:Qr(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&$r.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&$r.throwError("user rejected transaction",ie.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),g4("sendTransaction",o,s)))})}signTransaction(e){return $r.throwError("signing transactions is unsupported",ie.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ro(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield zc(()=>ro(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return ro(this,void 0,void 0,function*(){const r=typeof e=="string"?$s(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[lt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&$r.throwError("user rejected signing",ie.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return ro(this,void 0,void 0,function*(){const r=typeof e=="string"?$s(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),lt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&$r.throwError("user rejected signing",ie.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return ro(this,void 0,void 0,function*(){const i=yield gb.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(gb.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&$r.throwError("user rejected signing",ie.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return ro(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class gR extends m4{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const mR={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Px extends hR{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Us(this.constructor,"defaultUrl")()),typeof e=="string"?Oe(this,"connection",Object.freeze({url:e})):Oe(this,"connection",Object.freeze(Xr(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ro(this,void 0,void 0,function*(){yield jb(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Us(this.constructor,"getNetwork");try{return r(Ee.from(e).toNumber())}catch(n){return $r.throwError("could not detect network",ie.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return $r.throwError("could not detect network",ie.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new m4(Iy,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ro(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=_x(this.connection,JSON.stringify(n),pR).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Tc(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Tc(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Tc(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Tc(r.address),Ar(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Us(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Us(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Tc(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return ro(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&Ee.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Xr(r),r.transaction=Xr(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&$r.throwError(e+" not implemented",ie.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return g4(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return jb(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Xr(mR);if(r)for(const s in r)r[s]&&(n[s]=!0);c9(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=wx(Ee.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=lt(e[s]))}),e.accessList&&(i.accessList=fc(e.accessList)),i}}const Hb=new ie(G1);let yR=1;function Gb(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:yR++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Ro(s),provider:this}),e(s,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:u,provider:this}),u.error){const f=new Error(u.error.message);return f.code=u.error.code,f.data=u.error.data,a(f)}o(u.result)})})}}function xR(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Ro(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class y4 extends Px{constructor(e,r){e==null&&Hb.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=xR(e)):e.sendAsync?i=Gb(e,e.sendAsync.bind(e)):e.send?i=Gb(e,e.send.bind(e)):Hb.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),Oe(this,"jsonRpcFetchFunc",i),Oe(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const vR="units/5.7.0",wR=new ie(vR),x4=["wei","kwei","mwei","gwei","szabo","finney","ether"];function bR(t,e){if(typeof e=="string"){const r=x4.indexOf(e);r!==-1&&(e=3*r)}return Id(t,e??18)}function jc(t,e){if(typeof t!="string"&&wR.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=x4.indexOf(e);r!==-1&&(e=3*r)}return Es(t,e??18)}function AR(t){return bR(t,18)}const ER="modulepreload",SR=function(t){return"/wrose-authzn/"+t},Vb={},FR=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=SR(s),s in Vb)return;Vb[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const c=i[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":ER,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},CR=["string","number","bigint","symbol"],kR=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function _R(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(CR.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(PR(t))return"Buffer";const r=NR(t);return r||"Object"}function PR(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function NR(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(kR.includes(e))return e}class be{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}be.uint=new be(0,"uint",!0);be.negint=new be(1,"negint",!0);be.bytes=new be(2,"bytes",!0);be.string=new be(3,"string",!0);be.array=new be(4,"array",!1);be.map=new be(5,"map",!1);be.tag=new be(6,"tag",!1);be.float=new be(7,"float",!0);be.false=new be(7,"false",!0);be.true=new be(7,"true",!0);be.null=new be(7,"null",!0);be.undefined=new be(7,"undefined",!0);be.break=new be(7,"break",!0);class At{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const cc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",RR=new TextDecoder,TR=new TextEncoder;function Up(t){return cc&&globalThis.Buffer.isBuffer(t)}function v4(t){return t instanceof Uint8Array?Up(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const IR=cc?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):$b(t,e,r):(t,e,r)=>r-e>64?RR.decode(t.subarray(e,r)):$b(t,e,r),MR=cc?t=>t.length>64?globalThis.Buffer.from(t):Qb(t):t=>t.length>64?TR.encode(t):Qb(t),Zs=t=>Uint8Array.from(t),Nx=cc?(t,e,r)=>Up(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),BR=cc?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),v4(globalThis.Buffer.concat(t,e))):(t,e)=>{const r=new Uint8Array(e);let n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},OR=cc?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function UR(t,e){if(Up(t)&&Up(e))return t.compare(e);for(let r=0;r55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function $b(t,e,r){const n=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=r){let a,l,u,f;switch(o){case 1:i<128&&(s=i);break;case 2:a=t[e+1],(a&192)===128&&(f=(i&31)<<6|a&63,f>127&&(s=f));break;case 3:a=t[e+1],l=t[e+2],(a&192)===128&&(l&192)===128&&(f=(i&15)<<12|(a&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:a=t[e+1],l=t[e+2],u=t[e+3],(a&192)===128&&(l&192)===128&&(u&192)===128&&(f=(i&15)<<18|(a&63)<<12|(l&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=o}return DR(n)}const Kb=4096;function DR(t){const e=t.length;if(e<=Kb)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=Nx(n,0,this.cursor)}else r=BR(this.chunks,this.cursor);return e&&this.reset(),r}}const Xt="CBOR decode error:",b4="CBOR encode error:";function hc(t,e,r){if(t.length-e>>8,n&255])}else if(r>>24&255,n>>>16&255,n>>>8&255,n&255])}else{const n=BigInt(r);if(n>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,t.push(i)}else throw new Error(`${Xt} encountered BigInt larger than allowable range`)}}Jl.encodedSize=function(e){return Qi.encodedSize(e.value)};Qi.encodedSize=function(e){return er.value?1:0};function VR(t,e,r,n){return new At(be.negint,-1-Vl(t,e+1,n),2)}function QR(t,e,r,n){return new At(be.negint,-1-Ql(t,e+1,n),3)}function $R(t,e,r,n){return new At(be.negint,-1-$l(t,e+1,n),5)}const Rx=BigInt(-1),A4=BigInt(1);function KR(t,e,r,n){const i=Kl(t,e+1,n);if(typeof i!="bigint"){const s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new At(be.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Xt} integers outside of the safe integer range are not supported`);return new At(be.negint,Rx-BigInt(i),9)}function Tx(t,e){const r=e.value,n=typeof r=="bigint"?r*Rx-A4:r*-1-1;Qi(t,e.type.majorEncoded,n)}Tx.encodedSize=function(e){const r=e.value,n=typeof r=="bigint"?r*Rx-A4:r*-1-1;return nr.value?-1:0};function F0(t,e,r,n){hc(t,e,r+n);const i=Nx(t,e+r,e+r+n);return new At(be.bytes,i,r+n)}function JR(t,e,r,n){return F0(t,e,1,r)}function WR(t,e,r,n){return F0(t,e,2,Vl(t,e+1,n))}function YR(t,e,r,n){return F0(t,e,3,Ql(t,e+1,n))}function qR(t,e,r,n){return F0(t,e,5,$l(t,e+1,n))}function XR(t,e,r,n){const i=Kl(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer bytes lengths not supported`);return F0(t,e,9,i)}function Dp(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===be.string?MR(t.value):t.value),t.encodedBytes}function V1(t,e){const r=Dp(e);Qi(t,e.type.majorEncoded,r.length),t.push(r)}V1.encodedSize=function(e){const r=Dp(e);return Qi.encodedSize(r.length)+r.length};V1.compareTokens=function(e,r){return ZR(Dp(e),Dp(r))};function ZR(t,e){return t.lengthe.length?1:UR(t,e)}function C0(t,e,r,n,i){const s=r+n;hc(t,e,s);const o=new At(be.string,IR(t,e+r,e+s),s);return i.retainStringBytes===!0&&(o.byteValue=Nx(t,e+r,e+s)),o}function eT(t,e,r,n){return C0(t,e,1,r,n)}function tT(t,e,r,n){return C0(t,e,2,Vl(t,e+1,n),n)}function rT(t,e,r,n){return C0(t,e,3,Ql(t,e+1,n),n)}function nT(t,e,r,n){return C0(t,e,5,$l(t,e+1,n),n)}function iT(t,e,r,n){const i=Kl(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer string lengths not supported`);return C0(t,e,9,i,n)}const sT=V1;function dc(t,e,r,n){return new At(be.array,n,r)}function oT(t,e,r,n){return dc(t,e,1,r)}function aT(t,e,r,n){return dc(t,e,2,Vl(t,e+1,n))}function lT(t,e,r,n){return dc(t,e,3,Ql(t,e+1,n))}function uT(t,e,r,n){return dc(t,e,5,$l(t,e+1,n))}function fT(t,e,r,n){const i=Kl(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer array lengths not supported`);return dc(t,e,9,i)}function cT(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Xt} indefinite length items not allowed`);return dc(t,e,1,1/0)}function Ix(t,e){Qi(t,be.array.majorEncoded,e.value)}Ix.compareTokens=Jl.compareTokens;Ix.encodedSize=function(e){return Qi.encodedSize(e.value)};function pc(t,e,r,n){return new At(be.map,n,r)}function hT(t,e,r,n){return pc(t,e,1,r)}function dT(t,e,r,n){return pc(t,e,2,Vl(t,e+1,n))}function pT(t,e,r,n){return pc(t,e,3,Ql(t,e+1,n))}function gT(t,e,r,n){return pc(t,e,5,$l(t,e+1,n))}function mT(t,e,r,n){const i=Kl(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer map lengths not supported`);return pc(t,e,9,i)}function yT(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Xt} indefinite length items not allowed`);return pc(t,e,1,1/0)}function Mx(t,e){Qi(t,be.map.majorEncoded,e.value)}Mx.compareTokens=Jl.compareTokens;Mx.encodedSize=function(e){return Qi.encodedSize(e.value)};function xT(t,e,r,n){return new At(be.tag,r,1)}function vT(t,e,r,n){return new At(be.tag,Vl(t,e+1,n),2)}function wT(t,e,r,n){return new At(be.tag,Ql(t,e+1,n),3)}function bT(t,e,r,n){return new At(be.tag,$l(t,e+1,n),5)}function AT(t,e,r,n){return new At(be.tag,Kl(t,e+1,n),9)}function Bx(t,e){Qi(t,be.tag.majorEncoded,e.value)}Bx.compareTokens=Jl.compareTokens;Bx.encodedSize=function(e){return Qi.encodedSize(e.value)};const ET=20,ST=21,FT=22,CT=23;function kT(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${Xt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new At(be.null,null,1):new At(be.undefined,void 0,1)}function _T(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Xt} indefinite length items not allowed`);return new At(be.break,void 0,1)}function Ox(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${Xt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${Xt} Infinity values are not supported`)}return new At(be.float,t,e)}function PT(t,e,r,n){return Ox(Dx(t,e+1),3,n)}function NT(t,e,r,n){return Ox(Lx(t,e+1),5,n)}function RT(t,e,r,n){return Ox(C4(t,e+1),9,n)}function Ux(t,e,r){const n=e.value;if(n===!1)t.push([be.float.majorEncoded|ET]);else if(n===!0)t.push([be.float.majorEncoded|ST]);else if(n===null)t.push([be.float.majorEncoded|FT]);else if(n===void 0)t.push([be.float.majorEncoded|CT]);else{let i,s=!1;(!r||r.float64!==!0)&&(S4(n),i=Dx(qi,1),n===i||Number.isNaN(n)?(qi[0]=249,t.push(qi.slice(0,3)),s=!0):(F4(n),i=Lx(qi,1),n===i&&(qi[0]=250,t.push(qi.slice(0,5)),s=!0))),s||(TT(n),i=C4(qi,1),qi[0]=251,t.push(qi.slice(0,9)))}}Ux.encodedSize=function(e,r){const n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){S4(n);let i=Dx(qi,1);if(n===i||Number.isNaN(n))return 3;if(F4(n),i=Lx(qi,1),n===i)return 5}return 9};const E4=new ArrayBuffer(9),Fi=new DataView(E4,1),qi=new Uint8Array(E4,0);function S4(t){if(t===1/0)Fi.setUint16(0,31744,!1);else if(t===-1/0)Fi.setUint16(0,64512,!1);else if(Number.isNaN(t))Fi.setUint16(0,32256,!1);else{Fi.setFloat32(0,t);const e=Fi.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)Fi.setUint16(0,31744,!1);else if(r===0)Fi.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{const i=r-127;i<-24?Fi.setUint16(0,0):i<-14?Fi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Fi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Dx(t,e){if(t.length-e<2)throw new Error(`${Xt} not enough data for float16`);const r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;const n=r>>10&31,i=r&1023;let s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function F4(t){Fi.setFloat32(0,t,!1)}function Lx(t,e){if(t.length-e<4)throw new Error(`${Xt} not enough data for float32`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}function TT(t){Fi.setFloat64(0,t,!1)}function C4(t,e){if(t.length-e<8)throw new Error(`${Xt} not enough data for float64`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}Ux.compareTokens=Jl.compareTokens;function pr(t,e,r){throw new Error(`${Xt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}function Q1(t){return()=>{throw new Error(`${Xt} ${t}`)}}const Ke=[];for(let t=0;t<=23;t++)Ke[t]=pr;Ke[24]=zR;Ke[25]=jR;Ke[26]=HR;Ke[27]=GR;Ke[28]=pr;Ke[29]=pr;Ke[30]=pr;Ke[31]=pr;for(let t=32;t<=55;t++)Ke[t]=pr;Ke[56]=VR;Ke[57]=QR;Ke[58]=$R;Ke[59]=KR;Ke[60]=pr;Ke[61]=pr;Ke[62]=pr;Ke[63]=pr;for(let t=64;t<=87;t++)Ke[t]=JR;Ke[88]=WR;Ke[89]=YR;Ke[90]=qR;Ke[91]=XR;Ke[92]=pr;Ke[93]=pr;Ke[94]=pr;Ke[95]=Q1("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Ke[t]=eT;Ke[120]=tT;Ke[121]=rT;Ke[122]=nT;Ke[123]=iT;Ke[124]=pr;Ke[125]=pr;Ke[126]=pr;Ke[127]=Q1("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Ke[t]=oT;Ke[152]=aT;Ke[153]=lT;Ke[154]=uT;Ke[155]=fT;Ke[156]=pr;Ke[157]=pr;Ke[158]=pr;Ke[159]=cT;for(let t=160;t<=183;t++)Ke[t]=hT;Ke[184]=dT;Ke[185]=pT;Ke[186]=gT;Ke[187]=mT;Ke[188]=pr;Ke[189]=pr;Ke[190]=pr;Ke[191]=yT;for(let t=192;t<=215;t++)Ke[t]=xT;Ke[216]=vT;Ke[217]=wT;Ke[218]=bT;Ke[219]=AT;Ke[220]=pr;Ke[221]=pr;Ke[222]=pr;Ke[223]=pr;for(let t=224;t<=243;t++)Ke[t]=Q1("simple values are not supported");Ke[244]=pr;Ke[245]=pr;Ke[246]=pr;Ke[247]=kT;Ke[248]=Q1("simple values are not supported");Ke[249]=PT;Ke[250]=NT;Ke[251]=RT;Ke[252]=pr;Ke[253]=pr;Ke[254]=pr;Ke[255]=_T;const Xs=[];for(let t=0;t<24;t++)Xs[t]=new At(be.uint,t,1);for(let t=-1;t>=-24;t--)Xs[31-t]=new At(be.negint,t,1);Xs[64]=new At(be.bytes,new Uint8Array(0),1);Xs[96]=new At(be.string,"",1);Xs[128]=new At(be.array,0,1);Xs[160]=new At(be.map,0,1);Xs[244]=new At(be.false,!1,1);Xs[245]=new At(be.true,!0,1);Xs[246]=new At(be.null,null,1);function IT(t){switch(t.type){case be.false:return Zs([244]);case be.true:return Zs([245]);case be.null:return Zs([246]);case be.bytes:return t.value.length?void 0:Zs([64]);case be.string:return t.value===""?Zs([96]):void 0;case be.array:return t.value===0?Zs([128]):void 0;case be.map:return t.value===0?Zs([160]):void 0;case be.uint:return t.value<24?Zs([Number(t.value)]):void 0;case be.negint:if(t.value>=-24)return Zs([31-Number(t.value)])}}const MT={float64:!1,mapSorter:UT,quickEncodeToken:IT};function BT(){const t=[];return t[be.uint.major]=Jl,t[be.negint.major]=Tx,t[be.bytes.major]=V1,t[be.string.major]=sT,t[be.array.major]=Ix,t[be.map.major]=Mx,t[be.tag.major]=Bx,t[be.float.major]=Ux,t}const k4=BT(),em=new w4;class Lp{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${b4} object contains circular references`);return new Lp(r,e)}}const $o={null:new At(be.null,null),undefined:new At(be.undefined,void 0),true:new At(be.true,!0),false:new At(be.false,!1),emptyArray:new At(be.array,0),emptyMap:new At(be.map,0)},Ba={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new At(be.float,t):t>=0?new At(be.uint,t):new At(be.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new At(be.uint,t):new At(be.negint,t)},Uint8Array(t,e,r,n){return new At(be.bytes,t)},string(t,e,r,n){return new At(be.string,t)},boolean(t,e,r,n){return t?$o.true:$o.false},null(t,e,r,n){return $o.null},undefined(t,e,r,n){return $o.undefined},ArrayBuffer(t,e,r,n){return new At(be.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new At(be.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[$o.emptyArray,new At(be.break)]:$o.emptyArray;n=Lp.createCheck(n,t);const i=[];let s=0;for(const o of t)i[s++]=zd(o,r,n);return r.addBreakTokens?[new At(be.array,t.length),i,new At(be.break)]:[new At(be.array,t.length),i]},Object(t,e,r,n){const i=e!=="Object",s=i?t.keys():Object.keys(t),o=i?t.size:s.length;if(!o)return r.addBreakTokens===!0?[$o.emptyMap,new At(be.break)]:$o.emptyMap;n=Lp.createCheck(n,t);const a=[];let l=0;for(const u of s)a[l++]=[zd(u,r,n),zd(i?t.get(u):t[u],r,n)];return OT(a,r),r.addBreakTokens?[new At(be.map,o),a,new At(be.break)]:[new At(be.map,o),a]}};Ba.Map=Ba.Object;Ba.Buffer=Ba.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Ba[`${t}Array`]=Ba.DataView;function zd(t,e={},r){const n=_R(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Ba[n];if(typeof i=="function"){const o=i(t,n,e,r);if(o!=null)return o}const s=Ba[n];if(!s)throw new Error(`${b4} unsupported type: ${n}`);return s(t,n,e,r)}function OT(t,e){e.mapSorter&&t.sort(e.mapSorter)}function UT(t,e){const r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);const i=r.type.major,s=k4[i].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}function _4(t,e,r,n){if(Array.isArray(e))for(const i of e)_4(t,i,r,n);else r[e.type.major](t,e,n)}function DT(t,e,r){const n=zd(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){const i=r.quickEncodeToken(n);if(i)return i;const s=e[n.type.major];if(s.encodedSize){const o=s.encodedSize(n,r),a=new w4(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return v4(a.chunks[0])}}return em.reset(),_4(em,n,e,r),em.toBytes(!0)}function iu(t,e){return e=Object.assign({},MT,e),DT(t,k4,e)}const LT={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class zT{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let r=Xs[e];if(r===void 0){const n=Ke[e];if(!n)throw new Error(`${Xt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}}const Hh=Symbol.for("DONE"),$1=Symbol.for("BREAK");function jT(t,e,r){const n=[];for(let i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=oe>>5,this.extraBytes=(oe&31)>>3;for(var W=0;W<50;++W)this.s[W]=0}g.prototype.update=function(E){if(this.finalized)throw new Error(r);var J,oe=typeof E;if(oe!=="string"){if(oe==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);J=!0}for(var W=this.blocks,$=this.byteCount,V=E.length,Z=this.blockCount,he=0,Ue=this.s,pe,Be;he>2]|=E[he]<>2]|=Be<>2]|=(192|Be>>6)<>2]|=(128|Be&63)<=57344?(W[pe>>2]|=(224|Be>>12)<>2]|=(128|Be>>6&63)<>2]|=(128|Be&63)<>2]|=(240|Be>>18)<>2]|=(128|Be>>12&63)<>2]|=(128|Be>>6&63)<>2]|=(128|Be&63)<=$){for(this.start=pe-$,this.block=W[Z],pe=0;pe>8,oe=E&255;oe>0;)$.unshift(oe),E=E>>8,oe=E&255,++W;return J?$.push(W):$.unshift(W),this.update($),$.length},g.prototype.encodeString=function(E){var J,oe=typeof E;if(oe!=="string"){if(oe==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);J=!0}var W=0,$=E.length;if(J)W=$;else for(var V=0;V=57344?W+=3:(Z=65536+((Z&1023)<<10|E.charCodeAt(++V)&1023),W+=4)}return W+=this.encode(W*8),this.update(E),W},g.prototype.bytepad=function(E,J){for(var oe=this.encode(J),W=0;W>2]|=this.padding[J&3],this.lastByteIndex===this.byteCount)for(E[0]=E[oe],J=1;J>4&15]+u[he&15]+u[he>>12&15]+u[he>>8&15]+u[he>>20&15]+u[he>>16&15]+u[he>>28&15]+u[he>>24&15];V%E===0&&(ve(J),$=0)}return W&&(he=J[$],Z+=u[he>>4&15]+u[he&15],W>1&&(Z+=u[he>>12&15]+u[he>>8&15]),W>2&&(Z+=u[he>>20&15]+u[he>>16&15])),Z},g.prototype.arrayBuffer=function(){this.finalize();var E=this.blockCount,J=this.s,oe=this.outputBlocks,W=this.extraBytes,$=0,V=0,Z=this.outputBits>>3,he;W?he=new ArrayBuffer(oe+1<<2):he=new ArrayBuffer(Z);for(var Ue=new Uint32Array(he);V>8&255,Z[he+2]=Ue>>16&255,Z[he+3]=Ue>>24&255;V%E===0&&ve(J)}return W&&(he=V<<2,Ue=J[$],Z[he]=Ue&255,W>1&&(Z[he+1]=Ue>>8&255),W>2&&(Z[he+2]=Ue>>16&255)),Z};function O(E,J,oe){g.call(this,E,J,oe)}O.prototype=new g,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),g.prototype.finalize.call(this)};var ve=function(E){var J,oe,W,$,V,Z,he,Ue,pe,Be,ut,Je,Ye,pt,ze,ye,De,Ce,tt,Dt,yt,Ct,fr,Tt,It,Jt,Et,kt,Kt,xt,vt,ir,St,_t,q,re,ae,ke,Ie,Le,ht,He,je,Gt,wt,We,Ht,w,k,P,d,I,X,Y,ue,Se,Re,Fe,qe,Me,rt,Ve,dt;for(W=0;W<48;W+=2)$=E[0]^E[10]^E[20]^E[30]^E[40],V=E[1]^E[11]^E[21]^E[31]^E[41],Z=E[2]^E[12]^E[22]^E[32]^E[42],he=E[3]^E[13]^E[23]^E[33]^E[43],Ue=E[4]^E[14]^E[24]^E[34]^E[44],pe=E[5]^E[15]^E[25]^E[35]^E[45],Be=E[6]^E[16]^E[26]^E[36]^E[46],ut=E[7]^E[17]^E[27]^E[37]^E[47],Je=E[8]^E[18]^E[28]^E[38]^E[48],Ye=E[9]^E[19]^E[29]^E[39]^E[49],J=Je^(Z<<1|he>>>31),oe=Ye^(he<<1|Z>>>31),E[0]^=J,E[1]^=oe,E[10]^=J,E[11]^=oe,E[20]^=J,E[21]^=oe,E[30]^=J,E[31]^=oe,E[40]^=J,E[41]^=oe,J=$^(Ue<<1|pe>>>31),oe=V^(pe<<1|Ue>>>31),E[2]^=J,E[3]^=oe,E[12]^=J,E[13]^=oe,E[22]^=J,E[23]^=oe,E[32]^=J,E[33]^=oe,E[42]^=J,E[43]^=oe,J=Z^(Be<<1|ut>>>31),oe=he^(ut<<1|Be>>>31),E[4]^=J,E[5]^=oe,E[14]^=J,E[15]^=oe,E[24]^=J,E[25]^=oe,E[34]^=J,E[35]^=oe,E[44]^=J,E[45]^=oe,J=Ue^(Je<<1|Ye>>>31),oe=pe^(Ye<<1|Je>>>31),E[6]^=J,E[7]^=oe,E[16]^=J,E[17]^=oe,E[26]^=J,E[27]^=oe,E[36]^=J,E[37]^=oe,E[46]^=J,E[47]^=oe,J=Be^($<<1|V>>>31),oe=ut^(V<<1|$>>>31),E[8]^=J,E[9]^=oe,E[18]^=J,E[19]^=oe,E[28]^=J,E[29]^=oe,E[38]^=J,E[39]^=oe,E[48]^=J,E[49]^=oe,pt=E[0],ze=E[1],We=E[11]<<4|E[10]>>>28,Ht=E[10]<<4|E[11]>>>28,kt=E[20]<<3|E[21]>>>29,Kt=E[21]<<3|E[20]>>>29,Me=E[31]<<9|E[30]>>>23,rt=E[30]<<9|E[31]>>>23,He=E[40]<<18|E[41]>>>14,je=E[41]<<18|E[40]>>>14,_t=E[2]<<1|E[3]>>>31,q=E[3]<<1|E[2]>>>31,ye=E[13]<<12|E[12]>>>20,De=E[12]<<12|E[13]>>>20,w=E[22]<<10|E[23]>>>22,k=E[23]<<10|E[22]>>>22,xt=E[33]<<13|E[32]>>>19,vt=E[32]<<13|E[33]>>>19,Ve=E[42]<<2|E[43]>>>30,dt=E[43]<<2|E[42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E[44]=Fe^~Me&Ve,E[45]=qe^~rt&dt,E[6]=Dt^~Ct&pt,E[7]=yt^~fr&ze,E[16]=xt^~ir&Tt,E[17]=vt^~St&It,E[26]=Le^~He&_t,E[27]=ht^~je&q,E[36]=P^~I&Gt,E[37]=d^~X&wt,E[46]=Me^~Ve&Y,E[47]=rt^~dt&ue,E[8]=Ct^~pt&ye,E[9]=fr^~ze&De,E[18]=ir^~Tt&Jt,E[19]=St^~It&Et,E[28]=He^~_t&re,E[29]=je^~q&ae,E[38]=I^~Gt&We,E[39]=X^~wt&Ht,E[48]=Ve^~Y&Se,E[49]=dt^~ue&Re,E[0]^=b[W],E[1]^=b[W+1]};if(a)t.exports=h;else for(S=0;S>=8;return e}function ob(t,e,r){let n=0;for(let i=0;ie+1+n&&ks.throwError("child data too short",ie.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function kE(t,e){if(t.length===0&&ks.throwError("data too short",ie.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&ks.throwError("data short segment too short",ie.errors.BUFFER_OVERRUN,{});const n=ob(t,e+1,r);return e+1+r+n>t.length&&ks.throwError("data long segment too short",ie.errors.BUFFER_OVERRUN,{}),ab(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&ks.throwError("data array too short",ie.errors.BUFFER_OVERRUN,{}),ab(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&ks.throwError("data array too short",ie.errors.BUFFER_OVERRUN,{});const n=ob(t,e+1,r);e+1+r+n>t.length&&ks.throwError("data array too short",ie.errors.BUFFER_OVERRUN,{});const i=lt(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&ks.throwError("data too short",ie.errors.BUFFER_OVERRUN,{});const n=lt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:lt(t[e])}}function O1(t){const e=ct(t),r=kE(e,0);return r.consumed!==e.length&&ks.throwArgumentError("invalid rlp data","data",t),r.result}const E_="address/5.7.0",Au=new ie(E_);function lb(t){dr(t,20)||Au.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ct(Yr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const S_=9007199254740991;function F_(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Fx={};for(let t=0;t<10;t++)Fx[String(t)]=String(t);for(let t=0;t<26;t++)Fx[String.fromCharCode(65+t)]=String(10+t);const ub=Math.floor(F_(S_));function C_(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Fx[n]).join("");for(;e.length>=ub;){let n=e.substring(0,ub);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function mn(t){let e=null;if(typeof t!="string"&&Au.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=lb(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Au.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==C_(t)&&Au.throwArgumentError("bad icap checksum","address",t),e=o_(t.substring(4));e.length<40;)e="0"+e;e=lb("0x"+e)}else Au.throwArgumentError("invalid address","address",t);return e}function _E(t){let e=null;try{e=mn(t.from)}catch{Au.throwArgumentError("missing from address","transaction",t)}const r=Lf(ct(Ee.from(t.nonce).toHexString()));return mn(_n(Yr(B1([e,r])),12))}let k_=class extends zo{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=mn(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return mn(Ar(e.readValue().toHexString(),20))}},__=class extends zo{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};const Eu=new ie(b0);function PE(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return f||Eu.throwError("cannot encode object for signature with missing names",ie.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]&&Eu.throwError("cannot encode object for signature with duplicate names",ie.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]=!0,r[f]})}else Eu.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Eu.throwArgumentError("types/value length mismatch","tuple",r);let i=new Fy(t.wordSize),s=new Fy(t.wordSize),o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let p=i.writeUpdatableValue();o.push(y=>{p(y+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function NE(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(u){if(u.code===ie.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ie.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}let P_=class extends zo{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Eu.throwError("insufficient data length",ie.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===hi.OVERRUN?r.length-e-1:0}function H_(t,e,r,n,i){return t===hi.OVERLONG?(n.push(i),0):(n.push(65533),ME(t,e,r))}const G_=Object.freeze({error:j_,ignore:ME,replace:H_});function BE(t,e){e==null&&(e=G_.error),t=ct(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(hi.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(hi.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(hi.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(hi.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(hi.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(hi.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function $s(t,e=Dh.current){e!=Dh.current&&(IE.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ct(r)}function V_(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function A0(t,e){return V_(BE(t,e))}function Q_(t,e=Dh.current){return BE($s(t,e))}let K_=class extends RE{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,$s(r))}decode(e){return A0(super.decode(e))}},X0=class extends zo{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return PE(e,this.coders,r)}decode(e){return e.coerce(this.name,NE(e,this.coders))}};const Z0=new ie(b0),$_=new RegExp(/^bytes([0-9]*)$/),W_=new RegExp(/^(u?int)([0-9]*)$/);let J_=class{constructor(e){Oe(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new k_(e.name);case"bool":return new N_(e.name);case"string":return new K_(e.name);case"bytes":return new R_(e.name);case"array":return new P_(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new X0((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new I_(e.name)}let r=e.type.match(W_);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&Z0.throwArgumentError("invalid "+r[1]+" bit length","param",e),new L_(n/8,r[1]==="int",e.name)}if(r=e.type.match($_),r){let n=parseInt(r[1]);return(n===0||n>32)&&Z0.throwArgumentError("invalid bytes length","param",e),new T_(n,e.name)}return Z0.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new v_(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Fy(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Gs.from(i)));return new X0(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&Z0.throwError("types/values length mismatch",ie.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Gs.from(o))),i=new X0(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Gs.from(o)));return new X0(i,"_").decode(this._getReader(ct(r),n))}};const Y_=new J_;function Su(t){return Yr($s(t))}const OE="hash/5.7.0";function UE(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function q_(t){const e={};for(let r=0;r>--l&1}const c=31,p=Math.pow(2,c),y=p>>>1,v=y>>1,b=p-1;let N=0;for(let L=0;L1;){let ne=T+z>>>1;L>>1|f(),H=H<<1^y,K=(K^y)<<1|y|1;A=H,C=1+K-H}let F=n-4;return x.map(L=>{switch(L-F){case 3:return F+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return F+256+(t[a++]<<8|t[a++]);case 1:return F+t[a++];default:return L-1}})}function Z_(t){let e=0;return()=>t[e++]}function eP(t){return Z_(X_(t))}function tP(t){return t&1?~t>>1:t>>1}function rP(t,e){let r=Array(t);for(let n=0;ne[o]):r}function iP(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(oP(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(aP(r,t))}return q_(LE(e))}function sP(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function zE(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function oP(t,e){let r=1+e(),n=e(),i=sP(e),s=zE(i.length,1+t,e);return LE(s.map((o,a)=>{const l=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((f,c)=>{let p=c*n;return[l+c*r,u.map(y=>y+p)]})}))}function aP(t,e){let r=1+e();return zE(r,1+t,e).map(i=>[i[0],i.slice(1)])}function lP(t){let e=Tp(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=Tp(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,f)=>f.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function uP(){return eP(UE("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womAB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)}function pP(t){return t.filter(e=>e!=65039)}function HE(t){for(let e of t.split(".")){let r=jE(e);try{for(let n=r.lastIndexOf(hb)-1;n>=0;n--)if(r[n]!==hb)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===cb&&r[3]===cb)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function gP(t){return HE(mP(t,pP))}function mP(t,e){let r=jE(t).reverse(),n=[];for(;r.length;){let i=xP(r);if(i){n.push(...e(i));continue}let s=r.pop();if(fP.has(s)){n.push(s);continue}if(cP.has(s))continue;let o=hP[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return HE(yP(String.fromCodePoint(...n)))}function yP(t){return t.normalize("NFC")}function xP(t,e){var r;let n=dP,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const vP=new ie(OE),GE=new Uint8Array(32);GE.fill(0);function db(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function VE(t){const e=$s(gP(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(db(e.slice(n))),r}function Od(t){typeof t!="string"&&vP.throwArgumentError("invalid ENS name; not a string","name",t);let e=GE;const r=VE(t);for(;r.length;)e=Yr(gi([e,Yr(r.pop())]));return lt(e)}function wP(t){return lt(gi(VE(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var bP=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Sr=new ie(OE),QE=new Uint8Array(32);QE.fill(0);const AP=Ee.from(-1),KE=Ee.from(0),$E=Ee.from(1),EP=Ee.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function SP(t){const e=ct(t),r=e.length%32;return r?Zn([e,QE.slice(r)]):lt(e)}const FP=Ar($E.toHexString(),32),CP=Ar(KE.toHexString(),32),pb={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Gg=["name","version","chainId","verifyingContract","salt"];function gb(t){return function(e){return typeof e!="string"&&Sr.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const kP={name:gb("name"),version:gb("version"),chainId:function(t){try{return Ee.from(t).toString()}catch{}return Sr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return mn(t).toLowerCase()}catch{}return Sr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=ct(t);if(e.length!==32)throw new Error("bad length");return lt(e)}catch{}return Sr.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Vg(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Sr.throwArgumentError("invalid numeric width","type",t);const i=EP.mask(r?n-1:n),s=r?i.add($E).mul(AP):KE;return function(o){const a=Ee.from(o);return(a.lt(s)||a.gt(i))&&Sr.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),Ar(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Sr.throwArgumentError("invalid bytes width","type",t),function(n){return ct(n).length!==r&&Sr.throwArgumentError(`invalid length for ${t}`,"value",n),SP(n)}}}switch(t){case"address":return function(e){return Ar(mn(e),32)};case"bool":return function(e){return e?FP:CP};case"bytes":return function(e){return Yr(e)};case"string":return function(e){return Su(e)}}return null}function mb(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}let yb=class Yi{constructor(e){Oe(this,"types",Object.freeze(Ro(e))),Oe(this,"_encoderCache",{}),Oe(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&&Sr.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];f===a&&Sr.throwArgumentError(`circular type reference to ${JSON.stringify(f)}`,"types",e),!Vg(f)&&(n[f]||Sr.throwArgumentError(`unknown type ${JSON.stringify(f)}`,"types",e),n[f].push(a),r[a][f]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?Sr.throwArgumentError("missing primary type","types",e):s.length>1&&Sr.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Oe(this,"primaryType",s[0]);function o(a,l){l[a]&&Sr.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(f=>{i[f][u]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=mb(a,e[a])+l.map(u=>mb(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Vg(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&Sr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(Yr)),Yr(Zn(l))}}const n=this.types[e];if(n){const i=Su(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return this._types[l]?Yr(u):u});return o.unshift(i),Zn(o)}}return Sr.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Sr.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Yr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Vg(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&Sr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):Sr.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Yi(e)}static getPrimaryType(e){return Yi.from(e).primaryType}static hashStruct(e,r,n){return Yi.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=pb[n];i||Sr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Gg.indexOf(n.name)-Gg.indexOf(i.name)),Yi.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Zn(["0x1901",Yi.hashDomain(e),Yi.from(r).hash(n)])}static hash(e,r,n){return Yr(Yi.encode(e,r,n))}static resolveNames(e,r,n,i){return bP(this,void 0,void 0,function*(){e=Xr(e);const s={};e.verifyingContract&&!dr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Yi.from(r);o.visit(n,(a,l)=>(a==="address"&&!dr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){Yi.hashDomain(e);const i={},s=[];Gg.forEach(l=>{const u=e[l];u!=null&&(i[l]=kP[l](u),s.push({name:l,type:pb[l]}))});const o=Yi.from(r),a=Xr(r);return a.EIP712Domain?Sr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return lt(ct(u));if(l.match(/^u?int/))return Ee.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&Sr.throwArgumentError("invalid string","value",u),u}return Sr.throwArgumentError("unsupported type","type",l)})}}};const Er=new ie(b0);let _P=class extends w0{},PP=class extends w0{},NP=class extends w0{},ky=class extends w0{static isIndexed(e){return!!(e&&e._isIndexed)}};const RP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function xb(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}let vb=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Oe(this,"fragments",r.map(n=>M1.from(n)).filter(n=>n!=null)),Oe(this,"_abiCoder",Ls(new.target,"getAbiCoder")()),Oe(this,"functions",{}),Oe(this,"errors",{}),Oe(this,"events",{}),Oe(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Er.warn("duplicate definition - constructor");return}Oe(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){Er.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||Oe(this,"deploy",Np.from({payable:!1,type:"constructor"})),Oe(this,"_isInterface",!0)}format(e){e||(e=hr.full),e===hr.sighash&&Er.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===hr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return Y_}static getAddress(e){return mn(e)}static getSighash(e){return _n(Su(e.format()),0,4)}static getEventTopic(e){return Su(e.format())}getFunction(e){if(dr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Er.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Er.throwArgumentError("no matching function","name",n):i.length>1&&Er.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Rp.fromString(e).format()];return r||Er.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(dr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Er.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Er.throwArgumentError("no matching event","name",n):i.length>1&&Er.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Sy.fromString(e).format()];return r||Er.throwArgumentError("no matching event","signature",e),r}getError(e){if(dr(e)){const n=Ls(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Er.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Er.throwArgumentError("no matching error","name",n):i.length>1&&Er.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Rp.fromString(e).format()];return r||Er.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Ls(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Ls(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=ct(r);return lt(n.slice(0,4))!==this.getSighash(e)&&Er.throwArgumentError(`data signature does not match error ${e.name}.`,"data",lt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),lt(gi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=ct(r);return lt(n.slice(0,4))!==this.getSighash(e)&&Er.throwArgumentError(`data signature does not match function ${e.name}.`,"data",lt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),lt(gi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=ct(r),i=null,s="",o=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=lt(n.slice(0,4)),f=RP[u];if(f)o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,l=f.signature,f.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const c=this.getError(u);o=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.format()}catch{}break}}return Er.throwError("call revert exception"+s,ie.errors.CALL_EXCEPTION,{method:e.format(),data:lt(r),errorArgs:o,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),lt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Er.throwError("too many arguments for "+e.format(),ie.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?Su(o):s.type==="bytes"?Yr(lt(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=Ee.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),Ar(lt(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&Er.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?Er.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Er.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(Su(l));else if(o.type==="bytes")n.push(Yr(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let p=this.getEventTopic(e);(!dr(n[0],32)||n[0].toLowerCase()!==p)&&Er.throwError("fragment/topic mismatch",ie.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:p,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((p,y)=>{p.indexed?p.type==="string"||p.type==="bytes"||p.baseType==="tuple"||p.baseType==="array"?(i.push(Gs.fromObject({type:"bytes32",name:p.name})),o.push(!0)):(i.push(p),o.push(!1)):(s.push(p),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,gi(n)):null,l=this._abiCoder.decode(s,r,!0),u=[],f=0,c=0;e.inputs.forEach((p,y)=>{if(p.indexed)if(a==null)u[y]=new ky({_isIndexed:!0,hash:null});else if(o[y])u[y]=new ky({_isIndexed:!0,hash:a[c++]});else try{u[y]=a[c++]}catch(v){u[y]=v}else try{u[y]=l[f++]}catch(v){u[y]=v}if(p.name&&u[p.name]==null){const v=u[y];v instanceof Error?Object.defineProperty(u,p.name,{enumerable:!0,get:()=>{throw xb(`property ${JSON.stringify(p.name)}`,v)}}):u[p.name]=v}});for(let p=0;p{throw xb(`index ${p}`,y)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new PP({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Ee.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new _P({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=lt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new NP({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}};const TP="abstract-provider/5.7.0";var IP=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const MP=new ie(TP);class BP extends w0{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class E0{constructor(){MP.checkAbstract(new.target,E0),Oe(this,"_isProvider",!0)}getFeeData(){return IP(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield Qr({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=Ee.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const OP="abstract-signer/5.7.0";var Wi=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Si=new ie(OP),UP=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],DP=[ie.errors.INSUFFICIENT_FUNDS,ie.errors.NONCE_EXPIRED,ie.errors.REPLACEMENT_UNDERPRICED];class sc{constructor(){Si.checkAbstract(new.target,sc),Oe(this,"_isSigner",!0)}getBalance(e){return Wi(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Wi(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Wi(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield Qr(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Wi(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield Qr(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Wi(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Wi(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Wi(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Wi(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Wi(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)UP.indexOf(n)===-1&&Si.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Xr(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Si.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Wi(this,void 0,void 0,function*(){const r=yield Qr(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Wi(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Si.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Si.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Si.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Si.throwError("network does not support EIP-1559",ie.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Si.throwError("failed to get consistent fee data",ie.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(DP.indexOf(i.code)>=0)throw i;return Si.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ie.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Si.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Qr(r)})}_checkProvider(e){this.provider||Si.throwError("missing provider",ie.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class Lh extends sc{constructor(e,r){super(),Oe(this,"address",e),Oe(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Si.throwError(e,ie.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Lh(this.address,e)}}var WE={},er={},S0=JE;function JE(t,e){if(!t)throw new Error(e||"Assertion failed")}JE.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var _y={exports:{}};typeof Object.create=="function"?_y.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:_y.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var LP=_y.exports,zP=S0,jP=LP;er.inherits=jP;function HP(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function GP(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):HP(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}er.htonl=YE;function QP(t,e){for(var r="",n=0;n>>0}return s}er.join32=KP;function $P(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}er.split32=$P;function WP(t,e){return t>>>e|t<<32-e}er.rotr32=WP;function JP(t,e){return t<>>32-e}er.rotl32=JP;function YP(t,e){return t+e>>>0}er.sum32=YP;function qP(t,e,r){return t+e+r>>>0}er.sum32_3=qP;function XP(t,e,r,n){return t+e+r+n>>>0}er.sum32_4=XP;function ZP(t,e,r,n,i){return t+e+r+n+i>>>0}er.sum32_5=ZP;function eN(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}er.sum64=eN;function tN(t,e,r,n){var i=e+n>>>0,s=(i>>0}er.sum64_hi=tN;function rN(t,e,r,n){var i=e+n;return i>>>0}er.sum64_lo=rN;function nN(t,e,r,n,i,s,o,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}er.sum64_4_hi=nN;function iN(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}er.sum64_4_lo=iN;function sN(t,e,r,n,i,s,o,a,l,u){var f=0,c=e;c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0,f+=c>>0}er.sum64_5_hi=sN;function oN(t,e,r,n,i,s,o,a,l,u){var f=e+n+s+a+u;return f>>>0}er.sum64_5_lo=oN;function aN(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}er.rotr64_hi=aN;function lN(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}er.rotr64_lo=lN;function uN(t,e,r){return t>>>r}er.shr64_hi=uN;function fN(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}er.shr64_lo=fN;var oc={},wb=er,cN=S0;function D1(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}oc.BlockHash=D1;D1.prototype.update=function(e,r){if(e=wb.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=wb.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Xs.g0_256=mN;function yN(t){return Vs(t,17)^Vs(t,19)^t>>>10}Xs.g1_256=yN;var zf=er,xN=oc,vN=Xs,Qg=zf.rotl32,_c=zf.sum32,wN=zf.sum32_5,bN=vN.ft_1,r4=xN.BlockHash,AN=[1518500249,1859775393,2400959708,3395469782];function Ws(){if(!(this instanceof Ws))return new Ws;r4.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}zf.inherits(Ws,r4);var EN=Ws;Ws.blockSize=512;Ws.outSize=160;Ws.hmacStrength=80;Ws.padLength=64;Ws.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),fR(e.length<=this.blockSize);for(var r=e.length;r>8,p=f&255;c?l.push(c,p):l.push(p)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(p>>1)-1?b=(p>>1)-N:b=N,y.isubn(b)):b=0,c[v]=b,y.iushrn(1)}return c}r.getNAF=n;function i(l,u){var f=[[],[]];l=l.clone(),u=u.clone();for(var c=0,p=0,y;l.cmpn(-c)>0||u.cmpn(-p)>0;){var v=l.andln(3)+c&3,b=u.andln(3)+p&3;v===3&&(v=-1),b===3&&(b=-1);var N;v&1?(y=l.andln(7)+c&7,(y===3||y===5)&&b===2?N=-v:N=v):N=0,f[0].push(N);var x;b&1?(y=u.andln(7)+p&7,(y===3||y===5)&&v===2?x=-b:x=b):x=0,f[1].push(x),2*c===N+1&&(c=1-c),2*p===x+1&&(p=1-p),l.iushrn(1),u.iushrn(1)}return f}r.getJSF=i;function s(l,u,f){var c="_"+u;l.prototype[u]=function(){return this[c]!==void 0?this[c]:this[c]=f.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new zt(l,"hex","le")}r.intFromLE=a}),Ip=bi.getNAF,dR=bi.getJSF,Mp=bi.assert;function Ha(t,e){this.type=t,this.p=new zt(e.p,16),this.red=e.prime?zt.red(e.prime):zt.mont(this.p),this.zero=new zt(0).toRed(this.red),this.one=new zt(1).toRed(this.red),this.two=new zt(2).toRed(this.red),this.n=e.n&&new zt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Gl=Ha;Ha.prototype.point=function(){throw new Error("Not implemented")};Ha.prototype.validate=function(){throw new Error("Not implemented")};Ha.prototype._fixedNafMul=function(e,r){Mp(e.precomputed);var n=e._getDoubles(),i=Ip(r,1,this._bitLength),s=(1<=a;u--)l=(l<<1)+i[u];o.push(l)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var f=o[l];Mp(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Ha.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,f,c,p;for(f=0;f=1;f-=2){var v=f-1,b=f;if(o[v]!==1||o[b]!==1){l[v]=Ip(n[v],o[v],this._bitLength),l[b]=Ip(n[b],o[b],this._bitLength),u=Math.max(l[v].length,u),u=Math.max(l[b].length,u);continue}var N=[r[v],null,null,r[b]];r[v].y.cmp(r[b].y)===0?(N[1]=r[v].add(r[b]),N[2]=r[v].toJ().mixedAdd(r[b].neg())):r[v].y.cmp(r[b].y.redNeg())===0?(N[1]=r[v].toJ().mixedAdd(r[b]),N[2]=r[v].add(r[b].neg())):(N[1]=r[v].toJ().mixedAdd(r[b]),N[2]=r[v].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],A=dR(n[v],n[b]);for(u=Math.max(A[0].length,u),l[v]=new Array(u),l[b]=new Array(u),c=0;c=0;f--){for(var z=0;f>=0;){var H=!0;for(c=0;c=0&&z++,L=L.dblp(z),f<0)break;for(c=0;c0?p=a[c][K-1>>1]:K<0&&(p=a[c][-K-1>>1].neg()),p.type==="affine"?L=L.mixedAdd(p):L=L.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};Vi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(y=u,v=f),c.negative&&(c=c.neg(),p=p.neg()),y.negative&&(y=y.neg(),v=v.neg()),[{a:c,b:p},{a:y,b:v}]};Qi.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),u=s.mul(n.b),f=o.mul(i.b),c=e.sub(a).sub(l),p=u.add(f).neg();return{k1:c,k2:p}};Qi.prototype.pointFromX=function(e,r){e=new zt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Qi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Qi.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};on.prototype.isInfinity=function(){return this.inf};on.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};on.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};on.prototype.getX=function(){return this.x.fromRed()};on.prototype.getY=function(){return this.y.fromRed()};on.prototype.mul=function(e){return e=new zt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};on.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};on.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};on.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};on.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};on.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function yn(t,e,r,n){Gl.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new zt(0)):(this.x=new zt(e,16),this.y=new zt(r,16),this.z=new zt(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}kx(yn,Gl.BasePoint);Qi.prototype.jpoint=function(e,r,n){return new yn(this,e,r,n)};yn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};yn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};yn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),u=o.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=l.redSqr(),c=f.redMul(l),p=i.redMul(f),y=u.redSqr().redIAdd(c).redISub(p).redISub(p),v=u.redMul(p.redISub(y)).redISub(o.redMul(c)),b=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(y,v,b)};yn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=n.redMul(u),p=l.redSqr().redIAdd(f).redISub(c).redISub(c),y=l.redMul(c.redISub(p)).redISub(s.redMul(f)),v=this.z.redMul(a);return this.curve.jpoint(p,y,v)};yn.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};yn.prototype.inspect=function(){return this.isInfinity()?"":""};yn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Ud=uc(function(t,e){var r=e;r.base=Gl,r.short=gR,r.mont=null,r.edwards=null}),Dd=uc(function(t,e){var r=e,n=bi.assert;function i(a){a.type==="short"?this.curve=new Ud.short(a):a.type==="edwards"?this.curve=new Ud.edwards(a):this.curve=new Ud.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Cs.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Cs.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Cs.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Cs.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Cs.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Cs.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Cs.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Cs.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Ma(t){if(!(this instanceof Ma))return new Ma(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=cs.toArray(t.entropy,t.entropyEnc||"hex"),r=cs.toArray(t.nonce,t.nonceEnc||"hex"),n=cs.toArray(t.pers,t.persEnc||"hex");Cx(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var p4=Ma;Ma.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ma.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=cs.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var mR=bi.assert;function L1(t,e){if(t instanceof L1)return t;this._importDER(t,e)||(mR(t.r&&t.s,"Signature without r or s"),this.r=new zt(t.r,16),this.s=new zt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var z1=L1;function yR(){this.place=0}function Wg(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Sb(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}L1.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Sb(r),n=Sb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Jg(i,r.length),i=i.concat(r),i.push(2),Jg(i,n.length);var s=i.concat(n),o=[48];return Jg(o,s.length),o=o.concat(s),bi.encode(o,e)};var xR=function(){throw new Error("unsupported")},g4=bi.assert;function Gi(t){if(!(this instanceof Gi))return new Gi(t);typeof t=="string"&&(g4(Object.prototype.hasOwnProperty.call(Dd,t),"Unknown curve "+t),t=Dd[t]),t instanceof Dd.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var vR=Gi;Gi.prototype.keyPair=function(e){return new _x(this,e)};Gi.prototype.keyFromPrivate=function(e,r){return _x.fromPrivate(this,e,r)};Gi.prototype.keyFromPublic=function(e,r){return _x.fromPublic(this,e,r)};Gi.prototype.genKeyPair=function(e){e||(e={});for(var r=new p4({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||xR(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new zt(2));;){var s=new zt(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Gi.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Gi.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new zt(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new p4({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new zt(1)),f=0;;f++){var c=i.k?i.k(f):new zt(l.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),!(c.cmpn(1)<=0||c.cmp(u)>=0)){var p=this.g.mul(c);if(!p.isInfinity()){var y=p.getX(),v=y.umod(this.n);if(v.cmpn(0)!==0){var b=c.invm(this.n).mul(v.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var N=(p.getY().isOdd()?1:0)|(y.cmp(v)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),N^=1),new z1({r:v,s:b,recoveryParam:N})}}}}}};Gi.prototype.verify=function(e,r,n,i){e=this._truncateToN(new zt(e,16)),n=this.keyFromPublic(n,i),r=new z1(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};Gi.prototype.recoverPubKey=function(t,e,r,n){g4((3&r)===r,"The recovery param is more than two bits"),e=new z1(e,n);var i=this.n,s=new zt(t),o=e.r,a=e.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var f=e.r.invm(i),c=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(c,o,p)};Gi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new z1(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var wR=uc(function(t,e){var r=e;r.version="6.5.4",r.utils=bi,r.rand=function(){throw new Error("unsupported")},r.curve=Ud,r.curves=Dd,r.ec=vR,r.eddsa=null}),bR=wR.ec;const AR="signing-key/5.7.0",Ty=new ie(AR);let Yg=null;function Is(){return Yg||(Yg=new bR("secp256k1")),Yg}let ER=class{constructor(e){Oe(this,"curve","secp256k1"),Oe(this,"privateKey",lt(e)),Tl(this.privateKey)!==32&&Ty.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Is().keyFromPrivate(ct(this.privateKey));Oe(this,"publicKey","0x"+r.getPublic(!1,"hex")),Oe(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Oe(this,"_isSigningKey",!0)}_addPoint(e){const r=Is().keyFromPublic(ct(this.publicKey)),n=Is().keyFromPublic(ct(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Is().keyFromPrivate(ct(this.privateKey)),n=ct(e);n.length!==32&&Ty.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return I1({recoveryParam:i.recoveryParam,r:Ar("0x"+i.r.toString(16),32),s:Ar("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Is().keyFromPrivate(ct(this.privateKey)),n=Is().keyFromPublic(ct(m4(e)));return Ar("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function SR(t,e){const r=I1(e),n={r:ct(r.r),s:ct(r.s)};return"0x"+Is().recoverPubKey(ct(t),n,r.recoveryParam).encode("hex",!1)}function m4(t,e){const r=ct(t);if(r.length===32){const n=new ER(r);return e?"0x"+Is().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?lt(r):"0x"+Is().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Is().keyFromPublic(r).getPublic(!0,"hex"):lt(r)}return Ty.throwArgumentError("invalid public or private key","key","[REDACTED]")}const FR="transactions/5.7.0",jo=new ie(FR);var Fb;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Fb||(Fb={}));function Px(t){return t==="0x"?null:mn(t)}function Nn(t){return t==="0x"?TE:Ee.from(t)}function CR(t){const e=m4(t);return mn(_n(Yr(_n(e,1)),12))}function y4(t,e){return CR(SR(ct(t),e))}function di(t,e){const r=Lf(Ee.from(t).toHexString());return r.length>32&&jo.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function qg(t,e){return{address:mn(t),storageKeys:(e||[]).map((r,n)=>(Tl(r)!==32&&jo.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function fc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&jo.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),qg(r[0],r[1])):qg(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return qg(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function x4(t){return fc(t).map(e=>[e.address,e.storageKeys])}function kR(t,e){if(t.gasPrice!=null){const n=Ee.from(t.gasPrice),i=Ee.from(t.maxFeePerGas||0);n.eq(i)||jo.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[di(t.chainId||0,"chainId"),di(t.nonce||0,"nonce"),di(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),di(t.maxFeePerGas||0,"maxFeePerGas"),di(t.gasLimit||0,"gasLimit"),t.to!=null?mn(t.to):"0x",di(t.value||0,"value"),t.data||"0x",x4(t.accessList||[])];if(e){const n=I1(e);r.push(di(n.recoveryParam,"recoveryParam")),r.push(Lf(n.r)),r.push(Lf(n.s))}return Zn(["0x02",B1(r)])}function _R(t,e){const r=[di(t.chainId||0,"chainId"),di(t.nonce||0,"nonce"),di(t.gasPrice||0,"gasPrice"),di(t.gasLimit||0,"gasLimit"),t.to!=null?mn(t.to):"0x",di(t.value||0,"value"),t.data||"0x",x4(t.accessList||[])];if(e){const n=I1(e);r.push(di(n.recoveryParam,"recoveryParam")),r.push(Lf(n.r)),r.push(Lf(n.s))}return Zn(["0x01",B1(r)])}function v4(t,e,r){try{const n=Nn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{jo.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Ar(e[1],32),t.s=Ar(e[2],32);try{const n=Yr(r(t));t.from=y4(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function PR(t){const e=O1(t.slice(1));e.length!==9&&e.length!==12&&jo.throwArgumentError("invalid component count for transaction type: 2","payload",lt(t));const r=Nn(e[2]),n=Nn(e[3]),i={type:2,chainId:Nn(e[0]).toNumber(),nonce:Nn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Nn(e[4]),to:Px(e[5]),value:Nn(e[6]),data:e[7],accessList:fc(e[8])};return e.length===9||(i.hash=Yr(t),v4(i,e.slice(9),kR)),i}function NR(t){const e=O1(t.slice(1));e.length!==8&&e.length!==11&&jo.throwArgumentError("invalid component count for transaction type: 1","payload",lt(t));const r={type:1,chainId:Nn(e[0]).toNumber(),nonce:Nn(e[1]).toNumber(),gasPrice:Nn(e[2]),gasLimit:Nn(e[3]),to:Px(e[4]),value:Nn(e[5]),data:e[6],accessList:fc(e[7])};return e.length===8||(r.hash=Yr(t),v4(r,e.slice(8),_R)),r}function RR(t){const e=O1(t);e.length!==9&&e.length!==6&&jo.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Nn(e[0]).toNumber(),gasPrice:Nn(e[1]),gasLimit:Nn(e[2]),to:Px(e[3]),value:Nn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=Ee.from(e[6]).toNumber()}catch{return r}if(r.r=Ar(e[7],32),r.s=Ar(e[8],32),Ee.from(r.r).isZero()&&Ee.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(lt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Yr(B1(i));try{r.from=y4(s,{r:lt(r.r),s:lt(r.s),recoveryParam:n})}catch{}r.hash=Yr(t)}return r.type=null,r}function TR(t){const e=ct(t);if(e[0]>127)return RR(e);switch(e[0]){case 1:return NR(e);case 2:return PR(e)}return jo.throwError(`unsupported transaction type: ${e[0]}`,ie.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const IR="contracts/5.7.0";var Bl=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Hr=new ie(IR);function Bp(t,e){return Bl(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&Hr.throwArgumentError("invalid address or ENS name","name",r);try{return mn(r)}catch{}t||Hr.throwError("a provider or signer is needed to resolve ENS names",ie.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&Hr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Ld(t,e,r){return Bl(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Ld(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield Bp(t,e):r.type==="tuple"?yield Ld(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Ld(t,n,r.arrayChildren))):Promise.reject(Hr.makeError("invalid value for array",ie.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function j1(t,e,r){return Bl(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Xr(r.pop())),Hr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=Qr({override:Bp(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>Bl(this,void 0,void 0,function*(){return mn(u.signer)!==u.override&&Hr.throwError("Contract with a Signer cannot override from",ie.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=Bp(t.provider,n.from));const i=yield Qr({args:Ld(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Qr(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=Ee.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=Ee.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=Ee.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=Ee.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=Ee.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=fc(a.accessList)),o.gasLimit==null&&e.gas!=null){let u=21e3;const f=ct(s);for(let c=0;cn[u]!=null);return l.length&&Hr.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,ie.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function MR(t,e){return function(...r){return j1(t,e,r)}}function BR(t,e){const r=t.signer||t.provider;return function(...n){return Bl(this,void 0,void 0,function*(){r||Hr.throwError("estimate require a provider or signer",ie.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield j1(t,e,n);return yield r.estimateGas(i)})}}function OR(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=Ro(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function w4(t,e,r){const n=t.signer||t.provider;return function(...i){return Bl(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Xr(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield j1(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===ie.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function UR(t,e){return function(...r){return Bl(this,void 0,void 0,function*(){t.signer||Hr.throwError("sending a transaction requires a signer",ie.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield j1(t,e,r),i=yield t.signer.sendTransaction(n);return OR(t,i),i})}}function Cb(t,e,r){return e.constant?w4(t,e,r):UR(t,e)}function b4(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class zh{constructor(e,r){Oe(this,"tag",e),Oe(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class DR extends zh{constructor(){super("error",null)}}class kb extends zh{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&Hr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(b4(s),s),Oe(this,"address",e),Oe(this,"interface",r),Oe(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=x_(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class _b extends zh{constructor(e,r){super("*",{address:e}),Oe(this,"address",e),Oe(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}let LR=class{constructor(e,r,n){Oe(this,"interface",Ls(new.target,"getInterface")(r)),n==null?(Oe(this,"provider",null),Oe(this,"signer",null)):sc.isSigner(n)?(Oe(this,"provider",n.provider||null),Oe(this,"signer",n)):E0.isProvider(n)?(Oe(this,"provider",n),Oe(this,"signer",null)):Hr.throwArgumentError("invalid signer or provider","signerOrProvider",n),Oe(this,"callStatic",{}),Oe(this,"estimateGas",{}),Oe(this,"functions",{}),Oe(this,"populateTransaction",{}),Oe(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];Oe(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?Oe(this.filters,a,this.filters[l[0]]):Hr.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(Oe(this,"_runningEvents",{}),Oe(this,"_wrappedEmits",{}),e==null&&Hr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Oe(this,"address",e),this.provider)Oe(this,"resolvedAddress",Bp(this.provider,e));else try{Oe(this,"resolvedAddress",Promise.resolve(mn(e)))}catch{Hr.throwError("provider is required to use ENS name as contract address",ie.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){Hr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&Oe(this,o,Cb(this,a,!0)),this.functions[o]==null&&Oe(this.functions,o,Cb(this,a,!1)),this.callStatic[o]==null&&Oe(this.callStatic,o,w4(this,a,!0)),this.populateTransaction[o]==null&&Oe(this.populateTransaction,o,MR(this,a)),this.estimateGas[o]==null&&Oe(this.estimateGas,o,BR(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&Oe(this,o,this[l])}catch{}this.functions[o]==null&&Oe(this.functions,o,this.functions[l]),this.callStatic[o]==null&&Oe(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&Oe(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&Oe(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return _E(e)}static getInterface(e){return vb.isInterface(e)?e:new vb(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&Hr.throwError("contract not deployed",ie.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Hr.throwError("sending a transactions require a signer",ie.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Xr(e||{});return["from","to"].forEach(function(n){r[n]!=null&&Hr.throwError("cannot override "+n,ie.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new Lh(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Oe(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return ky.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new DR);if(e==="event")return this._normalizeRunningEvent(new zh("event",null));if(e==="*")return this._normalizeRunningEvent(new _b(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new kb(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new kb(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new zh(b4(r),r))}return this._normalizeRunningEvent(new _b(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Ro(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||Hr.throwError("events require a provider or a signer with a provider",ie.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Xr(i.filter);return typeof r=="string"&&dr(r,32)?(n!=null&&Hr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}},zR=class extends LR{};class A4{constructor(e){Oe(this,"alphabet",e),Oe(this,"base",e.length),Oe(this,"_alphabetMap",{}),Oe(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:ct(new Uint8Array(i))}})}var $R=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const qi=new ie(VR);function Mb(t){return new Promise(e=>{setTimeout(e,t)})}function Qo(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Df(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return A0(t)}catch{}return lt(t)}return t}function WR(t){return $s(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function JR(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;qi.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;qi.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let f=!1,c=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&qi.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(c=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&qi.throwError("basic authentication requires a secure https url",ie.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+DE($s(x))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=Xr(t.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=l?l.match(p):null;if(y)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?UE(y[3]):WR(y[3])};let A=x.body;return r&&(A=r(x.body,x)),Promise.resolve(A)}catch(x){qi.throwError("processing response error",ie.errors.SERVER_ERROR,{body:Qo(y[1],y[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const v={};Object.keys(a).forEach(x=>{const A=a[x];v[A.key]=A.value}),u.headers=v;const b=function(){let x=null;return{promise:new Promise(function(F,L){c&&(x=setTimeout(()=>{x!=null&&(x=null,L(qi.makeError("timeout",ie.errors.TIMEOUT,{requestBody:Qo(u.body,v["content-type"]),requestMethod:u.method,timeout:c,url:l})))},c))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),N=function(){return $R(this,void 0,void 0,function*(){for(let x=0;x=300)&&(b.cancel(),qi.throwError("bad response",ie.errors.SERVER_ERROR,{status:A.statusCode,headers:A.headers,body:Qo(C,A.headers?A.headers["content-type"]:null),requestBody:Qo(u.body,v["content-type"]),requestMethod:u.method,url:l})),r)try{const F=yield r(C,A);return b.cancel(),F}catch(F){if(F.throttleRetry&&x{let a=null;if(s!=null)try{a=JSON.parse(A0(s))}catch(l){qi.throwError("invalid JSON",ie.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=$s(e);const s=typeof t=="string"?{url:t}:Xr(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Xr(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return JR(t,i,n)}function zc(t,e){return e||(e={}),e=Xr(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let c=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));ce.ceiling&&(c=e.ceiling),setTimeout(u,c)}return null},function(f){o()&&n(f)})}u()})}var Up="qpzry9x8gf2tvdw0s3jn54khce6mua7l",My={};for(var rd=0;rd>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function E4(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Hu(e)^n>>5}for(e=Hu(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=E4(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Hu(n)^o,i+=Up.charAt(o)}for(s=0;s<6;++s)n=Hu(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Up.charAt(a)}return i}function S4(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=E4(s);if(typeof a=="string")return a;for(var l=[],u=0;u=o.length)&&l.push(c)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function qR(){var t=S4.apply(null,arguments);if(typeof t=="object")return t}function XR(t){var e=S4.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function H1(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(c,!0);return e.transaction={hash:o,type:u,accessList:at.allowNull(this.accessList.bind(this),null),blockHash:at.allowNull(o,null),blockNumber:at.allowNull(l,null),transactionIndex:at.allowNull(l,null),confirmations:at.allowNull(l,null),from:r,gasPrice:at.allowNull(n),maxPriorityFeePerGas:at.allowNull(n),maxFeePerGas:at.allowNull(n),gasLimit:n,to:at.allowNull(r,null),value:n,nonce:l,data:s,r:at.allowNull(this.uint256),s:at.allowNull(this.uint256),v:at.allowNull(l),creates:at.allowNull(r,null),raw:at.allowNull(s)},e.transactionRequest={from:at.allowNull(r),nonce:at.allowNull(l),gasLimit:at.allowNull(n),gasPrice:at.allowNull(n),maxPriorityFeePerGas:at.allowNull(n),maxFeePerGas:at.allowNull(n),to:at.allowNull(r),value:at.allowNull(n),data:at.allowNull(f),type:at.allowNull(l),accessList:at.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:at.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:at.allowNull(this.address,null),from:at.allowNull(this.address,null),contractAddress:at.allowNull(r,null),transactionIndex:l,root:at.allowNull(a),gasUsed:n,logsBloom:at.allowNull(s),blockHash:o,transactionHash:o,logs:at.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:at.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:at.allowNull(n),status:at.allowNull(l),type:u},e.block={hash:at.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:at.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:at.allowNull(r),extraData:s,transactions:at.allowNull(at.arrayOf(o)),baseFeePerGas:at.allowNull(n)},e.blockWithTransactions=Xr(e.block),e.blockWithTransactions.transactions=at.allowNull(at.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:at.allowNull(i,void 0),toBlock:at.allowNull(i,void 0),blockHash:at.allowNull(o,void 0),address:at.allowNull(r,void 0),topics:at.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:at.allowNull(l),blockHash:at.allowNull(o),transactionIndex:l,removed:at.allowNull(this.boolean.bind(this)),address:r,data:at.allowFalsish(s,"0x"),topics:at.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return fc(e||[])}number(e){return e==="0x"?0:Ee.from(e).toNumber()}type(e){return e==="0x"||e==null?0:Ee.from(e).toNumber()}bigNumber(e){return Ee.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),dr(e))?e.toLowerCase():Nc.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return mn(e)}callAddress(e){if(!dr(e,32))return null;const r=mn(_n(e,12));return r===M_?null:r}contractAddress(e){return _E(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||dr(e))return Ax(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Tl(n)!==32?Nc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=Ee.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!dr(e))throw new Error("invalid uint256");return Ar(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=at.check(r,e);return i._difficulty=n==null?null:Ee.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return at.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&Ee.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=at.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;dr(n)&&(n=Ee.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),dr(n)&&(n=Ee.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return TR(e)}receiptLog(e){return at.check(this.formats.receiptLog,e)}receipt(e){const r=at.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=Ee.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&Nc.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Nc.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Nc.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return at.check(this.formats.filter,e)}filterLog(e){return at.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var Ut=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const $t=new ie(G1),iT=10;function Ob(t){return t==null?"null":(Tl(t)!==32&&$t.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Ub(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[Ob(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Ob(e)}).join("&")}function sT(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Yl(t){if(typeof t=="string"){if(t=t.toLowerCase(),Tl(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+Ub(t);if(BP.isForkEvent(t))throw $t.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+Ub(t.topics||[])}throw new Error("invalid event - "+t)}function Rc(){return new Date().getTime()}function Db(t){return new Promise(e=>{setTimeout(e,t)})}const oT=["block","network","pending","poll"];let aT=class{constructor(e,r,n){Oe(this,"tag",e),Oe(this,"listener",r),Oe(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=sT(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||oT.indexOf(this.tag)>=0}};const lT={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Zg(t){return Ar(Ee.from(t).toHexString(),32)}function Lb(t){return Iy.encode(gi([t,_n(Pb(Pb(t)),0,4)]))}const F4=new RegExp("^(ipfs)://(.*)$","i"),zb=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),F4,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function zd(t,e){try{return A0(jh(t,e))}catch{}return null}function jh(t,e){if(t==="0x")return null;const r=Ee.from(_n(t,e,e+32)).toNumber(),n=Ee.from(_n(t,r,r+32)).toNumber();return _n(t,r+32,r+32+n)}function em(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):$t.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function jb(t){const e=ct(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function uT(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function C4(t){const e=[];let r=0;for(let n=0;nEe.from(e).eq(1)).catch(e=>{if(e.code===ie.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Ut(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Zn([e,Od(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Zn(["0x9061b923",C4([wP(this.name),n.data])]));try{let s=yield this.provider.call(n);return ct(s).length%32===4&&$t.throwError("resolver threw error",ie.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=jh(s,0)),s}catch(s){if(s.code===ie.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Ut(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?jh(n,0):null})}_getAddress(e,r){const n=lT[String(e)];if(n==null&&$t.throwError(`unsupported coin type: ${e}`,ie.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=ct(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Lb(gi([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Lb(gi([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=Bb.toWords(i.slice(2));return a.unshift(o),Bb.encode(n.prefix,a)}}return null}getAddress(e){return Ut(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===D_?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ie.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Zg(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&$t.throwError("invalid or unsupported coin data",ie.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Ut(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return $t.throwError("invalid or unsupported content hash data",ie.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Ut(this,void 0,void 0,function*(){let r=$s(e);r=gi([Zg(64),Zg(r.length),r]),r.length%32!==0&&(r=gi([r,Ar("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",lt(r));return n==null||n==="0x"?null:A0(n)})}}let tm=null,fT=1;class cT extends E0{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Oe(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Ls(new.target,"getNetwork")(e);r?(Oe(this,"_network",r),this.emit("network",r,null)):$t.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Ut(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||$t.throwError("no network detected",ie.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:Oe(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return zc(()=>this._ready().then(e=>e,e=>{if(!(e.code===ie.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return tm==null&&(tm=new at),tm}static getNetwork(e){return GR(e??"homestead")}ccipReadFetch(e,r,n){return Ut(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),c=yield Nx({url:u,errorPassThrough:!0},f,(y,v)=>(y.status=v.statusCode,y));if(c.data)return c.data;const p=c.message||"unknown error";if(c.status>=400&&c.status<500)return $t.throwError(`response not found during CCIP fetch: ${p}`,ie.errors.SERVER_ERROR,{url:l,errorMessage:p});o.push(p)}return $t.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ie.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Ut(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(Rc()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=Rc(),n=Qr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=Rc();return i=Ee.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Ut(this,void 0,void 0,function*(){const e=fT++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)$t.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",$t.makeError("network block skew detected",ie.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Ut(this,void 0,void 0,function*(){return $t.throwError("provider does not support network detection",ie.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Ut(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield Db(0),this._network;const n=$t.makeError("underlying network changed",ie.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=Rc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Ut(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Ut(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let u=!1;const f=function(){return u?!0:(u=!0,l.forEach(p=>{p()}),!1)},c=p=>{p.confirmations{this.removeListener(e,c)}),i){let p=i.startBlock,y=null;const v=b=>Ut(this,void 0,void 0,function*(){u||(yield Db(1e3),this.getTransactionCount(i.from).then(N=>Ut(this,void 0,void 0,function*(){if(!u){if(N<=i.nonce)p=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(y==null&&(y=p-3,y{u||this.once("block",v)}))});if(u)return;this.once("block",v),l.push(()=>{this.removeListener("block",v)})}if(typeof n=="number"&&n>0){const p=setTimeout(()=>{f()||a($t.makeError("timeout exceeded",ie.errors.TIMEOUT,{timeout:n}))},n);p.unref&&p.unref(),l.push(()=>{clearTimeout(p)})}})})}getBlockNumber(){return Ut(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Ee.from(e)}catch(r){return $t.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return Ee.from(i)}catch(s){return $t.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return Ee.from(i).toNumber()}catch(s){return $t.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return lt(i)}catch(s){return $t.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Ax(o))}),s=yield this.perform("getStorageAt",i);try{return lt(s)}catch(o){return $t.throwError("bad result from backend",ie.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Tl(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&$t.throwError("Transaction hash mismatch from Provider.sendTransaction.",ie.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Ut(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&$t.throwError("transaction failed",ie.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>lt(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Ut(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Ee.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?lt(s):null))}),this.formatter.transactionRequest(yield Qr(n))})}_getFilter(e){return Ut(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield Qr(r))})}_call(e,r,n){return Ut(this,void 0,void 0,function*(){n>=iT&&$t.throwError("CCIP read exceeded maximum redirections",ie.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Tl(s)%32===4)try{const o=_n(s,4),a=_n(o,0,32);Ee.from(a).eq(i)||$t.throwError("CCIP Read sender did not match",ie.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],u=Ee.from(_n(o,32,64)).toNumber(),f=Ee.from(_n(o,u,u+32)).toNumber(),c=_n(o,u+32);for(let x=0;xUt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return zc(()=>Ut(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return zc(()=>Ut(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Ut(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Qr({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),at.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Ut(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Ut(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&$t.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Ut(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new Hb(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Ut(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||$t.throwError("network does not support ENS",ie.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Od(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Ut(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(dr(e))throw n}typeof e!="string"&&$t.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Ut(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=zd(yield this.call({to:n,data:"0x691f3431"+Od(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Ut(this,void 0,void 0,function*(){let r=null;if(dr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new Hb(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ie.errors.CALL_EXCEPTION)throw a}try{const a=zd(yield this.call({to:o,data:"0x691f3431"+Od(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ie.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return $t.throwError(e+" not implemented",ie.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new aT(Yl(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Yl(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Yl(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Yl(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Yl(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Yl(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var no=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Kr=new ie(G1),hT=["call","estimateGas"];function lh(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=dr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=lh(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return lh(JSON.parse(t),e)}catch{}return null}function k4(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=lh(e,!0);if(s)return s.data;Kr.throwError("missing revert data in call exception; Transaction reverted without a reason string",ie.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=lh(e.body,!1);s==null&&(s=lh(e,!1)),s&&Kr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ie.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ie.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Kr.throwError("insufficient funds for intrinsic transaction cost",ie.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Kr.throwError("nonce has already been used",ie.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Kr.throwError("replacement fee too low",ie.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Kr.throwError("legacy pre-eip-155 transactions not supported",ie.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),hT.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Kr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ie.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Gb(t){return new Promise(function(e){setTimeout(e,t)})}function dT(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Tc(t){return t&&t.toLowerCase()}const By={};class _4 extends sc{constructor(e,r,n){if(super(),e!==By)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Oe(this,"provider",r),n==null&&(n=0),typeof n=="string"?(Oe(this,"_address",this.provider.formatter.address(n)),Oe(this,"_index",null)):typeof n=="number"?(Oe(this,"_index",n),Oe(this,"_address",null)):Kr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Kr.throwError("cannot alter JSON-RPC Signer connection",ie.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new pT(By,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&Kr.throwError("unknown account #"+this._index,ie.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Xr(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Xr(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>no(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Kr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),Qr({tx:Qr(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Kr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Kr.throwError("user rejected transaction",ie.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),k4("sendTransaction",o,s)))})}signTransaction(e){return Kr.throwError("signing transactions is unsupported",ie.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return no(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield zc(()=>no(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return no(this,void 0,void 0,function*(){const r=typeof e=="string"?$s(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[lt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Kr.throwError("user rejected signing",ie.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return no(this,void 0,void 0,function*(){const r=typeof e=="string"?$s(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),lt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Kr.throwError("user rejected signing",ie.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return no(this,void 0,void 0,function*(){const i=yield yb.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(yb.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Kr.throwError("user rejected signing",ie.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return no(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class pT extends _4{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const gT={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Rx extends cT{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Ls(this.constructor,"defaultUrl")()),typeof e=="string"?Oe(this,"connection",Object.freeze({url:e})):Oe(this,"connection",Object.freeze(Xr(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return no(this,void 0,void 0,function*(){yield Gb(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Ls(this.constructor,"getNetwork");try{return r(Ee.from(e).toNumber())}catch(n){return Kr.throwError("could not detect network",ie.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Kr.throwError("could not detect network",ie.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new _4(By,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ro(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Nx(this.connection,JSON.stringify(n),dT).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Tc(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Tc(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Tc(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Tc(r.address),Ar(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Ls(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Ls(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Tc(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return no(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&Ee.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Xr(r),r.transaction=Xr(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Kr.throwError(e+" not implemented",ie.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return k4(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return Gb(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Xr(gT);if(r)for(const s in r)r[s]&&(n[s]=!0);f_(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Ax(Ee.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=lt(e[s]))}),e.accessList&&(i.accessList=fc(e.accessList)),i}}const Vb=new ie(G1);let mT=1;function Qb(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:mT++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Ro(s),provider:this}),e(s,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:u,provider:this}),u.error){const f=new Error(u.error.message);return f.code=u.error.code,f.data=u.error.data,a(f)}o(u.result)})})}}function yT(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Ro(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class P4 extends Rx{constructor(e,r){e==null&&Vb.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=yT(e)):e.sendAsync?i=Qb(e,e.sendAsync.bind(e)):e.send?i=Qb(e,e.send.bind(e)):Vb.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),Oe(this,"jsonRpcFetchFunc",i),Oe(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const xT="units/5.7.0",vT=new ie(xT),N4=["wei","kwei","mwei","gwei","szabo","finney","ether"];function wT(t,e){if(typeof e=="string"){const r=N4.indexOf(e);r!==-1&&(e=3*r)}return Md(t,e??18)}function jc(t,e){if(typeof t!="string"&&vT.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=N4.indexOf(e);r!==-1&&(e=3*r)}return Ss(t,e??18)}function bT(t){return wT(t,18)}const AT="modulepreload",ET=function(t){return"/wrose-authzn/"+t},Kb={},ST=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=ET(s),s in Kb)return;Kb[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const c=i[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":AT,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},FT=["string","number","bigint","symbol"],CT=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function kT(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(FT.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(_T(t))return"Buffer";const r=PT(t);return r||"Object"}function _T(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function PT(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(CT.includes(e))return e}class be{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}be.uint=new be(0,"uint",!0);be.negint=new be(1,"negint",!0);be.bytes=new be(2,"bytes",!0);be.string=new be(3,"string",!0);be.array=new be(4,"array",!1);be.map=new be(5,"map",!1);be.tag=new be(6,"tag",!1);be.float=new be(7,"float",!0);be.false=new be(7,"false",!0);be.true=new be(7,"true",!0);be.null=new be(7,"null",!0);be.undefined=new be(7,"undefined",!0);be.break=new be(7,"break",!0);class At{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const cc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",NT=new TextDecoder,RT=new TextEncoder;function Dp(t){return cc&&globalThis.Buffer.isBuffer(t)}function R4(t){return t instanceof Uint8Array?Dp(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const TT=cc?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):Wb(t,e,r):(t,e,r)=>r-e>64?NT.decode(t.subarray(e,r)):Wb(t,e,r),IT=cc?t=>t.length>64?globalThis.Buffer.from(t):$b(t):t=>t.length>64?RT.encode(t):$b(t),eo=t=>Uint8Array.from(t),Tx=cc?(t,e,r)=>Dp(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),MT=cc?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),R4(globalThis.Buffer.concat(t,e))):(t,e)=>{const r=new Uint8Array(e);let n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},BT=cc?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function OT(t,e){if(Dp(t)&&Dp(e))return t.compare(e);for(let r=0;r55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Wb(t,e,r){const n=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=r){let a,l,u,f;switch(o){case 1:i<128&&(s=i);break;case 2:a=t[e+1],(a&192)===128&&(f=(i&31)<<6|a&63,f>127&&(s=f));break;case 3:a=t[e+1],l=t[e+2],(a&192)===128&&(l&192)===128&&(f=(i&15)<<12|(a&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:a=t[e+1],l=t[e+2],u=t[e+3],(a&192)===128&&(l&192)===128&&(u&192)===128&&(f=(i&15)<<18|(a&63)<<12|(l&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=o}return UT(n)}const Jb=4096;function UT(t){const e=t.length;if(e<=Jb)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=Tx(n,0,this.cursor)}else r=MT(this.chunks,this.cursor);return e&&this.reset(),r}}const Xt="CBOR decode error:",I4="CBOR encode error:";function hc(t,e,r){if(t.length-e>>8,n&255])}else if(r>>24&255,n>>>16&255,n>>>8&255,n&255])}else{const n=BigInt(r);if(n>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,t.push(i)}else throw new Error(`${Xt} encountered BigInt larger than allowable range`)}}Wl.encodedSize=function(e){return Ki.encodedSize(e.value)};Ki.encodedSize=function(e){return er.value?1:0};function GT(t,e,r,n){return new At(be.negint,-1-Vl(t,e+1,n),2)}function VT(t,e,r,n){return new At(be.negint,-1-Ql(t,e+1,n),3)}function QT(t,e,r,n){return new At(be.negint,-1-Kl(t,e+1,n),5)}const Ix=BigInt(-1),M4=BigInt(1);function KT(t,e,r,n){const i=$l(t,e+1,n);if(typeof i!="bigint"){const s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new At(be.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Xt} integers outside of the safe integer range are not supported`);return new At(be.negint,Ix-BigInt(i),9)}function Mx(t,e){const r=e.value,n=typeof r=="bigint"?r*Ix-M4:r*-1-1;Ki(t,e.type.majorEncoded,n)}Mx.encodedSize=function(e){const r=e.value,n=typeof r=="bigint"?r*Ix-M4:r*-1-1;return nr.value?-1:0};function F0(t,e,r,n){hc(t,e,r+n);const i=Tx(t,e+r,e+r+n);return new At(be.bytes,i,r+n)}function $T(t,e,r,n){return F0(t,e,1,r)}function WT(t,e,r,n){return F0(t,e,2,Vl(t,e+1,n))}function JT(t,e,r,n){return F0(t,e,3,Ql(t,e+1,n))}function YT(t,e,r,n){return F0(t,e,5,Kl(t,e+1,n))}function qT(t,e,r,n){const i=$l(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer bytes lengths not supported`);return F0(t,e,9,i)}function Lp(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===be.string?IT(t.value):t.value),t.encodedBytes}function V1(t,e){const r=Lp(e);Ki(t,e.type.majorEncoded,r.length),t.push(r)}V1.encodedSize=function(e){const r=Lp(e);return Ki.encodedSize(r.length)+r.length};V1.compareTokens=function(e,r){return XT(Lp(e),Lp(r))};function XT(t,e){return t.lengthe.length?1:OT(t,e)}function C0(t,e,r,n,i){const s=r+n;hc(t,e,s);const o=new At(be.string,TT(t,e+r,e+s),s);return i.retainStringBytes===!0&&(o.byteValue=Tx(t,e+r,e+s)),o}function ZT(t,e,r,n){return C0(t,e,1,r,n)}function eI(t,e,r,n){return C0(t,e,2,Vl(t,e+1,n),n)}function tI(t,e,r,n){return C0(t,e,3,Ql(t,e+1,n),n)}function rI(t,e,r,n){return C0(t,e,5,Kl(t,e+1,n),n)}function nI(t,e,r,n){const i=$l(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer string lengths not supported`);return C0(t,e,9,i,n)}const iI=V1;function dc(t,e,r,n){return new At(be.array,n,r)}function sI(t,e,r,n){return dc(t,e,1,r)}function oI(t,e,r,n){return dc(t,e,2,Vl(t,e+1,n))}function aI(t,e,r,n){return dc(t,e,3,Ql(t,e+1,n))}function lI(t,e,r,n){return dc(t,e,5,Kl(t,e+1,n))}function uI(t,e,r,n){const i=$l(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer array lengths not supported`);return dc(t,e,9,i)}function fI(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Xt} indefinite length items not allowed`);return dc(t,e,1,1/0)}function Bx(t,e){Ki(t,be.array.majorEncoded,e.value)}Bx.compareTokens=Wl.compareTokens;Bx.encodedSize=function(e){return Ki.encodedSize(e.value)};function pc(t,e,r,n){return new At(be.map,n,r)}function cI(t,e,r,n){return pc(t,e,1,r)}function hI(t,e,r,n){return pc(t,e,2,Vl(t,e+1,n))}function dI(t,e,r,n){return pc(t,e,3,Ql(t,e+1,n))}function pI(t,e,r,n){return pc(t,e,5,Kl(t,e+1,n))}function gI(t,e,r,n){const i=$l(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Xt} 64-bit integer map lengths not supported`);return pc(t,e,9,i)}function mI(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Xt} indefinite length items not allowed`);return pc(t,e,1,1/0)}function Ox(t,e){Ki(t,be.map.majorEncoded,e.value)}Ox.compareTokens=Wl.compareTokens;Ox.encodedSize=function(e){return Ki.encodedSize(e.value)};function yI(t,e,r,n){return new At(be.tag,r,1)}function xI(t,e,r,n){return new At(be.tag,Vl(t,e+1,n),2)}function vI(t,e,r,n){return new At(be.tag,Ql(t,e+1,n),3)}function wI(t,e,r,n){return new At(be.tag,Kl(t,e+1,n),5)}function bI(t,e,r,n){return new At(be.tag,$l(t,e+1,n),9)}function Ux(t,e){Ki(t,be.tag.majorEncoded,e.value)}Ux.compareTokens=Wl.compareTokens;Ux.encodedSize=function(e){return Ki.encodedSize(e.value)};const AI=20,EI=21,SI=22,FI=23;function CI(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${Xt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new At(be.null,null,1):new At(be.undefined,void 0,1)}function kI(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Xt} indefinite length items not allowed`);return new At(be.break,void 0,1)}function Dx(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${Xt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${Xt} Infinity values are not supported`)}return new At(be.float,t,e)}function _I(t,e,r,n){return Dx(zx(t,e+1),3,n)}function PI(t,e,r,n){return Dx(jx(t,e+1),5,n)}function NI(t,e,r,n){return Dx(D4(t,e+1),9,n)}function Lx(t,e,r){const n=e.value;if(n===!1)t.push([be.float.majorEncoded|AI]);else if(n===!0)t.push([be.float.majorEncoded|EI]);else if(n===null)t.push([be.float.majorEncoded|SI]);else if(n===void 0)t.push([be.float.majorEncoded|FI]);else{let i,s=!1;(!r||r.float64!==!0)&&(O4(n),i=zx(Xi,1),n===i||Number.isNaN(n)?(Xi[0]=249,t.push(Xi.slice(0,3)),s=!0):(U4(n),i=jx(Xi,1),n===i&&(Xi[0]=250,t.push(Xi.slice(0,5)),s=!0))),s||(RI(n),i=D4(Xi,1),Xi[0]=251,t.push(Xi.slice(0,9)))}}Lx.encodedSize=function(e,r){const n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){O4(n);let i=zx(Xi,1);if(n===i||Number.isNaN(n))return 3;if(U4(n),i=jx(Xi,1),n===i)return 5}return 9};const B4=new ArrayBuffer(9),Ci=new DataView(B4,1),Xi=new Uint8Array(B4,0);function O4(t){if(t===1/0)Ci.setUint16(0,31744,!1);else if(t===-1/0)Ci.setUint16(0,64512,!1);else if(Number.isNaN(t))Ci.setUint16(0,32256,!1);else{Ci.setFloat32(0,t);const e=Ci.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)Ci.setUint16(0,31744,!1);else if(r===0)Ci.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{const i=r-127;i<-24?Ci.setUint16(0,0):i<-14?Ci.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Ci.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function zx(t,e){if(t.length-e<2)throw new Error(`${Xt} not enough data for float16`);const r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;const n=r>>10&31,i=r&1023;let s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function U4(t){Ci.setFloat32(0,t,!1)}function jx(t,e){if(t.length-e<4)throw new Error(`${Xt} not enough data for float32`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}function RI(t){Ci.setFloat64(0,t,!1)}function D4(t,e){if(t.length-e<8)throw new Error(`${Xt} not enough data for float64`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}Lx.compareTokens=Wl.compareTokens;function pr(t,e,r){throw new Error(`${Xt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}function Q1(t){return()=>{throw new Error(`${Xt} ${t}`)}}const $e=[];for(let t=0;t<=23;t++)$e[t]=pr;$e[24]=LT;$e[25]=zT;$e[26]=jT;$e[27]=HT;$e[28]=pr;$e[29]=pr;$e[30]=pr;$e[31]=pr;for(let t=32;t<=55;t++)$e[t]=pr;$e[56]=GT;$e[57]=VT;$e[58]=QT;$e[59]=KT;$e[60]=pr;$e[61]=pr;$e[62]=pr;$e[63]=pr;for(let t=64;t<=87;t++)$e[t]=$T;$e[88]=WT;$e[89]=JT;$e[90]=YT;$e[91]=qT;$e[92]=pr;$e[93]=pr;$e[94]=pr;$e[95]=Q1("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)$e[t]=ZT;$e[120]=eI;$e[121]=tI;$e[122]=rI;$e[123]=nI;$e[124]=pr;$e[125]=pr;$e[126]=pr;$e[127]=Q1("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)$e[t]=sI;$e[152]=oI;$e[153]=aI;$e[154]=lI;$e[155]=uI;$e[156]=pr;$e[157]=pr;$e[158]=pr;$e[159]=fI;for(let t=160;t<=183;t++)$e[t]=cI;$e[184]=hI;$e[185]=dI;$e[186]=pI;$e[187]=gI;$e[188]=pr;$e[189]=pr;$e[190]=pr;$e[191]=mI;for(let t=192;t<=215;t++)$e[t]=yI;$e[216]=xI;$e[217]=vI;$e[218]=wI;$e[219]=bI;$e[220]=pr;$e[221]=pr;$e[222]=pr;$e[223]=pr;for(let t=224;t<=243;t++)$e[t]=Q1("simple values are not supported");$e[244]=pr;$e[245]=pr;$e[246]=pr;$e[247]=CI;$e[248]=Q1("simple values are not supported");$e[249]=_I;$e[250]=PI;$e[251]=NI;$e[252]=pr;$e[253]=pr;$e[254]=pr;$e[255]=kI;const Zs=[];for(let t=0;t<24;t++)Zs[t]=new At(be.uint,t,1);for(let t=-1;t>=-24;t--)Zs[31-t]=new At(be.negint,t,1);Zs[64]=new At(be.bytes,new Uint8Array(0),1);Zs[96]=new At(be.string,"",1);Zs[128]=new At(be.array,0,1);Zs[160]=new At(be.map,0,1);Zs[244]=new At(be.false,!1,1);Zs[245]=new At(be.true,!0,1);Zs[246]=new At(be.null,null,1);function TI(t){switch(t.type){case be.false:return eo([244]);case be.true:return eo([245]);case be.null:return eo([246]);case be.bytes:return t.value.length?void 0:eo([64]);case be.string:return t.value===""?eo([96]):void 0;case be.array:return t.value===0?eo([128]):void 0;case be.map:return t.value===0?eo([160]):void 0;case be.uint:return t.value<24?eo([Number(t.value)]):void 0;case be.negint:if(t.value>=-24)return eo([31-Number(t.value)])}}const II={float64:!1,mapSorter:OI,quickEncodeToken:TI};function MI(){const t=[];return t[be.uint.major]=Wl,t[be.negint.major]=Mx,t[be.bytes.major]=V1,t[be.string.major]=iI,t[be.array.major]=Bx,t[be.map.major]=Ox,t[be.tag.major]=Ux,t[be.float.major]=Lx,t}const L4=MI(),rm=new T4;class zp{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${I4} object contains circular references`);return new zp(r,e)}}const Ko={null:new At(be.null,null),undefined:new At(be.undefined,void 0),true:new At(be.true,!0),false:new At(be.false,!1),emptyArray:new At(be.array,0),emptyMap:new At(be.map,0)},Ba={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new At(be.float,t):t>=0?new At(be.uint,t):new At(be.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new At(be.uint,t):new At(be.negint,t)},Uint8Array(t,e,r,n){return new At(be.bytes,t)},string(t,e,r,n){return new At(be.string,t)},boolean(t,e,r,n){return t?Ko.true:Ko.false},null(t,e,r,n){return Ko.null},undefined(t,e,r,n){return Ko.undefined},ArrayBuffer(t,e,r,n){return new At(be.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new At(be.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Ko.emptyArray,new At(be.break)]:Ko.emptyArray;n=zp.createCheck(n,t);const i=[];let s=0;for(const o of t)i[s++]=jd(o,r,n);return r.addBreakTokens?[new At(be.array,t.length),i,new At(be.break)]:[new At(be.array,t.length),i]},Object(t,e,r,n){const i=e!=="Object",s=i?t.keys():Object.keys(t),o=i?t.size:s.length;if(!o)return r.addBreakTokens===!0?[Ko.emptyMap,new At(be.break)]:Ko.emptyMap;n=zp.createCheck(n,t);const a=[];let l=0;for(const u of s)a[l++]=[jd(u,r,n),jd(i?t.get(u):t[u],r,n)];return BI(a,r),r.addBreakTokens?[new At(be.map,o),a,new At(be.break)]:[new At(be.map,o),a]}};Ba.Map=Ba.Object;Ba.Buffer=Ba.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Ba[`${t}Array`]=Ba.DataView;function jd(t,e={},r){const n=kT(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Ba[n];if(typeof i=="function"){const o=i(t,n,e,r);if(o!=null)return o}const s=Ba[n];if(!s)throw new Error(`${I4} unsupported type: ${n}`);return s(t,n,e,r)}function BI(t,e){e.mapSorter&&t.sort(e.mapSorter)}function OI(t,e){const r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);const i=r.type.major,s=L4[i].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}function z4(t,e,r,n){if(Array.isArray(e))for(const i of e)z4(t,i,r,n);else r[e.type.major](t,e,n)}function UI(t,e,r){const n=jd(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){const i=r.quickEncodeToken(n);if(i)return i;const s=e[n.type.major];if(s.encodedSize){const o=s.encodedSize(n,r),a=new T4(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return R4(a.chunks[0])}}return rm.reset(),z4(rm,n,e,r),rm.toBytes(!0)}function su(t,e){return e=Object.assign({},II,e),UI(t,L4,e)}const DI={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class LI{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let r=Zs[e];if(r===void 0){const n=$e[e];if(!n)throw new Error(`${Xt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}}const Hh=Symbol.for("DONE"),K1=Symbol.for("BREAK");function zI(t,e,r){const n=[];for(let i=0;i>>0},e.getByteBigEndian=function(n,i){return n>>>8*(3-i)&255},e.getBytesBigEndian=function(n){return[e.getByteBigEndian(n,0),e.getByteBigEndian(n,1),e.getByteBigEndian(n,2),e.getByteBigEndian(n,3)]},e.toHex=function(n,i){i=i||8;var s=n.toString(16);return s.length>>0},e.highPart=function(n){return e.toUint32(n/r)},e.or=function(n,i){for(var s=n,o=1;o>>0},e.and=function(n,i){for(var s=n,o=1;o>>0},e.xor=function(n,i){for(var s=n,o=1;o>>0},e.not=function(n){return~n>>>0},e.shiftLeft=function(n,i){return n<>>0},e.shiftRight=function(n,i){return n>>>i},e.rotateLeft=function(n,i){return(n<>>0|n>>>32-i)>>>0},e.rotateRight=function(n,i){return(n>>>i|n<<32-i>>>0)>>>0},e.choose=function(n,i,s){return(n&(i^s)^s)>>>0},e.majority=function(n,i,s){return(n&(i|s)|i&s)>>>0},e.addMod32=function(n){for(var i=n,s=1;s>>0},e.log2=function(n){return Math.floor(Math.log(n)/Math.LN2)},e.mult=function(n,i,s){var o=((n&4294901760)>>>0)*i,a=(n&65535)*i,l=e.toUint32(o)+e.toUint32(a)>=r?1:0;s[0]=e.highPart(o)+e.highPart(a)+l>>>0,s[1]=(o>>>0)+(a>>>0)}})(t.exports={})})(P4);var zx=P4.exports,j=zx;const GT=[1,2,4,8,16,32,64,128,27,54],Gf=j.fromBytesBigEndian(85,85,85,85),Vf=j.fromBytesBigEndian(170,170,170,170),rd=j.fromBytesBigEndian(51,51,51,51),nd=j.fromBytesBigEndian(204,204,204,204),Jb=j.fromBytesBigEndian(15,15,15,15),Wb=j.fromBytesBigEndian(240,240,240,240),VT=j.fromBytesBigEndian(0,0,0,255),QT=j.fromBytesBigEndian(0,0,252,0),$T=j.fromBytesBigEndian(0,0,3,0),KT=j.fromBytesBigEndian(0,240,0,0),JT=j.fromBytesBigEndian(0,15,0,0),WT=j.fromBytesBigEndian(192,0,0,0),YT=j.fromBytesBigEndian(63,0,0,0);function My(){return new Uint32Array(8)}function Hd(t,e){t[0]=j.xor(t[0],e[0]),t[1]=j.xor(t[1],e[1]),t[2]=j.xor(t[2],e[2]),t[3]=j.xor(t[3],e[3]),t[4]=j.xor(t[4],e[4]),t[5]=j.xor(t[5],e[5]),t[6]=j.xor(t[6],e[6]),t[7]=j.xor(t[7],e[7])}function zp(t){const e=t[7],r=t[6],n=t[5],i=t[4],s=t[3],o=t[2],a=t[1],l=t[0],u=j.xor(i,o),f=j.xor(e,a),c=j.xor(e,i),p=j.xor(e,o),y=j.xor(r,n),v=j.xor(y,l),b=j.xor(v,i),N=j.xor(f,u),x=j.xor(v,e),A=j.xor(v,a),C=j.xor(A,p),F=j.xor(s,N),z=j.xor(F,o),T=j.xor(F,r),D=j.xor(z,l),G=j.xor(z,y),$=j.xor(T,c),ne=j.xor(l,$),te=j.xor(G,$),de=j.xor(G,p),_=j.xor(y,$),h=j.xor(f,_),m=j.xor(e,_),S=j.and(N,z),M=j.and(C,D),R=j.xor(M,S),U=j.and(b,l),H=j.xor(U,S),B=j.and(f,_),g=j.and(A,v),O=j.xor(g,B),ve=j.and(x,ne),E=j.xor(ve,B),W=j.and(c,$),oe=j.and(u,te),J=j.xor(oe,W),K=j.and(p,G),V=j.xor(K,W),Z=j.xor(R,J),he=j.xor(H,V),Ue=j.xor(O,J),pe=j.xor(E,V),Be=j.xor(Z,T),ut=j.xor(he,de),We=j.xor(Ue,h),Ye=j.xor(pe,m),pt=j.xor(Be,ut),ze=j.and(Be,We),ye=j.xor(Ye,ze),De=j.and(pt,ye),Ce=j.xor(De,ut),tt=j.xor(We,Ye),Dt=j.xor(ut,ze),yt=j.and(Dt,tt),Ct=j.xor(yt,Ye),fr=j.xor(We,Ct),Tt=j.xor(ye,Ct),It=j.and(Ye,Tt),Wt=j.xor(It,fr),Et=j.xor(ye,It),kt=j.and(Ce,Et),$t=j.xor(pt,kt),xt=j.xor($t,Wt),vt=j.xor(Ce,Ct),ir=j.xor(Ce,$t),St=j.xor(Ct,Wt),_t=j.xor(vt,xt),q=j.and(St,z),re=j.and(Wt,D),ae=j.and(Ct,l),ke=j.and(ir,_),Ie=j.and($t,v),Le=j.and(Ce,ne),ht=j.and(vt,$),He=j.and(_t,te),je=j.and(xt,G),Gt=j.and(St,N),wt=j.and(Wt,C),Je=j.and(Ct,b),Ht=j.and(ir,f),w=j.and($t,A),k=j.and(Ce,x),P=j.and(vt,c),d=j.and(_t,u),I=j.and(xt,p),X=j.xor(P,d),Y=j.xor(wt,Je),ue=j.xor(Le,w),Se=j.xor(Gt,wt),Re=j.xor(ae,Ht),Fe=j.xor(ae,Le),qe=j.xor(He,je),Me=j.xor(q,ke),rt=j.xor(ht,He),Ve=j.xor(d,I),dt=j.xor(Ht,ue),Ft=j.xor(Re,Me),gt=j.xor(Ie,X),Pt=j.xor(ke,rt),Nt=j.xor(X,Ft),Xe=j.xor(k,Ft),st=j.xor(qe,gt),Qe=j.xor(Se,gt),Ze=j.xor(Ie,Pt),et=j.xor(Xe,st),Ge=j.xor(re,Qe),fe=j.xor(Pt,Qe),ce=j.xor(dt,j.not(st)),Ae=j.xor(ue,j.not(Nt)),ge=j.xor(Ze,et),xe=j.xor(Me,Ge),_e=j.xor(Fe,Ge),bt=j.xor(Y,et),Bt=j.xor(Ze,j.not(xe)),Lt=j.xor(Ve,j.not(ge));t[7]=fe,t[6]=Bt,t[5]=Lt,t[4]=xe,t[3]=_e,t[2]=bt,t[1]=ce,t[0]=Ae}function By(t){for(let e=0;e<8;e++){const r=t[e];t[e]=j.or(j.and(r,VT),j.shiftRight(j.and(r,QT),2),j.shiftLeft(j.and(r,$T),6),j.shiftRight(j.and(r,KT),4),j.shiftLeft(j.and(r,JT),4),j.shiftRight(j.and(r,WT),6),j.shiftLeft(j.and(r,YT),2))}}function N4(t){const e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],l=t[7],u=j.or(j.shiftRight(e,8),j.shiftLeft(e,24)),f=j.or(j.shiftRight(r,8),j.shiftLeft(r,24)),c=j.or(j.shiftRight(n,8),j.shiftLeft(n,24)),p=j.or(j.shiftRight(i,8),j.shiftLeft(i,24)),y=j.or(j.shiftRight(s,8),j.shiftLeft(s,24)),v=j.or(j.shiftRight(o,8),j.shiftLeft(o,24)),b=j.or(j.shiftRight(a,8),j.shiftLeft(a,24)),N=j.or(j.shiftRight(l,8),j.shiftLeft(l,24));t[0]=j.xor(l,N,u,j.rotateRight(j.xor(e,u),16)),t[1]=j.xor(e,u,l,N,f,j.rotateRight(j.xor(r,f),16)),t[2]=j.xor(r,f,c,j.rotateRight(j.xor(n,c),16)),t[3]=j.xor(n,c,l,N,p,j.rotateRight(j.xor(i,p),16)),t[4]=j.xor(i,p,l,N,y,j.rotateRight(j.xor(s,y),16)),t[5]=j.xor(s,y,v,j.rotateRight(j.xor(o,v),16)),t[6]=j.xor(o,v,b,j.rotateRight(j.xor(a,b),16)),t[7]=j.xor(a,b,N,j.rotateRight(j.xor(l,N),16))}function R4(t,e){const r=new DataView(e.buffer);t[0]=r.getUint32(0+e.byteOffset,!0),t[2]=r.getUint32(4+e.byteOffset,!0),t[4]=r.getUint32(8+e.byteOffset,!0),t[6]=r.getUint32(12+e.byteOffset,!0),t[1]=0,t[3]=0,t[5]=0,t[7]=0,Mo(t)}function T4(t,e,r){const n=new DataView(e.buffer),i=new DataView(r.buffer);t[0]=n.getUint32(0+e.byteOffset,!0),t[2]=n.getUint32(4+e.byteOffset,!0),t[4]=n.getUint32(8+e.byteOffset,!0),t[6]=n.getUint32(12+e.byteOffset,!0),t[1]=i.getUint32(0+r.byteOffset,!0),t[3]=i.getUint32(4+r.byteOffset,!0),t[5]=i.getUint32(8+r.byteOffset,!0),t[7]=i.getUint32(12+r.byteOffset,!0),Mo(t)}function I4(t,e){Mo(e);const r=new DataView(t.buffer);r.setUint32(0+t.byteOffset,e[0],!0),r.setUint32(4+t.byteOffset,e[2],!0),r.setUint32(8+t.byteOffset,e[4],!0),r.setUint32(12+t.byteOffset,e[6],!0)}function M4(t,e,r){Mo(r);const n=new DataView(t.buffer),i=new DataView(e.buffer);n.setUint32(0+t.byteOffset,r[0],!0),n.setUint32(4+t.byteOffset,r[2],!0),n.setUint32(8+t.byteOffset,r[4],!0),n.setUint32(12+t.byteOffset,r[6],!0),i.setUint32(0+e.byteOffset,r[1],!0),i.setUint32(4+e.byteOffset,r[3],!0),i.setUint32(8+e.byteOffset,r[5],!0),i.setUint32(12+e.byteOffset,r[7],!0)}function Mo(t){for(let e=0;e<8;e+=2){const r=t[e],n=t[e+1];t[e]=j.or(j.and(r,Gf),j.shiftLeft(j.and(n,Gf),1)),t[e+1]=j.or(j.shiftRight(j.and(r,Vf),1),j.and(n,Vf))}for(let e=0;e<8;e+=4){const r=t[e],n=t[e+1],i=t[e+2],s=t[e+3];t[e]=j.or(j.and(r,rd),j.shiftLeft(j.and(i,rd),2)),t[e+2]=j.or(j.shiftRight(j.and(r,nd),2),j.and(i,nd)),t[e+1]=j.or(j.and(n,rd),j.shiftLeft(j.and(s,rd),2)),t[e+3]=j.or(j.shiftRight(j.and(n,nd),2),j.and(s,nd))}for(let e=0;e<4;e++){const r=t[e],n=t[e+4];t[e]=j.or(j.and(r,Jb),j.shiftLeft(j.and(n,Jb),4)),t[e+4]=j.or(j.shiftRight(j.and(r,Wb),4),j.and(n,Wb))}}function qT(t,e){const r=new DataView(e.buffer);for(let n=0;n<4;n++){const i=r.getUint32(n*4+e.byteOffset,!0);t[n*2]=i,t[n*2+1]=i}Mo(t);for(let n=0,i=0;n<4;n=n+1,i=i+2){let s=j.or(j.and(t[i+0],Gf),j.and(t[i+1],Vf)),o=s;s=j.and(s,Gf),t[i]=j.or(s,j.shiftLeft(s,1)),o=j.and(o,Vf),t[i+1]=j.or(o,j.shiftRight(o,1))}}function B4(t,e,r){const n=(e+1)*4;for(let i=0,s=0;i6&&f==4&&(s=Yb(s)),s=j.xor(s,i[(u-o)*2]),i[u*2]=s,i[u*2+1]=s,f++,f==o&&(f=0,c++);for(let u=0;u>7,i=r>>5&1;t[e]=r<<1|n^i}}function sI(t){for(let e=0;e>6&1;t[e]=r>>1|(n^i)<<7}}function Xb(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=ld[e],t[5]^=ld[e],t[6]^=ld[e],t[7]^=ld[e]}function oI(t,e){let r=t.subarray(16,32),n=t.subarray(0,16);ni(e[0],r,n,Qf),Xb(e[0],0);for(let i=1;i<=xa;i++)iI(r),Uy(r),sI(n),Uy(n),ni(e[i],r,n,Qf),Xb(e[i],i)}function Hc(t,e,r){let n=new Uint8Array(r);ni(t[0],e[0],n,Qf);for(let i=1;i<=xa;i++)Uy(n),ni(t[i],e[i],n,Qf)}function ea(){let t=[];for(let e=0;e<=xa;e++)t.push(new Uint8Array(16));return t}class aI{static bcEncrypt(e,r,n,i){let s=ea();Hc(s,r,n);let o=Ot.newQ(),a=Ot.newQ();Ot.load4xU32(o,i),Ot.load4xU32(a,s[0]),Ot.addRoundKey(o,a);for(let l=1;l<=xa;l++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load4xU32(a,s[l]),Ot.addRoundKey(o,a);Ot.store4xU32(e,o)}static bcKeystreamx2(e,r,n,i){let s=[ea(),ea()];for(let l=0;l<2;l++)Hc(s[l],r,n[l]);let o=Ot.newQ(),a=Ot.newQ();Ot.rkeyOrtho(o,i),Ot.load8xU32(a,s[0][0],s[1][0]),Ot.addRoundKey(o,a);for(let l=1;l<=xa;l++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load8xU32(a,s[0][l],s[1][l]),Ot.addRoundKey(o,a);Ot.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,r,n,i){let s=ea();Hc(s,r,n);let o=Ot.newQ(),a=Ot.newQ();Ot.load4xU32(o,i),Ot.load4xU32(a,s[0]),Ot.addRoundKey(o,a);for(let y=1;y<=xa;y++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load4xU32(a,s[y]),Ot.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),p=l.getUint32(12,!0);Ot.ortho(o),u=Ii.xor(u,o[0]),f=Ii.xor(f,o[2]),c=Ii.xor(c,o[4]),p=Ii.xor(p,o[6]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,p,!0)}static bcTagx2(e,r,n,i){let s=[ea(),ea()];for(let y=0;y<2;y++)Hc(s[y],r,n[y]);let o=Ot.newQ(),a=Ot.newQ();Ot.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Ot.load8xU32(a,s[0][0],s[1][0]),Ot.addRoundKey(o,a);for(let y=1;y<=xa;y++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load8xU32(a,s[0][y],s[1][y]),Ot.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),p=l.getUint32(12,!0);Ot.ortho(o),u=Ii.xor(u,o[0],o[1]),f=Ii.xor(f,o[2],o[3]),c=Ii.xor(c,o[4],o[5]),p=Ii.xor(p,o[6],o[7]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,p,!0)}}class lI{static bcEncrypt(e,r,n,i){let s=ea();Hc(s,r,n);const o=new DataView(i.buffer);let a=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),u=o.getUint32(8+i.byteOffset,!1),f=o.getUint32(12+i.byteOffset,!1);const c=new DataView(s[0].buffer);a=Ii.xor(a,c.getUint32(0+s[0].byteOffset,!1)),l=Ii.xor(l,c.getUint32(4+s[0].byteOffset,!1)),u=Ii.xor(u,c.getUint32(8+s[0].byteOffset,!1)),f=Ii.xor(f,c.getUint32(12+s[0].byteOffset,!1));for(let y=1;y<=xa;y++)[a,l,u,f]=rI.aesencVartime(a,l,u,f,s[y]);const p=new DataView(e.buffer);p.setUint32(0+e.byteOffset,a,!1),p.setUint32(4+e.byteOffset,l,!1),p.setUint32(8+e.byteOffset,u,!1),p.setUint32(12+e.byteOffset,f,!1)}static bcKeystreamx2(e,r,n,i){this.bcEncrypt(e.subarray(0,16),r,n[0],i),this.bcEncrypt(e.subarray(16,32),r,n[1],i)}static bcTagx1(e,r,n,i){let s=new Uint8Array($e);this.bcEncrypt(s,r,n,i),ni(e,e,s,$e)}static bcTagx2(e,r,n,i){let s=new Uint8Array(2*$e);this.bcEncrypt(s.subarray(0,16),r,n[0],i.subarray(0,16)),this.bcEncrypt(s.subarray(16,32),r,n[1],i.subarray(16,32)),ni(e,e,s.subarray(0,16),$e),ni(e,e,s.subarray(16,32),$e)}}function Cn(t,e,r){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,r,!1),t[0]=e<=2*$e;a+=2)Cn(o[0],Hu,a),Cn(o[1],Hu,a+1),t.bcTagx2(f,e,o,i.subarray(a*$e,(a+2)*$e)),u-=2*$e;for(;u>=$e;a++)Cn(o[0],Hu,a),t.bcTagx1(f,e,o[0],i.subarray(a*$e,(a+1)*$e)),u-=$e;if(u>0){Cn(o[0],D4,a);let v=new Uint8Array($e);v.set(i.subarray(i.length-u)),v[u]=128,t.bcTagx1(f,e,o[0],v)}let c=s.length;for(l=0;c>=2*$e;l+=2)Cn(o[0],Gu,l),Cn(o[1],Gu,l+1),t.bcTagx2(f,e,o,s.subarray(l*$e,(l+2)*$e)),c-=2*$e;for(;c>=$e;l++)Cn(o[0],Gu,l),t.bcTagx1(f,e,o[0],s.subarray(l*$e,(l+1)*$e)),c-=$e;if(c>0){Cn(o[0],L4,l);let v=new Uint8Array($e);v.set(s.subarray(s.length-c)),v[c]=128,t.bcTagx1(f,e,o[0],v)}let p=new Uint8Array($e);p.set(r,1),p[0]=z4<=2*$e;l+=2)va(o[0],f,l),va(o[1],f,l+1),t.bcKeystreamx2(y,e,o,p),ni(n.subarray(l*$e,(l+2)*$e),s.subarray(l*$e,(l+2)*$e),y,2*$e),c-=2*$e;for(;c>=$e;l++)va(o[0],f,l),t.bcEncrypt(y,e,o[0],p),ni(n.subarray(l*$e,(l+1)*$e),s.subarray(l*$e,(l+1)*$e),y,$e),c-=$e;c>0&&(va(o[0],f,l),t.bcEncrypt(y,e,o[0],p),ni(n.subarray(l*$e,s.length),s.subarray(l*$e),y,c)),n.set(f,s.length)}function fI(t,e,r,n,i,s){let o=s.length-bl;const a=s.subarray(0,o),l=s.subarray(o);let u=0,f=Dy(),c=new Uint8Array($e);c.set(r,1);let p=new Uint8Array(2*$e);for(u=0;o>=2*$e;u+=2)va(f[0],l,u),va(f[1],l,u+1),t.bcKeystreamx2(p,e,f,c),ni(n.subarray(u*$e,(u+2)*$e),a.subarray(u*$e,(u+2)*$e),p,2*$e),o-=2*$e;for(;o>=$e;u++)va(f[0],l,u),t.bcEncrypt(p,e,f[0],c),ni(n.subarray(u*$e,(u+1)*$e),a.subarray(u*$e,(u+1)*$e),p,$e),o-=$e;o>0&&(va(f[0],l,u),t.bcEncrypt(p,e,f[0],c),ni(n.subarray(u*$e),a.subarray(u*$e),p,o));let y=0,v=i.length,b=Dy(),N=new Uint8Array(bl);for(y=0;v>=2*$e;y+=2)Cn(b[0],Hu,y),Cn(b[1],Hu,y+1),t.bcTagx2(N,e,b,i.subarray(y*$e,(y+2)*$e)),v-=2*$e;for(;v>=$e;y++)Cn(b[0],Hu,y),t.bcTagx1(N,e,b[0],i.subarray(y*$e,(y+1)*$e)),v-=$e;if(v>0){Cn(b[0],D4,y);let C=new Uint8Array($e);C.set(i.subarray(i.length-v)),C[v]=128,t.bcTagx1(N,e,b[0],C)}let x=n.length;for(u=0;x>=2*$e;u+=2)Cn(b[0],Gu,u),Cn(b[1],Gu,u+1),t.bcTagx2(N,e,b,n.subarray(u*$e,(u+2)*$e)),x-=2*$e;for(;x>=$e;u++)Cn(b[0],Gu,u),t.bcTagx1(N,e,b[0],n.subarray(u*$e,(u+1)*$e)),x-=$e;if(x>0){Cn(b[0],L4,u);let C=new Uint8Array($e);C.set(n.subarray(n.length-x)),C[x]=128,t.bcTagx1(N,e,b[0],C)}if(c[0]=z4<>>0},e.getByteBigEndian=function(n,i){return n>>>8*(3-i)&255},e.getBytesBigEndian=function(n){return[e.getByteBigEndian(n,0),e.getByteBigEndian(n,1),e.getByteBigEndian(n,2),e.getByteBigEndian(n,3)]},e.toHex=function(n,i){i=i||8;var s=n.toString(16);return s.length>>0},e.highPart=function(n){return e.toUint32(n/r)},e.or=function(n,i){for(var s=n,o=1;o>>0},e.and=function(n,i){for(var s=n,o=1;o>>0},e.xor=function(n,i){for(var s=n,o=1;o>>0},e.not=function(n){return~n>>>0},e.shiftLeft=function(n,i){return n<>>0},e.shiftRight=function(n,i){return n>>>i},e.rotateLeft=function(n,i){return(n<>>0|n>>>32-i)>>>0},e.rotateRight=function(n,i){return(n>>>i|n<<32-i>>>0)>>>0},e.choose=function(n,i,s){return(n&(i^s)^s)>>>0},e.majority=function(n,i,s){return(n&(i|s)|i&s)>>>0},e.addMod32=function(n){for(var i=n,s=1;s>>0},e.log2=function(n){return Math.floor(Math.log(n)/Math.LN2)},e.mult=function(n,i,s){var o=((n&4294901760)>>>0)*i,a=(n&65535)*i,l=e.toUint32(o)+e.toUint32(a)>=r?1:0;s[0]=e.highPart(o)+e.highPart(a)+l>>>0,s[1]=(o>>>0)+(a>>>0)}})(t.exports={})})(j4);var Hx=j4.exports,j=Hx;const HI=[1,2,4,8,16,32,64,128,27,54],Gf=j.fromBytesBigEndian(85,85,85,85),Vf=j.fromBytesBigEndian(170,170,170,170),nd=j.fromBytesBigEndian(51,51,51,51),id=j.fromBytesBigEndian(204,204,204,204),Yb=j.fromBytesBigEndian(15,15,15,15),qb=j.fromBytesBigEndian(240,240,240,240),GI=j.fromBytesBigEndian(0,0,0,255),VI=j.fromBytesBigEndian(0,0,252,0),QI=j.fromBytesBigEndian(0,0,3,0),KI=j.fromBytesBigEndian(0,240,0,0),$I=j.fromBytesBigEndian(0,15,0,0),WI=j.fromBytesBigEndian(192,0,0,0),JI=j.fromBytesBigEndian(63,0,0,0);function Oy(){return new Uint32Array(8)}function Gd(t,e){t[0]=j.xor(t[0],e[0]),t[1]=j.xor(t[1],e[1]),t[2]=j.xor(t[2],e[2]),t[3]=j.xor(t[3],e[3]),t[4]=j.xor(t[4],e[4]),t[5]=j.xor(t[5],e[5]),t[6]=j.xor(t[6],e[6]),t[7]=j.xor(t[7],e[7])}function jp(t){const e=t[7],r=t[6],n=t[5],i=t[4],s=t[3],o=t[2],a=t[1],l=t[0],u=j.xor(i,o),f=j.xor(e,a),c=j.xor(e,i),p=j.xor(e,o),y=j.xor(r,n),v=j.xor(y,l),b=j.xor(v,i),N=j.xor(f,u),x=j.xor(v,e),A=j.xor(v,a),C=j.xor(A,p),F=j.xor(s,N),L=j.xor(F,o),T=j.xor(F,r),z=j.xor(L,l),H=j.xor(L,y),K=j.xor(T,c),ne=j.xor(l,K),te=j.xor(H,K),de=j.xor(H,p),_=j.xor(y,K),h=j.xor(f,_),m=j.xor(e,_),S=j.and(N,L),M=j.and(C,z),R=j.xor(M,S),U=j.and(b,l),G=j.xor(U,S),B=j.and(f,_),g=j.and(A,v),O=j.xor(g,B),ve=j.and(x,ne),E=j.xor(ve,B),J=j.and(c,K),oe=j.and(u,te),W=j.xor(oe,J),$=j.and(p,H),V=j.xor($,J),Z=j.xor(R,W),he=j.xor(G,V),Ue=j.xor(O,W),pe=j.xor(E,V),Be=j.xor(Z,T),ut=j.xor(he,de),Je=j.xor(Ue,h),Ye=j.xor(pe,m),pt=j.xor(Be,ut),ze=j.and(Be,Je),ye=j.xor(Ye,ze),De=j.and(pt,ye),Ce=j.xor(De,ut),tt=j.xor(Je,Ye),Dt=j.xor(ut,ze),yt=j.and(Dt,tt),Ct=j.xor(yt,Ye),fr=j.xor(Je,Ct),Tt=j.xor(ye,Ct),It=j.and(Ye,Tt),Jt=j.xor(It,fr),Et=j.xor(ye,It),kt=j.and(Ce,Et),Kt=j.xor(pt,kt),xt=j.xor(Kt,Jt),vt=j.xor(Ce,Ct),ir=j.xor(Ce,Kt),St=j.xor(Ct,Jt),_t=j.xor(vt,xt),q=j.and(St,L),re=j.and(Jt,z),ae=j.and(Ct,l),ke=j.and(ir,_),Ie=j.and(Kt,v),Le=j.and(Ce,ne),ht=j.and(vt,K),He=j.and(_t,te),je=j.and(xt,H),Gt=j.and(St,N),wt=j.and(Jt,C),We=j.and(Ct,b),Ht=j.and(ir,f),w=j.and(Kt,A),k=j.and(Ce,x),P=j.and(vt,c),d=j.and(_t,u),I=j.and(xt,p),X=j.xor(P,d),Y=j.xor(wt,We),ue=j.xor(Le,w),Se=j.xor(Gt,wt),Re=j.xor(ae,Ht),Fe=j.xor(ae,Le),qe=j.xor(He,je),Me=j.xor(q,ke),rt=j.xor(ht,He),Ve=j.xor(d,I),dt=j.xor(Ht,ue),Ft=j.xor(Re,Me),gt=j.xor(Ie,X),Pt=j.xor(ke,rt),Nt=j.xor(X,Ft),Xe=j.xor(k,Ft),st=j.xor(qe,gt),Qe=j.xor(Se,gt),Ze=j.xor(Ie,Pt),et=j.xor(Xe,st),Ge=j.xor(re,Qe),fe=j.xor(Pt,Qe),ce=j.xor(dt,j.not(st)),Ae=j.xor(ue,j.not(Nt)),ge=j.xor(Ze,et),xe=j.xor(Me,Ge),_e=j.xor(Fe,Ge),bt=j.xor(Y,et),Bt=j.xor(Ze,j.not(xe)),Lt=j.xor(Ve,j.not(ge));t[7]=fe,t[6]=Bt,t[5]=Lt,t[4]=xe,t[3]=_e,t[2]=bt,t[1]=ce,t[0]=Ae}function Uy(t){for(let e=0;e<8;e++){const r=t[e];t[e]=j.or(j.and(r,GI),j.shiftRight(j.and(r,VI),2),j.shiftLeft(j.and(r,QI),6),j.shiftRight(j.and(r,KI),4),j.shiftLeft(j.and(r,$I),4),j.shiftRight(j.and(r,WI),6),j.shiftLeft(j.and(r,JI),2))}}function H4(t){const e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],l=t[7],u=j.or(j.shiftRight(e,8),j.shiftLeft(e,24)),f=j.or(j.shiftRight(r,8),j.shiftLeft(r,24)),c=j.or(j.shiftRight(n,8),j.shiftLeft(n,24)),p=j.or(j.shiftRight(i,8),j.shiftLeft(i,24)),y=j.or(j.shiftRight(s,8),j.shiftLeft(s,24)),v=j.or(j.shiftRight(o,8),j.shiftLeft(o,24)),b=j.or(j.shiftRight(a,8),j.shiftLeft(a,24)),N=j.or(j.shiftRight(l,8),j.shiftLeft(l,24));t[0]=j.xor(l,N,u,j.rotateRight(j.xor(e,u),16)),t[1]=j.xor(e,u,l,N,f,j.rotateRight(j.xor(r,f),16)),t[2]=j.xor(r,f,c,j.rotateRight(j.xor(n,c),16)),t[3]=j.xor(n,c,l,N,p,j.rotateRight(j.xor(i,p),16)),t[4]=j.xor(i,p,l,N,y,j.rotateRight(j.xor(s,y),16)),t[5]=j.xor(s,y,v,j.rotateRight(j.xor(o,v),16)),t[6]=j.xor(o,v,b,j.rotateRight(j.xor(a,b),16)),t[7]=j.xor(a,b,N,j.rotateRight(j.xor(l,N),16))}function G4(t,e){const r=new DataView(e.buffer);t[0]=r.getUint32(0+e.byteOffset,!0),t[2]=r.getUint32(4+e.byteOffset,!0),t[4]=r.getUint32(8+e.byteOffset,!0),t[6]=r.getUint32(12+e.byteOffset,!0),t[1]=0,t[3]=0,t[5]=0,t[7]=0,Mo(t)}function V4(t,e,r){const n=new DataView(e.buffer),i=new DataView(r.buffer);t[0]=n.getUint32(0+e.byteOffset,!0),t[2]=n.getUint32(4+e.byteOffset,!0),t[4]=n.getUint32(8+e.byteOffset,!0),t[6]=n.getUint32(12+e.byteOffset,!0),t[1]=i.getUint32(0+r.byteOffset,!0),t[3]=i.getUint32(4+r.byteOffset,!0),t[5]=i.getUint32(8+r.byteOffset,!0),t[7]=i.getUint32(12+r.byteOffset,!0),Mo(t)}function Q4(t,e){Mo(e);const r=new DataView(t.buffer);r.setUint32(0+t.byteOffset,e[0],!0),r.setUint32(4+t.byteOffset,e[2],!0),r.setUint32(8+t.byteOffset,e[4],!0),r.setUint32(12+t.byteOffset,e[6],!0)}function K4(t,e,r){Mo(r);const n=new DataView(t.buffer),i=new DataView(e.buffer);n.setUint32(0+t.byteOffset,r[0],!0),n.setUint32(4+t.byteOffset,r[2],!0),n.setUint32(8+t.byteOffset,r[4],!0),n.setUint32(12+t.byteOffset,r[6],!0),i.setUint32(0+e.byteOffset,r[1],!0),i.setUint32(4+e.byteOffset,r[3],!0),i.setUint32(8+e.byteOffset,r[5],!0),i.setUint32(12+e.byteOffset,r[7],!0)}function Mo(t){for(let e=0;e<8;e+=2){const r=t[e],n=t[e+1];t[e]=j.or(j.and(r,Gf),j.shiftLeft(j.and(n,Gf),1)),t[e+1]=j.or(j.shiftRight(j.and(r,Vf),1),j.and(n,Vf))}for(let e=0;e<8;e+=4){const r=t[e],n=t[e+1],i=t[e+2],s=t[e+3];t[e]=j.or(j.and(r,nd),j.shiftLeft(j.and(i,nd),2)),t[e+2]=j.or(j.shiftRight(j.and(r,id),2),j.and(i,id)),t[e+1]=j.or(j.and(n,nd),j.shiftLeft(j.and(s,nd),2)),t[e+3]=j.or(j.shiftRight(j.and(n,id),2),j.and(s,id))}for(let e=0;e<4;e++){const r=t[e],n=t[e+4];t[e]=j.or(j.and(r,Yb),j.shiftLeft(j.and(n,Yb),4)),t[e+4]=j.or(j.shiftRight(j.and(r,qb),4),j.and(n,qb))}}function YI(t,e){const r=new DataView(e.buffer);for(let n=0;n<4;n++){const i=r.getUint32(n*4+e.byteOffset,!0);t[n*2]=i,t[n*2+1]=i}Mo(t);for(let n=0,i=0;n<4;n=n+1,i=i+2){let s=j.or(j.and(t[i+0],Gf),j.and(t[i+1],Vf)),o=s;s=j.and(s,Gf),t[i]=j.or(s,j.shiftLeft(s,1)),o=j.and(o,Vf),t[i+1]=j.or(o,j.shiftRight(o,1))}}function $4(t,e,r){const n=(e+1)*4;for(let i=0,s=0;i6&&f==4&&(s=Xb(s)),s=j.xor(s,i[(u-o)*2]),i[u*2]=s,i[u*2+1]=s,f++,f==o&&(f=0,c++);for(let u=0;u>7,i=r>>5&1;t[e]=r<<1|n^i}}function iM(t){for(let e=0;e>6&1;t[e]=r>>1|(n^i)<<7}}function e3(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=ud[e],t[5]^=ud[e],t[6]^=ud[e],t[7]^=ud[e]}function sM(t,e){let r=t.subarray(16,32),n=t.subarray(0,16);ii(e[0],r,n,Qf),e3(e[0],0);for(let i=1;i<=xa;i++)nM(r),Ly(r),iM(n),Ly(n),ii(e[i],r,n,Qf),e3(e[i],i)}function Hc(t,e,r){let n=new Uint8Array(r);ii(t[0],e[0],n,Qf);for(let i=1;i<=xa;i++)Ly(n),ii(t[i],e[i],n,Qf)}function ea(){let t=[];for(let e=0;e<=xa;e++)t.push(new Uint8Array(16));return t}class oM{static bcEncrypt(e,r,n,i){let s=ea();Hc(s,r,n);let o=Ot.newQ(),a=Ot.newQ();Ot.load4xU32(o,i),Ot.load4xU32(a,s[0]),Ot.addRoundKey(o,a);for(let l=1;l<=xa;l++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load4xU32(a,s[l]),Ot.addRoundKey(o,a);Ot.store4xU32(e,o)}static bcKeystreamx2(e,r,n,i){let s=[ea(),ea()];for(let l=0;l<2;l++)Hc(s[l],r,n[l]);let o=Ot.newQ(),a=Ot.newQ();Ot.rkeyOrtho(o,i),Ot.load8xU32(a,s[0][0],s[1][0]),Ot.addRoundKey(o,a);for(let l=1;l<=xa;l++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load8xU32(a,s[0][l],s[1][l]),Ot.addRoundKey(o,a);Ot.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,r,n,i){let s=ea();Hc(s,r,n);let o=Ot.newQ(),a=Ot.newQ();Ot.load4xU32(o,i),Ot.load4xU32(a,s[0]),Ot.addRoundKey(o,a);for(let y=1;y<=xa;y++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load4xU32(a,s[y]),Ot.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),p=l.getUint32(12,!0);Ot.ortho(o),u=Mi.xor(u,o[0]),f=Mi.xor(f,o[2]),c=Mi.xor(c,o[4]),p=Mi.xor(p,o[6]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,p,!0)}static bcTagx2(e,r,n,i){let s=[ea(),ea()];for(let y=0;y<2;y++)Hc(s[y],r,n[y]);let o=Ot.newQ(),a=Ot.newQ();Ot.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Ot.load8xU32(a,s[0][0],s[1][0]),Ot.addRoundKey(o,a);for(let y=1;y<=xa;y++)Ot.subBytes(o),Ot.shiftRows(o),Ot.mixColumns(o),Ot.load8xU32(a,s[0][y],s[1][y]),Ot.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),p=l.getUint32(12,!0);Ot.ortho(o),u=Mi.xor(u,o[0],o[1]),f=Mi.xor(f,o[2],o[3]),c=Mi.xor(c,o[4],o[5]),p=Mi.xor(p,o[6],o[7]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,p,!0)}}class aM{static bcEncrypt(e,r,n,i){let s=ea();Hc(s,r,n);const o=new DataView(i.buffer);let a=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),u=o.getUint32(8+i.byteOffset,!1),f=o.getUint32(12+i.byteOffset,!1);const c=new DataView(s[0].buffer);a=Mi.xor(a,c.getUint32(0+s[0].byteOffset,!1)),l=Mi.xor(l,c.getUint32(4+s[0].byteOffset,!1)),u=Mi.xor(u,c.getUint32(8+s[0].byteOffset,!1)),f=Mi.xor(f,c.getUint32(12+s[0].byteOffset,!1));for(let y=1;y<=xa;y++)[a,l,u,f]=tM.aesencVartime(a,l,u,f,s[y]);const p=new DataView(e.buffer);p.setUint32(0+e.byteOffset,a,!1),p.setUint32(4+e.byteOffset,l,!1),p.setUint32(8+e.byteOffset,u,!1),p.setUint32(12+e.byteOffset,f,!1)}static bcKeystreamx2(e,r,n,i){this.bcEncrypt(e.subarray(0,16),r,n[0],i),this.bcEncrypt(e.subarray(16,32),r,n[1],i)}static bcTagx1(e,r,n,i){let s=new Uint8Array(Ke);this.bcEncrypt(s,r,n,i),ii(e,e,s,Ke)}static bcTagx2(e,r,n,i){let s=new Uint8Array(2*Ke);this.bcEncrypt(s.subarray(0,16),r,n[0],i.subarray(0,16)),this.bcEncrypt(s.subarray(16,32),r,n[1],i.subarray(16,32)),ii(e,e,s.subarray(0,16),Ke),ii(e,e,s.subarray(16,32),Ke)}}function kn(t,e,r){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,r,!1),t[0]=e<=2*Ke;a+=2)kn(o[0],Gu,a),kn(o[1],Gu,a+1),t.bcTagx2(f,e,o,i.subarray(a*Ke,(a+2)*Ke)),u-=2*Ke;for(;u>=Ke;a++)kn(o[0],Gu,a),t.bcTagx1(f,e,o[0],i.subarray(a*Ke,(a+1)*Ke)),u-=Ke;if(u>0){kn(o[0],Y4,a);let v=new Uint8Array(Ke);v.set(i.subarray(i.length-u)),v[u]=128,t.bcTagx1(f,e,o[0],v)}let c=s.length;for(l=0;c>=2*Ke;l+=2)kn(o[0],Vu,l),kn(o[1],Vu,l+1),t.bcTagx2(f,e,o,s.subarray(l*Ke,(l+2)*Ke)),c-=2*Ke;for(;c>=Ke;l++)kn(o[0],Vu,l),t.bcTagx1(f,e,o[0],s.subarray(l*Ke,(l+1)*Ke)),c-=Ke;if(c>0){kn(o[0],q4,l);let v=new Uint8Array(Ke);v.set(s.subarray(s.length-c)),v[c]=128,t.bcTagx1(f,e,o[0],v)}let p=new Uint8Array(Ke);p.set(r,1),p[0]=X4<=2*Ke;l+=2)va(o[0],f,l),va(o[1],f,l+1),t.bcKeystreamx2(y,e,o,p),ii(n.subarray(l*Ke,(l+2)*Ke),s.subarray(l*Ke,(l+2)*Ke),y,2*Ke),c-=2*Ke;for(;c>=Ke;l++)va(o[0],f,l),t.bcEncrypt(y,e,o[0],p),ii(n.subarray(l*Ke,(l+1)*Ke),s.subarray(l*Ke,(l+1)*Ke),y,Ke),c-=Ke;c>0&&(va(o[0],f,l),t.bcEncrypt(y,e,o[0],p),ii(n.subarray(l*Ke,s.length),s.subarray(l*Ke),y,c)),n.set(f,s.length)}function uM(t,e,r,n,i,s){let o=s.length-El;const a=s.subarray(0,o),l=s.subarray(o);let u=0,f=zy(),c=new Uint8Array(Ke);c.set(r,1);let p=new Uint8Array(2*Ke);for(u=0;o>=2*Ke;u+=2)va(f[0],l,u),va(f[1],l,u+1),t.bcKeystreamx2(p,e,f,c),ii(n.subarray(u*Ke,(u+2)*Ke),a.subarray(u*Ke,(u+2)*Ke),p,2*Ke),o-=2*Ke;for(;o>=Ke;u++)va(f[0],l,u),t.bcEncrypt(p,e,f[0],c),ii(n.subarray(u*Ke,(u+1)*Ke),a.subarray(u*Ke,(u+1)*Ke),p,Ke),o-=Ke;o>0&&(va(f[0],l,u),t.bcEncrypt(p,e,f[0],c),ii(n.subarray(u*Ke),a.subarray(u*Ke),p,o));let y=0,v=i.length,b=zy(),N=new Uint8Array(El);for(y=0;v>=2*Ke;y+=2)kn(b[0],Gu,y),kn(b[1],Gu,y+1),t.bcTagx2(N,e,b,i.subarray(y*Ke,(y+2)*Ke)),v-=2*Ke;for(;v>=Ke;y++)kn(b[0],Gu,y),t.bcTagx1(N,e,b[0],i.subarray(y*Ke,(y+1)*Ke)),v-=Ke;if(v>0){kn(b[0],Y4,y);let C=new Uint8Array(Ke);C.set(i.subarray(i.length-v)),C[v]=128,t.bcTagx1(N,e,b[0],C)}let x=n.length;for(u=0;x>=2*Ke;u+=2)kn(b[0],Vu,u),kn(b[1],Vu,u+1),t.bcTagx2(N,e,b,n.subarray(u*Ke,(u+2)*Ke)),x-=2*Ke;for(;x>=Ke;u++)kn(b[0],Vu,u),t.bcTagx1(N,e,b[0],n.subarray(u*Ke,(u+1)*Ke)),x-=Ke;if(x>0){kn(b[0],q4,u);let C=new Uint8Array(Ke);C.set(n.subarray(n.length-x)),C[x]=128,t.bcTagx1(N,e,b[0],C)}if(c[0]=X4<>2]|=T[ne]<>2]|=$<>2]|=(192|$>>6)<>2]|=(128|$&63)<=57344?(_[te>>2]|=(224|$>>12)<>2]|=(128|$>>6&63)<>2]|=(128|$&63)<>2]|=(240|$>>18)<>2]|=(128|$>>12&63)<>2]|=(128|$>>6&63)<>2]|=(128|$&63)<=128?(this.block=_[32],this.start=te-128,this.hash(),this.hashed=!0):this.start=te}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var T=this.blocks,D=this.lastByteIndex;T[32]=this.block,T[D>>2]|=f[D&3],this.block=T[32],D>=112&&(this.hashed||this.hash(),T[0]=this.block,T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=T[16]=T[17]=T[18]=T[19]=T[20]=T[21]=T[22]=T[23]=T[24]=T[25]=T[26]=T[27]=T[28]=T[29]=T[30]=T[31]=T[32]=0),T[30]=this.hBytes<<3|this.bytes>>>29,T[31]=this.bytes<<3,this.hash()}},C.prototype.hash=function(){var T=this.h0h,D=this.h0l,G=this.h1h,$=this.h1l,ne=this.h2h,te=this.h2l,de=this.h3h,_=this.h3l,h=this.h4h,m=this.h4l,S=this.h5h,M=this.h5l,R=this.h6h,U=this.h6l,H=this.h7h,B=this.h7l,g=this.blocks,O,ve,E,W,oe,J,K,V,Z,he,Ue,pe,Be,ut,We,Ye,pt,ze,ye,De,Ce,tt,Dt,yt,Ct;for(O=32;O<160;O+=2)De=g[O-30],Ce=g[O-29],ve=(De>>>1|Ce<<31)^(De>>>8|Ce<<24)^De>>>7,E=(Ce>>>1|De<<31)^(Ce>>>8|De<<24)^(Ce>>>7|De<<25),De=g[O-4],Ce=g[O-3],W=(De>>>19|Ce<<13)^(Ce>>>29|De<<3)^De>>>6,oe=(Ce>>>19|De<<13)^(De>>>29|Ce<<3)^(Ce>>>6|De<<26),De=g[O-32],Ce=g[O-31],tt=g[O-14],Dt=g[O-13],J=(Dt&65535)+(Ce&65535)+(E&65535)+(oe&65535),K=(Dt>>>16)+(Ce>>>16)+(E>>>16)+(oe>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(ve&65535)+(W&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(ve>>>16)+(W>>>16)+(V>>>16),g[O]=Z<<16|V&65535,g[O+1]=K<<16|J&65535;var fr=T,Tt=D,It=G,Wt=$,Et=ne,kt=te,$t=de,xt=_,vt=h,ir=m,St=S,_t=M,q=R,re=U,ae=H,ke=B;for(Ye=It&Et,pt=Wt&kt,O=0;O<160;O+=8)ve=(fr>>>28|Tt<<4)^(Tt>>>2|fr<<30)^(Tt>>>7|fr<<25),E=(Tt>>>28|fr<<4)^(fr>>>2|Tt<<30)^(fr>>>7|Tt<<25),W=(vt>>>14|ir<<18)^(vt>>>18|ir<<14)^(ir>>>9|vt<<23),oe=(ir>>>14|vt<<18)^(ir>>>18|vt<<14)^(vt>>>9|ir<<23),he=fr&It,Ue=Tt&Wt,ze=he^fr&Et^Ye,ye=Ue^Tt&kt^pt,yt=vt&St^~vt&q,Ct=ir&_t^~ir&re,De=g[O],Ce=g[O+1],tt=p[O],Dt=p[O+1],J=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(ke&65535),K=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(ke>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(W&65535)+(ae&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(W>>>16)+(ae>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=K<<16|J&65535,J=(ye&65535)+(E&65535),K=(ye>>>16)+(E>>>16)+(J>>>16),V=(ze&65535)+(ve&65535)+(K>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=K<<16|J&65535,J=(xt&65535)+(Ce&65535),K=(xt>>>16)+(Ce>>>16)+(J>>>16),V=($t&65535)+(De&65535)+(K>>>16),Z=($t>>>16)+(De>>>16)+(V>>>16),ae=Z<<16|V&65535,ke=K<<16|J&65535,J=(Dt&65535)+(Ce&65535),K=(Dt>>>16)+(Ce>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),$t=Z<<16|V&65535,xt=K<<16|J&65535,ve=($t>>>28|xt<<4)^(xt>>>2|$t<<30)^(xt>>>7|$t<<25),E=(xt>>>28|$t<<4)^($t>>>2|xt<<30)^($t>>>7|xt<<25),W=(ae>>>14|ke<<18)^(ae>>>18|ke<<14)^(ke>>>9|ae<<23),oe=(ke>>>14|ae<<18)^(ke>>>18|ae<<14)^(ae>>>9|ke<<23),pe=$t&fr,Be=xt&Tt,ze=pe^$t&It^he,ye=Be^xt&Wt^Ue,yt=ae&vt^~ae&St,Ct=ke&ir^~ke&_t,De=g[O+2],Ce=g[O+3],tt=p[O+2],Dt=p[O+3],J=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(re&65535),K=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(re>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(W&65535)+(q&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(W>>>16)+(q>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=K<<16|J&65535,J=(ye&65535)+(E&65535),K=(ye>>>16)+(E>>>16)+(J>>>16),V=(ze&65535)+(ve&65535)+(K>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=K<<16|J&65535,J=(kt&65535)+(Ce&65535),K=(kt>>>16)+(Ce>>>16)+(J>>>16),V=(Et&65535)+(De&65535)+(K>>>16),Z=(Et>>>16)+(De>>>16)+(V>>>16),q=Z<<16|V&65535,re=K<<16|J&65535,J=(Dt&65535)+(Ce&65535),K=(Dt>>>16)+(Ce>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),Et=Z<<16|V&65535,kt=K<<16|J&65535,ve=(Et>>>28|kt<<4)^(kt>>>2|Et<<30)^(kt>>>7|Et<<25),E=(kt>>>28|Et<<4)^(Et>>>2|kt<<30)^(Et>>>7|kt<<25),W=(q>>>14|re<<18)^(q>>>18|re<<14)^(re>>>9|q<<23),oe=(re>>>14|q<<18)^(re>>>18|q<<14)^(q>>>9|re<<23),ut=Et&$t,We=kt&xt,ze=ut^Et&fr^pe,ye=We^kt&Tt^Be,yt=q&ae^~q&vt,Ct=re&ke^~re&ir,De=g[O+4],Ce=g[O+5],tt=p[O+4],Dt=p[O+5],J=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(_t&65535),K=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(_t>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(W&65535)+(St&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(W>>>16)+(St>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=K<<16|J&65535,J=(ye&65535)+(E&65535),K=(ye>>>16)+(E>>>16)+(J>>>16),V=(ze&65535)+(ve&65535)+(K>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=K<<16|J&65535,J=(Wt&65535)+(Ce&65535),K=(Wt>>>16)+(Ce>>>16)+(J>>>16),V=(It&65535)+(De&65535)+(K>>>16),Z=(It>>>16)+(De>>>16)+(V>>>16),St=Z<<16|V&65535,_t=K<<16|J&65535,J=(Dt&65535)+(Ce&65535),K=(Dt>>>16)+(Ce>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),It=Z<<16|V&65535,Wt=K<<16|J&65535,ve=(It>>>28|Wt<<4)^(Wt>>>2|It<<30)^(Wt>>>7|It<<25),E=(Wt>>>28|It<<4)^(It>>>2|Wt<<30)^(It>>>7|Wt<<25),W=(St>>>14|_t<<18)^(St>>>18|_t<<14)^(_t>>>9|St<<23),oe=(_t>>>14|St<<18)^(_t>>>18|St<<14)^(St>>>9|_t<<23),Ye=It&Et,pt=Wt&kt,ze=Ye^It&$t^ut,ye=pt^Wt&xt^We,yt=St&q^~St&ae,Ct=_t&re^~_t&ke,De=g[O+6],Ce=g[O+7],tt=p[O+6],Dt=p[O+7],J=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(ir&65535),K=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(ir>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(W&65535)+(vt&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(W>>>16)+(vt>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=K<<16|J&65535,J=(ye&65535)+(E&65535),K=(ye>>>16)+(E>>>16)+(J>>>16),V=(ze&65535)+(ve&65535)+(K>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=K<<16|J&65535,J=(Tt&65535)+(Ce&65535),K=(Tt>>>16)+(Ce>>>16)+(J>>>16),V=(fr&65535)+(De&65535)+(K>>>16),Z=(fr>>>16)+(De>>>16)+(V>>>16),vt=Z<<16|V&65535,ir=K<<16|J&65535,J=(Dt&65535)+(Ce&65535),K=(Dt>>>16)+(Ce>>>16)+(J>>>16),V=(tt&65535)+(De&65535)+(K>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),fr=Z<<16|V&65535,Tt=K<<16|J&65535;J=(D&65535)+(Tt&65535),K=(D>>>16)+(Tt>>>16)+(J>>>16),V=(T&65535)+(fr&65535)+(K>>>16),Z=(T>>>16)+(fr>>>16)+(V>>>16),this.h0h=Z<<16|V&65535,this.h0l=K<<16|J&65535,J=($&65535)+(Wt&65535),K=($>>>16)+(Wt>>>16)+(J>>>16),V=(G&65535)+(It&65535)+(K>>>16),Z=(G>>>16)+(It>>>16)+(V>>>16),this.h1h=Z<<16|V&65535,this.h1l=K<<16|J&65535,J=(te&65535)+(kt&65535),K=(te>>>16)+(kt>>>16)+(J>>>16),V=(ne&65535)+(Et&65535)+(K>>>16),Z=(ne>>>16)+(Et>>>16)+(V>>>16),this.h2h=Z<<16|V&65535,this.h2l=K<<16|J&65535,J=(_&65535)+(xt&65535),K=(_>>>16)+(xt>>>16)+(J>>>16),V=(de&65535)+($t&65535)+(K>>>16),Z=(de>>>16)+($t>>>16)+(V>>>16),this.h3h=Z<<16|V&65535,this.h3l=K<<16|J&65535,J=(m&65535)+(ir&65535),K=(m>>>16)+(ir>>>16)+(J>>>16),V=(h&65535)+(vt&65535)+(K>>>16),Z=(h>>>16)+(vt>>>16)+(V>>>16),this.h4h=Z<<16|V&65535,this.h4l=K<<16|J&65535,J=(M&65535)+(_t&65535),K=(M>>>16)+(_t>>>16)+(J>>>16),V=(S&65535)+(St&65535)+(K>>>16),Z=(S>>>16)+(St>>>16)+(V>>>16),this.h5h=Z<<16|V&65535,this.h5l=K<<16|J&65535,J=(U&65535)+(re&65535),K=(U>>>16)+(re>>>16)+(J>>>16),V=(R&65535)+(q&65535)+(K>>>16),Z=(R>>>16)+(q>>>16)+(V>>>16),this.h6h=Z<<16|V&65535,this.h6l=K<<16|J&65535,J=(B&65535)+(ke&65535),K=(B>>>16)+(ke>>>16)+(J>>>16),V=(H&65535)+(ae&65535)+(K>>>16),Z=(H>>>16)+(ae>>>16)+(V>>>16),this.h7h=Z<<16|V&65535,this.h7l=K<<16|J&65535},C.prototype.hex=function(){this.finalize();var T=this.h0h,D=this.h0l,G=this.h1h,$=this.h1l,ne=this.h2h,te=this.h2l,de=this.h3h,_=this.h3l,h=this.h4h,m=this.h4l,S=this.h5h,M=this.h5l,R=this.h6h,U=this.h6l,H=this.h7h,B=this.h7l,g=this.bits,O=u[T>>28&15]+u[T>>24&15]+u[T>>20&15]+u[T>>16&15]+u[T>>12&15]+u[T>>8&15]+u[T>>4&15]+u[T&15]+u[D>>28&15]+u[D>>24&15]+u[D>>20&15]+u[D>>16&15]+u[D>>12&15]+u[D>>8&15]+u[D>>4&15]+u[D&15]+u[G>>28&15]+u[G>>24&15]+u[G>>20&15]+u[G>>16&15]+u[G>>12&15]+u[G>>8&15]+u[G>>4&15]+u[G&15]+u[$>>28&15]+u[$>>24&15]+u[$>>20&15]+u[$>>16&15]+u[$>>12&15]+u[$>>8&15]+u[$>>4&15]+u[$&15]+u[ne>>28&15]+u[ne>>24&15]+u[ne>>20&15]+u[ne>>16&15]+u[ne>>12&15]+u[ne>>8&15]+u[ne>>4&15]+u[ne&15]+u[te>>28&15]+u[te>>24&15]+u[te>>20&15]+u[te>>16&15]+u[te>>12&15]+u[te>>8&15]+u[te>>4&15]+u[te&15]+u[de>>28&15]+u[de>>24&15]+u[de>>20&15]+u[de>>16&15]+u[de>>12&15]+u[de>>8&15]+u[de>>4&15]+u[de&15];return g>=256&&(O+=u[_>>28&15]+u[_>>24&15]+u[_>>20&15]+u[_>>16&15]+u[_>>12&15]+u[_>>8&15]+u[_>>4&15]+u[_&15]),g>=384&&(O+=u[h>>28&15]+u[h>>24&15]+u[h>>20&15]+u[h>>16&15]+u[h>>12&15]+u[h>>8&15]+u[h>>4&15]+u[h&15]+u[m>>28&15]+u[m>>24&15]+u[m>>20&15]+u[m>>16&15]+u[m>>12&15]+u[m>>8&15]+u[m>>4&15]+u[m&15]+u[S>>28&15]+u[S>>24&15]+u[S>>20&15]+u[S>>16&15]+u[S>>12&15]+u[S>>8&15]+u[S>>4&15]+u[S&15]+u[M>>28&15]+u[M>>24&15]+u[M>>20&15]+u[M>>16&15]+u[M>>12&15]+u[M>>8&15]+u[M>>4&15]+u[M&15]),g==512&&(O+=u[R>>28&15]+u[R>>24&15]+u[R>>20&15]+u[R>>16&15]+u[R>>12&15]+u[R>>8&15]+u[R>>4&15]+u[R&15]+u[U>>28&15]+u[U>>24&15]+u[U>>20&15]+u[U>>16&15]+u[U>>12&15]+u[U>>8&15]+u[U>>4&15]+u[U&15]+u[H>>28&15]+u[H>>24&15]+u[H>>20&15]+u[H>>16&15]+u[H>>12&15]+u[H>>8&15]+u[H>>4&15]+u[H&15]+u[B>>28&15]+u[B>>24&15]+u[B>>20&15]+u[B>>16&15]+u[B>>12&15]+u[B>>8&15]+u[B>>4&15]+u[B&15]),O},C.prototype.toString=C.prototype.hex,C.prototype.digest=function(){this.finalize();var T=this.h0h,D=this.h0l,G=this.h1h,$=this.h1l,ne=this.h2h,te=this.h2l,de=this.h3h,_=this.h3l,h=this.h4h,m=this.h4l,S=this.h5h,M=this.h5l,R=this.h6h,U=this.h6l,H=this.h7h,B=this.h7l,g=this.bits,O=[T>>24&255,T>>16&255,T>>8&255,T&255,D>>24&255,D>>16&255,D>>8&255,D&255,G>>24&255,G>>16&255,G>>8&255,G&255,$>>24&255,$>>16&255,$>>8&255,$&255,ne>>24&255,ne>>16&255,ne>>8&255,ne&255,te>>24&255,te>>16&255,te>>8&255,te&255,de>>24&255,de>>16&255,de>>8&255,de&255];return g>=256&&O.push(_>>24&255,_>>16&255,_>>8&255,_&255),g>=384&&O.push(h>>24&255,h>>16&255,h>>8&255,h&255,m>>24&255,m>>16&255,m>>8&255,m&255,S>>24&255,S>>16&255,S>>8&255,S&255,M>>24&255,M>>16&255,M>>8&255,M&255),g==512&&O.push(R>>24&255,R>>16&255,R>>8&255,R&255,U>>24&255,U>>16&255,U>>8&255,U&255,H>>24&255,H>>16&255,H>>8&255,H&255,B>>24&255,B>>16&255,B>>8&255,B&255),O},C.prototype.array=C.prototype.digest,C.prototype.arrayBuffer=function(){this.finalize();var T=this.bits,D=new ArrayBuffer(T/8),G=new DataView(D);return G.setUint32(0,this.h0h),G.setUint32(4,this.h0l),G.setUint32(8,this.h1h),G.setUint32(12,this.h1l),G.setUint32(16,this.h2h),G.setUint32(20,this.h2l),G.setUint32(24,this.h3h),T>=256&&G.setUint32(28,this.h3l),T>=384&&(G.setUint32(32,this.h4h),G.setUint32(36,this.h4l),G.setUint32(40,this.h5h),G.setUint32(44,this.h5l)),T==512&&(G.setUint32(48,this.h6h),G.setUint32(52,this.h6l),G.setUint32(56,this.h7h),G.setUint32(60,this.h7l)),D},C.prototype.clone=function(){var T=new C(this.bits,!1);return this.copyTo(T),T},C.prototype.copyTo=function(T){var D=0,G=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(D=0;D>6,de[_++]=128|h&63):h<55296||h>=57344?(de[_++]=224|h>>12,de[_++]=128|h>>6&63,de[_++]=128|h&63):(h=65536+((h&1023)<<10|T.charCodeAt(++m)&1023),de[_++]=240|h>>18,de[_++]=128|h>>12&63,de[_++]=128|h>>6&63,de[_++]=128|h&63);T=de}T.length>128&&(T=new C(D,!0).update(T).array());for(var S=[],M=[],m=0;m<128;++m){var R=T[m]||0;S[m]=92^R,M[m]=54^R}C.call(this,D,G),this.update(M),this.oKeyPad=S,this.inner=!0,this.sharedMemory=G}F.prototype=new C,F.prototype.finalize=function(){if(C.prototype.finalize.call(this),this.inner){this.inner=!1;var T=this.array();C.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(T),C.prototype.finalize.call(this)}},F.prototype.clone=function(){var T=new F([],this.bits,!1);this.copyTo(T),T.inner=this.inner;for(var D=0;D>24&255,w[k+1]=P>>16&255,w[k+2]=P>>8&255,w[k+3]=P&255,w[k+4]=d>>24&255,w[k+5]=d>>16&255,w[k+6]=d>>8&255,w[k+7]=d&255}function b(w,k,P,d,I){var X,Y=0;for(X=0;X>>8)-1}function N(w,k,P,d){return b(w,k,P,d,16)}function x(w,k,P,d){return b(w,k,P,d,32)}function A(w,k,P,d){for(var I=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,X=P[0]&255|(P[1]&255)<<8|(P[2]&255)<<16|(P[3]&255)<<24,Y=P[4]&255|(P[5]&255)<<8|(P[6]&255)<<16|(P[7]&255)<<24,ue=P[8]&255|(P[9]&255)<<8|(P[10]&255)<<16|(P[11]&255)<<24,Se=P[12]&255|(P[13]&255)<<8|(P[14]&255)<<16|(P[15]&255)<<24,Re=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,Fe=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,qe=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Me=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,rt=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Ve=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,dt=P[16]&255|(P[17]&255)<<8|(P[18]&255)<<16|(P[19]&255)<<24,Ft=P[20]&255|(P[21]&255)<<8|(P[22]&255)<<16|(P[23]&255)<<24,gt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xe>>>16&255,w[43]=xe>>>24&255,w[44]=_e>>>0&255,w[45]=_e>>>8&255,w[46]=_e>>>16&255,w[47]=_e>>>24&255,w[48]=bt>>>0&255,w[49]=bt>>>8&255,w[50]=bt>>>16&255,w[51]=bt>>>24&255,w[52]=Bt>>>0&255,w[53]=Bt>>>8&255,w[54]=Bt>>>16&255,w[55]=Bt>>>24&255,w[56]=Lt>>>0&255,w[57]=Lt>>>8&255,w[58]=Lt>>>16&255,w[59]=Lt>>>24&255,w[60]=jt>>>0&255,w[61]=jt>>>8&255,w[62]=jt>>>16&255,w[63]=jt>>>24&255}function C(w,k,P,d){for(var I=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,X=P[0]&255|(P[1]&255)<<8|(P[2]&255)<<16|(P[3]&255)<<24,Y=P[4]&255|(P[5]&255)<<8|(P[6]&255)<<16|(P[7]&255)<<24,ue=P[8]&255|(P[9]&255)<<8|(P[10]&255)<<16|(P[11]&255)<<24,Se=P[12]&255|(P[13]&255)<<8|(P[14]&255)<<16|(P[15]&255)<<24,Re=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,Fe=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,qe=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Me=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,rt=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Ve=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,dt=P[16]&255|(P[17]&255)<<8|(P[18]&255)<<16|(P[19]&255)<<24,Ft=P[20]&255|(P[21]&255)<<8|(P[22]&255)<<16|(P[23]&255)<<24,gt=P[24]&255|(P[25]&255)<<8|(P[26]&255)<<16|(P[27]&255)<<24,Pt=P[28]&255|(P[29]&255)<<8|(P[30]&255)<<16|(P[31]&255)<<24,Nt=d[12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>>32-18,Q=jt+Lt|0,bt^=Q<<7|Q>>>32-7,Q=bt+jt|0,Bt^=Q<<9|Q>>>32-9,Q=Bt+bt|0,Lt^=Q<<13|Q>>>32-13,Q=Lt+Bt|0,jt^=Q<<18|Q>>>32-18;w[0]=Xe>>>0&255,w[1]=Xe>>>8&255,w[2]=Xe>>>16&255,w[3]=Xe>>>24&255,w[4]=Ge>>>0&255,w[5]=Ge>>>8&255,w[6]=Ge>>>16&255,w[7]=Ge>>>24&255,w[8]=xe>>>0&255,w[9]=xe>>>8&255,w[10]=xe>>>16&255,w[11]=xe>>>24&255,w[12]=jt>>>0&255,w[13]=jt>>>8&255,w[14]=jt>>>16&255,w[15]=jt>>>24&255,w[16]=fe>>>0&255,w[17]=fe>>>8&255,w[18]=fe>>>16&255,w[19]=fe>>>24&255,w[20]=ce>>>0&255,w[21]=ce>>>8&255,w[22]=ce>>>16&255,w[23]=ce>>>24&255,w[24]=Ae>>>0&255,w[25]=Ae>>>8&255,w[26]=Ae>>>16&255,w[27]=Ae>>>24&255,w[28]=ge>>>0&255,w[29]=ge>>>8&255,w[30]=ge>>>16&255,w[31]=ge>>>24&255}function F(w,k,P,d){A(w,k,P,d)}function z(w,k,P,d){C(w,k,P,d)}var T=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function D(w,k,P,d,I,X,Y){var ue=new Uint8Array(16),Se=new Uint8Array(64),Re,Fe;for(Fe=0;Fe<16;Fe++)ue[Fe]=0;for(Fe=0;Fe<8;Fe++)ue[Fe]=X[Fe];for(;I>=64;){for(F(Se,ue,Y,T),Fe=0;Fe<64;Fe++)w[k+Fe]=P[d+Fe]^Se[Fe];for(Re=1,Fe=8;Fe<16;Fe++)Re=Re+(ue[Fe]&255)|0,ue[Fe]=Re&255,Re>>>=8;I-=64,k+=64,d+=64}if(I>0)for(F(Se,ue,Y,T),Fe=0;Fe=64;){for(F(Y,X,I,T),Se=0;Se<64;Se++)w[k+Se]=Y[Se];for(ue=1,Se=8;Se<16;Se++)ue=ue+(X[Se]&255)|0,X[Se]=ue&255,ue>>>=8;P-=64,k+=64}if(P>0)for(F(Y,X,I,T),Se=0;Se>>13|P<<3)&8191,d=w[4]&255|(w[5]&255)<<8,this.r[2]=(P>>>10|d<<6)&7939,I=w[6]&255|(w[7]&255)<<8,this.r[3]=(d>>>7|I<<9)&8191,X=w[8]&255|(w[9]&255)<<8,this.r[4]=(I>>>4|X<<12)&255,this.r[5]=X>>>1&8190,Y=w[10]&255|(w[11]&255)<<8,this.r[6]=(X>>>14|Y<<2)&8191,ue=w[12]&255|(w[13]&255)<<8,this.r[7]=(Y>>>11|ue<<5)&8065,Se=w[14]&255|(w[15]&255)<<8,this.r[8]=(ue>>>8|Se<<8)&8191,this.r[9]=Se>>>5&127,this.pad[0]=w[16]&255|(w[17]&255)<<8,this.pad[1]=w[18]&255|(w[19]&255)<<8,this.pad[2]=w[20]&255|(w[21]&255)<<8,this.pad[3]=w[22]&255|(w[23]&255)<<8,this.pad[4]=w[24]&255|(w[25]&255)<<8,this.pad[5]=w[26]&255|(w[27]&255)<<8,this.pad[6]=w[28]&255|(w[29]&255)<<8,this.pad[7]=w[30]&255|(w[31]&255)<<8};te.prototype.blocks=function(w,k,P){for(var d=this.fin?0:2048,I,X,Y,ue,Se,Re,Fe,qe,Me,rt,Ve,dt,Ft,gt,Pt,Nt,Xe,st,Qe,Ze=this.h[0],et=this.h[1],Ge=this.h[2],fe=this.h[3],ce=this.h[4],Ae=this.h[5],ge=this.h[6],xe=this.h[7],_e=this.h[8],bt=this.h[9],Bt=this.r[0],Lt=this.r[1],jt=this.r[2],Q=this.r[3],Qt=this.r[4],sr=this.r[5],or=this.r[6],Vt=this.r[7],rr=this.r[8],nr=this.r[9];P>=16;)I=w[k+0]&255|(w[k+1]&255)<<8,Ze+=I&8191,X=w[k+2]&255|(w[k+3]&255)<<8,et+=(I>>>13|X<<3)&8191,Y=w[k+4]&255|(w[k+5]&255)<<8,Ge+=(X>>>10|Y<<6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=Nt,xe=Xe,_e=st,bt=Qe,k+=16,P-=16;this.h[0]=Ze,this.h[1]=et,this.h[2]=Ge,this.h[3]=fe,this.h[4]=ce,this.h[5]=Ae,this.h[6]=ge,this.h[7]=xe,this.h[8]=_e,this.h[9]=bt},te.prototype.finish=function(w,k){var P=new Uint16Array(10),d,I,X,Y;if(this.leftover){for(Y=this.leftover,this.buffer[Y++]=1;Y<16;Y++)this.buffer[Y]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(d=this.h[1]>>>13,this.h[1]&=8191,Y=2;Y<10;Y++)this.h[Y]+=d,d=this.h[Y]>>>13,this.h[Y]&=8191;for(this.h[0]+=d*5,d=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=d,d=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=d,P[0]=this.h[0]+5,d=P[0]>>>13,P[0]&=8191,Y=1;Y<10;Y++)P[Y]=this.h[Y]+d,d=P[Y]>>>13,P[Y]&=8191;for(P[9]-=8192,I=(d^1)-1,Y=0;Y<10;Y++)P[Y]&=I;for(I=~I,Y=0;Y<10;Y++)this.h[Y]=this.h[Y]&I|P[Y];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,X=this.h[0]+this.pad[0],this.h[0]=X&65535,Y=1;Y<8;Y++)X=(this.h[Y]+this.pad[Y]|0)+(X>>>16)|0,this.h[Y]=X&65535;w[k+0]=this.h[0]>>>0&255,w[k+1]=this.h[0]>>>8&255,w[k+2]=this.h[1]>>>0&255,w[k+3]=this.h[1]>>>8&255,w[k+4]=this.h[2]>>>0&255,w[k+5]=this.h[2]>>>8&255,w[k+6]=this.h[3]>>>0&255,w[k+7]=this.h[3]>>>8&255,w[k+8]=this.h[4]>>>0&255,w[k+9]=this.h[4]>>>8&255,w[k+10]=this.h[5]>>>0&255,w[k+11]=this.h[5]>>>8&255,w[k+12]=this.h[6]>>>0&255,w[k+13]=this.h[6]>>>8&255,w[k+14]=this.h[7]>>>0&255,w[k+15]=this.h[7]>>>8&255},te.prototype.update=function(w,k,P){var d,I;if(this.leftover){for(I=16-this.leftover,I>P&&(I=P),d=0;d=16&&(I=P-P%16,this.blocks(w,k,I),k+=I,P-=I),P){for(d=0;d>16&1),X[P-1]&=65535;X[15]=Y[15]-32767-(X[14]>>16&1),I=X[15]>>16&1,X[14]&=65535,R(Y,X,1-I)}for(P=0;P<16;P++)w[2*P]=Y[P]&255,w[2*P+1]=Y[P]>>8}function H(w,k){var P=new Uint8Array(32),d=new Uint8Array(32);return U(P,w),U(d,k),x(P,0,d,0)}function B(w){var k=new Uint8Array(32);return U(k,w),k[0]&1}function g(w,k){var P;for(P=0;P<16;P++)w[P]=k[2*P]+(k[2*P+1]<<8);w[15]&=32767}function O(w,k,P){for(var d=0;d<16;d++)w[d]=k[d]+P[d]}function ve(w,k,P){for(var d=0;d<16;d++)w[d]=k[d]-P[d]}function E(w,k,P){var d,I,X=0,Y=0,ue=0,Se=0,Re=0,Fe=0,qe=0,Me=0,rt=0,Ve=0,dt=0,Ft=0,gt=0,Pt=0,Nt=0,Xe=0,st=0,Qe=0,Ze=0,et=0,Ge=0,fe=0,ce=0,Ae=0,ge=0,xe=0,_e=0,bt=0,Bt=0,Lt=0,jt=0,Q=P[0],Qt=P[1],sr=P[2],or=P[3],Vt=P[4],rr=P[5],nr=P[6],Lr=P[7],gr=P[8],Rr=P[9],Tr=P[10],Ir=P[11],Jr=P[12],yn=P[13],xn=P[14],vn=P[15];d=k[0],X+=d*Q,Y+=d*Qt,ue+=d*sr,Se+=d*or,Re+=d*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xn,bt+=d*vn,d=k[13],Pt+=d*Q,Nt+=d*Qt,Xe+=d*sr,st+=d*or,Qe+=d*Vt,Ze+=d*rr,et+=d*nr,Ge+=d*Lr,fe+=d*gr,ce+=d*Rr,Ae+=d*Tr,ge+=d*Ir,xe+=d*Jr,_e+=d*yn,bt+=d*xn,Bt+=d*vn,d=k[14],Nt+=d*Q,Xe+=d*Qt,st+=d*sr,Qe+=d*or,Ze+=d*Vt,et+=d*rr,Ge+=d*nr,fe+=d*Lr,ce+=d*gr,Ae+=d*Rr,ge+=d*Tr,xe+=d*Ir,_e+=d*Jr,bt+=d*yn,Bt+=d*xn,Lt+=d*vn,d=k[15],Xe+=d*Q,st+=d*Qt,Qe+=d*sr,Ze+=d*or,et+=d*Vt,Ge+=d*rr,fe+=d*nr,ce+=d*Lr,Ae+=d*gr,ge+=d*Rr,xe+=d*Tr,_e+=d*Ir,bt+=d*Jr,Bt+=d*yn,Lt+=d*xn,jt+=d*vn,X+=38*st,Y+=38*Qe,ue+=38*Ze,Se+=38*et,Re+=38*Ge,Fe+=38*fe,qe+=38*ce,Me+=38*Ae,rt+=38*ge,Ve+=38*xe,dt+=38*_e,Ft+=38*bt,gt+=38*Bt,Pt+=38*Lt,Nt+=38*jt,I=1,d=X+I+65535,I=Math.floor(d/65536),X=d-I*65536,d=Y+I+65535,I=Math.floor(d/65536),Y=d-I*65536,d=ue+I+65535,I=Math.floor(d/65536),ue=d-I*65536,d=Se+I+65535,I=Math.floor(d/65536),Se=d-I*65536,d=Re+I+65535,I=Math.floor(d/65536),Re=d-I*65536,d=Fe+I+65535,I=Math.floor(d/65536),Fe=d-I*65536,d=qe+I+65535,I=Math.floor(d/65536),qe=d-I*65536,d=Me+I+65535,I=Math.floor(d/65536),Me=d-I*65536,d=rt+I+65535,I=Math.floor(d/65536),rt=d-I*65536,d=Ve+I+65535,I=Math.floor(d/65536),Ve=d-I*65536,d=dt+I+65535,I=Math.floor(d/65536),dt=d-I*65536,d=Ft+I+65535,I=Math.floor(d/65536),Ft=d-I*65536,d=gt+I+65535,I=Math.floor(d/65536),gt=d-I*65536,d=Pt+I+65535,I=Math.floor(d/65536),Pt=d-I*65536,d=Nt+I+65535,I=Math.floor(d/65536),Nt=d-I*65536,d=Xe+I+65535,I=Math.floor(d/65536),Xe=d-I*65536,X+=I-1+37*(I-1),I=1,d=X+I+65535,I=Math.floor(d/65536),X=d-I*65536,d=Y+I+65535,I=Math.floor(d/65536),Y=d-I*65536,d=ue+I+65535,I=Math.floor(d/65536),ue=d-I*65536,d=Se+I+65535,I=Math.floor(d/65536),Se=d-I*65536,d=Re+I+65535,I=Math.floor(d/65536),Re=d-I*65536,d=Fe+I+65535,I=Math.floor(d/65536),Fe=d-I*65536,d=qe+I+65535,I=Math.floor(d/65536),qe=d-I*65536,d=Me+I+65535,I=Math.floor(d/65536),Me=d-I*65536,d=rt+I+65535,I=Math.floor(d/65536),rt=d-I*65536,d=Ve+I+65535,I=Math.floor(d/65536),Ve=d-I*65536,d=dt+I+65535,I=Math.floor(d/65536),dt=d-I*65536,d=Ft+I+65535,I=Math.floor(d/65536),Ft=d-I*65536,d=gt+I+65535,I=Math.floor(d/65536),gt=d-I*65536,d=Pt+I+65535,I=Math.floor(d/65536),Pt=d-I*65536,d=Nt+I+65535,I=Math.floor(d/65536),Nt=d-I*65536,d=Xe+I+65535,I=Math.floor(d/65536),Xe=d-I*65536,X+=I-1+37*(I-1),w[0]=X,w[1]=Y,w[2]=ue,w[3]=Se,w[4]=Re,w[5]=Fe,w[6]=qe,w[7]=Me,w[8]=rt,w[9]=Ve,w[10]=dt,w[11]=Ft,w[12]=gt,w[13]=Pt,w[14]=Nt,w[15]=Xe}function W(w,k){E(w,k,k)}function oe(w,k){var P=r(),d;for(d=0;d<16;d++)P[d]=k[d];for(d=253;d>=0;d--)W(P,P),d!==2&&d!==4&&E(P,P,k);for(d=0;d<16;d++)w[d]=P[d]}function J(w,k){var P=r(),d;for(d=0;d<16;d++)P[d]=k[d];for(d=250;d>=0;d--)W(P,P),d!==1&&E(P,P,k);for(d=0;d<16;d++)w[d]=P[d]}function K(w,k,P){var d=new Uint8Array(32),I=new Float64Array(80),X,Y,ue=r(),Se=r(),Re=r(),Fe=r(),qe=r(),Me=r();for(Y=0;Y<31;Y++)d[Y]=k[Y];for(d[31]=k[31]&127|64,d[0]&=248,g(I,P),Y=0;Y<16;Y++)Se[Y]=I[Y],Fe[Y]=ue[Y]=Re[Y]=0;for(ue[0]=Fe[0]=1,Y=254;Y>=0;--Y)X=d[Y>>>3]>>>(Y&7)&1,R(ue,Se,X),R(Re,Fe,X),O(qe,ue,Re),ve(ue,ue,Re),O(Re,Se,Fe),ve(Se,Se,Fe),W(Fe,qe),W(Me,ue),E(ue,Re,ue),E(Re,Se,qe),O(qe,ue,Re),ve(ue,ue,Re),W(Se,ue),ve(Re,Fe,Me),E(ue,Re,l),O(ue,ue,Fe),E(Re,Re,ue),E(ue,Fe,Me),E(Fe,Se,I),W(Se,qe),R(ue,Se,X),R(Re,Fe,X);for(Y=0;Y<16;Y++)I[Y+16]=ue[Y],I[Y+32]=Re[Y],I[Y+48]=Se[Y],I[Y+64]=Fe[Y];var rt=I.subarray(32),Ve=I.subarray(16);return oe(rt,rt),E(Ve,Ve,rt),U(w,Ve),0}function V(w,k){return K(w,k,s)}function Z(w,k){return n(k,32),V(w,k)}function he(w,k,P){var d=new Uint8Array(32);return K(d,P,k),z(w,i,d,T)}var Ue=h,pe=m;function Be(w,k,P,d,I,X){var Y=new Uint8Array(32);return he(Y,I,X),Ue(w,k,P,d,Y)}function ut(w,k,P,d,I,X){var Y=new Uint8Array(32);return he(Y,I,X),pe(w,k,P,d,Y)}var We=[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 Ye(w,k,P,d){for(var I=new Int32Array(16),X=new Int32Array(16),Y,ue,Se,Re,Fe,qe,Me,rt,Ve,dt,Ft,gt,Pt,Nt,Xe,st,Qe,Ze,et,Ge,fe,ce,Ae,ge,xe,_e,bt=w[0],Bt=w[1],Lt=w[2],jt=w[3],Q=w[4],Qt=w[5],sr=w[6],or=w[7],Vt=k[0],rr=k[1],nr=k[2],Lr=k[3],gr=k[4],Rr=k[5],Tr=k[6],Ir=k[7],Jr=0;d>=128;){for(et=0;et<16;et++)Ge=8*et+Jr,I[et]=P[Ge+0]<<24|P[Ge+1]<<16|P[Ge+2]<<8|P[Ge+3],X[et]=P[Ge+4]<<24|P[Ge+5]<<16|P[Ge+6]<<8|P[Ge+7];for(et=0;et<80;et++)if(Y=bt,ue=Bt,Se=Lt,Re=jt,Fe=Q,qe=Qt,Me=sr,rt=or,Ve=Vt,dt=rr,Ft=nr,gt=Lr,Pt=gr,Nt=Rr,Xe=Tr,st=Ir,fe=or,ce=Ir,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=(Q>>>14|gr<<32-14)^(Q>>>18|gr<<32-18)^(gr>>>41-32|Q<<32-(41-32)),ce=(gr>>>14|Q<<32-14)^(gr>>>18|Q<<32-18)^(Q>>>41-32|gr<<32-(41-32)),Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=Q&Qt^~Q&sr,ce=gr&Rr^~gr&Tr,Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=We[et*2],ce=We[et*2+1],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=I[et%16],ce=X[et%16],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,Qe=xe&65535|_e<<16,Ze=Ae&65535|ge<<16,fe=Qe,ce=Ze,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=(bt>>>28|Vt<<32-28)^(Vt>>>34-32|bt<<32-(34-32))^(Vt>>>39-32|bt<<32-(39-32)),ce=(Vt>>>28|bt<<32-28)^(bt>>>34-32|Vt<<32-(34-32))^(bt>>>39-32|Vt<<32-(39-32)),Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=bt&Bt^bt&Lt^Bt&Lt,ce=Vt&rr^Vt&nr^rr&nr,Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,rt=xe&65535|_e<<16,st=Ae&65535|ge<<16,fe=Re,ce=gt,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=Qe,ce=Ze,Ae+=ce&65535,ge+=ce>>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&65535,_e=fe>>>16,fe=w[1],ce=k[1],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[1]=Bt=xe&65535|_e<<16,k[1]=rr=Ae&65535|ge<<16,fe=Lt,ce=nr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[2],ce=k[2],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[2]=Lt=xe&65535|_e<<16,k[2]=nr=Ae&65535|ge<<16,fe=jt,ce=Lr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[3],ce=k[3],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[3]=jt=xe&65535|_e<<16,k[3]=Lr=Ae&65535|ge<<16,fe=Q,ce=gr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[4],ce=k[4],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[4]=Q=xe&65535|_e<<16,k[4]=gr=Ae&65535|ge<<16,fe=Qt,ce=Rr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[5],ce=k[5],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[5]=Qt=xe&65535|_e<<16,k[5]=Rr=Ae&65535|ge<<16,fe=sr,ce=Tr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[6],ce=k[6],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[6]=sr=xe&65535|_e<<16,k[6]=Tr=Ae&65535|ge<<16,fe=or,ce=Ir,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[7],ce=k[7],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[7]=or=xe&65535|_e<<16,k[7]=Ir=Ae&65535|ge<<16,Jr+=128,d-=128}return d}function pt(w,k,P){var d=new Int32Array(8),I=new Int32Array(8),X=new Uint8Array(256),Y,ue=P;for(d[0]=1779033703,d[1]=3144134277,d[2]=1013904242,d[3]=2773480762,d[4]=1359893119,d[5]=2600822924,d[6]=528734635,d[7]=1541459225,I[0]=4089235720,I[1]=2227873595,I[2]=4271175723,I[3]=1595750129,I[4]=2917565137,I[5]=725511199,I[6]=4215389547,I[7]=327033209,Ye(d,I,k,P),P%=128,Y=0;Y=0;--I)d=P[I/8|0]>>(I&7)&1,ye(w,k,d),ze(k,w),ze(w,w),ye(w,k,d)}function tt(w,k){var P=[r(),r(),r(),r()];S(P[0],c),S(P[1],p),S(P[2],a),E(P[3],c,p),Ce(w,P,k)}function Dt(w,k,P){var d=new Uint8Array(64),I=[r(),r(),r(),r()],X;for(P||n(k,32),pt(d,k,32),d[0]&=248,d[31]&=127,d[31]|=64,tt(I,d),De(w,I),X=0;X<32;X++)k[X+32]=w[X];return 0}var yt=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 Ct(w,k){var P,d,I,X;for(d=63;d>=32;--d){for(P=0,I=d-32,X=d-12;I>4)*yt[I],P=k[I]>>8,k[I]&=255;for(I=0;I<32;I++)k[I]-=P*yt[I];for(d=0;d<32;d++)k[d+1]+=k[d]>>8,w[d]=k[d]&255}function fr(w){var k=new Float64Array(64),P;for(P=0;P<64;P++)k[P]=w[P];for(P=0;P<64;P++)w[P]=0;Ct(w,k)}function Tt(w,k,P,d){var I=new Uint8Array(64),X=new Uint8Array(64),Y=new Uint8Array(64),ue,Se,Re=new Float64Array(64),Fe=[r(),r(),r(),r()];pt(I,d,32),I[0]&=248,I[31]&=127,I[31]|=64;var qe=P+64;for(ue=0;ue>7&&ve(w[0],o,w[0]),E(w[3],w[0],w[1]),0)}function Wt(w,k,P,d){var I,X=new Uint8Array(32),Y=new Uint8Array(64),ue=[r(),r(),r(),r()],Se=[r(),r(),r(),r()];if(P<64||It(Se,d))return-1;for(I=0;I=0},e.sign.keyPair=function(){var w=new Uint8Array(Le),k=new Uint8Array(ht);return Dt(w,k),{publicKey:w,secretKey:k}},e.sign.keyPair.fromSecretKey=function(w){if(Je(w),w.length!==ht)throw new Error("bad secret key size");for(var k=new Uint8Array(Le),P=0;PReflect.get(n,r))):(...n)=>On(this,void 0,void 0,function*(){return e.inner||(e.inner=Promise.resolve(t())),e.inner.then(i=>Reflect.get(i,r).apply(i,n))})}})}function rm(t,e){var r;return On(this,void 0,void 0,function*(){const{defaultGateway:n}=KU[t];if(!n)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(r=globalThis==null?void 0:globalThis.fetch)!==null&&r!==void 0?r:e==null?void 0:e.fetch,s=yield i?xI(n,i):yI(n);return ct(s.result.key)})}function yI(t){return On(this,void 0,void 0,function*(){const e=yield FR(()=>import(t.split(":")[0]),[]),r=Q4();return new Promise((n,i)=>{const s={method:"POST",headers:{"content-type":"application/json","content-length":r.length}},o=e.request(t,s,a=>{const l=[];a.on("error",u=>i(u)),a.on("data",u=>l.push(u)),a.on("end",()=>{n(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",a=>i(a)),o.write(r),o.end()})})}function xI(t,e){return On(this,void 0,void 0,function*(){const r=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:Q4()});if(!r.ok)throw new dh("Failed to fetch runtime public key.",r);return yield r.json()})}function Q4(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:x2,params:[]})}const vI="6.8.1";function wI(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Mt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&wI(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function Fu(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(Fu).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return Fu(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${Fu(r)}: ${Fu(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function ds(t,e){return t&&t.code===e}function Hx(t){return ds(t,"CALL_EXCEPTION")}function Kf(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${Fu(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+Fu(a))}}s.push(`code=${e}`),s.push(`version=${vI}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Mt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Mt(i,{shortMessage:n}),i}function Ne(t,e,r,n){if(!t)throw Kf(e,r,n)}function se(t,e,r,n){Ne(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function $4(t,e,r){r==null&&(r=""),r&&(r=": "+r),Ne(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Ne(t<=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const bI=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const r=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(r!==n)throw new Error("broken")}t.push(e)}catch{}return t},[]);function AI(t){Ne(bI.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function K1(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Ne(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function K4(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+e3[i&15]}return r}function Zr(t){return"0x"+t.map(e=>mt(e).substring(2)).join("")}function Vu(t){return Dr(t,!0)?(t.length-2)/2:ur(t).length}function Br(t,e,r){const n=ur(t);return r!=null&&r>n.length&&Ne(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),mt(n.slice(e??0,r??n.length))}function J4(t,e,r){const n=ur(t);Ne(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),mt(i)}function Ol(t,e){return J4(t,e,!0)}function SI(t,e){return J4(t,e,!1)}const J1=BigInt(0),us=BigInt(1),Cu=9007199254740991;function FI(t,e){const r=W1(t,"value"),n=BigInt(Jt(e,"width"));if(Ne(r>>n===J1,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-us){const i=(us<=-Cu&&t<=Cu,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){se(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}se(!1,"invalid BigNumberish value",e||"value",t)}function W1(t,e){const r=Rt(t,e);return Ne(r>=J1,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const t3="0123456789abcdef";function Gx(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=t3[r>>4],e+=t3[r&15];return BigInt(e)}return Rt(t)}function Jt(t,e){switch(typeof t){case"bigint":return se(t>=-Cu&&t<=Cu,"overflow",e||"value",t),Number(t);case"number":return se(Number.isInteger(t),"underflow",e||"value",t),se(t>=-Cu&&t<=Cu,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Jt(BigInt(t),e)}catch(r){se(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}se(!1,"invalid numeric value",e||"value",t)}function CI(t){return Jt(Gx(t))}function Oa(t,e){let n=W1(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Jt(e,"width");for(Ne(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function TI(t,e,r,n,i){return t==="OVERLONG"?(se(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),q4(t,e,r))}const II=Object.freeze({error:RI,ignore:q4,replace:TI});function MI(t,e){e==null&&(e=II.error);const r=ur(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let l=s&(1<<8-o-1)-1;for(let u=0;u1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,l);continue}if(l<=a){i+=e("OVERLONG",i-1-o,r,n,l);continue}n.push(l)}}return n}function Al(t,e){e!=null&&(AI(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);se(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function BI(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Vx(t,e){return BI(MI(t,e))}function X4(t){async function e(r,n){const i=r.url.split(":")[0].toLowerCase();Ne(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Ne(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s;if(n){const c=new AbortController;s=c.signal,n.addListener(()=>{c.abort()})}const o={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:s},a=await fetch(r.url,o),l={};a.headers.forEach((c,p)=>{l[p.toLowerCase()]=c});const u=await a.arrayBuffer(),f=u==null?null:new Uint8Array(u);return{statusCode:a.status,statusMessage:a.statusText,headers:l,body:f}}return e}const OI=12,UI=250;let n3=X4();const DI=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),LI=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let nm=!1;async function Z4(t,e){try{const r=t.match(DI);if(!r)throw new Error("invalid data");return new Pa(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?PI(r[3]):jI(r[3]))}catch{return new Pa(599,"BAD REQUEST (invalid data: URI)",{},null,new Ua(t))}}function e8(t){async function e(r,n){try{const i=r.match(LI);if(!i)throw new Error("invalid link");return new Ua(`${t}${i[2]}`)}catch{return new Pa(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Ua(r))}}return e}const fd={data:Z4,ipfs:e8("https://gateway.ipfs.io/ipfs/")},t8=new WeakMap;var il,na;class zI{constructor(e){me(this,il,void 0);me(this,na,void 0);ee(this,il,[]),ee(this,na,!1),t8.set(e,()=>{if(!L(this,na)){ee(this,na,!0);for(const r of L(this,il))setTimeout(()=>{r()},0);ee(this,il,[])}})}addListener(e){Ne(!L(this,na),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),L(this,il).push(e)}get cancelled(){return L(this,na)}checkSignal(){Ne(!this.cancelled,"cancelled","CANCELLED",{})}}il=new WeakMap,na=new WeakMap;function cd(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Wu,Yu,ns,lo,qu,Xu,en,ai,uo,sl,ol,al,ks,fo,ia,ll,Vc;const r1=class r1{constructor(e){me(this,ll);me(this,Wu,void 0);me(this,Yu,void 0);me(this,ns,void 0);me(this,lo,void 0);me(this,qu,void 0);me(this,Xu,void 0);me(this,en,void 0);me(this,ai,void 0);me(this,uo,void 0);me(this,sl,void 0);me(this,ol,void 0);me(this,al,void 0);me(this,ks,void 0);me(this,fo,void 0);me(this,ia,void 0);ee(this,Xu,String(e)),ee(this,Wu,!1),ee(this,Yu,!0),ee(this,ns,{}),ee(this,lo,""),ee(this,qu,3e5),ee(this,fo,{slotInterval:UI,maxAttempts:OI}),ee(this,ia,null)}get url(){return L(this,Xu)}set url(e){ee(this,Xu,String(e))}get body(){return L(this,en)==null?null:new Uint8Array(L(this,en))}set body(e){if(e==null)ee(this,en,void 0),ee(this,ai,void 0);else if(typeof e=="string")ee(this,en,Al(e)),ee(this,ai,"text/plain");else if(e instanceof Uint8Array)ee(this,en,e),ee(this,ai,"application/octet-stream");else if(typeof e=="object")ee(this,en,Al(JSON.stringify(e))),ee(this,ai,"application/json");else throw new Error("invalid body")}hasBody(){return L(this,en)!=null}get method(){return L(this,lo)?L(this,lo):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),ee(this,lo,String(e).toUpperCase())}get headers(){const e=Object.assign({},L(this,ns));return L(this,uo)&&(e.authorization=`Basic ${NI(Al(L(this,uo)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&L(this,ai)&&(e["content-type"]=L(this,ai)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){L(this,ns)[String(e).toLowerCase()]=String(r)}clearHeaders(){ee(this,ns,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),ee(this,qu,e)}get preflightFunc(){return L(this,sl)||null}set preflightFunc(e){ee(this,sl,e)}get processFunc(){return L(this,ol)||null}set processFunc(e){ee(this,ol,e)}get retryFunc(){return L(this,al)||null}set retryFunc(e){ee(this,al,e)}get getUrlFunc(){return L(this,ia)||n3}set getUrlFunc(e){ee(this,ia,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(L(this,fo).slotInterval=e.slotInterval),e.maxAttempts!=null&&(L(this,fo).maxAttempts=e.maxAttempts)}send(){return Ne(L(this,ks)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),ee(this,ks,new zI(this)),ot(this,ll,Vc).call(this,0,i3()+this.timeout,0,this,new Pa(0,"",{},null,this))}cancel(){Ne(L(this,ks)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=t8.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Ne(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new r1(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,ee(i,ns,Object.assign({},L(this,ns))),L(this,en)&&ee(i,en,new Uint8Array(L(this,en))),ee(i,ai,L(this,ai)),i}clone(){const e=new r1(this.url);return ee(e,lo,L(this,lo)),L(this,en)&&ee(e,en,L(this,en)),ee(e,ai,L(this,ai)),ee(e,ns,Object.assign({},L(this,ns))),ee(e,uo,L(this,uo)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),ee(e,sl,L(this,sl)),ee(e,ol,L(this,ol)),ee(e,al,L(this,al)),ee(e,ia,L(this,ia)),e}static lockConfig(){nm=!0}static getGateway(e){return fd[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(nm)throw new Error("gateways locked");fd[e]=r}static registerGetUrl(e){if(nm)throw new Error("gateways locked");n3=e}static createGetUrlFunc(e){return X4()}static createDataGateway(){return Z4}static createIpfsGatewayFunc(e){return e8(e)}};Wu=new WeakMap,Yu=new WeakMap,ns=new WeakMap,lo=new WeakMap,qu=new WeakMap,Xu=new WeakMap,en=new WeakMap,ai=new WeakMap,uo=new WeakMap,sl=new WeakMap,ol=new WeakMap,al=new WeakMap,ks=new WeakMap,fo=new WeakMap,ia=new WeakMap,ll=new WeakSet,Vc=async function(e,r,n,i,s){var f,c,p;if(e>=L(this,fo).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Ne(i3()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await HI(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in fd){const y=await fd[a](o.url,cd(L(i,ks)));if(y instanceof Pa){let v=y;if(this.processFunc){cd(L(i,ks));try{v=await this.processFunc(o,v)}catch(b){(b.throttle==null||typeof b.stall!="number")&&v.makeServerError("error in post-processing function",b).assertOk()}}return v}o=y}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,cd(L(i,ks)));let u=new Pa(l.statusCode,l.statusMessage,l.headers,l.body,i);if(u.statusCode===301||u.statusCode===302){try{const y=u.headers.location||"";return ot(f=o.redirect(y),ll,Vc).call(f,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const y=u.headers["retry-after"];let v=L(this,fo).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof y=="string"&&y.match(/^[1-9][0-9]*$/)&&(v=parseInt(y)),ot(c=o.clone(),ll,Vc).call(c,e+1,r,v,i,u)}if(this.processFunc){cd(L(i,ks));try{u=await this.processFunc(o,u)}catch(y){(y.throttle==null||typeof y.stall!="number")&&u.makeServerError("error in post-processing function",y).assertOk();let v=L(this,fo).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return y.stall>=0&&(v=y.stall),ot(p=o.clone(),ll,Vc).call(p,e+1,r,v,i,u)}}return u};let Ua=r1;var Zh,e0,t0,is,Zu,ul;const gv=class gv{constructor(e,r,n,i,s){me(this,Zh,void 0);me(this,e0,void 0);me(this,t0,void 0);me(this,is,void 0);me(this,Zu,void 0);me(this,ul,void 0);ee(this,Zh,e),ee(this,e0,r),ee(this,t0,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),ee(this,is,i==null?null:new Uint8Array(i)),ee(this,Zu,s||null),ee(this,ul,{message:""})}toString(){return``}get statusCode(){return L(this,Zh)}get statusMessage(){return L(this,e0)}get headers(){return Object.assign({},L(this,t0))}get body(){return L(this,is)==null?null:new Uint8Array(L(this,is))}get bodyText(){try{return L(this,is)==null?"":Vx(L(this,is))}catch{Ne(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Ne(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Mt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return L(this,is)!=null}get request(){return L(this,Zu)}ok(){return L(this,ul).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=L(this,ul);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),Ne(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r})}};Zh=new WeakMap,e0=new WeakMap,t0=new WeakMap,is=new WeakMap,Zu=new WeakMap,ul=new WeakMap;let Pa=gv;function i3(){return new Date().getTime()}function jI(t){return Al(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function HI(t){return new Promise(e=>setTimeout(e,t))}function GI(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function s3(t,e,r){let n=0;for(let i=0;i{Ne(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=s3(t,e+1,n);return r(e+1+n+i),o3(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),o3(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=s3(t,e+1,n);r(e+1+n+i);const s=mt(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=mt(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:GI(t[e])}}function Qx(t){const e=ur(t,"data"),r=r8(e,0);return se(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function a3(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function n8(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(n8(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=a3(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(ur(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=a3(e.length);return r.unshift(183+r.length),r.concat(e)}const l3="0123456789abcdef";function Vh(t){let e="0x";for(const r of n8(t))e+=l3[r>>4],e+=l3[r&15];return e}const Ln=32,jy=new Uint8Array(Ln),VI=["then"],hd={};function Ic(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}var sa;const ph=class ph extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==hd&&(i=r,s=[],o=!1);super(i.length);me(this,sa,void 0);i.forEach((l,u)=>{this[u]=l});const a=s.reduce((l,u)=>(typeof u=="string"&&l.set(u,(l.get(u)||0)+1),l),new Map);if(ee(this,sa,Object.freeze(i.map((l,u)=>{const f=s[u];return f!=null&&a.get(f)===1?f:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,u,f)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const p=Jt(u,"%index");if(p<0||p>=this.length)throw new RangeError("out of result range");const y=l[p];return y instanceof Error&&Ic(`index ${p}`,y),y}if(VI.indexOf(u)>=0)return Reflect.get(l,u,f);const c=l[u];if(c instanceof Function)return function(...p){return c.apply(this===f?l:this,p)};if(!(u in l))return l.getValue.apply(this===f?l:this,[u])}return Reflect.get(l,u,f)}})}toArray(){const r=[];return this.forEach((n,i)=>{n instanceof Error&&Ic(`index ${i}`,n),r.push(n)}),r}toObject(){return L(this,sa).reduce((r,n,i)=>(Ne(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in r||(r[n]=this.getValue(n)),r),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=[],s=[];for(let o=r;o{L(this,co)[e]=u3(r)}}}co=new WeakMap,fl=new WeakMap,ef=new WeakSet,Gd=function(e){return L(this,co).push(e),ee(this,fl,L(this,fl)+e.length),e.length};var li,_i,n1,i8;const mv=class mv{constructor(e,r){me(this,n1);le(this,"allowLoose");me(this,li,void 0);me(this,_i,void 0);Mt(this,{allowLoose:!!r}),ee(this,li,Rn(e)),ee(this,_i,0)}get data(){return mt(L(this,li))}get dataLength(){return L(this,li).length}get consumed(){return L(this,_i)}get bytes(){return new Uint8Array(L(this,li))}subReader(e){return new mv(L(this,li).slice(L(this,_i)+e),this.allowLoose)}readBytes(e,r){let n=ot(this,n1,i8).call(this,0,e,!!r);return ee(this,_i,L(this,_i)+n.length),n.slice(0,e)}readValue(){return Gx(this.readBytes(Ln))}readIndex(){return CI(this.readBytes(Ln))}};li=new WeakMap,_i=new WeakMap,n1=new WeakSet,i8=function(e,r,n){let i=Math.ceil(r/Ln)*Ln;return L(this,_i)+i>L(this,li).length&&(this.allowLoose&&n&&L(this,_i)+r<=L(this,li).length?i=r:Ne(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Rn(L(this,li)),length:L(this,li).length,offset:L(this,_i)+i})),L(this,li).slice(L(this,_i),L(this,_i)+i)};let Gy=mv;function Vp(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function $x(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function QI(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Vp(t.outputLen),Vp(t.blockLen)}function Jf(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function s8(t,e){$x(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,$I=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),sm=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),bs=(t,e)=>t<<32-e|t>>>e,KI=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!KI)throw new Error("Non little-endian hardware is not supported");function JI(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Y1(t){if(typeof t=="string"&&(t=JI(t)),!o8(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function WI(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!o8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class Kx{clone(){return this._cloneInto()}}function a8(t){const e=n=>t().update(Y1(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function YI(t=32){if(im&&typeof im.getRandomValues=="function")return im.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class l8 extends Kx{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,QI(e);const n=Y1(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew l8(t,e).update(r).digest();u8.create=(t,e)=>new l8(t,e);function qI(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+u,a,n)}class XI extends Kx{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=sm(this.buffer)}update(e){Jf(this);const{view:r,buffer:n,blockLen:i}=this;e=Y1(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let c=o;cf.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;ct&e^~t&r,eM=(t,e,r)=>t&e^t&r^e&r,tM=new Uint32Array([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]),Ko=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Jo=new Uint32Array(64);class rM extends XI{constructor(){super(64,32,8,!1),this.A=Ko[0]|0,this.B=Ko[1]|0,this.C=Ko[2]|0,this.D=Ko[3]|0,this.E=Ko[4]|0,this.F=Ko[5]|0,this.G=Ko[6]|0,this.H=Ko[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:l}=this;return[e,r,n,i,s,o,a,l]}set(e,r,n,i,s,o,a,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,r){for(let c=0;c<16;c++,r+=4)Jo[c]=e.getUint32(r,!1);for(let c=16;c<64;c++){const p=Jo[c-15],y=Jo[c-2],v=bs(p,7)^bs(p,18)^p>>>3,b=bs(y,17)^bs(y,19)^y>>>10;Jo[c]=b+Jo[c-7]+v+Jo[c-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:u,H:f}=this;for(let c=0;c<64;c++){const p=bs(a,6)^bs(a,11)^bs(a,25),y=f+p+ZI(a,l,u)+tM[c]+Jo[c]|0,b=(bs(n,2)^bs(n,13)^bs(n,22))+eM(n,i,s)|0;f=u,u=l,l=a,a=o+y|0,o=s,s=i,i=n,n=y+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,l,u,f)}roundClean(){Jo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const nM=a8(()=>new rM),dd=BigInt(2**32-1),f3=BigInt(32);function iM(t,e=!1){return e?{h:Number(t&dd),l:Number(t>>f3&dd)}:{h:Number(t>>f3&dd)|0,l:Number(t&dd)|0}}function sM(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,aM=(t,e,r)=>e<>>32-r,lM=(t,e,r)=>e<>>64-r,uM=(t,e,r)=>t<>>64-r,[f8,c8,h8]=[[],[],[]],fM=BigInt(0),Mc=BigInt(1),cM=BigInt(2),hM=BigInt(7),dM=BigInt(256),pM=BigInt(113);for(let t=0,e=Mc,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],f8.push(2*(5*n+r)),c8.push((t+1)*(t+2)/2%64);let i=fM;for(let s=0;s<7;s++)e=(e<>hM)*pM)%dM,e&cM&&(i^=Mc<<(Mc<r>32?lM(t,e,r):oM(t,e,r),h3=(t,e,r)=>r>32?uM(t,e,r):aM(t,e,r);function yM(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=r[l],f=r[l+1],c=c3(u,f,1)^r[a],p=h3(u,f,1)^r[a+1];for(let y=0;y<50;y+=10)t[o+y]^=c,t[o+y+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=c8[o],l=c3(i,s,a),u=h3(i,s,a),f=f8[o];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=gM[n],t[1]^=mM[n]}r.fill(0)}class Jx extends Kx{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Vp(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=$I(this.state)}keccak(){yM(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Jf(this);const{blockLen:r,state:n}=this;e=Y1(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Vp(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(s8(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Jx(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const xM=(t,e,r)=>a8(()=>new Jx(e,t,r)),vM=xM(1,136,256/8);let d8=!1;const p8=function(t){return vM(t)};let g8=p8;function _r(t){const e=ur(t,"data");return mt(g8(e))}_r._=p8;_r.lock=function(){d8=!0};_r.register=function(t){if(d8)throw new TypeError("keccak256 is locked");g8=t};Object.freeze(_r);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const m8=BigInt(0),q1=BigInt(1),wM=BigInt(2),X1=t=>t instanceof Uint8Array,bM=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Wf(t){if(!X1(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!X1(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function EM(t,e){if(t.length!==e.length)return!1;for(let r=0;rm8;t>>=q1,e+=1);return e}function CM(t,e){return t>>BigInt(e)&q1}const kM=(t,e,r)=>t|(r?q1:m8)<(wM<new Uint8Array(t),d3=t=>Uint8Array.from(t);function x8(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=om(t),i=om(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...c)=>r(i,n,...c),l=(c=om())=>{i=a(d3([0]),c),n=a(),c.length!==0&&(i=a(d3([1]),c),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let c=0;const p=[];for(;c{o(),l(c);let y;for(;!(y=p(u()));)l();return o(),y}}const _M={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function k0(t,e,r={}){const n=(i,s,o)=>{const a=_M[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const PM=Object.freeze(Object.defineProperty({__proto__:null,bitGet:CM,bitLen:FM,bitMask:Xx,bitSet:kM,bytesToHex:Wf,bytesToNumberBE:El,bytesToNumberLE:Yx,concatBytes:Qh,createHmacDrbg:x8,ensureBytes:ts,equalBytes:EM,hexToBytes:Yf,hexToNumber:Wx,numberToBytesBE:qf,numberToBytesLE:qx,numberToHexUnpadded:y8,numberToVarBytesBE:AM,utf8ToBytes:SM,validateObject:k0},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rn=BigInt(0),Vr=BigInt(1),Ka=BigInt(2),NM=BigInt(3),Vy=BigInt(4),p3=BigInt(5),g3=BigInt(8);BigInt(9);BigInt(16);function Jn(t,e){const r=t%e;return r>=rn?r:e+r}function RM(t,e,r){if(r<=rn||e 0");if(r===Vr)return rn;let n=Vr;for(;e>rn;)e&Vr&&(n=n*t%r),t=t*t%r,e>>=Vr;return n}function Ai(t,e,r){let n=t;for(;e-- >rn;)n*=n,n%=r;return n}function Qy(t,e){if(t===rn||e<=rn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Jn(t,e),n=e,i=rn,s=Vr;for(;r!==rn;){const a=n/r,l=n%r,u=i-s*a;n=r,r=l,i=s,s=u}if(n!==Vr)throw new Error("invert: does not exist");return Jn(i,e)}function TM(t){const e=(t-Vr)/Ka;let r,n,i;for(r=t-Vr,n=0;r%Ka===rn;r/=Ka,n++);for(i=Ka;i(n[i]="function",n),e);return k0(t,r)}function OM(t,e,r){if(r 0");if(r===rn)return t.ONE;if(r===Vr)return e;let n=t.ONE,i=e;for(;r>rn;)r&Vr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Vr;return n}function UM(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function v8(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function DM(t,e,r=!1,n={}){if(t<=rn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=v8(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=IM(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Xx(i),ZERO:rn,ONE:Vr,create:l=>Jn(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return rn<=l&&ll===rn,isOdd:l=>(l&Vr)===Vr,neg:l=>Jn(-l,t),eql:(l,u)=>l===u,sqr:l=>Jn(l*l,t),add:(l,u)=>Jn(l+u,t),sub:(l,u)=>Jn(l-u,t),mul:(l,u)=>Jn(l*u,t),pow:(l,u)=>OM(a,l,u),div:(l,u)=>Jn(l*Qy(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Qy(l,t),sqrt:n.sqrt||(l=>o(a,l)),invertBatch:l=>UM(a,l),cmov:(l,u,f)=>f?u:l,toBytes:l=>r?qx(l,s):qf(l,s),fromBytes:l=>{if(l.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${l.length}`);return r?Yx(l):El(l)}});return Object.freeze(a)}function w8(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function b8(t){const e=w8(t);return e+Math.ceil(e/2)}function LM(t,e,r=!1){const n=t.length,i=w8(e),s=b8(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?El(t):Yx(t),a=Jn(o,e-Vr)+Vr;return r?qx(a,i):qf(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zM=BigInt(0),am=BigInt(1);function jM(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zM;)s&am&&(o=o.add(a)),a=a.double(),s>>=am;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),l=[];let u=i,f=u;for(let c=0;c>=y,N>l&&(N-=p,o+=am);const x=b,A=b+Math.abs(N)-1,C=v%2!==0,F=N<0;N===0?f=f.add(r(C,s[x])):u=u.add(r(F,s[A]))}return{p:u,f}},wNAFCached(i,s,o,a){const l=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&s.set(i,a(u))),this.wNAF(l,u,o)}}}function A8(t){return BM(t.Fp),k0(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...v8(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function HM(t){const e=A8(t);k0(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:GM,hexToBytes:VM}=PM,el={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=el;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:GM(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=el,r=typeof t=="string"?VM(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=el._parseInt(r.subarray(2)),{d:o,l:a}=el._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},wo=BigInt(0),Mi=BigInt(1);BigInt(2);const m3=BigInt(3);BigInt(4);function QM(t){const e=HM(t),{Fp:r}=e,n=e.toBytes||((v,b,N)=>{const x=b.toAffine();return Qh(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(v=>{const b=v.subarray(1),N=r.fromBytes(b.subarray(0,r.BYTES)),x=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:N,y:x}});function s(v){const{a:b,b:N}=e,x=r.sqr(v),A=r.mul(x,v);return r.add(r.add(A,r.mul(v,b)),N)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&wor.eql(C,r.ZERO);return A(N)&&A(x)?c.ZERO:new c(N,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const N=r.invertBatch(b.map(x=>x.pz));return b.map((x,A)=>x.toAffine(N[A])).map(c.fromAffine)}static fromHex(b){const N=c.fromAffine(i(ts("pointHex",b)));return N.assertValidity(),N}static fromPrivateKey(b){return c.BASE.multiply(l(b))}_setWindowSize(b){this._WINDOW_SIZE=b,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:N}=this.toAffine();if(!r.isValid(b)||!r.isValid(N))throw new Error("bad point: x or y not FE");const x=r.sqr(N),A=s(b);if(!r.eql(x,A))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:N,py:x,pz:A}=this,{px:C,py:F,pz:z}=b,T=r.eql(r.mul(N,z),r.mul(C,A)),D=r.eql(r.mul(x,z),r.mul(F,A));return T&&D}negate(){return new c(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:N}=e,x=r.mul(N,m3),{px:A,py:C,pz:F}=this;let z=r.ZERO,T=r.ZERO,D=r.ZERO,G=r.mul(A,A),$=r.mul(C,C),ne=r.mul(F,F),te=r.mul(A,C);return te=r.add(te,te),D=r.mul(A,F),D=r.add(D,D),z=r.mul(b,D),T=r.mul(x,ne),T=r.add(z,T),z=r.sub($,T),T=r.add($,T),T=r.mul(z,T),z=r.mul(te,z),D=r.mul(x,D),ne=r.mul(b,ne),te=r.sub(G,ne),te=r.mul(b,te),te=r.add(te,D),D=r.add(G,G),G=r.add(D,G),G=r.add(G,ne),G=r.mul(G,te),T=r.add(T,G),ne=r.mul(C,F),ne=r.add(ne,ne),G=r.mul(ne,te),z=r.sub(z,G),D=r.mul(ne,$),D=r.add(D,D),D=r.add(D,D),new c(z,T,D)}add(b){f(b);const{px:N,py:x,pz:A}=this,{px:C,py:F,pz:z}=b;let T=r.ZERO,D=r.ZERO,G=r.ZERO;const $=e.a,ne=r.mul(e.b,m3);let te=r.mul(N,C),de=r.mul(x,F),_=r.mul(A,z),h=r.add(N,x),m=r.add(C,F);h=r.mul(h,m),m=r.add(te,de),h=r.sub(h,m),m=r.add(N,A);let S=r.add(C,z);return m=r.mul(m,S),S=r.add(te,_),m=r.sub(m,S),S=r.add(x,A),T=r.add(F,z),S=r.mul(S,T),T=r.add(de,_),S=r.sub(S,T),G=r.mul($,m),T=r.mul(ne,_),G=r.add(T,G),T=r.sub(de,G),G=r.add(de,G),D=r.mul(T,G),de=r.add(te,te),de=r.add(de,te),_=r.mul($,_),m=r.mul(ne,m),de=r.add(de,_),_=r.sub(te,_),_=r.mul($,_),m=r.add(m,_),te=r.mul(de,m),D=r.add(D,te),te=r.mul(S,m),T=r.mul(h,T),T=r.sub(T,te),te=r.mul(h,de),G=r.mul(S,G),G=r.add(G,te),new c(T,D,G)}subtract(b){return this.add(b.negate())}is0(){return this.equals(c.ZERO)}wNAF(b){return y.wNAFCached(this,u,b,N=>{const x=r.invertBatch(N.map(A=>A.pz));return N.map((A,C)=>A.toAffine(x[C])).map(c.fromAffine)})}multiplyUnsafe(b){const N=c.ZERO;if(b===wo)return N;if(a(b),b===Mi)return this;const{endo:x}=e;if(!x)return y.unsafeLadder(this,b);let{k1neg:A,k1:C,k2neg:F,k2:z}=x.splitScalar(b),T=N,D=N,G=this;for(;C>wo||z>wo;)C&Mi&&(T=T.add(G)),z&Mi&&(D=D.add(G)),G=G.double(),C>>=Mi,z>>=Mi;return A&&(T=T.negate()),F&&(D=D.negate()),D=new c(r.mul(D.px,x.beta),D.py,D.pz),T.add(D)}multiply(b){a(b);let N=b,x,A;const{endo:C}=e;if(C){const{k1neg:F,k1:z,k2neg:T,k2:D}=C.splitScalar(N);let{p:G,f:$}=this.wNAF(z),{p:ne,f:te}=this.wNAF(D);G=y.constTimeNegate(F,G),ne=y.constTimeNegate(T,ne),ne=new c(r.mul(ne.px,C.beta),ne.py,ne.pz),x=G.add(ne),A=$.add(te)}else{const{p:F,f:z}=this.wNAF(N);x=F,A=z}return c.normalizeZ([x,A])[0]}multiplyAndAddUnsafe(b,N,x){const A=c.BASE,C=(z,T)=>T===wo||T===Mi||!z.equals(A)?z.multiplyUnsafe(T):z.multiply(T),F=C(this,N).add(C(b,x));return F.is0()?void 0:F}toAffine(b){const{px:N,py:x,pz:A}=this,C=this.is0();b==null&&(b=C?r.ONE:r.inv(A));const F=r.mul(N,b),z=r.mul(x,b),T=r.mul(A,b);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(T,r.ONE))throw new Error("invZ was invalid");return{x:F,y:z}}isTorsionFree(){const{h:b,isTorsionFree:N}=e;if(b===Mi)return!0;if(N)return N(c,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:N}=e;return b===Mi?this:N?N(c,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(c,this,b)}toHex(b=!0){return Wf(this.toRawBytes(b))}}c.BASE=new c(e.Gx,e.Gy,r.ONE),c.ZERO=new c(r.ZERO,r.ONE,r.ZERO);const p=e.nBitLength,y=jM(c,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function $M(t){const e=A8(t);return k0(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function KM(t){const e=$M(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return woWf(qf(m,e.nByteLength));function v(m){const S=n>>Mi;return m>S}function b(m){return v(m)?a(-m):m}const N=(m,S,M)=>El(m.slice(S,M));class x{constructor(S,M,R){this.r=S,this.s=M,this.recovery=R,this.assertValidity()}static fromCompact(S){const M=e.nByteLength;return S=ts("compactSignature",S,M*2),new x(N(S,0,M),N(S,M,2*M))}static fromDER(S){const{r:M,s:R}=el.toSig(ts("DER",S));return new x(M,R)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(S){return new x(this.r,this.s,S)}recoverPublicKey(S){const{r:M,s:R,recovery:U}=this,H=D(ts("msgHash",S));if(U==null||![0,1,2,3].includes(U))throw new Error("recovery id invalid");const B=U===2||U===3?M+e.n:M;if(B>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const g=U&1?"03":"02",O=u.fromHex(g+y(B)),ve=l(B),E=a(-H*ve),W=a(R*ve),oe=u.BASE.multiplyAndAddUnsafe(O,E,W);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Yf(this.toDERHex())}toDERHex(){return el.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Yf(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const A={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=b8(e.n);return LM(e.randomBytes(m),e.n)},precompute(m=8,S=u.BASE){return S._setWindowSize(m),S.multiply(BigInt(3)),S}};function C(m,S=!0){return u.fromPrivateKey(m).toRawBytes(S)}function F(m){const S=m instanceof Uint8Array,M=typeof m=="string",R=(S||M)&&m.length;return S?R===i||R===s:M?R===2*i||R===2*s:m instanceof u}function z(m,S,M=!0){if(F(m))throw new Error("first arg must be private key");if(!F(S))throw new Error("second arg must be public key");return u.fromHex(S).multiply(f(m)).toRawBytes(M)}const T=e.bits2int||function(m){const S=El(m),M=m.length*8-e.nBitLength;return M>0?S>>BigInt(M):S},D=e.bits2int_modN||function(m){return a(T(m))},G=Xx(e.nBitLength);function $(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(wo<=m&&mK in M))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:U}=e;let{lowS:H,prehash:B,extraEntropy:g}=M;H==null&&(H=!0),m=ts("msgHash",m),B&&(m=ts("prehashed msgHash",R(m)));const O=D(m),ve=f(S),E=[$(ve),$(O)];if(g!=null){const K=g===!0?U(r.BYTES):g;E.push(ts("extraEntropy",K))}const W=Qh(...E),oe=O;function J(K){const V=T(K);if(!p(V))return;const Z=l(V),he=u.BASE.multiply(V).toAffine(),Ue=a(he.x);if(Ue===wo)return;const pe=a(Z*a(oe+Ue*ve));if(pe===wo)return;let Be=(he.x===Ue?0:2)|Number(he.y&Mi),ut=pe;return H&&v(pe)&&(ut=b(pe),Be^=1),new x(Ue,ut,Be)}return{seed:W,k2sig:J}}const te={lowS:e.lowS,prehash:!1},de={lowS:e.lowS,prehash:!1};function _(m,S,M=te){const{seed:R,k2sig:U}=ne(m,S,M),H=e;return x8(H.hash.outputLen,H.nByteLength,H.hmac)(R,U)}u.BASE._setWindowSize(8);function h(m,S,M,R=de){var he;const U=m;if(S=ts("msgHash",S),M=ts("publicKey",M),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:B}=R;let g,O;try{if(typeof U=="string"||U instanceof Uint8Array)try{g=x.fromDER(U)}catch(Ue){if(!(Ue instanceof el.Err))throw Ue;g=x.fromCompact(U)}else if(typeof U=="object"&&typeof U.r=="bigint"&&typeof U.s=="bigint"){const{r:Ue,s:pe}=U;g=new x(Ue,pe)}else throw new Error("PARSE");O=u.fromHex(M)}catch(Ue){if(Ue.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&g.hasHighS())return!1;B&&(S=e.hash(S));const{r:ve,s:E}=g,W=D(S),oe=l(E),J=a(W*oe),K=a(ve*oe),V=(he=u.BASE.multiplyAndAddUnsafe(O,J,K))==null?void 0:he.toAffine();return V?a(V.x)===ve:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:z,sign:_,verify:h,ProjectivePoint:u,Signature:x,utils:A}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function JM(t){return{hash:t,hmac:(e,...r)=>u8(t,e,WI(...r)),randomBytes:YI}}function WM(t,e){const r=n=>KM({...t,...JM(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const E8=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),y3=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),YM=BigInt(1),$y=BigInt(2),x3=(t,e)=>(t+e/$y)/e;function qM(t){const e=E8,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,f=u*u*t%e,c=Ai(f,r,e)*f%e,p=Ai(c,r,e)*f%e,y=Ai(p,$y,e)*u%e,v=Ai(y,i,e)*y%e,b=Ai(v,s,e)*v%e,N=Ai(b,a,e)*b%e,x=Ai(N,l,e)*N%e,A=Ai(x,a,e)*b%e,C=Ai(A,r,e)*f%e,F=Ai(C,o,e)*v%e,z=Ai(F,n,e)*u%e,T=Ai(z,$y,e);if(!Ky.eql(Ky.sqr(T),t))throw new Error("Cannot find square root");return T}const Ky=DM(E8,void 0,void 0,{sqrt:qM}),qo=WM({a:BigInt(0),b:BigInt(7),Fp:Ky,n:y3,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=y3,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-YM*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=x3(s*t,e),l=x3(-n*t,e);let u=Jn(t-a*r-l*i,e),f=Jn(-a*n-l*s,e);const c=u>o,p=f>o;if(c&&(u=e-u),p&&(f=e-f),u>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:c,k1:u,k2neg:p,k2:f}}}},nM);BigInt(0);qo.ProjectivePoint;const Jy="0x0000000000000000000000000000000000000000",v3="0x0000000000000000000000000000000000000000000000000000000000000000",w3=BigInt(0),b3=BigInt(1),A3=BigInt(2),E3=BigInt(27),S3=BigInt(28),pd=BigInt(35),ql={};function F3(t){return Ol(gi(t),32)}var tf,rf,nf,cl;const Xi=class Xi{constructor(e,r,n,i){me(this,tf,void 0);me(this,rf,void 0);me(this,nf,void 0);me(this,cl,void 0);K1(e,ql,"Signature"),ee(this,tf,r),ee(this,rf,n),ee(this,nf,i),ee(this,cl,null)}get r(){return L(this,tf)}set r(e){se(Vu(e)===32,"invalid r","value",e),ee(this,tf,mt(e))}get s(){return L(this,rf)}set s(e){se(Vu(e)===32,"invalid s","value",e);const r=mt(e);se(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),ee(this,rf,r)}get v(){return L(this,nf)}set v(e){const r=Jt(e,"value");se(r===27||r===28,"invalid v","v",e),ee(this,nf,r)}get networkV(){return L(this,cl)}get legacyChainId(){const e=this.networkV;return e==null?null:Xi.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ur(this.s);return this.yParity&&(e[0]|=128),mt(e)}get compactSerialized(){return Zr([this.r,this.yParityAndS])}get serialized(){return Zr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Xi(ql,this.r,this.s,this.v);return this.networkV&&ee(e,cl,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Rt(e,"v");return r==E3||r==S3?w3:(se(r>=pd,"invalid EIP-155 v","v",e),(r-pd)/A3)}static getChainIdV(e,r){return Rt(e)*A3+BigInt(35+r-27)}static getNormalizedV(e){const r=Rt(e);return r===w3||r===E3?27:r===b3||r===S3?28:(se(r>=pd,"invalid v","v",e),r&b3?27:28)}static from(e){function r(u,f){se(u,f,"signature",e)}if(e==null)return new Xi(ql,v3,v3,27);if(typeof e=="string"){const u=ur(e,"signature");if(u.length===64){const f=mt(u.slice(0,32)),c=u.slice(32,64),p=c[0]&128?28:27;return c[0]&=127,new Xi(ql,f,mt(c),p)}if(u.length===65){const f=mt(u.slice(0,32)),c=u.slice(32,64);r((c[0]&128)===0,"non-canonical s");const p=Xi.getNormalizedV(u[64]);return new Xi(ql,f,mt(c),p)}r(!1,"invalid raw signature length")}if(e instanceof Xi)return e.clone();const n=e.r;r(n!=null,"missing r");const i=F3(n),s=function(u,f){if(u!=null)return F3(u);if(f!=null){r(Dr(f,32),"invalid yParityAndS");const c=ur(f);return c[0]&=127,mt(c)}r(!1,"missing s")}(e.s,e.yParityAndS);r((ur(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,f,c){if(u!=null){const p=Rt(u);return{networkV:p>=pd?p:void 0,v:Xi.getNormalizedV(p)}}if(f!=null)return r(Dr(f,32),"invalid yParityAndS"),{v:ur(f)[0]&128?28:27};if(c!=null){switch(Jt(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Xi(ql,i,s,a);return o&&ee(l,cl,o),r(e.yParity==null||Jt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};tf=new WeakMap,rf=new WeakMap,nf=new WeakMap,cl=new WeakMap;let ys=Xi;var ho;const Ja=class Ja{constructor(e){me(this,ho,void 0);se(Vu(e)===32,"invalid private key","privateKey","[REDACTED]"),ee(this,ho,mt(e))}get privateKey(){return L(this,ho)}get publicKey(){return Ja.computePublicKey(L(this,ho))}get compressedPublicKey(){return Ja.computePublicKey(L(this,ho),!0)}sign(e){se(Vu(e)===32,"invalid digest length","digest",e);const r=qo.sign(Rn(e),Rn(L(this,ho)),{lowS:!0});return ys.from({r:Oa(r.r,32),s:Oa(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ja.computePublicKey(e);return mt(qo.getSharedSecret(Rn(L(this,ho)),ur(r),!1))}static computePublicKey(e,r){let n=ur(e,"key");if(n.length===32){const s=qo.getPublicKey(n,!!r);return mt(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=qo.ProjectivePoint.fromHex(n);return mt(i.toRawBytes(r))}static recoverPublicKey(e,r){se(Vu(e)===32,"invalid digest length","digest",e);const n=ys.from(r);let i=qo.Signature.fromCompact(Rn(Zr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Rn(e));return se(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=qo.ProjectivePoint.fromHex(Ja.computePublicKey(e).substring(2)),s=qo.ProjectivePoint.fromHex(Ja.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};ho=new WeakMap;let $h=Ja;const XM=BigInt(0),ZM=BigInt(36);function C3(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ur(_r(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Zx={};for(let t=0;t<10;t++)Zx[String(t)]=String(t);for(let t=0;t<26;t++)Zx[String.fromCharCode(65+t)]=String(10+t);const k3=15;function eB(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Zx[n]).join("");for(;e.length>=k3;){let n=e.substring(0,k3);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const tB=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function rB(t){t=t.toLowerCase();let e=XM;for(let r=0;re.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return L(this,hl)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return L(this,hl)===!0?-1:L(this,hl)===!1?this.value.length:null}static from(e,r){return new io(no,e,r)}static uint8(e){return nt(e,8)}static uint16(e){return nt(e,16)}static uint24(e){return nt(e,24)}static uint32(e){return nt(e,32)}static uint40(e){return nt(e,40)}static uint48(e){return nt(e,48)}static uint56(e){return nt(e,56)}static uint64(e){return nt(e,64)}static uint72(e){return nt(e,72)}static uint80(e){return nt(e,80)}static uint88(e){return nt(e,88)}static uint96(e){return nt(e,96)}static uint104(e){return nt(e,104)}static uint112(e){return nt(e,112)}static uint120(e){return nt(e,120)}static uint128(e){return nt(e,128)}static uint136(e){return nt(e,136)}static uint144(e){return nt(e,144)}static uint152(e){return nt(e,152)}static uint160(e){return nt(e,160)}static uint168(e){return nt(e,168)}static uint176(e){return nt(e,176)}static uint184(e){return nt(e,184)}static uint192(e){return nt(e,192)}static uint200(e){return nt(e,200)}static uint208(e){return nt(e,208)}static uint216(e){return nt(e,216)}static uint224(e){return nt(e,224)}static uint232(e){return nt(e,232)}static uint240(e){return nt(e,240)}static uint248(e){return nt(e,248)}static uint256(e){return nt(e,256)}static uint(e){return nt(e,256)}static int8(e){return nt(e,-8)}static int16(e){return nt(e,-16)}static int24(e){return nt(e,-24)}static int32(e){return nt(e,-32)}static int40(e){return nt(e,-40)}static int48(e){return nt(e,-48)}static int56(e){return nt(e,-56)}static int64(e){return nt(e,-64)}static int72(e){return nt(e,-72)}static int80(e){return nt(e,-80)}static int88(e){return nt(e,-88)}static int96(e){return nt(e,-96)}static int104(e){return nt(e,-104)}static int112(e){return nt(e,-112)}static int120(e){return nt(e,-120)}static int128(e){return nt(e,-128)}static int136(e){return nt(e,-136)}static int144(e){return nt(e,-144)}static int152(e){return nt(e,-152)}static int160(e){return nt(e,-160)}static int168(e){return nt(e,-168)}static int176(e){return nt(e,-176)}static int184(e){return nt(e,-184)}static int192(e){return nt(e,-192)}static int200(e){return nt(e,-200)}static int208(e){return nt(e,-208)}static int216(e){return nt(e,-216)}static int224(e){return nt(e,-224)}static int232(e){return nt(e,-232)}static int240(e){return nt(e,-240)}static int248(e){return nt(e,-248)}static int256(e){return nt(e,-256)}static int(e){return nt(e,-256)}static bytes1(e){return cr(e,1)}static bytes2(e){return cr(e,2)}static bytes3(e){return cr(e,3)}static bytes4(e){return cr(e,4)}static bytes5(e){return cr(e,5)}static bytes6(e){return cr(e,6)}static bytes7(e){return cr(e,7)}static bytes8(e){return cr(e,8)}static bytes9(e){return cr(e,9)}static bytes10(e){return cr(e,10)}static bytes11(e){return cr(e,11)}static bytes12(e){return cr(e,12)}static bytes13(e){return cr(e,13)}static bytes14(e){return cr(e,14)}static bytes15(e){return cr(e,15)}static bytes16(e){return cr(e,16)}static bytes17(e){return cr(e,17)}static bytes18(e){return cr(e,18)}static bytes19(e){return cr(e,19)}static bytes20(e){return cr(e,20)}static bytes21(e){return cr(e,21)}static bytes22(e){return cr(e,22)}static bytes23(e){return cr(e,23)}static bytes24(e){return cr(e,24)}static bytes25(e){return cr(e,25)}static bytes26(e){return cr(e,26)}static bytes27(e){return cr(e,27)}static bytes28(e){return cr(e,28)}static bytes29(e){return cr(e,29)}static bytes30(e){return cr(e,30)}static bytes31(e){return cr(e,31)}static bytes32(e){return cr(e,32)}static address(e){return new io(no,"address",e)}static bool(e){return new io(no,"bool",!!e)}static bytes(e){return new io(no,"bytes",e)}static string(e){return new io(no,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new io(no,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===_3}static dereference(e,r){if(io.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};hl=new WeakMap;let In=io;class iB extends jo{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=In.dereference(r,"string");try{n=yr(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return yr(Oa(e.readValue(),20))}}class sB extends jo{constructor(r){super(r.name,r.type,"_",r.dynamic);le(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function F8(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return Ne(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),Ne(!l[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),l[f]=!0,r[f]})}else se(!1,"invalid tuple value","tuple",r);se(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Hy,s=new Hy,o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let p=i.writeUpdatableValue();o.push(y=>{p(y+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function C8(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),l=i.subReader(a);try{o=s.decode(l)}catch(u){if(ds(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(ds(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Gp.fromItems(r,n)}class oB extends jo{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);le(this,"coder");le(this,"length");Mt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+dB))&&this._throwError("value out-of-bounds",n),i=W4(i,8*Ln)}else(iGc(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=Gc(r.readValue(),this.size*8);return this.signed&&(n=FI(n,this.size*8)),n}}class mB extends k8{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Al(In.dereference(r,"string")))}decode(e){return Vx(super.decode(e))}}class gd extends jo{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);le(this,"coders");Mt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=In.dereference(n,"tuple");return F8(r,this.coders,i)}decode(r){return C8(r,this.coders)}}function Ul(t){return _r(Al(t))}var yB="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD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Vf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const P3=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),N3=4;function xB(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let z=1;z>--l&1}const c=31,p=2**c,y=p>>>1,v=y>>1,b=p-1;let N=0;for(let z=0;z1;){let ne=T+D>>>1;z>>1|f(),G=G<<1^y,$=($^y)<<1|y|1;A=G,C=1+$-G}let F=n-4;return x.map(z=>{switch(z-F){case 3:return F+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return F+256+(t[a++]<<8|t[a++]);case 1:return F+t[a++];default:return z-1}})}function vB(t){let e=0;return()=>t[e++]}function _8(t){return vB(xB(wB(t)))}function wB(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function bB(t){return t&1?~t>>1:t>>1}function AB(t,e){let r=Array(t);for(let n=0,i=0;n{let e=Kh(t);if(e.length)return e})}function N8(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(EB(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(SB(r,t))}return e.flat()}function Jh(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function R8(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function EB(t,e){let r=1+e(),n=e(),i=Jh(e);return R8(i.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(i[a]).fill().map((f,c)=>{let p=c*n;return[l+c*r,u.map(y=>y+p)]})})}function SB(t,e){let r=1+e();return R8(r,1+t,e).map(i=>[i[0],i.slice(1)])}function FB(t){let e=[],r=Kh(t);return i(n([]),[]),e;function n(s){let o=t(),a=Jh(()=>{let l=Kh(t).map(u=>r[u]);if(l.length)return n(l)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,l){if(!(s&4&&l===a[a.length-1])){s&2&&(l=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let f of u.Q)i(u,[...a,f],l)}}}function CB(t){return t.toString(16).toUpperCase().padStart(2,"0")}function T8(t){return`{${CB(t)}}`}function kB(t){let e=[];for(let r=0,n=t.length;r>24&255}function B8(t){return t&16777215}let Wy,R3,Yy,Vd;function BB(){let t=_8(PB);Wy=new Map(P8(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),R3=new Set(Kh(t)),Yy=new Map,Vd=new Map;for(let[e,r]of N8(t)){if(!R3.has(e)&&r.length==2){let[n,i]=r,s=Vd.get(n);s||(s=new Map,Vd.set(n,s)),s.set(i,e)}Yy.set(e,r.reverse())}}function O8(t){return t>=Wh&&t=Qp&&t=$p&&eKp&&e0&&i(Kp+u)}else{let o=Yy.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Qc(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let l=OB(n,a);l>=0?n=l:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function D8(t){return U8(t).map(B8)}function DB(t){return UB(U8(t))}const T3=45,L8=".",z8=65039,j8=1,ku=t=>Array.from(t);function Yh(t,e){return t.P.has(e)||t.Q.has(e)}class LB extends Array{get is_emoji(){return!0}}let qy,H8,tl,Xy,G8,Qu,um,su,V8,I3,Zy;function ev(){if(qy)return;let t=_8(yB);const e=()=>Kh(t),r=()=>new Set(e());qy=new Map(N8(t)),H8=r(),tl=e(),Xy=new Set(e().map(f=>tl[f])),tl=new Set(tl),G8=r(),r();let n=P8(t),i=t();const s=()=>new Set(e().flatMap(f=>n[f]).concat(e()));Qu=Jh(f=>{let c=Jh(t).map(p=>p+96);if(c.length){let p=f>=i;c[0]-=32,c=Xf(c),p&&(c=`Restricted[${c}]`);let y=s(),v=s(),b=!t();return{N:c,P:y,Q:v,M:b,R:p}}}),um=r(),su=new Map;let o=e().concat(ku(um)).sort((f,c)=>f-c);o.forEach((f,c)=>{let p=t(),y=o[c]=p?o[c-p]:{V:[],M:new Map};y.V.push(f),um.has(f)||su.set(f,y)});for(let{V:f,M:c}of new Set(su.values())){let p=[];for(let v of f){let b=Qu.filter(x=>Yh(x,v)),N=p.find(({G:x})=>b.some(A=>x.has(A)));N||(N={G:new Set,V:[]},p.push(N)),N.V.push(v),b.forEach(x=>N.G.add(x))}let y=p.flatMap(v=>ku(v.G));for(let{G:v,V:b}of p){let N=new Set(y.filter(x=>!v.has(x)));for(let x of b)c.set(x,N)}}let a=new Set,l=new Set;const u=f=>a.has(f)?l.add(f):a.add(f);for(let f of Qu){for(let c of f.P)u(c);for(let c of f.Q)u(c)}for(let f of a)!su.has(f)&&!l.has(f)&&su.set(f,j8);V8=new Set(ku(a).concat(ku(D8(a)))),I3=FB(t).map(f=>LB.from(f)).sort(_B),Zy=new Map;for(let f of I3){let c=[Zy];for(let p of f){let y=c.map(v=>{let b=v.get(p);return b||(b=new Map,v.set(p,b)),b});p===z8?c.push(...y):c=y}for(let p of c)p.V=f}}function tv(t){return(Q8(t)?"":`${rv(Z1([t]))} `)+T8(t)}function rv(t){return`"${t}"‎`}function zB(t){if(t.length>=4&&t[2]==T3&&t[3]==T3)throw new Error(`invalid label extension: "${Xf(t.slice(0,4))}"`)}function jB(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function HB(t){let e=t[0],r=P3.get(e);if(r)throw uh(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=kB(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=YB(s,e,r),l=a.length,u;if(!l)throw new Error("empty label");let f=o.output=a.flat();if(jB(f),!(o.emoji=l>1||a[0].is_emoji)&&f.every(p=>p<128))zB(f),u="ASCII";else{let p=a.flatMap(y=>y.is_emoji?[]:y);if(!p.length)u="Emoji";else{if(tl.has(f[0]))throw uh("leading combining mark");for(let b=1;bo.has(a)):ku(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Yh(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function KB(t){let e=Qu;for(let r of t){let n=e.filter(i=>Yh(i,r));if(!n.length)throw Qu.some(i=>Yh(i,r))?K8(e[0],r):$8(r);if(e=n,n.length==1)break}return e}function JB(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${rv(Z1(e))}: ${i}`)}return Xf(n)}).join(L8)}function $8(t){return new Error(`disallowed character: ${tv(t)}`)}function K8(t,e){let r=tv(e),n=Qu.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function uh(t){return new Error(`illegal placement: ${t}`)}function WB(t,e){for(let r of e)if(!Yh(t,r))throw K8(t,r);if(t.M){let r=D8(e);for(let n=1,i=r.length;nN3)throw new Error(`excessive non-spacing marks: ${rv(Z1(r.slice(n-1,s)))} (${s-n}/${N3})`);n=s}}}function YB(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=XB(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(V8.has(o))i.push(o);else{let a=qy.get(o);if(a)i.push(...a);else if(!H8.has(o))throw $8(o)}}}return i.length&&n.push(e(i)),n}function qB(t){return t.filter(e=>e!=z8)}function XB(t,e){let r=Zy,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const J8=new Uint8Array(32);J8.fill(0);function M3(t){return se(t.length!==0,"invalid ENS name; empty component","comp",t),t}function W8(t){const e=Al(ZB(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function fm(t,e){return{address:yr(t),storageKeys:e.map((r,n)=>(se(Dr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function gc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(se(r.length===2,"invalid slot set",`value[${n}]`,r),fm(r[0],r[1])):(se(r!=null&&typeof r=="object","invalid address-slot set","value",t),fm(r.address,r.storageKeys)));se(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return fm(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function tO(t){let e;return typeof t=="string"?e=$h.computePublicKey(t,!1):e=t.publicKey,yr(_r("0x"+e.substring(4)).substring(26))}function rO(t,e){return tO($h.recoverPublicKey(t,e))}const Yn=BigInt(0),nO=BigInt(2),iO=BigInt(27),sO=BigInt(28),oO=BigInt(35),aO=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function nv(t){return t==="0x"?null:yr(t)}function Y8(t,e){try{return gc(t)}catch(r){se(!1,r.message,e,t)}}function eg(t,e){return t==="0x"?0:Jt(t,e)}function Un(t,e){if(t==="0x")return Yn;const r=Rt(t,e);return se(r<=aO,"value exceeds uint size",e,r),r}function fn(t,e){const r=Rt(t,"value"),n=gi(r);return se(n.length<=32,"value too large",`tx.${e}`,r),n}function q8(t){return gc(t).map(e=>[e.address,e.storageKeys])}function lO(t){const e=Qx(t);se(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:eg(e[0],"nonce"),gasPrice:Un(e[1],"gasPrice"),gasLimit:Un(e[2],"gasLimit"),to:nv(e[3]),value:Un(e[4],"value"),data:mt(e[5]),chainId:Yn};if(e.length===6)return r;const n=Un(e[6],"v"),i=Un(e[7],"r"),s=Un(e[8],"s");if(i===Yn&&s===Yn)r.chainId=n;else{let o=(n-oO)/nO;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Ne(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Ne(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Is.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Is;if(typeof e=="string"){const n=ur(e);if(n[0]>=127)return Is.from(lO(n));switch(n[0]){case 1:return Is.from(fO(n));case 2:return Is.from(uO(n))}Ne(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Is;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=ys.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(se(r.isSigned(),"unsigned transaction cannot define hash","tx",e),se(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(se(r.isSigned(),"unsigned transaction cannot define from","tx",e),se(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}},po=new WeakMap,sf=new WeakMap,of=new WeakMap,af=new WeakMap,lf=new WeakMap,uf=new WeakMap,ff=new WeakMap,cf=new WeakMap,hf=new WeakMap,df=new WeakMap,pf=new WeakMap,gf=new WeakMap,Is);const Z8=new Uint8Array(32);Z8.fill(0);const cO=BigInt(-1),eS=BigInt(0),tS=BigInt(1),hO=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function dO(t){const e=ur(t),r=e.length%32;return r?Zr([e,Z8.slice(r)]):mt(e)}const pO=Oa(tS,32),gO=Oa(eS,32),D3={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},cm=["name","version","chainId","verifyingContract","salt"];function L3(t){return function(e){return se(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const mO={name:L3("name"),version:L3("version"),chainId:function(t){const e=Rt(t,"domain.chainId");return se(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Za(e)},verifyingContract:function(t){try{return yr(t).toLowerCase()}catch{}se(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ur(t,"domain.salt");return se(e.length===32,'invalid domain value "salt"',"domain.salt",t),mt(e)}};function hm(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");se(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=Gc(hO,r?n-1:n),s=r?(i+tS)*cO:eS;return function(o){const a=Rt(o,"value");return se(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Oa(r?W4(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return se(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=ur(n);return se(i.length===r,`invalid length for ${t}`,"value",n),dO(n)}}}switch(t){case"address":return function(e){return Ol(yr(e),32)};case"bool":return function(e){return e?pO:gO};case"bytes":return function(e){return _r(e)};case"string":return function(e){return Ul(e)}}return null}function z3(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var r0,go,mf,i1,rS;const Ci=class Ci{constructor(e){me(this,i1);le(this,"primaryType");me(this,r0,void 0);me(this,go,void 0);me(this,mf,void 0);ee(this,r0,JSON.stringify(e)),ee(this,go,new Map),ee(this,mf,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(a=>{r.set(a,new Set),n.set(a,[]),i.set(a,new Set)});for(const a in e){const l=new Set;for(const u of e[a]){se(!l.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;se(f!==a,`circular type reference to ${JSON.stringify(f)}`,"types",e),!hm(f)&&(se(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(a),r.get(a).add(f))}}const s=Array.from(n.keys()).filter(a=>n.get(a).length===0);se(s.length!==0,"missing primary type","types",e),se(s.length===1,`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Mt(this,{primaryType:s[0]});function o(a,l){se(!l.has(a),`circular type reference to ${JSON.stringify(a)}`,"types",e),l.add(a);for(const u of r.get(a))if(n.has(u)){o(u,l);for(const f of l)i.get(f).add(u)}l.delete(a)}o(this.primaryType,new Set);for(const[a,l]of i){const u=Array.from(l);u.sort(),L(this,go).set(a,z3(a,e[a])+u.map(f=>z3(f,e[f])).join(""))}}get types(){return JSON.parse(L(this,r0))}getEncoder(e){let r=L(this,mf).get(e);return r||(r=ot(this,i1,rS).call(this,e),L(this,mf).set(e,r)),r}encodeType(e){const r=L(this,go).get(e);return se(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return _r(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(hm(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return se(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(o=>this._visit(i[1],o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{});se(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Ci(e)}static getPrimaryType(e){return Ci.from(e).primaryType}static hashStruct(e,r,n){return Ci.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=D3[n];se(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>cm.indexOf(n.name)-cm.indexOf(i.name)),Ci.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Zr(["0x1901",Ci.hashDomain(e),Ci.from(r).hash(n)])}static hash(e,r,n){return _r(Ci.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Dr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Ci.from(r);o.visit(n,(a,l)=>(a==="address"&&!Dr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}}static getPayload(e,r,n){Ci.hashDomain(e);const i={},s=[];cm.forEach(l=>{const u=e[l];u!=null&&(i[l]=mO[l](u),s.push({name:l,type:D3[l]}))});const o=Ci.from(r),a=Object.assign({},r);return se(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return mt(ur(u));if(l.match(/^u?int/))return Rt(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return se(typeof u=="string","invalid string","value",u),u}se(!1,"unsupported type","type",l)})}}};r0=new WeakMap,go=new WeakMap,mf=new WeakMap,i1=new WeakSet,rS=function(e){{const i=hm(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i);return o=>{se(!r[3]||parseInt(r[3])===o.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",o);let a=o.map(s);return L(this,go).has(i)&&(a=a.map(_r)),_r(Zr(a))}}const n=this.types[e];if(n){const i=Ul(L(this,go).get(e));return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return L(this,go).has(l)?_r(u):u});return o.unshift(i),Zr(o)}}se(!1,`unknown type: ${e}`,"type",e)};let t2=Ci;function zn(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const yO="external public payable",xO=zn(yO.split(" ")),nS="constant external internal payable private public pure view",vO=zn(nS.split(" ")),iS="constructor error event fallback function receive struct",sS=zn(iS.split(" ")),oS="calldata memory storage payable indexed",wO=zn(oS.split(" ")),bO="tuple returns",AO=[iS,oS,bO,nS].join(" "),EO=zn(AO.split(" ")),SO={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},FO=new RegExp("^(\\s*)"),CO=new RegExp("^([0-9]+)"),kO=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),aS=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),lS=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ln,ss,n0,r2;const s1=class s1{constructor(e){me(this,n0);me(this,ln,void 0);me(this,ss,void 0);ee(this,ln,0),ee(this,ss,e.slice())}get offset(){return L(this,ln)}get length(){return L(this,ss).length-L(this,ln)}clone(){return new s1(L(this,ss))}reset(){ee(this,ln,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=ot(this,n0,r2).call(this,L(this,ln)+1,e.match+1);return ee(this,ln,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;L(this,ln)=L(this,ss).length)throw new Error("out-of-bounds");return L(this,ss)[L(this,ln)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return lg(this,ln)._++,e}toString(){const e=[];for(let r=L(this,ln);r`}};ln=new WeakMap,ss=new WeakMap,n0=new WeakSet,r2=function(e=0,r=0){return new s1(L(this,ss).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let xs=s1;function Ga(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const c=e.pop().text;f=c+f,e[e.length-1].value=Jt(c)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(kO),a){if(l.text=a[1],s+=l.text.length,EO.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(lS)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(CO),a){l.text=a[1],l.type="NUMBER",s+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new xs(e.map(o=>Object.freeze(o)))}function j3(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function tg(t,e){if(e.peekKeyword(sS)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Bo(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function uS(t){let e=Bo(t,vO);return j3(e,zn("constant payable nonpayable".split(" "))),j3(e,zn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Fo(t,e){return t.popParams().map(r=>dn.from(r,e))}function fS(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Rt(t.pop().text);throw new Error("invalid gas")}return null}function Dl(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const _O=new RegExp(/^(.*)\[([0-9]*)\]$/);function H3(t){const e=t.match(lS);if(se(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);se(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);se(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const kr={},si=Symbol.for("_ethers_internal"),G3="_ParamTypeInternal",V3="_ErrorInternal",Q3="_EventInternal",$3="_ConstructorInternal",K3="_FallbackInternal",J3="_FunctionInternal",W3="_StructInternal";var yf,Qd;const ki=class ki{constructor(e,r,n,i,s,o,a,l){me(this,yf);le(this,"name");le(this,"type");le(this,"baseType");le(this,"indexed");le(this,"components");le(this,"arrayLength");le(this,"arrayChildren");if(K1(e,kr,"ParamType"),Object.defineProperty(this,si,{value:G3}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Mt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return ot(this,yf,Qd).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(ki.isParamType(e))return e;if(typeof e=="string")try{return ki.from(Ga(e),r)}catch{se(!1,"invalid param type","obj",e)}else if(e instanceof xs){let a="",l="",u=null;Bo(e,zn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(b=>ki.from(b)),a=`tuple(${u.map(b=>b.format()).join(",")})`):(a=H3(e.popType("TYPE")),l=a);let f=null,c=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new ki(kr,"",a,l,null,u,c,f),c=b.value,a+=b.text,l="array",u=null}let p=null;if(Bo(e,wO).has("indexed")){if(!r)throw new Error("");p=!0}const v=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new ki(kr,v,a,l,p,u,c,f)}const n=e.name;se(!n||typeof n=="string"&&n.match(aS),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(se(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(_O);if(o){const a=parseInt(o[2]||"-1"),l=ki.from({type:o[1],components:e.components});return new ki(kr,n||"",s,"array",i,null,a,l)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(u=>ki.from(u)):null;return new ki(kr,n||"",s,"tuple",i,a,null,null)}return s=H3(e.type),new ki(kr,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[si]===G3}};yf=new WeakSet,Qd=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((l,u)=>{var f;ot(f=o,yf,Qd).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in r))throw new Error(`missing value for component ${l.name}`);return r[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var f;ot(f=o[u],yf,Qd).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let dn=ki;class Ll{constructor(e,r,n){le(this,"type");le(this,"inputs");K1(e,kr,"Fragment"),n=Object.freeze(n.slice()),Mt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Ll.from(JSON.parse(e))}catch{}return Ll.from(Ga(e))}if(e instanceof xs)switch(e.peekKeyword(sS)){case"constructor":return Eo.from(e);case"error":return qn.from(e);case"event":return Bs.from(e);case"fallback":case"receive":return ao.from(e);case"function":return Os.from(e);case"struct":return Sl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Eo.from(e);case"error":return qn.from(e);case"event":return Bs.from(e);case"fallback":case"receive":return ao.from(e);case"function":return Os.from(e);case"struct":return Sl.from(e)}Ne(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}se(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Eo.isFragment(e)}static isError(e){return qn.isFragment(e)}static isEvent(e){return Bs.isFragment(e)}static isFunction(e){return Os.isFragment(e)}static isStruct(e){return Sl.isFragment(e)}}class rg extends Ll{constructor(r,n,i,s){super(r,n,s);le(this,"name");se(typeof i=="string"&&i.match(aS),"invalid identifier","name",i),s=Object.freeze(s.slice()),Mt(this,{name:i})}}function qh(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class qn extends rg{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,si,{value:V3})}get selector(){return Ul(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+qh(e,this.inputs)),r.join(" ")}static from(e){if(qn.isFragment(e))return e;if(typeof e=="string")return qn.from(Ga(e));if(e instanceof xs){const r=tg("error",e),n=Fo(e);return Dl(e),new qn(kr,r,n)}return new qn(kr,e.name,e.inputs?e.inputs.map(dn.from):[])}static isFragment(e){return e&&e[si]===V3}}class Bs extends rg{constructor(r,n,i,s){super(r,"event",n,i);le(this,"anonymous");Object.defineProperty(this,si,{value:Q3}),Mt(this,{anonymous:s})}get topicHash(){return Ul(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+qh(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>dn.from(s)),new Bs(kr,r,n,!1).topicHash}static from(r){if(Bs.isFragment(r))return r;if(typeof r=="string")try{return Bs.from(Ga(r))}catch{se(!1,"invalid event fragment","obj",r)}else if(r instanceof xs){const n=tg("event",r),i=Fo(r,!0),s=!!Bo(r,zn(["anonymous"])).has("anonymous");return Dl(r),new Bs(kr,n,i,s)}return new Bs(kr,r.name,r.inputs?r.inputs.map(n=>dn.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[si]===Q3}}class Eo extends Ll{constructor(r,n,i,s,o){super(r,n,i);le(this,"payable");le(this,"gas");Object.defineProperty(this,si,{value:$3}),Mt(this,{payable:s,gas:o})}format(r){if(Ne(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${qh(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(Eo.isFragment(r))return r;if(typeof r=="string")try{return Eo.from(Ga(r))}catch{se(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof xs){Bo(r,zn(["constructor"]));const n=Fo(r),i=!!Bo(r,xO).has("payable"),s=fS(r);return Dl(r),new Eo(kr,"constructor",n,i,s)}return new Eo(kr,"constructor",r.inputs?r.inputs.map(dn.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[si]===$3}}class ao extends Ll{constructor(r,n,i){super(r,"fallback",n);le(this,"payable");Object.defineProperty(this,si,{value:K3}),Mt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(ao.isFragment(r))return r;if(typeof r=="string")try{return ao.from(Ga(r))}catch{se(!1,"invalid fallback fragment","obj",r)}else if(r instanceof xs){const n=r.toString(),i=r.peekKeyword(zn(["fallback","receive"]));if(se(i,"type must be fallback or receive","obj",n),r.popKeyword(zn(["fallback","receive"]))==="receive"){const l=Fo(r);return se(l.length===0,"receive cannot have arguments","obj.inputs",l),Bo(r,zn(["payable"])),Dl(r),new ao(kr,[],!0)}let o=Fo(r);o.length?se(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[dn.from("bytes")];const a=uS(r);if(se(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Bo(r,zn(["returns"])).has("returns")){const l=Fo(r);se(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return Dl(r),new ao(kr,o,a==="payable")}if(r.type==="receive")return new ao(kr,[],!0);if(r.type==="fallback"){const n=[dn.from("bytes")],i=r.stateMutability==="payable";return new ao(kr,n,i)}se(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[si]===K3}}class Os extends rg{constructor(r,n,i,s,o,a){super(r,"function",n,s);le(this,"constant");le(this,"outputs");le(this,"stateMutability");le(this,"payable");le(this,"gas");Object.defineProperty(this,si,{value:J3}),o=Object.freeze(o.slice()),Mt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Ul(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+qh(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(qh(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>dn.from(s)),new Os(kr,r,"view",n,[],null).selector}static from(r){if(Os.isFragment(r))return r;if(typeof r=="string")try{return Os.from(Ga(r))}catch{se(!1,"invalid function fragment","obj",r)}else if(r instanceof xs){const i=tg("function",r),s=Fo(r),o=uS(r);let a=[];Bo(r,zn(["returns"])).has("returns")&&(a=Fo(r));const l=fS(r);return Dl(r),new Os(kr,i,o,s,a,l)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Os(kr,r.name,n,r.inputs?r.inputs.map(dn.from):[],r.outputs?r.outputs.map(dn.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[si]===J3}}class Sl extends rg{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,si,{value:W3})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Sl.from(Ga(e))}catch{se(!1,"invalid struct fragment","obj",e)}else if(e instanceof xs){const r=tg("struct",e),n=Fo(e);return Dl(e),new Sl(kr,r,n)}return new Sl(kr,e.name,e.inputs?e.inputs.map(dn.from):[])}static isFragment(e){return e&&e[si]===W3}}const vs=new Map;vs.set(0,"GENERIC_PANIC");vs.set(1,"ASSERT_FALSE");vs.set(17,"OVERFLOW");vs.set(18,"DIVIDE_BY_ZERO");vs.set(33,"ENUM_RANGE_ERROR");vs.set(34,"BAD_STORAGE_DATA");vs.set(49,"STACK_UNDERFLOW");vs.set(50,"ARRAY_RANGE_ERROR");vs.set(65,"OUT_OF_MEMORY");vs.set(81,"UNINITIALIZED_FUNCTION_CALL");const PO=new RegExp(/^bytes([0-9]*)$/),NO=new RegExp(/^(u?int)([0-9]*)$/);let dm=null;function RO(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const u=ur(r);if(r=mt(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(mt(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(mt(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${vs.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?yr(e.to):null,data:e.data||"0x"};return e.from&&(l.from=yr(e.from)),Kf(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:l,invocation:o,revert:a})}var oa,ou;const o1=class o1{constructor(){me(this,oa)}getDefaultValue(e){const r=e.map(i=>ot(this,oa,ou).call(this,dn.from(i)));return new gd(r,"_").defaultValue()}encode(e,r){$4(r.length,e.length,"types/values length mismatch");const n=e.map(o=>ot(this,oa,ou).call(this,dn.from(o))),i=new gd(n,"_"),s=new Hy;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>ot(this,oa,ou).call(this,dn.from(o)));return new gd(i,"_").decode(new Gy(r,n))}static defaultAbiCoder(){return dm==null&&(dm=new o1),dm}static getBuiltinCallException(e,r,n){return RO(e,r,n,o1.defaultAbiCoder())}};oa=new WeakSet,ou=function(e){if(e.isArray())return new oB(ot(this,oa,ou).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new gd(e.components.map(n=>ot(this,oa,ou).call(this,n)),e.name);switch(e.baseType){case"address":return new iB(e.name);case"bool":return new aB(e.name);case"string":return new mB(e.name);case"bytes":return new lB(e.name);case"":return new cB(e.name)}let r=e.type.match(NO);if(r){let n=parseInt(r[2]||"256");return se(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new gB(n/8,r[1]==="int",e.name)}if(r=e.type.match(PO),r){let n=parseInt(r[1]);return se(n!==0&&n<=32,"invalid bytes length","param",e),new uB(n,e.name)}se(!1,"invalid type","type",e.type)};let Wp=o1;class TO{constructor(e,r,n){le(this,"fragment");le(this,"name");le(this,"signature");le(this,"topic");le(this,"args");const i=e.name,s=e.format();Mt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class IO{constructor(e,r,n,i){le(this,"fragment");le(this,"name");le(this,"args");le(this,"signature");le(this,"selector");le(this,"value");const s=e.name,o=e.format();Mt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class MO{constructor(e,r,n){le(this,"fragment");le(this,"name");le(this,"args");le(this,"signature");le(this,"selector");const i=e.name,s=e.format();Mt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class Y3{constructor(e){le(this,"hash");le(this,"_isIndexed");Mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const q3={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},X3={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&q3[t.toString()]&&(e=q3[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var _s,Ps,Ns,En,xf,$d,vf,Kd;const Pu=class Pu{constructor(e){me(this,xf);me(this,vf);le(this,"fragments");le(this,"deploy");le(this,"fallback");le(this,"receive");me(this,_s,void 0);me(this,Ps,void 0);me(this,Ns,void 0);me(this,En,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ee(this,Ns,new Map),ee(this,_s,new Map),ee(this,Ps,new Map);const n=[];for(const o of r)try{n.push(Ll.from(o))}catch(a){console.log("EE",a)}Mt(this,{fragments:Object.freeze(n)});let i=null,s=!1;ee(this,En,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Mt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(se(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":l=L(this,Ns);break;case"event":l=L(this,Ps);break;case"error":l=L(this,_s);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Mt(this,{deploy:Eo.from("constructor()")}),Mt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Wp.defaultAbiCoder()}getFunctionName(e){const r=ot(this,xf,$d).call(this,e,null,!1);return se(r,"no matching function","key",e),r.name}hasFunction(e){return!!ot(this,xf,$d).call(this,e,null,!1)}getFunction(e,r){return ot(this,xf,$d).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(L(this,Ns).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");se(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=qn.from(e).format(),e==="Error(string)")return qn.from("error Error(string)");if(e==="Panic(uint256)")return qn.from("error Panic(uint256)");const n=L(this,_s).get(e);return n||null}forEachError(e){const r=Array.from(L(this,_s).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?Ul(o):s.type==="bytes"?_r(mt(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=Oa(o):s.type.match(/^bytes/)?o=SI(o,32):s.type==="address"&&L(this,En).encode(["address"],[o]),Ol(mt(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){se(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?se(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);se(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),se(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(Ul(l));else if(o.type==="bytes")n.push(_r(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(L(this,En).encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:L(this,En).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const y=this.getEvent(e);se(y,"unknown event","eventFragment",e),e=y}if(n!=null&&!e.anonymous){const y=e.topicHash;se(Dr(n[0],32)&&n[0].toLowerCase()===y,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((y,v)=>{y.indexed?y.type==="string"||y.type==="bytes"||y.baseType==="tuple"||y.baseType==="array"?(i.push(dn.from({type:"bytes32",name:y.name})),o.push(!0)):(i.push(y),o.push(!1)):(s.push(y),o.push(!1))});const a=n!=null?L(this,En).decode(i,Zr(n)):null,l=L(this,En).decode(s,r,!0),u=[],f=[];let c=0,p=0;return e.inputs.forEach((y,v)=>{let b=null;if(y.indexed)if(a==null)b=new Y3(null);else if(o[v])b=new Y3(a[p++]);else try{b=a[p++]}catch(N){b=N}else try{b=l[c++]}catch(N){b=N}u.push(b),f.push(y.name||null)}),Gp.fromItems(u,f)}parseTransaction(e){const r=ur(e.data,"tx.data"),n=Rt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(mt(r.slice(0,4)));if(!i)return null;const s=L(this,En).decode(i.inputs,r.slice(4));return new IO(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new TO(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=mt(e),n=this.getError(Br(r,0,4));if(!n)return null;const i=L(this,En).decode(n.inputs,Br(r,4));return new MO(n,n.selector,i)}static from(e){return e instanceof Pu?e:typeof e=="string"?new Pu(JSON.parse(e)):typeof e.format=="function"?new Pu(e.format("json")):new Pu(e)}};_s=new WeakMap,Ps=new WeakMap,Ns=new WeakMap,En=new WeakMap,xf=new WeakSet,$d=function(e,r,n){if(Dr(e)){const s=e.toLowerCase();for(const o of L(this,Ns).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of L(this,Ns))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,l=!0;In.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=s.length-1;u>=0;u--){const f=s[u].inputs.length;f!==a&&(!l||f!==a-1)&&s.splice(u,1)}for(let u=s.length-1;u>=0;u--){const f=s[u].inputs;for(let c=0;c=f.length){if(r[c].type==="overrides")continue;s.splice(u,1);break}if(r[c].type!==f[c].baseType){s.splice(u,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");se(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=L(this,Ns).get(Os.from(e).format());return i||null},vf=new WeakSet,Kd=function(e,r,n){if(Dr(e)){const s=e.toLowerCase();for(const o of L(this,Ps).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of L(this,Ps))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let l=0;l1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");se(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=L(this,Ps).get(Bs.from(e).format());return i||null};let n2=Pu;const cS=BigInt(0);function fh(t){return t??null}function Nn(t){return t==null?null:t.toString()}class Z3{constructor(e,r,n){le(this,"gasPrice");le(this,"maxFeePerGas");le(this,"maxPriorityFeePerGas");Mt(this,{gasPrice:fh(e),maxFeePerGas:fh(r),maxPriorityFeePerGas:fh(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Nn(e),maxFeePerGas:Nn(r),maxPriorityFeePerGas:Nn(n)}}}function Yp(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=mt(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Rt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Jt(t[i],`request.${i}`));return t.accessList&&(e.accessList=gc(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var mo;class BO{constructor(e,r){le(this,"provider");le(this,"number");le(this,"hash");le(this,"timestamp");le(this,"parentHash");le(this,"nonce");le(this,"difficulty");le(this,"gasLimit");le(this,"gasUsed");le(this,"miner");le(this,"extraData");le(this,"baseFeePerGas");me(this,mo,void 0);ee(this,mo,e.transactions.map(n=>typeof n!="string"?new Xh(n,r):n)),Mt(this,{provider:r,hash:fh(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:fh(e.baseFeePerGas)})}get transactions(){return L(this,mo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=L(this,mo).slice();return e.length===0?[]:(Ne(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:p}=this;return{_type:"Block",baseFeePerGas:Nn(e),difficulty:Nn(r),extraData:n,gasLimit:Nn(i),gasUsed:Nn(s),hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:p}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew _0(i,r))));let n=cS;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Mt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return L(this,i0)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:f,root:c}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Nn(this.cumulativeGasUsed),from:r,gasPrice:Nn(this.gasPrice),gasUsed:Nn(this.gasUsed),hash:i,index:s,logs:u,logsBloom:l,root:c,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:p,nonce:y}=await Kn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(y{if(p==null||p.status!==0)return p;Ne(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await l(),n===0)return null;return await new Promise((p,y)=>{const v=[],b=()=>{v.forEach(x=>x())};if(v.push(()=>{a=!0}),i>0){const x=setTimeout(()=>{b(),y(Kf("wait for transaction timeout","TIMEOUT"))},i);v.push(()=>{clearTimeout(x)})}const N=async x=>{if(await x.confirmations()>=n){b();try{p(u(x))}catch(A){y(A)}}};if(v.push(()=>{this.provider.off(this.hash,N)}),this.provider.on(this.hash,N),s>=0){const x=async()=>{try{await l()}catch(A){if(ds(A,"TRANSACTION_REPLACED")){b(),y(A);return}}a||this.provider.once("block",x)};v.push(()=>{this.provider.off("block",x)}),this.provider.once("block",x)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return Ne(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),pS(this)}reorderedEvent(e){return Ne(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ne(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),dS(this,e)}replaceableTransaction(e){se(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new yv(this,this.provider);return ee(r,aa,e),r}};aa=new WeakMap;let Xh=yv;function OO(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function dS(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function pS(t){return{orphan:"drop-transaction",tx:t}}function UO(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class sv extends _0{constructor(r,n,i){super(r,r.provider);le(this,"interface");le(this,"fragment");le(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Mt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class gS extends _0{constructor(r,n){super(r,r.provider);le(this,"error");Mt(this,{error:n})}}var wf;class DO extends hS{constructor(r,n,i){super(i,n);me(this,wf,void 0);ee(this,wf,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?L(this,wf).getEvent(r.topics[0]):null;if(n)try{return new sv(r,L(this,wf),n)}catch(i){return new gS(r,i)}return r})}}wf=new WeakMap;var s0;class ov extends Xh{constructor(r,n,i){super(i,n);me(this,s0,void 0);ee(this,s0,r)}async wait(r){const n=await super.wait(r);return n==null?null:new DO(L(this,s0),this.provider,n)}}s0=new WeakMap;class mS extends Y4{constructor(r,n,i,s){super(r,n,i);le(this,"log");Mt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class LO extends mS{constructor(e,r,n,i,s){super(e,r,n,new sv(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Mt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const eA=BigInt(0);function yS(t){return t&&typeof t.call=="function"}function xS(t){return t&&typeof t.estimateGas=="function"}function ng(t){return t&&typeof t.resolveName=="function"}function vS(t){return t&&typeof t.sendTransaction=="function"}function wS(t){if(t!=null){if(ng(t))return t;if(t.provider)return t.provider}}var o0;class zO{constructor(e,r,n){me(this,o0,void 0);le(this,"fragment");if(Mt(this,{fragment:r}),r.inputs.lengthn[l]==null?null:a.walkAsync(n[l],(f,c)=>f==="address"?Array.isArray(c)?Promise.all(c.map(p=>ps(p,s))):ps(c,s):c)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return L(this,o0)}}o0=new WeakMap;function zl(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function rl(t){return t==null?null:t.provider||null}async function bS(t,e){const r=In.dereference(t,"overrides");se(typeof r=="object","invalid overrides parameter","overrides",t);const n=Yp(r);return se(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),se(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function jO(t,e,r){const n=zl(t,"resolveName"),i=ng(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,l)=>(l=In.dereference(l,a),a==="address"?ps(l,i):l))))}function HO(t){const e=async function(o){const a=await bS(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await ps(a.from,wS(t.runner)));const l=t.interface,u=Rt(a.value||eA,"overrides.value")===eA,f=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!f&&!u&&se(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),se(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const c=l.receive||l.fallback&&l.fallback.payable;return se(c||u,"cannot send value to non-payable fallback","overrides.value",a.value),se(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=zl(t.runner,"call");Ne(yS(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw Hx(u)&&u.data?t.interface.makeError(u.data,l):u}},n=async function(o){const a=t.runner;Ne(vS(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=rl(t.runner);return new ov(t.interface,u,l)},i=async function(o){const a=zl(t.runner,"estimateGas");return Ne(xS(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Mt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function GO(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return Ne(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let c={};if(f.inputs.length+1===u.length&&(c=await bS(u.pop()),c.from&&(c.from=await ps(c.from,wS(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const p=await jO(t.runner,f.inputs,u);return Object.assign({},c,await Kn({to:t.getAddress(),data:t.interface.encodeFunctionData(f,p)}))},i=async function(...u){const f=await a(...u);return f.length===1?f[0]:f},s=async function(...u){const f=t.runner;Ne(vS(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await f.sendTransaction(await n(...u)),p=rl(t.runner);return new ov(t.interface,p,c)},o=async function(...u){const f=zl(t.runner,"estimateGas");return Ne(xS(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},a=async function(...u){const f=zl(t.runner,"call");Ne(yS(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await n(...u);let p="0x";try{p=await f.call(c)}catch(v){throw Hx(v)&&v.data?t.interface.makeError(v.data,c):v}const y=r(...u);return t.interface.decodeFunctionResult(y,p)},l=async(...u)=>r(...u).constant?await i(...u):await s(...u);return Mt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return Ne(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function VO(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Ne(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new zO(t,r(...i),i)};return Mt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Ne(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const qp=Symbol.for("_ethersInternal_contract"),AS=new WeakMap;function QO(t,e){AS.set(t[qp],e)}function oi(t){return AS.get(t[qp])}function $O(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function av(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Dr(o,32))return o;const a=t.interface.getEvent(o);return se(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Dr(e,32)?r=[e]:(n=t.interface.getEvent(e),se(n,"unknown fragment","event",e),r=[n.topicHash]):$O(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):se(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function $c(t,e){const{subs:r}=oi(t);return r.get((await av(t,e)).tag)||null}async function tA(t,e,r){const n=rl(t.runner);Ne(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await av(t,r),{addr:a,subs:l}=oi(t);let u=l.get(s);if(!u){const c={address:a||t,topics:o},p=N=>{let x=i;if(x==null)try{x=t.interface.getEvent(N.topics[0])}catch{}if(x){const A=x,C=i?t.interface.decodeEventLog(i,N.data,N.topics):[];s2(t,r,C,F=>new LO(t,F,r,A,N))}else s2(t,r,[],A=>new mS(t,A,r,N))};let y=[];u={tag:s,listeners:[],start:()=>{y.length||y.push(n.on(c,p))},stop:async()=>{if(y.length==0)return;let N=y;y=[],await Promise.all(N),n.off(c,p)}},l.set(s,u)}return u}let i2=Promise.resolve();async function KO(t,e,r,n){await i2;const i=await $c(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const l=Array.from(r);n&&l.push(n(a?null:o));try{o.call(t,...l)}catch{}return!a}),i.listeners.length===0&&(i.stop(),oi(t).subs.delete(i.tag)),s>0}async function s2(t,e,r,n){try{await i2}catch{}const i=KO(t,e,r,n);return i2=i,await i}const md=["then"];var uz;const gh=class gh{constructor(e,r,n,i){le(this,"target");le(this,"interface");le(this,"runner");le(this,"filters");le(this,uz);le(this,"fallback");se(typeof e=="string"||S8(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=n2.from(r);Mt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,qp,{value:{}});let o,a=null,l=null;if(i){const c=rl(n);l=new ov(this.interface,c,i)}let u=new Map;if(typeof e=="string")if(Dr(e))a=e,o=Promise.resolve(e);else{const c=zl(n,"resolveName");if(!ng(c))throw Kf("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=c.resolveName(e).then(p=>{if(p==null)throw Kf("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return oi(this).addr=p,p})}else o=e.getAddress().then(c=>{if(c==null)throw new Error("TODO");return oi(this).addr=c,c});QO(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const f=new Proxy({},{get:(c,p,y)=>{if(typeof p=="symbol"||md.indexOf(p)>=0)return Reflect.get(c,p,y);try{return this.getEvent(p)}catch(v){if(!ds(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(c,p)=>md.indexOf(p)>=0?Reflect.has(c,p):Reflect.has(c,p)||this.interface.hasEvent(String(p))});return Mt(this,{filters:f}),Mt(this,{fallback:s.receive||s.fallback?HO(this):null}),new Proxy(this,{get:(c,p,y)=>{if(typeof p=="symbol"||p in c||md.indexOf(p)>=0)return Reflect.get(c,p,y);try{return c.getFunction(p)}catch(v){if(!ds(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(c,p)=>typeof p=="symbol"||p in c||md.indexOf(p)>=0?Reflect.has(c,p):c.interface.hasFunction(p)})}connect(e){return new gh(this.target,this.interface,e)}attach(e){return new gh(e,this.interface,this.runner)}async getAddress(){return await oi(this).addrPromise}async getDeployedCode(){const e=rl(this.runner);Ne(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=rl(this.runner);return Ne(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return oi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),GO(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),VO(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=oi(this),o=i||await s,{fragment:a,topics:l}=await av(this,e),u={address:o,topics:l,fromBlock:r,toBlock:n},f=rl(this.runner);return Ne(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(c=>{let p=a;if(p==null)try{p=this.interface.getEvent(c.topics[0])}catch{}if(p)try{return new sv(c,this.interface,p)}catch(y){return new gS(c,y)}return new _0(c,f)})}async on(e,r){const n=await tA(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await tA(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await s2(this,e,r,null)}async listenerCount(e){if(e){const i=await $c(this,e);return i?i.listeners.length:0}const{subs:r}=oi(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await $c(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=oi(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await $c(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),oi(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await $c(this,e);if(!r)return this;r.stop(),oi(this).subs.delete(r.tag)}else{const{subs:r}=oi(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends gh{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};uz=qp;let o2=gh;function JO(){return o2}class ch extends JO(){}function pm(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):se(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class WO{constructor(e){le(this,"name");Mt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const ES=new RegExp("^(ipfs)://(.*)$","i"),rA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ES,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var la,dl,ua,au,a1,SS;const Nu=class Nu{constructor(e,r,n){me(this,ua);le(this,"provider");le(this,"address");le(this,"name");me(this,la,void 0);me(this,dl,void 0);Mt(this,{provider:e,address:r,name:n}),ee(this,la,null),ee(this,dl,new ch(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return L(this,la)==null&&ee(this,la,(async()=>{try{return await L(this,dl).supportsInterface("0x9061b923")}catch(e){if(ds(e,"CALL_EXCEPTION"))return!1;throw ee(this,la,null),e}})()),await L(this,la)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await ot(this,ua,au).call(this,"addr(bytes32)");return s==null||s===Jy?null:s}catch(s){if(ds(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await ot(this,ua,au).call(this,"addr(bytes32,uint)",[s]);if(Dr(o,20))return yr(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof WO&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await ot(this,ua,au).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Ne(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await ot(this,ua,au).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await ot(this,ua,au).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${_I("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Ne(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function P0(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Ne(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function YO(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}se(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function ec(t){return se(Dr(t,!0),"invalid data","value",t),t}function Li(t){return se(Dr(t,32),"invalid hash","value",t),t}const qO=P0({address:yr,blockHash:Li,blockNumber:Jt,data:ec,index:Jt,removed:Fr(YO,!1),topics:lv(Li),transactionHash:Li,transactionIndex:Jt},{index:["logIndex"]});function XO(t){return qO(t)}const ZO=P0({hash:Fr(Li),parentHash:Li,number:Jt,timestamp:Jt,nonce:Fr(ec),difficulty:Rt,gasLimit:Rt,gasUsed:Rt,miner:Fr(yr),extraData:ec,baseFeePerGas:Fr(Rt)});function eU(t){const e=ZO(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:FS(r)),e}const tU=P0({transactionIndex:Jt,blockNumber:Jt,transactionHash:Li,address:yr,topics:lv(Li),data:ec,index:Jt,blockHash:Li},{index:["logIndex"]});function rU(t){return tU(t)}const nU=P0({to:Fr(yr,null),from:Fr(yr,null),contractAddress:Fr(yr,null),index:Jt,root:Fr(mt),gasUsed:Rt,logsBloom:Fr(ec),blockHash:Li,hash:Li,logs:lv(rU),blockNumber:Jt,cumulativeGasUsed:Rt,effectiveGasPrice:Fr(Rt),status:Fr(Jt),type:Fr(Jt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function iU(t){return nU(t)}function FS(t){t.to&&Rt(t.to)===nA&&(t.to="0x0000000000000000000000000000000000000000");const e=P0({hash:Li,type:r=>r==="0x"||r==null?0:Jt(r),accessList:Fr(gc,null),blockHash:Fr(Li,null),blockNumber:Fr(Jt,null),transactionIndex:Fr(Jt,null),from:yr,gasPrice:Fr(Rt),maxPriorityFeePerGas:Fr(Rt),maxFeePerGas:Fr(Rt),gasLimit:Rt,to:Fr(yr,null),value:Rt,nonce:Jt,data:ec,creates:Fr(yr,null),chainId:Fr(Rt,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=nB(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=ys.from(t.signature):e.signature=ys.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Rt(e.blockHash)===nA&&(e.blockHash=null),e}const sU="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class N0{constructor(e){le(this,"name");Mt(this,{name:e})}clone(){return new N0(this.name)}}class ig extends N0{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);le(this,"effectiveBlock");le(this,"txBase");le(this,"txCreate");le(this,"txDataZero");le(this,"txDataNonzero");le(this,"txAccessListStorageKey");le(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let l=(n||{})[o];l==null&&(l=a),se(typeof l=="number",`invalud value for ${o}`,"costs",n),i[o]=l}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Mt(this,i)}clone(){return new ig(this.effectiveBlock,this)}}class sg extends N0{constructor(r,n){super("org.ethers.plugins.network.Ens");le(this,"address");le(this,"targetNetwork");Mt(this,{address:r||sU,targetNetwork:n??1})}clone(){return new sg(this.address,this.targetNetwork)}}var a0,l0;class CS extends N0{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");me(this,a0,void 0);me(this,l0,void 0);ee(this,a0,r),ee(this,l0,n)}get url(){return L(this,a0)}get processFunc(){return L(this,l0)}clone(){return this}}a0=new WeakMap,l0=new WeakMap;const gm=new Map;var bf,Af,fa;const Ru=class Ru{constructor(e,r){me(this,bf,void 0);me(this,Af,void 0);me(this,fa,void 0);ee(this,bf,e),ee(this,Af,Rt(r)),ee(this,fa,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return L(this,bf)}set name(e){ee(this,bf,e)}get chainId(){return L(this,Af)}set chainId(e){ee(this,Af,Rt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Rt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Rt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Rt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(L(this,fa).values())}attachPlugin(e){if(L(this,fa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return L(this,fa).set(e.name,e.clone()),this}getPlugin(e){return L(this,fa).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new Ru(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new ig;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function sA(t){return new CS(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:iA(a.maxFee,9),maxPriorityFeePerGas:iA(a.maxPriorityFee,9)}}catch(s){Ne(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}function oU(t){return new CS("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const s=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:s+t,maxPriorityFeePerGas:t}})}let oA=!1;function aU(){if(oA)return;oA=!0;function t(e,r,n){const i=function(){const s=new nl(e,r);return n.ensNetwork!=null&&s.attachPlugin(new sg(null,n.ensNetwork)),s.attachPlugin(new ig),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};nl.register(e,i),nl.register(r,i),n.altNames&&n.altNames.forEach(s=>{nl.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[sA("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[sA("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[oU(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function a2(t){return JSON.parse(JSON.stringify(t))}var yo,Pi,ca,Rs,Ef,Jd;class lU{constructor(e){me(this,Ef);me(this,yo,void 0);me(this,Pi,void 0);me(this,ca,void 0);me(this,Rs,void 0);ee(this,yo,e),ee(this,Pi,null),ee(this,ca,4e3),ee(this,Rs,-2)}get pollingInterval(){return L(this,ca)}set pollingInterval(e){ee(this,ca,e)}start(){L(this,Pi)||(ee(this,Pi,L(this,yo)._setTimeout(ot(this,Ef,Jd).bind(this),L(this,ca))),ot(this,Ef,Jd).call(this))}stop(){L(this,Pi)&&(L(this,yo)._clearTimeout(L(this,Pi)),ee(this,Pi,null))}pause(e){this.stop(),e&&ee(this,Rs,-2)}resume(){this.start()}}yo=new WeakMap,Pi=new WeakMap,ca=new WeakMap,Rs=new WeakMap,Ef=new WeakSet,Jd=async function(){try{const e=await L(this,yo).getBlockNumber();if(L(this,Rs)===-2){ee(this,Rs,e);return}if(e!==L(this,Rs)){for(let r=L(this,Rs)+1;r<=e;r++){if(L(this,Pi)==null)return;await L(this,yo).emit("block",r)}ee(this,Rs,e)}}catch{}L(this,Pi)!=null&&ee(this,Pi,L(this,yo)._setTimeout(ot(this,Ef,Jd).bind(this),L(this,ca)))};var pl,gl,ha;class kS{constructor(e){me(this,pl,void 0);me(this,gl,void 0);me(this,ha,void 0);ee(this,pl,e),ee(this,ha,!1),ee(this,gl,r=>{this._poll(r,L(this,pl))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){L(this,ha)||(ee(this,ha,!0),L(this,gl).call(this,-2),L(this,pl).on("block",L(this,gl)))}stop(){L(this,ha)&&(ee(this,ha,!1),L(this,pl).off("block",L(this,gl)))}pause(e){this.stop()}resume(){this.start()}}pl=new WeakMap,gl=new WeakMap,ha=new WeakMap;var l1;class uU extends kS{constructor(r,n){super(r);me(this,l1,void 0);ee(this,l1,a2(n))}async _poll(r,n){throw new Error("@TODO")}}l1=new WeakMap;var Sf;class fU extends kS{constructor(r,n){super(r);me(this,Sf,void 0);ee(this,Sf,n)}async _poll(r,n){const i=await n.getTransactionReceipt(L(this,Sf));i&&n.emit(L(this,Sf),i)}}Sf=new WeakMap;var xo,Ff,Cf,da,Ni,u1,_S;class cU{constructor(e,r){me(this,u1);me(this,xo,void 0);me(this,Ff,void 0);me(this,Cf,void 0);me(this,da,void 0);me(this,Ni,void 0);ee(this,xo,e),ee(this,Ff,a2(r)),ee(this,Cf,ot(this,u1,_S).bind(this)),ee(this,da,!1),ee(this,Ni,-2)}start(){L(this,da)||(ee(this,da,!0),L(this,Ni)===-2&&L(this,xo).getBlockNumber().then(e=>{ee(this,Ni,e)}),L(this,xo).on("block",L(this,Cf)))}stop(){L(this,da)&&(ee(this,da,!1),L(this,xo).off("block",L(this,Cf)))}pause(e){this.stop(),e&&ee(this,Ni,-2)}resume(){this.start()}}xo=new WeakMap,Ff=new WeakMap,Cf=new WeakMap,da=new WeakMap,Ni=new WeakMap,u1=new WeakSet,_S=async function(e){if(L(this,Ni)===-2)return;const r=a2(L(this,Ff));r.fromBlock=L(this,Ni)+1,r.toBlock=e;const n=await L(this,xo).getLogs(r);if(n.length===0){L(this,Ni){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class pU{constructor(e){le(this,"name");Mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function gU(t){return JSON.parse(JSON.stringify(t))}function l2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function mm(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(Dr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:Wd("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:Wd("orphan",r),filter:gU(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?l2(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Dr(a)?i.push(a):s.push((async()=>{i.push(await ps(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=l2(i.map(a=>a.toLowerCase()))}return{filter:n,tag:Wd("event",n),type:"event"}}se(!1,"unknown ProviderEvent","event",t)}function ym(){return new Date().getTime()}const mU={cacheTimeout:250,pollingInterval:4e3};var Sn,pa,Fn,kf,ui,ml,ga,vo,u0,Ri,_f,Pf,$n,Si,f0,u2,c0,f2,yl,Kc,h0,c2,xl,Jc,Nf,Yd;class yU{constructor(e,r){me(this,$n);me(this,f0);me(this,c0);me(this,yl);me(this,h0);me(this,xl);me(this,Nf);me(this,Sn,void 0);me(this,pa,void 0);me(this,Fn,void 0);me(this,kf,void 0);me(this,ui,void 0);me(this,ml,void 0);me(this,ga,void 0);me(this,vo,void 0);me(this,u0,void 0);me(this,Ri,void 0);me(this,_f,void 0);me(this,Pf,void 0);if(ee(this,Pf,Object.assign({},mU,r||{})),e==="any")ee(this,ml,!0),ee(this,ui,null);else if(e){const n=nl.from(e);ee(this,ml,!1),ee(this,ui,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else ee(this,ml,!1),ee(this,ui,null);ee(this,vo,-1),ee(this,ga,new Map),ee(this,Sn,new Map),ee(this,pa,new Map),ee(this,Fn,null),ee(this,kf,!1),ee(this,u0,1),ee(this,Ri,new Map),ee(this,_f,!1)}get pollingInterval(){return L(this,Pf).pollingInterval}get provider(){return this}get plugins(){return Array.from(L(this,pa).values())}attachPlugin(e){if(L(this,pa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return L(this,pa).set(e.name,e.connect(this)),this}getPlugin(e){return L(this,pa).get(e)||null}get disableCcipRead(){return L(this,_f)}set disableCcipRead(e){ee(this,_f,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${c}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:c}}),o.push(c)}Ne(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new BO(eU(e),this)}_wrapLog(e,r){return new _0(XO(e),this)}_wrapTransactionReceipt(e,r){return new hS(iU(e),this)}_wrapTransactionResponse(e,r){return new Xh(FS(e),this)}_detectNetwork(){Ne(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Ne(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Jt(await ot(this,$n,Si).call(this,{method:"getBlockNumber"}),"%response");return L(this,vo)>=0&&ee(this,vo,e),e}_getAddress(e){return ps(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(Dr(e))return Dr(e,32)?e:Za(e);if(typeof e=="bigint"&&(e=Jt(e,"blockTag")),typeof e=="number")return e>=0?Za(e):L(this,vo)>=0?Za(L(this,vo)+e):this.getBlockNumber().then(r=>Za(r+e));se(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?l2(l.map(u=>u.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,u,f)=>{let c;switch(l.length){case 0:break;case 1:c=l[0];break;default:l.sort(),c=l}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const p={};return c&&(p.address=c),r.length&&(p.topics=r),u&&(p.fromBlock=u),f&&(p.toBlock=f),n&&(p.blockHash=n),p};let s=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)s.push(this._getAddress(l));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(l=>i(l[0],l[1],l[2])):i(s,o,a)}_getTransactionRequest(e){const r=Yp(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=ps(r[i],this);yd(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);yd(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(L(this,ui)==null){const i=this._detectNetwork().then(s=>(this.emit("network",s,null),s),s=>{throw L(this,ui)===i&&ee(this,ui,null),s});return ee(this,ui,i),(await i).clone()}const e=L(this,ui),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(L(this,ml)?(this.emit("network",n,r),L(this,ui)===e&&ee(this,ui,Promise.resolve(n))):Ne(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s}=await Kn({_block:ot(this,h0,c2).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ot(this,$n,Si).call(this,{method:"getGasPrice"});return Rt(u,"%response")}catch{}return null})()});let o=null,a=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(a=BigInt("1000000000"),o=l.baseFeePerGas*hU+a),new Z3(s,o,a)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Ua(n.url),s=await n.processFunc(r,this,i);return new Z3(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return yd(r)&&(r=await r),Rt(await ot(this,$n,Si).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await Kn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ot(this,c0,f2).call(this,ot(this,f0,u2).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Rt(await ot(this,yl,Kc).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return Jt(await ot(this,yl,Kc).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return mt(await ot(this,yl,Kc).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Rt(r,"position");return mt(await ot(this,yl,Kc).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await Kn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=iv.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await Kn({network:this.getNetwork(),params:ot(this,h0,c2).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await Kn({network:this.getNetwork(),params:ot(this,$n,Si).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await Kn({network:this.getNetwork(),params:ot(this,$n,Si).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await ot(this,$n,Si).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await Kn({network:this.getNetwork(),result:ot(this,$n,Si).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:mt(r)}async getLogs(e){let r=this._getFilter(e);yd(r)&&(r=await r);const{network:n,params:i}=await Kn({network:this.getNetwork(),params:ot(this,$n,Si).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Ne(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Xp.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=yr(e);const r=e2(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Xp.getEnsAddress(this),s=await new ch(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===Jy)return null;const a=await new ch(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(ds(n,"BAD_DATA")&&n.value==="0x"||ds(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const l=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",l)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(Kf("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){Ne(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=L(this,Ri).get(e);r&&(r.timer&&clearTimeout(r.timer),L(this,Ri).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=lg(this,u0)._++,i=()=>{L(this,Ri).delete(n),e()};if(this.paused)L(this,Ri).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);L(this,Ri).set(n,{timer:s,func:i,time:ym()})}return n}_forEachSubscriber(e){for(const r of L(this,Sn).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new pU(e.type);case"block":{const r=new lU(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new cU(this,e.filter);case"transaction":return new fU(this,e.hash);case"orphan":return new uU(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of L(this,Sn).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),L(this,Fn)!=null&&r.pause(L(this,Fn));break}}async on(e,r){const n=await ot(this,Nf,Yd).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,L(this,Fn)!=null&&n.subscriber.pause(L(this,Fn))),this}async once(e,r){const n=await ot(this,Nf,Yd).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,L(this,Fn)!=null&&n.subscriber.pause(L(this,Fn))),this}async emit(e,...r){const n=await ot(this,xl,Jc).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new Y4(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),L(this,Sn).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await ot(this,xl,Jc).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of L(this,Sn).values())r+=n.length;return r}async listeners(e){if(e){const n=await ot(this,xl,Jc).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of L(this,Sn).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await ot(this,xl,Jc).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),L(this,Sn).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await ot(this,Nf,Yd).call(this,e);n&&i.stop(),L(this,Sn).delete(r)}else for(const[r,{started:n,subscriber:i}]of L(this,Sn))n&&i.stop(),L(this,Sn).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return L(this,kf)}destroy(){this.removeAllListeners();for(const e of L(this,Ri).keys())this._clearTimeout(e);ee(this,kf,!0)}get paused(){return L(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(ee(this,vo,-1),L(this,Fn)!=null){if(L(this,Fn)==!!e)return;Ne(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),ee(this,Fn,!!e);for(const r of L(this,Ri).values())r.timer&&clearTimeout(r.timer),r.time=ym()-r.time}resume(){if(L(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),ee(this,Fn,null);for(const e of L(this,Ri).values()){let r=e.time;r<0&&(r=0),e.time=ym(),setTimeout(e.func,r)}}}}Sn=new WeakMap,pa=new WeakMap,Fn=new WeakMap,kf=new WeakMap,ui=new WeakMap,ml=new WeakMap,ga=new WeakMap,vo=new WeakMap,u0=new WeakMap,Ri=new WeakMap,_f=new WeakMap,Pf=new WeakMap,$n=new WeakSet,Si=async function(e){const r=L(this,Pf).cacheTimeout;if(r<0)return await this._perform(e);const n=Wd(e.method,e);let i=L(this,ga).get(n);return i||(i=this._perform(e),L(this,ga).set(n,i),setTimeout(()=>{L(this,ga).get(n)===i&&L(this,ga).delete(n)},r)),await i},f0=new WeakSet,u2=async function(e,r,n){Ne(n=0&&r==="latest"&&i.to!=null&&Br(s.data,0,4)==="0x556f1830"){const o=s.data,a=await ps(i.to,this);let l;try{l=AU(Br(s.data,4))}catch(c){Ne(!1,c.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Ne(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const u=await this.ccipReadFetch(i,l.calldata,l.urls);Ne(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:l.errorArgs}});const f={to:a,data:Zr([l.selector,bU([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const c=await ot(this,f0,u2).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:c}),c}catch(c){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:c}),c}}throw s}},c0=new WeakSet,f2=async function(e){const{value:r}=await Kn({network:this.getNetwork(),value:e});return r},yl=new WeakSet,Kc=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await ot(this,c0,f2).call(this,ot(this,$n,Si).call(this,Object.assign(e,{address:i,blockTag:s})))},h0=new WeakSet,c2=async function(e,r){if(Dr(e,32))return await ot(this,$n,Si).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await ot(this,$n,Si).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},xl=new WeakSet,Jc=async function(e,r){let n=await mm(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await mm({orphan:"drop-log",log:r[0]},this)),L(this,Sn).get(n.tag)||null},Nf=new WeakSet,Yd=async function(e){const r=await mm(e,this),n=r.tag;let i=L(this,Sn).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},L(this,Sn).set(n,i)),i};function xU(t,e){try{const r=h2(t,e);if(r)return Vx(r)}catch{}return null}function h2(t,e){if(t==="0x")return null;try{const r=Jt(Br(t,e,e+32)),n=Jt(Br(t,r,r+32));return Br(t,r+32,r+32+n)}catch{}return null}function aA(t){const e=gi(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function vU(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const wU=new Uint8Array([]);function bU(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=Br(t,0,32);Ne(Br(r,0,12)===Br(lA,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Br(r,12);try{const n=[],i=Jt(Br(t,32,64)),s=Jt(Br(t,i,i+32)),o=Br(t,i+32);for(let a=0;ae[n]),e}function Xl(t,e){if(t.provider)return t.provider;Ne(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function uA(t,e){let r=Yp(e);if(r.to!=null&&(r.to=ps(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),ps(n,t)]).then(([i,s])=>(se(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await Kn(r)}class EU{constructor(e){le(this,"provider");Mt(this,{provider:e||null})}async getNonce(e){return Xl(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await uA(this,e)}async populateTransaction(e){const r=Xl(this,"populateTransaction"),n=await uA(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Rt(n.chainId);se(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?se(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&se(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();Ne(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Ne(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Ne(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Kn(n)}async estimateGas(e){return Xl(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Xl(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Xl(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=Xl(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=iv.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Zp=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},fA=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},qd,d2;const SU=1,FU=3e7,CU=0,kU=20,_U=4e3,PU="0x",NU=()=>`0x${"0".repeat(40)}`;class RU{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,r,n,i,s){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,s),this.cachedLeashes.set(r,{nonce:n.leash.nonce,block_number:n.leash.blockNumber,block_hash:n.leash.blockHash,block_range:n.leash.blockRange})}get(e,r){var n;return(n=this.cachedSignatures.get(e))===null||n===void 0?void 0:n.get(r)}getLeash(e){return this.cachedLeashes.get(e)}}const hh=new RU;function TU(t){return{domain:{name:"oasis-runtime-sdk/evm: signed query",version:"1.0.0",chainId:t},types:{Call:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"gasLimit",type:"uint64"},{name:"gasPrice",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"leash",type:"Leash"}],Leash:[{name:"nonce",type:"uint64"},{name:"blockNumber",type:"uint64"},{name:"blockHash",type:"bytes32"},{name:"blockRange",type:"uint64"}]}}}class R0{static make(e,r,n){return Zp(this,void 0,void 0,function*(){const i=yield MU(r,n==null?void 0:n.leash);return new R0(i,yield OU(BU(e,i),r,{chainId:n==null?void 0:n.chainId}),e.data?PS(e.data):void 0)})}constructor(e,r,n){this.leash=e,this.signature=r,this.data=n,qd.add(this)}encode(){return fA(this,qd,"m",d2).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return Zp(this,void 0,void 0,function*(){return this.data?fA(this,qd,"m",d2).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}qd=new WeakSet,d2=function(e){return mt(iu({data:e||void 0,leash:this.leash,signature:this.signature}))};function PS(t){return Array.isArray(t)?new Uint8Array(t):Rn(t)}function IU(t){return Array.isArray(t)?mt(new Uint8Array(t)):mt(t)}function MU(t,e){var r;return Zp(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&hh.clear();const n=e!=null&&e.nonce?e.nonce:"getNonce"in t?t.getNonce("pending"):t.getTransactionCount("pending");let i;if((e==null?void 0:e.block)!==void 0)i=e.block;else{if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const l=yield t.provider.getBlock("latest");if(!l)throw new Error("unable to get latest block");i=t.provider.getBlock(l.number-2)}const[s,o]=yield Promise.all([n,i]),a=(r=e==null?void 0:e.blockRange)!==null&&r!==void 0?r:_U;if((e==null?void 0:e.nonce)===void 0&&(e==null?void 0:e.block)===void 0){if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const{chainId:l}=yield t.provider.getNetwork(),u=hh.getLeash(BigInt(l));if(u!==void 0){if(u.nonce>s&&u.block_number+a>o.number+2)return u;hh.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:s+kU,block_number:o.number,block_hash:Rn(o.hash),block_range:a}})}function BU(t,e){var r,n,i,s,o;return{from:t.from,to:(r=t.to)!==null&&r!==void 0?r:NU(),gasLimit:Ee.from((i=(n=t.gas)!==null&&n!==void 0?n:t.gasLimit)!==null&&i!==void 0?i:FU).toNumber(),gasPrice:Ee.from((s=t.gasPrice)!==null&&s!==void 0?s:SU),value:Ee.from((o=t.value)!==null&&o!==void 0?o:CU),data:t.data?IU(t.data):PU,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function OU(t,e,r){return Zp(this,void 0,void 0,function*(){const n=yield e.getAddress();let i;if(r!=null&&r.chainId)i=BigInt(r.chainId);else if(e.provider)({chainId:i}=yield e.provider.getNetwork());else throw new Error("must either connect provider or provide manual chainId override");const{domain:s,types:o}=TU(Number(i)),a=UU(s),l=DU(t),u=t2.hash(a,o,l);let f=hh.get(n,u);return"_signTypedData"in e?f=ur(yield e._signTypedData(s,o,t)):f=ur(yield e.signTypedData(a,o,l)),hh.cache(n,BigInt(i),t,u,f),f})}function UU(t){return Object.assign(Object.assign({},t),{salt:t.salt?PS(t.salt):void 0,chainId:t.chainId?Ee.from(t.chainId).toHexString():void 0})}function DU(t){const e=r=>{if(r!=null)return typeof r=="string"?r:r instanceof Ee?r.toHexString():Za(r)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?ur(t.data):void 0})}var sn=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},LU=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);isn(this,void 0,void 0,function*(){return BigInt(Oo)}),connect(s){return e1(n.connect(s),r)}};return _u(n,r,i)}if(uv(t)){let n;if(t.provider)try{n=t.connect(hA(t.provider,r,t))}catch(s){if(s.code!=="UNSUPPORTED_OPERATION")throw s;n=t}else n=t;const i={sendTransaction:pA(n.sendTransaction.bind(n),r),signTransaction:pA(n.signTransaction.bind(n),r),call:m2(n,"call",r),estimateGas:()=>sn(this,void 0,void 0,function*(){return Ee.from(Oo)}),connect(s){return e1(n.connect(s),r)}};return _u(n,r,i)}if(p2(t))return hA(t,r);if(g2(t))return dA(t,r);if("request"in t||"send"in t||"sendAsync"in t){const n=IS(t).getSigner(),i=zU(n,r),s=mA(i);let o=s;return"send"in t&&NS(t.send)&&(o=(a,l)=>i({method:a,params:l})),_u(t,r,{request:i,send:o,sendAsync:s})}throw new TypeError("Unable to wrap unsupported upstream signer.")}function NS(t){if(!t)return!1;try{const e=t();if(e instanceof Promise)return e.catch(()=>{}),!0}catch{}return!1}function cA(t){return mI(()=>sn(this,void 0,void 0,function*(){const e=yield $U(t);return jp.ephemeral(e)}))}function _u(t,e,r){return new Proxy(t,{get(n,i){if(i===og)return{cipher:e};if(i in r)return Reflect.get(r,i);const s=Reflect.get(n,i);return typeof s=="function"?s.bind(n):s}})}function hA(t,e,r){if(Reflect.get(t,og)!==void 0)return t;const n=r?{sendTransaction:i=>sn(this,void 0,void 0,function*(){const s=yield TS(yield i,e,r);return t.sendTransaction(s)})}:{call:m2(t,"call",e),estimateGas:m2(t,"estimateGas",e)};return _u(t,e,n)}function dA(t,e,r){if(Reflect.get(t,og)!==void 0)return t;const n=r?{}:{call:y2(t,"call",e),estimateGas:y2(t,"estimateGas",e)};return _u(t,e,n)}function p2(t){return E0.isProvider(t)}function uv(t){return sc.isSigner(t)&&"_signTypedData"in t}function fv(t){return t instanceof EU}function g2(t){return t instanceof yU}function m2(t,e,r){const n=(i,s,o)=>sn(this,void 0,void 0,function*(){return i[e](Object.assign(Object.assign({},s),{data:r.encryptEncode(yield s.data)}),o)});return(i,s)=>sn(this,void 0,void 0,function*(){let o;if(uv(t)){const a=t;if(yield cv(i)){const l=yield R0.make(yield RS(i),a);o=yield a[e](Object.assign(Object.assign({},i),{data:l.encryptEncode(r)}),s)}else{if(!a.provider)throw new Error("unable to sign call");o=yield n(a.provider,i,s)}}else o=yield n(t,i,s);return typeof o=="string"?r.decryptEncoded(o):o})}function y2(t,e,r){const n=(i,s)=>sn(this,void 0,void 0,function*(){var o;return i[e](Object.assign(Object.assign({},s),{data:yield r.encryptEncode((o=s.data)!==null&&o!==void 0?o:new Uint8Array)}))});return i=>sn(this,void 0,void 0,function*(){let s;if(fv(t)){const o=t;if(!o.provider)throw new Error("signer not connected to a provider");const a=o.provider;if(yield cv(i)){const l=yield R0.make(yield RS(i),o);s=yield a[e](Object.assign(Object.assign({},i),{data:yield l.encryptEncode(r)}))}else s=yield n(a,i)}else s=yield n(t,i);return typeof s=="string"?r.decryptEncoded(s):s})}function pA(t,e){return(r,...n)=>sn(this,void 0,void 0,function*(){const i=yield r.data;return r.data=e.encryptEncode(i),r.gasLimit||(r.gasLimit=Oo),t(r,...n)})}function gA(t,e){return(r,...n)=>sn(this,void 0,void 0,function*(){return r.data&&(r.data=yield e.encryptEncode(r.data)),r.gasLimit||(r.gasLimit=Oo),t(r,...n)})}function cv(t){return sn(this,void 0,void 0,function*(){const[e,r]=yield Promise.all([t.from,t.to]);return!!r&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function RS(t){return sn(this,void 0,void 0,function*(){return Object.fromEntries(yield Promise.all(Object.entries(t).map(([e,r])=>sn(this,void 0,void 0,function*(){return[e,yield r]}))))})}function zU(t,e){return r=>sn(this,void 0,void 0,function*(){if(r.method==="eth_estimateGas")return Ee.from(Oo).toHexString();const{method:n,params:i}=yield HU(r,t,e),s=yield t.provider.send(n,i??[]);return n==="eth_call"?e.decryptEncoded(s):s})}function jU(t,e){return({method:r,params:n})=>sn(this,void 0,void 0,function*(){return r==="eth_estimateGas"?Ee.from(Oo).toHexString():r==="eth_call"&&n?(n[0].data=yield e.encryptEncode(n[0].data),n[0].gasLimit||(n[0].gasLimit=Oo),t.send(r,n)):t.send(r,n??[])})}function mA(t){return(e,r)=>{t(e).then(n=>r(null,{jsonrpc:"2.0",id:e.id,result:n})).catch(n=>r(n))}}function HU({method:t,params:e},r,n){return sn(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield TS(e[0],n,r)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield cv(e[0]))){const i=yield R0.make(e[0],r),s=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(n)});return{method:t,params:[s,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)?(e[0].data=yield n.encryptEncode(e[0].data),e[0].gasLimit||(e[0].gasLimit=Oo),{method:t,params:e}):{method:t,params:e}})}const GU="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function TS(t,e,r){var n;return sn(this,void 0,void 0,function*(){const s=O1(t),o=ct(s[5],{allowMissingPrefix:!0});try{const f=jd(o),{format:c,body:p}=f,y=LU(f,["format","body"]);if(VU(c,p,y))return t;throw new yA("Bogus enveloped data found in sendRawTransaction.")}catch(f){if(f instanceof yA)throw f}const a=iv.from(t);if(a.isSigned()&&(!r||(yield r.getAddress())!=a.from))return a.serialized;const l=f=>{if(f)return Za(f)},u={to:a.to,from:a.from,data:a.data,nonce:a.nonce,gasLimit:l(a.gasLimit),gasPrice:(n=l(a.gasPrice))!==null&&n!==void 0?n:void 0,value:l(a.value),chainId:Number(a.chainId)};u.gasLimit||(u.gasLimit=l(BigInt(Oo)));try{return r.signTransaction(Object.assign(Object.assign({},u),{data:yield e.encryptEncode(o)}))}catch(f){throw new dh(GU,f)}})}function VU(t,e,r){return!(Object.keys(r).length>0||!e||t&&t!==$f.Plain&&(Df(e)||!Df(e.data)))}class yA extends Error{}function QU(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}function $U(t){return sn(this,void 0,void 0,function*(){const e=uv(t)||fv(t),r=e?t.provider:t;if(r&&"send"in r)try{const i=r,s=QU(),o=function(l,u){u&&s.resolve(u.result),s.reject(l)};let a;if(!e&&!p2(r)&&!g2(r)){if(a=yield i.send({method:x2,params:[]},o),a===void 0&&(a=yield s.promise,a===void 0))throw Error("Got unexpected `undefined` from source.send callback!")}else a=yield i.send(x2,[]);if("key"in a){const l=a.key;return ct(l)}}catch{}if(p2(t)||g2(t)){const i=Number((yield t.getNetwork()).chainId);return rm(i)}if(e){const i=Number((yield t.provider.getNetwork()).chainId);return rm(i)}const n=(yield IS(t).getNetwork()).chainId;return rm(n)})}function IS(t){let e;return"send"in t&&NS(t.send)?e={request:({method:r,params:n})=>t.send(r,n??[])}:e=t,new y4(e)}const xm={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},vm={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},wm={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},KU={mainnet:xm,testnet:vm,localnet:wm,[xm.chainId]:xm,[vm.chainId]:vm,[wm.chainId]:wm},x2="oasis_callDataPublicKey";class dh extends Error{constructor(e,r){super(e),this.response=r}}const xA={23294:{wRoseContractAddress:"0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3",explorerBaseUrl:"https://explorer.oasis.io/mainnet/sapphire",networkName:"Sapphire"},23295:{wRoseContractAddress:"0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94",explorerBaseUrl:"https://explorer.oasis.io/testnet/sapphire",networkName:"Sapphire Testnet"}},JU="https://faucet.testnet.oasis.dev/?paratime=sapphire",WU={version:"0.8.16+commit.07a7930e"},YU="Solidity",qU={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"dst",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],devdoc:{kind:"dev",methods:{"allowance(address,address)":{details:"See {IERC20-allowance}."},"approve(address,uint256)":{details:"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address."},"balanceOf(address)":{details:"See {IERC20-balanceOf}."},"burn(uint256)":{details:"Destroys `amount` tokens from the caller. See {ERC20-_burn}."},"burnFrom(address,uint256)":{details:"Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`."},"decimals()":{details:"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}."},"decreaseAllowance(address,uint256)":{details:"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`."},"increaseAllowance(address,uint256)":{details:"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address."},"name()":{details:"Returns the name of the token."},"symbol()":{details:"Returns the symbol of the token, usually a shorter version of the name."},"totalSupply()":{details:"See {IERC20-totalSupply}."},"transfer(address,uint256)":{details:"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`."},"transferFrom(address,address,uint256)":{details:"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`."}},version:1},userdoc:{kind:"user",methods:{},version:1}},XU={compilationTarget:{"contracts/WrappedROSE.sol":"WrappedROSE"},evmVersion:"london",libraries:{},metadata:{bytecodeHash:"ipfs"},optimizer:{enabled:!0,runs:0},remappings:[],viaIR:!0},ZU={"@openzeppelin/contracts/token/ERC20/ERC20.sol":{keccak256:"0x24b04b8aacaaf1a4a0719117b29c9c3647b1f479c5ac2a60f5ff1bb6d839c238",license:"MIT",urls:["bzz-raw://43e46da9d9f49741ecd876a269e71bc7494058d7a8e9478429998adb5bc3eaa0","dweb:/ipfs/QmUtp4cqzf22C5rJ76AabKADquGWcjsc33yjYXxXC4sDvy"]},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{keccak256:"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b",license:"MIT",urls:["bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34","dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr"]},"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol":{keccak256:"0x0d19410453cda55960a818e02bd7c18952a5c8fe7a3036e81f0d599f34487a7b",license:"MIT",urls:["bzz-raw://4c0f62d3d5bef22b5ca00cc3903e7de6152cb68d2d22401a463f373cda54c00f","dweb:/ipfs/QmSfzjZux7LC7NW2f7rjCXTHeFMUCWERqDkhpCTBy7kxTe"]},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{keccak256:"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca",license:"MIT",urls:["bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd","dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8"]},"@openzeppelin/contracts/utils/Context.sol":{keccak256:"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7",license:"MIT",urls:["bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92","dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3"]},"contracts/WrappedROSE.sol":{keccak256:"0x4efa46ca0afc2256ce79193e3216fde354825d66fd7ef46ab4d6c3066fa7c8d4",license:"MIT",urls:["bzz-raw://a3126204c240f9aec1bf2fcd409f6778528c17e7c45baa447a44cbec1919c817","dweb:/ipfs/QmQ76bjcVBj13B7grnDQozmPiRLQJU6kFNHF9yMXoLtBeS"]}},eD=1,tD={compiler:WU,language:YU,output:qU,settings:XU,sources:ZU,version:eD};class MS extends Error{constructor(e){super(e)}}function rD({mustBeMetaMask:t=!1,silent:e=!1,timeout:r=3e3}={}){i();let n=!1;return new Promise(s=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},r));function o(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:a}=window;a&&(!t||a.isMetaMask)?s(a):(!e&&console.error("@metamask/detect-provider:",t&&a?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),s(null))}});function i(){if(typeof t!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof r!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}var nD=rD;const iD=Uo(nD),sD=3e5,{VITE_BASE_AUTH_URL:oD}={VITE_SAPPHIRE_JSONRPC:"https://testnet.sapphire.oasis.dev",VITE_SAPPHIRE_CHAIN_ID:"0x5aff",BASE_URL:"/wrose-authzn",MODE:"production",DEV:!1,PROD:!0,SSR:!1},BS=oD??"https://playground.oasis.io";let As=null,vA=null;const wA=(t,e)=>{if(t.origin!==BS)return!1;const{data:r}=t,n=new URLSearchParams(r);if(n.get("target")!=="authzn-popup")return!1;switch(e){case"login":case"register":{const i=n.get("username"),s=n.get("address"),o=new CustomEvent(e,{detail:{username:i,address:s}});window.dispatchEvent(o);return}case"sign":{const i=n.get("tx"),s=new CustomEvent(e,{detail:{signedTransaction:i}});window.dispatchEvent(s);return}}},hv=(t,e={})=>{const r={...e,origin:window.location.origin},n=new URLSearchParams(r).toString(),i=`${BS}/authzn/#/${t}?${n}`,s=`AuthNZ - ${t}`;window.removeEventListener("message",wA);const o="toolbar=no, menubar=no, width=1280, height=800, top=100, left=100";return As===null||As.closed?As=window.open(i,s,o):vA!==i?(As=window.open(i,s,o),As==null||As.focus()):As.focus(),window.addEventListener("message",a=>wA(a,t),!1),vA=i,new Promise((a,l)=>{const u=setTimeout(()=>{window.removeEventListener(t,f),As&&As.close(),l("Register event timed out!")},sD),f=c=>{window.removeEventListener(t,f),clearInterval(u),a(c.detail)};window.addEventListener(t,f)})},aD=async()=>hv("register"),lD=async()=>hv("login"),bA=async t=>hv("sign",{unSignedTx:t}),uD={sapphireJsonRpc:"",sapphireChainId:-1},OS=we.createContext({}),fD=({children:t})=>{const[e,r]=we.useState({...uD});we.useEffect(()=>{const{VITE_SAPPHIRE_JSONRPC:i,VITE_SAPPHIRE_CHAIN_ID:s}={VITE_SAPPHIRE_JSONRPC:"https://testnet.sapphire.oasis.dev",VITE_SAPPHIRE_CHAIN_ID:"0x5aff",BASE_URL:"/wrose-authzn",MODE:"production",DEV:!1,PROD:!0,SSR:!1};r({sapphireJsonRpc:i,sapphireChainId:parseInt(s,16)})},[]);const n={state:e};return Pe.jsx(OS.Provider,{value:n,children:t})},cD=()=>{const t=we.useContext(OS);if(t===void 0)throw new Error("[useConfig] Component not wrapped within a Provider");return t},AA=1e5,hD={isConnected:!1,ethProvider:null,sapphireEthProvider:null,wRoseContractAddress:null,wRoseContract:null,account:null,explorerBaseUrl:null,networkName:null},US=we.createContext({}),dD=({children:t})=>{const{state:{sapphireJsonRpc:e,sapphireChainId:r}}=cD(),[n,i]=we.useState({...hD}),s=async x=>{if(!r||!e)throw new Error("Configuration missing!");try{const A=new Px(e),C=e1(A);if(!(r in xA))return Promise.reject(new MS("Unknown network!"));const{wRoseContractAddress:F,explorerBaseUrl:z,networkName:T}=xA[r],D=new jN(F,tD.output.abi,C);i(G=>({...G,isConnected:!0,ethProvider:A,sapphireEthProvider:C,wRoseContract:D,account:x,explorerBaseUrl:z,networkName:T,wRoseContractAddress:F}))}catch{throw i(C=>({...C,isConnected:!1})),new Error("[Web3Context] Unable to initialize providers!")}},o=async()=>{const{account:x,sapphireEthProvider:A}=n;if(!x||!A)throw new Error("[Web3Context] Unable to fetch balance!");return await A.getBalance(x).catch(()=>Ee.from(0))},a=async()=>{const{account:x,wRoseContract:A}=n;if(!x||!A)throw new Error("[Web3Context] Unable to fetch WROSE balance!");return await A.balanceOf(x).catch(()=>Ee.from(0))},l=async()=>{const x=await iD();return!!window.ethereum&&x===window.ethereum},u=async({address:x})=>{await s(x)},f=async x=>{var A,C;throw x===23294&&await((C=(A=window.ethereum).request)==null?void 0:C.call(A,{method:"wallet_addEthereumChain",params:[{chainId:"0x5afe",chainName:"Oasis Sapphire",nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}]})),new Error("Unable to automatically add the network, please do it manually!")},N={state:n,isMetaMaskInstalled:l,connectWallet:u,switchNetwork:async(x=23294)=>{var z,T;const A=new y4(window.ethereum);if((await e1(A).getNetwork()).chainId!==x)try{await((T=(z=window.ethereum).request)==null?void 0:T.call(z,{method:"wallet_switchEthereumChain",params:[{chainId:lt(x)}]}))}catch(D){if((D==null?void 0:D.code)!==4902&&(D==null?void 0:D.code)!==-32603)throw D;f(x)}},wrap:async x=>{var te;if(!x)throw new Error("[amount] is required!");const{wRoseContract:A,account:C,sapphireEthProvider:F}=n;if(!A||!C||!F)throw new Error("[wRoseContract] not initialized!");const z=new Lh(C,F),D=await A.connect(z).populateTransaction.deposit();D.gasLimit=AA,D.value=x;const G=await z.populateTransaction(D),$=Object.entries(G).reduce((de,_)=>{const[h,m]=_,S=Ee.isBigNumber(m)?m.toString():m;return{...de,[h]:S}},{}),{signedTransaction:ne}=await bA(JSON.stringify($));return await((te=n.sapphireEthProvider)==null?void 0:te.send("eth_sendRawTransaction",[ne]))},unwrap:async x=>{var te;if(!x)throw new Error("[amount] is required!");const{wRoseContract:A,account:C,sapphireEthProvider:F}=n;if(!A||!C||!F)throw new Error("[wRoseContract] not initialized!");const z=new Lh(C,F),D=await A.connect(z).populateTransaction.withdraw(x);D.gasLimit=AA,D.value=0;const G=await z.populateTransaction(D),$=Object.entries(G).reduce((de,_)=>{const[h,m]=_,S=Ee.isBigNumber(m)?m.toString():m;return{...de,[h]:S}},{}),{signedTransaction:ne}=await bA(JSON.stringify($));return await((te=n.sapphireEthProvider)==null?void 0:te.send("eth_sendRawTransaction",[ne]))},getBalance:o,getBalanceOfWROSE:a,getTransaction:async x=>{if(!x)throw new Error("[txHash] is required!");const{sapphireEthProvider:A}=n;if(!A)throw new Error("[sapphireEthProvider] not initialized!");if((await A.waitForTransaction(x)).status===0)throw new Error("Transaction failed");return await A.getTransaction(x)},addTokenToWallet:async()=>{var C,F;const{wRoseContractAddress:x}=n,A="WROSE";try{await((F=(C=window.ethereum).request)==null?void 0:F.call(C,{method:"wallet_watchAsset",params:{type:"ERC20",options:{address:x,symbol:A,decimals:18}}}))}catch(z){console.error(z)}}};return Pe.jsx(US.Provider,{value:N,children:t})},T0=()=>{const t=we.useContext(US);if(t===void 0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t},pD="_account_ec5ym_1",gD="_accountDetails_ec5ym_15",mD="_accountAddress_ec5ym_27",yD="_network_ec5ym_37",xd={account:pD,accountDetails:gD,accountAddress:mD,network:yD},xD=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class $u{}le($u,"truncateAddress",e=>{const r=e.match(xD);if(r.length<=0)return e;const[,n,i]=r;return`${n}…${i}`}),le($u,"getTransactionUrl",(e,r)=>`${e}/tx/${r}`),le($u,"getAccountUrl",(e,r)=>`${e}/address/${r}`);var Ho=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Ho.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Ho.prototype.init_by_array=function(t,e){var r,n,i;for(this.init_seed(19650218),r=1,n=0,i=this.N>e?this.N:e;i;i--){var s=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+t[n]+n,this.mt[r]>>>=0,r++,n++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1),n>=e&&(n=0)}for(i=this.N-1;i;i--){var s=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-r,this.mt[r]>>>=0,r++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1)}this.mt[0]=2147483648};Ho.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_seed(5489),r=0;r>>1^e[t&1];for(;r>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Ho.prototype.random_int31=function(){return this.random_int()>>>1};Ho.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Ho.prototype.random=function(){return this.random_int()*(1/4294967296)};Ho.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Ho.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var vD=Ho;function wD(t,e){var r=document.createElement("div");return r.style.borderRadius="50px",r.style.overflow="hidden",r.style.padding="0px",r.style.margin="0px",r.style.width=""+t+"px",r.style.height=""+t+"px",r.style.display="inline-block",r.style.background=e,{container:r}}var bD=wD,DS={exports:{}};(function(t){var e=function(){function r(l,u,f,c){typeof u=="object"&&(f=u.depth,c=u.prototype,u.filter,u=u.circular);var p=[],y=[],v=typeof Buffer<"u";typeof u>"u"&&(u=!0),typeof f>"u"&&(f=1/0);function b(N,x){if(N===null)return null;if(x==0)return N;var A,C;if(typeof N!="object")return N;if(r.__isArray(N))A=[];else if(r.__isRegExp(N))A=new RegExp(N.source,a(N)),N.lastIndex&&(A.lastIndex=N.lastIndex);else if(r.__isDate(N))A=new Date(N.getTime());else{if(v&&Buffer.isBuffer(N))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(N.length):A=new Buffer(N.length),N.copy(A),A;typeof c>"u"?(C=Object.getPrototypeOf(N),A=Object.create(C)):(A=Object.create(c),C=c)}if(u){var F=p.indexOf(N);if(F!=-1)return y[F];p.push(N),y.push(A)}for(var z in N){var T;C&&(T=Object.getOwnPropertyDescriptor(C,z)),!(T&&T.set==null)&&(A[z]=b(N[z],x-1))}return A}return b(l,f)}r.clonePrototype=function(u){if(u===null)return null;var f=function(){};return f.prototype=u,new f};function n(l){return Object.prototype.toString.call(l)}r.__objToStr=n;function i(l){return typeof l=="object"&&n(l)==="[object Date]"}r.__isDate=i;function s(l){return typeof l=="object"&&n(l)==="[object Array]"}r.__isArray=s;function o(l){return typeof l=="object"&&n(l)==="[object RegExp]"}r.__isRegExp=o;function a(l){var u="";return l.global&&(u+="g"),l.ignoreCase&&(u+="i"),l.multiline&&(u+="m"),u}return r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)})(DS);var AD=DS.exports,LS={exports:{}},ED={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Fl=ED,zS={};for(var bm in Fl)Fl.hasOwnProperty(bm)&&(zS[Fl[bm]]=bm);var ft=LS.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Qn in ft)if(ft.hasOwnProperty(Qn)){if(!("channels"in ft[Qn]))throw new Error("missing channels property: "+Qn);if(!("labels"in ft[Qn]))throw new Error("missing channel labels property: "+Qn);if(ft[Qn].labels.length!==ft[Qn].channels)throw new Error("channel and label counts mismatch: "+Qn);var SD=ft[Qn].channels,FD=ft[Qn].labels;delete ft[Qn].channels,delete ft[Qn].labels,Object.defineProperty(ft[Qn],"channels",{value:SD}),Object.defineProperty(ft[Qn],"labels",{value:FD})}ft.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=s-i,a,l,u;return s===i?a=0:e===s?a=(r-n)/o:r===s?a=2+(n-e)/o:n===s&&(a=4+(e-r)/o),a=Math.min(a*60,360),a<0&&(a+=360),u=(i+s)/2,s===i?l=0:u<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,u*100]};ft.rgb.hsv=function(t){var e,r,n,i,s,o=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(o,a,l),f=u-Math.min(o,a,l),c=function(p){return(u-p)/6/f+1/2};return f===0?i=s=0:(s=f/u,e=c(o),r=c(a),n=c(l),o===u?i=n-r:a===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,u*100]};ft.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2],i=ft.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,s*100,n*100]};ft.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i,s,o,a;return a=Math.min(1-e,1-r,1-n),i=(1-e-a)/(1-a)||0,s=(1-r-a)/(1-a)||0,o=(1-n-a)/(1-a)||0,[i*100,s*100,o*100,a*100]};function CD(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}ft.rgb.keyword=function(t){var e=zS[t];if(e)return e;var r=1/0,n;for(var i in Fl)if(Fl.hasOwnProperty(i)){var s=Fl[i],o=CD(t,s);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+r*.3576+n*.1805,s=e*.2126+r*.7152+n*.0722,o=e*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};ft.rgb.lab=function(t){var e=ft.rgb.xyz(t),r=e[0],n=e[1],i=e[2],s,o,a;return r/=95.047,n/=100,i/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*n-16,o=500*(r-n),a=200*(n-i),[s,o,a]};ft.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i,s,o,a,l;if(r===0)return l=n*255,[l,l,l];n<.5?s=n*(1+r):s=n+r-n*r,i=2*n-s,a=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(s-i)*6*o:2*o<1?l=s:3*o<2?l=i+(s-i)*(2/3-o)*6:l=i,a[u]=l*255;return a};ft.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,s=Math.max(n,.01),o,a;return n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s,a=(n+r)/2,o=n===0?2*i/(s+i):2*r/(n+r),[e,o*100,a*100]};ft.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-r),a=255*n*(1-r*s),l=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};ft.hsv.hsl=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),s,o,a;return a=(2-r)*n,s=(2-r)*i,o=r*i,o/=s<=1?s:2-s,o=o||0,a/=2,[e,o*100,a*100]};ft.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,s,o,a,l;i>1&&(r/=i,n/=i),s=Math.floor(6*e),o=1-n,a=6*e-s,s&1&&(a=1-a),l=r+a*(o-r);var u,f,c;switch(s){default:case 6:case 0:u=o,f=l,c=r;break;case 1:u=l,f=o,c=r;break;case 2:u=r,f=o,c=l;break;case 3:u=r,f=l,c=o;break;case 4:u=l,f=r,c=o;break;case 5:u=o,f=r,c=l;break}return[u*255,f*255,c*255]};ft.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,s,o,a;return s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),[s*255,o*255,a*255]};ft.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i,s,o;return i=e*3.2406+r*-1.5372+n*-.4986,s=e*-.9689+r*1.8758+n*.0415,o=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};ft.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return e/=95.047,r/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*r-16,s=500*(e-r),o=200*(r-n),[i,s,o]};ft.lab.xyz=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;s=(e+16)/116,i=r/500+s,o=s-n/200;var a=Math.pow(s,3),l=Math.pow(i,3),u=Math.pow(o,3);return s=a>.008856?a:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};ft.lab.lch=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return i=Math.atan2(n,r),s=i*360/2/Math.PI,s<0&&(s+=360),o=Math.sqrt(r*r+n*n),[e,o,s]};ft.lch.lab=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return o=n/360*2*Math.PI,i=r*Math.cos(o),s=r*Math.sin(o),[e,i,s]};ft.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:ft.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return i===2&&(s+=60),s};ft.hsv.ansi16=function(t){return ft.rgb.ansi16(ft.hsv.rgb(t),t[2])};ft.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];if(e===r&&r===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};ft.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[n,i,s]};ft.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var r,n=Math.floor(t/36)/5*255,i=Math.floor((r=t%36)/6)/5*255,s=r%6/5*255;return[n,i,s]};ft.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};ft.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(a){return a+a}).join(""));var n=parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};ft.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),s=Math.min(Math.min(e,r),n),o=i-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:i===e?l=(r-n)/o%6:i===r?l=2+(n-e)/o:l=4+(e-r)/o+4,l/=6,l%=1,[l*360,o*100,a*100]};ft.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return r<.5?n=2*e*r:n=2*e*(1-r),n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};ft.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};ft.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];var i=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};ft.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};ft.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,n=r*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};ft.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};ft.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1-r,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[t[0],i*100,s*100]};ft.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ft.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ft.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ft.gray.hsl=ft.gray.hsv=function(t){return[0,0,t[0]]};ft.gray.hwb=function(t){return[0,100,t[0]]};ft.gray.cmyk=function(t){return[0,0,0,t[0]]};ft.gray.lab=function(t){return[t[0],0,0]};ft.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};ft.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var jS=LS.exports,t1=jS;function kD(){for(var t={},e=Object.keys(t1),r=e.length,n=0;n1&&(r=Array.prototype.slice.call(arguments)),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function BD(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=t(r);if(typeof n=="object")for(var i=n.length,s=0;sr?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var r=this,n=t,i=e===void 0?.5:e,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,l=1-a;return this.rgb(a*r.red()+l*n.red(),a*r.green()+l*n.green(),a*r.blue()+l*n.blue()).alpha(r.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new Qs;return t.values=JD(this.values),t}};Qs.prototype.getValues=function(t){for(var e={},r=0;r{const r=we.useRef(null);return we.useEffect(()=>{var n;if(r!=null&&r.current){const i=Xd.jsNumberForAddress(t),s=aL(e,i);(n=r.current)==null||n.replaceChildren(s)}},[e,r,t]),Pe.jsx("div",{ref:r,style:{width:e,height:e},className:uL.jazzIcon})},cL=we.memo(fL);var WS={exports:{}};(function(t,e){(function(n,i){t.exports=i(we)})(f1,r=>(()=>{var n={"./node_modules/css-mediaquery/index.js":(a,l)=>{l.match=v,l.parse=b;var u=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,f=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,c=/^(?:(min|max)-)?(.+)/,p=/(em|rem|px|cm|mm|in|pt|pc)?$/,y=/(dpi|dpcm|dppx)?$/;function v(C,F){return b(C).some(function(z){var T=z.inverse,D=z.type==="all"||F.type===z.type;if(D&&T||!(D||T))return!1;var G=z.expressions.every(function($){var ne=$.feature,te=$.modifier,de=$.value,_=F[ne];if(!_)return!1;switch(ne){case"orientation":case"scan":return _.toLowerCase()===de.toLowerCase();case"width":case"height":case"device-width":case"device-height":de=A(de),_=A(_);break;case"resolution":de=x(de),_=x(_);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":de=N(de),_=N(_);break;case"grid":case"color":case"color-index":case"monochrome":de=parseInt(de,10)||1,_=parseInt(_,10)||0;break}switch(te){case"min":return _>=de;case"max":return _<=de;default:return _===de}});return G&&!T||!G&&T})}function b(C){return C.split(",").map(function(F){F=F.trim();var z=F.match(u),T=z[1],D=z[2],G=z[3]||"",$={};return $.inverse=!!T&&T.toLowerCase()==="not",$.type=D?D.toLowerCase():"all",G=G.match(/\([^\)]+\)/g)||[],$.expressions=G.map(function(ne){var te=ne.match(f),de=te[1].toLowerCase().match(c);return{modifier:de[1],feature:de[2],value:te[2]}}),$})}function N(C){var F=Number(C),z;return F||(z=C.match(/^(\d+)\s*\/\s*(\d+)$/),F=z[1]/z[2]),F}function x(C){var F=parseFloat(C),z=String(C).match(y)[1];switch(z){case"dpcm":return F/2.54;case"dppx":return F*96;default:return F}}function A(C){var F=parseFloat(C),z=String(C).match(p)[1];switch(z){case"em":return F*16;case"rem":return F*16;case"cm":return F*96/2.54;case"mm":return F*96/2.54/10;case"in":return F*96;case"pt":return F*72;case"pc":return F*72/12;default:return F}}},"./node_modules/hyphenate-style-name/index.js":(a,l,u)=>{u.r(l),u.d(l,{default:()=>b});var f=/[A-Z]/g,c=/^ms-/,p={};function y(N){return"-"+N.toLowerCase()}function v(N){if(p.hasOwnProperty(N))return p[N];var x=N.replace(f,y);return p[N]=c.test(x)?"-"+x:x}const b=v},"./node_modules/matchmediaquery/index.js":(a,l,u)=>{var f=u("./node_modules/css-mediaquery/index.js").match,c=typeof window<"u"?window.matchMedia:null;function p(v,b,N){var x=this;if(c&&!N){var A=c.call(window,v);this.matches=A.matches,this.media=A.media,A.addListener(z)}else this.matches=f(v,b),this.media=v;this.addListener=C,this.removeListener=F,this.dispose=T;function C(D){A&&A.addListener(D)}function F(D){A&&A.removeListener(D)}function z(D){x.matches=D.matches,x.media=D.media}function T(){A&&A.removeListener(z)}}function y(v,b,N){return new p(v,b,N)}a.exports=y},"./node_modules/object-assign/index.js":a=>{/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;function c(y){if(y==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(y)}function p(){try{if(!Object.assign)return!1;var y=new String("abc");if(y[5]="de",Object.getOwnPropertyNames(y)[0]==="5")return!1;for(var v={},b=0;b<10;b++)v["_"+String.fromCharCode(b)]=b;var N=Object.getOwnPropertyNames(v).map(function(A){return v[A]});if(N.join("")!=="0123456789")return!1;var x={};return"abcdefghijklmnopqrst".split("").forEach(function(A){x[A]=A}),Object.keys(Object.assign({},x)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}a.exports=p()?Object.assign:function(y,v){for(var b,N=c(y),x,A=1;A{var f=function(){};{var c=u("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),p={},y=u("./node_modules/prop-types/lib/has.js");f=function(b){var N="Warning: "+b;typeof console<"u"&&console.error(N);try{throw new Error(N)}catch{}}}function v(b,N,x,A,C){for(var F in b)if(y(b,F)){var z;try{if(typeof b[F]!="function"){var T=Error((A||"React class")+": "+x+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof b[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}z=b[F](N,F,A,x,null,c)}catch(G){z=G}if(z&&!(z instanceof Error)&&f((A||"React class")+": type specification of "+x+" `"+F+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof z+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),z instanceof Error&&!(z.message in p)){p[z.message]=!0;var D=C?C():"";f("Failed "+x+" type: "+z.message+(D??""))}}}v.resetWarningCache=function(){p={}},a.exports=v},"./node_modules/prop-types/factoryWithTypeCheckers.js":(a,l,u)=>{var f=u("./node_modules/react-is/index.js"),c=u("./node_modules/object-assign/index.js"),p=u("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),y=u("./node_modules/prop-types/lib/has.js"),v=u("./node_modules/prop-types/checkPropTypes.js"),b=function(){};b=function(x){var A="Warning: "+x;typeof console<"u"&&console.error(A);try{throw new Error(A)}catch{}};function N(){return null}a.exports=function(x,A){var C=typeof Symbol=="function"&&Symbol.iterator,F="@@iterator";function z(V){var Z=V&&(C&&V[C]||V[F]);if(typeof Z=="function")return Z}var T="<>",D={array:te("array"),bigint:te("bigint"),bool:te("boolean"),func:te("function"),number:te("number"),object:te("object"),string:te("string"),symbol:te("symbol"),any:de(),arrayOf:_,element:h(),elementType:m(),instanceOf:S,node:H(),objectOf:R,oneOf:M,oneOfType:U,shape:g,exact:O};function G(V,Z){return V===Z?V!==0||1/V===1/Z:V!==V&&Z!==Z}function $(V,Z){this.message=V,this.data=Z&&typeof Z=="object"?Z:{},this.stack=""}$.prototype=Error.prototype;function ne(V){var Z={},he=0;function Ue(Be,ut,We,Ye,pt,ze,ye){if(Ye=Ye||T,ze=ze||We,ye!==p){if(A){var De=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw De.name="Invariant Violation",De}else if(typeof console<"u"){var Ce=Ye+":"+We;!Z[Ce]&&he<3&&(b("You are manually calling a React.PropTypes validation function for the `"+ze+"` prop on `"+Ye+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Z[Ce]=!0,he++)}}return ut[We]==null?Be?ut[We]===null?new $("The "+pt+" `"+ze+"` is marked as required "+("in `"+Ye+"`, but its value is `null`.")):new $("The "+pt+" `"+ze+"` is marked as required in "+("`"+Ye+"`, but its value is `undefined`.")):null:V(ut,We,Ye,pt,ze)}var pe=Ue.bind(null,!1);return pe.isRequired=Ue.bind(null,!0),pe}function te(V){function Z(he,Ue,pe,Be,ut,We){var Ye=he[Ue],pt=W(Ye);if(pt!==V){var ze=oe(Ye);return new $("Invalid "+Be+" `"+ut+"` of type "+("`"+ze+"` supplied to `"+pe+"`, expected ")+("`"+V+"`."),{expectedType:V})}return null}return ne(Z)}function de(){return ne(N)}function _(V){function Z(he,Ue,pe,Be,ut){if(typeof V!="function")return new $("Property `"+ut+"` of component `"+pe+"` has invalid PropType notation inside arrayOf.");var We=he[Ue];if(!Array.isArray(We)){var Ye=W(We);return new $("Invalid "+Be+" `"+ut+"` of type "+("`"+Ye+"` supplied to `"+pe+"`, expected an array."))}for(var pt=0;pt1?b("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):b("Invalid argument supplied to oneOf, expected an array."),N;function Z(he,Ue,pe,Be,ut){for(var We=he[Ue],Ye=0;Ye0?", expected one of type ["+pt.join(", ")+"]":"";return new $("Invalid "+We+" `"+Ye+"` supplied to "+("`"+ut+"`"+Ce+"."))}return ne(Ue)}function H(){function V(Z,he,Ue,pe,Be){return ve(Z[he])?null:new $("Invalid "+pe+" `"+Be+"` supplied to "+("`"+Ue+"`, expected a ReactNode."))}return ne(V)}function B(V,Z,he,Ue,pe){return new $((V||"React class")+": "+Z+" type `"+he+"."+Ue+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+pe+"`.")}function g(V){function Z(he,Ue,pe,Be,ut){var We=he[Ue],Ye=W(We);if(Ye!=="object")return new $("Invalid "+Be+" `"+ut+"` of type `"+Ye+"` "+("supplied to `"+pe+"`, expected `object`."));for(var pt in V){var ze=V[pt];if(typeof ze!="function")return B(pe,Be,ut,pt,oe(ze));var ye=ze(We,pt,pe,Be,ut+"."+pt,p);if(ye)return ye}return null}return ne(Z)}function O(V){function Z(he,Ue,pe,Be,ut){var We=he[Ue],Ye=W(We);if(Ye!=="object")return new $("Invalid "+Be+" `"+ut+"` of type `"+Ye+"` "+("supplied to `"+pe+"`, expected `object`."));var pt=c({},he[Ue],V);for(var ze in pt){var ye=V[ze];if(y(V,ze)&&typeof ye!="function")return B(pe,Be,ut,ze,oe(ye));if(!ye)return new $("Invalid "+Be+" `"+ut+"` key `"+ze+"` supplied to `"+pe+"`.\nBad object: "+JSON.stringify(he[Ue],null," ")+` -Valid keys: `+JSON.stringify(Object.keys(V),null," "));var De=ye(We,ze,pe,Be,ut+"."+ze,p);if(De)return De}return null}return ne(Z)}function ve(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(ve);if(V===null||x(V))return!0;var Z=z(V);if(Z){var he=Z.call(V),Ue;if(Z!==V.entries){for(;!(Ue=he.next()).done;)if(!ve(Ue.value))return!1}else for(;!(Ue=he.next()).done;){var pe=Ue.value;if(pe&&!ve(pe[1]))return!1}}else return!1;return!0;default:return!1}}function E(V,Z){return V==="symbol"?!0:Z?Z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Z instanceof Symbol:!1}function W(V){var Z=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":E(Z,V)?"symbol":Z}function oe(V){if(typeof V>"u"||V===null)return""+V;var Z=W(V);if(Z==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return Z}function J(V){var Z=oe(V);switch(Z){case"array":case"object":return"an "+Z;case"boolean":case"date":case"regexp":return"a "+Z;default:return Z}}function K(V){return!V.constructor||!V.constructor.name?T:V.constructor.name}return D.checkPropTypes=v,D.resetWarningCache=v.resetWarningCache,D.PropTypes=D,D}},"./node_modules/prop-types/index.js":(a,l,u)=>{{var f=u("./node_modules/react-is/index.js"),c=!0;a.exports=u("./node_modules/prop-types/factoryWithTypeCheckers.js")(f.isElement,c)}},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":a=>{var l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";a.exports=l},"./node_modules/prop-types/lib/has.js":a=>{a.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(a,l)=>{/** @license React v16.13.1 - * react-is.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(){var u=typeof Symbol=="function"&&Symbol.for,f=u?Symbol.for("react.element"):60103,c=u?Symbol.for("react.portal"):60106,p=u?Symbol.for("react.fragment"):60107,y=u?Symbol.for("react.strict_mode"):60108,v=u?Symbol.for("react.profiler"):60114,b=u?Symbol.for("react.provider"):60109,N=u?Symbol.for("react.context"):60110,x=u?Symbol.for("react.async_mode"):60111,A=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,F=u?Symbol.for("react.suspense"):60113,z=u?Symbol.for("react.suspense_list"):60120,T=u?Symbol.for("react.memo"):60115,D=u?Symbol.for("react.lazy"):60116,G=u?Symbol.for("react.block"):60121,$=u?Symbol.for("react.fundamental"):60117,ne=u?Symbol.for("react.responder"):60118,te=u?Symbol.for("react.scope"):60119;function de(ye){return typeof ye=="string"||typeof ye=="function"||ye===p||ye===A||ye===v||ye===y||ye===F||ye===z||typeof ye=="object"&&ye!==null&&(ye.$$typeof===D||ye.$$typeof===T||ye.$$typeof===b||ye.$$typeof===N||ye.$$typeof===C||ye.$$typeof===$||ye.$$typeof===ne||ye.$$typeof===te||ye.$$typeof===G)}function _(ye){if(typeof ye=="object"&&ye!==null){var De=ye.$$typeof;switch(De){case f:var Ce=ye.type;switch(Ce){case x:case A:case p:case v:case y:case F:return Ce;default:var tt=Ce&&Ce.$$typeof;switch(tt){case N:case C:case D:case T:case b:return tt;default:return De}}case c:return De}}}var h=x,m=A,S=N,M=b,R=f,U=C,H=p,B=D,g=T,O=c,ve=v,E=y,W=F,oe=!1;function J(ye){return oe||(oe=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),K(ye)||_(ye)===x}function K(ye){return _(ye)===A}function V(ye){return _(ye)===N}function Z(ye){return _(ye)===b}function he(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===f}function Ue(ye){return _(ye)===C}function pe(ye){return _(ye)===p}function Be(ye){return _(ye)===D}function ut(ye){return _(ye)===T}function We(ye){return _(ye)===c}function Ye(ye){return _(ye)===v}function pt(ye){return _(ye)===y}function ze(ye){return _(ye)===F}l.AsyncMode=h,l.ConcurrentMode=m,l.ContextConsumer=S,l.ContextProvider=M,l.Element=R,l.ForwardRef=U,l.Fragment=H,l.Lazy=B,l.Memo=g,l.Portal=O,l.Profiler=ve,l.StrictMode=E,l.Suspense=W,l.isAsyncMode=J,l.isConcurrentMode=K,l.isContextConsumer=V,l.isContextProvider=Z,l.isElement=he,l.isForwardRef=Ue,l.isFragment=pe,l.isLazy=Be,l.isMemo=ut,l.isPortal=We,l.isProfiler=Ye,l.isStrictMode=pt,l.isSuspense=ze,l.isValidElementType=de,l.typeOf=_})()},"./node_modules/react-is/index.js":(a,l,u)=>{a.exports=u("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(a,l,u)=>{u.r(l),u.d(l,{shallowEqualArrays:()=>c,shallowEqualObjects:()=>f});function f(p,y){if(p===y)return!0;if(!p||!y)return!1;var v=Object.keys(p),b=Object.keys(y),N=v.length;if(b.length!==N)return!1;for(var x=0;x{Object.defineProperty(l,"__esModule",{value:!0});var f=u("react"),c=(0,f.createContext)(void 0);l.default=c},"./src/index.ts":function(a,l,u){var f=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(l,"__esModule",{value:!0}),l.Context=l.toQuery=l.useMediaQuery=l.default=void 0;var c=f(u("./src/useMediaQuery.ts"));l.useMediaQuery=c.default;var p=f(u("./src/Component.ts"));l.default=p.default;var y=f(u("./src/toQuery.ts"));l.toQuery=y.default;var v=f(u("./src/Context.ts"));l.Context=v.default},"./src/mediaQuery.ts":function(a,l,u){var f=this&&this.__assign||function(){return f=Object.assign||function(F){for(var z,T=1,D=arguments.length;T{a.exports=r}},i={};function s(a){var l=i[a];if(l!==void 0)return l.exports;var u=i[a]={exports:{}};return n[a].call(u.exports,u,u.exports,s),u.exports}s.d=(a,l)=>{for(var u in l)s.o(l,u)&&!s.o(a,u)&&Object.defineProperty(a,u,{enumerable:!0,get:l[u]})},s.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),s.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var o=s("./src/index.ts");return o})())})(WS);var hL=WS.exports;const dL=({address:t,networkName:e})=>{const r=hL.useMediaQuery({query:"(min-width: 1000px)"}),{state:{explorerBaseUrl:n}}=T0(),i=()=>{n&&window.open($u.getAccountUrl(n,t),"_blank","noopener,noreferrer")};return Pe.jsxs("div",{className:xd.account,onClick:i,children:[Pe.jsx(cL,{size:r?60:30,address:t}),Pe.jsxs("p",{className:xd.accountDetails,children:[Pe.jsx("abbr",{title:t,className:xd.accountAddress,children:$u.truncateAddress(t)}),Pe.jsx("span",{className:xd.network,children:e})]})]})},pL=()=>Pe.jsxs("svg",{width:"75",height:"48",viewBox:"0 0 75 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pe.jsx("rect",{x:"0.5",y:"10",width:"74",height:"37",rx:"10.5",fill:"#6665D8",stroke:"#6665D8"}),Pe.jsx("path",{d:"M12.848 43.2C11.8667 41.8987 10.9707 40.4907 10.16 38.976C9.34933 37.44 8.70933 35.8187 8.24 34.112C7.77067 32.4053 7.536 30.6347 7.536 28.8C7.536 26.944 7.77067 25.1733 8.24 23.488C8.70933 21.7813 9.34933 20.1707 10.16 18.656C10.9707 17.12 11.8667 15.7013 12.848 14.4H17.008C16.0267 15.7653 15.1307 17.2267 14.32 18.784C13.5093 20.3413 12.8693 21.9627 12.4 23.648C11.9307 25.312 11.696 27.0293 11.696 28.8C11.696 30.5493 11.9307 32.2667 12.4 33.952C12.8693 35.6373 13.5093 37.2587 14.32 38.816C15.1307 40.352 16.0267 41.8133 17.008 43.2H12.848ZM61.7198 43.2H57.5598C58.5624 41.8133 59.4584 40.352 60.2478 38.816C61.0584 37.2587 61.6984 35.6373 62.1678 33.952C62.6371 32.2667 62.8718 30.5493 62.8718 28.8C62.8718 27.0293 62.6371 25.312 62.1678 23.648C61.6984 21.9627 61.0584 20.3413 60.2478 18.784C59.4584 17.2267 58.5624 15.7653 57.5598 14.4H61.7198C62.7224 15.7013 63.6184 17.12 64.4078 18.656C65.2184 20.1707 65.8584 21.7813 66.3278 23.488C66.7971 25.1733 67.0318 26.944 67.0318 28.8C67.0318 30.6347 66.7971 32.4053 66.3278 34.112C65.8584 35.8187 65.2184 37.44 64.4078 38.976C63.6184 40.4907 62.7224 41.8987 61.7198 43.2Z",fill:"white"}),Pe.jsx("path",{d:"M31.384 38L31.128 35.056V22H35.352V38H31.384ZM20.536 31.152V22H24.76V30.192L20.536 31.152ZM24.76 30.192C24.76 31.2587 24.8773 32.1013 25.112 32.72C25.368 33.3173 25.72 33.7547 26.168 34.032C26.6373 34.288 27.16 34.416 27.736 34.416C28.8453 34.4373 29.688 34.1067 30.264 33.424C30.84 32.72 31.128 31.7067 31.128 30.384H32.568C32.568 32.0907 32.312 33.5413 31.8 34.736C31.3093 35.9093 30.6053 36.816 29.688 37.456C28.792 38.0747 27.736 38.384 26.52 38.384C24.6 38.384 23.1173 37.7973 22.072 36.624C21.048 35.4293 20.536 33.6053 20.536 31.152L24.76 30.192ZM39.0115 38V22H42.9795L43.2355 24.944V38H39.0115ZM49.6035 38V29.808L53.8275 28.848V38H49.6035ZM49.6035 29.808C49.6035 28.72 49.4755 27.8773 49.2195 27.28C48.9848 26.6827 48.6435 26.256 48.1955 26C47.7475 25.7227 47.2248 25.584 46.6275 25.584C45.5395 25.5627 44.6968 25.8933 44.0995 26.576C43.5235 27.2587 43.2355 28.272 43.2355 29.616H41.8275C41.8275 27.9093 42.0728 26.4693 42.5635 25.296C43.0755 24.1013 43.7795 23.1947 44.6755 22.576C45.5715 21.936 46.6275 21.616 47.8435 21.616C49.7848 21.616 51.2675 22.2133 52.2915 23.408C53.3368 24.5813 53.8488 26.3947 53.8275 28.848L49.6035 29.808Z",fill:"white"})]}),gL=()=>{const{state:{isConnected:t,account:e,networkName:r}}=T0(),{pathname:n}=R1(),i=T1();return we.useEffect(()=>{n.startsWith("/tx")||(!t&&n!=="/"?i("/"):t&&n==="/"&&i("/wrapper"))},[t,n,i]),Pe.jsxs("main",{className:Vw.layout,children:[t&&e&&Pe.jsx(dL,{address:e,networkName:r??""}),Pe.jsxs("h2",{className:Vw.header,children:["ROSE ",Pe.jsx(pL,{})," wrapper"]}),Pe.jsx(Bk,{})]})},mL="_subHeader_au1gt_1",yL="_amountPercList_au1gt_8",xL="_testTokensBtn_au1gt_15",Em={subHeader:mL,amountPercList:yL,testTokensBtn:xL},vL="_button_i479a_1",wL="_buttonPrimary_i479a_18",bL="_buttonSecondary_i479a_23",AL="_buttonTertiary_i479a_28",EL="_buttonDisabled_i479a_39",SL="_fullWidth_i479a_46",Ku={button:vL,buttonPrimary:wL,buttonSecondary:bL,buttonTertiary:AL,buttonDisabled:EL,fullWidth:SL},FL={primary:Ku.buttonPrimary,secondary:Ku.buttonSecondary,tertiary:Ku.buttonTertiary},Na=({className:t,children:e,disabled:r,variant:n="primary",fullWidth:i,onClick:s,type:o})=>Pe.jsx("button",{className:[t,Ku.button,...r?[Ku.buttonDisabled]:[],...i?[Ku.fullWidth]:[],FL[n]].join(" "),onClick:s,disabled:r,type:o,children:e}),CL="_inputGroup_9s8on_1",kL={inputGroup:CL},FA=({type:t,label:e,pattern:r,placeholder:n,id:i,disabled:s,inputMode:o,value:a,valueChange:l})=>{const u=we.useId(),f=i||u;return Pe.jsxs("div",{className:kL.inputGroup,children:[Pe.jsx("label",{htmlFor:f,children:e}),Pe.jsx("input",{id:f,type:t,inputMode:o,autoComplete:"off",autoCorrect:"off",pattern:r,placeholder:n,disabled:s,value:a,onChange:({target:{value:c}})=>l(c)})]})},_L="_wrapForm_ik4r8_1",PL="_wrapFormInputs_ik4r8_7",NL="_toggleBtn_ik4r8_14",RL="_gasEstimateLabel_ik4r8_21",vd={wrapForm:_L,wrapFormInputs:PL,toggleBtn:NL,gasEstimateLabel:RL};var Co=(t=>(t.WRAP="wrap",t.UNWRAP="unwrap",t))(Co||{});const TL={isLoading:!1,amount:null,formType:"unwrap",balance:Ee.from(0),wRoseBalance:Ee.from(0)},YS=we.createContext({}),IL=({children:t})=>{const{state:{isConnected:e},getBalance:r,getBalanceOfWROSE:n,wrap:i,unwrap:s}=T0(),[o,a]=we.useState({...TL}),l=b=>{a(N=>({...N,isLoading:b}))},u=async()=>{if(!e)return;l(!0);const[b,N]=await Promise.all([r(),n()]);a(x=>({...x,balance:b,wRoseBalance:N,isLoading:!1}))},f=async b=>{try{const N=Ee.from(b),x=N.lte(0)?Ee.from(0):N;a(A=>({...A,amount:x}))}catch(N){console.error(N)}},c=()=>jc("0.01","ether"),v={state:o,init:u,getFeeAmount:c,setAmount:f,toggleFormType:b=>{const{balance:N,wRoseBalance:x,formType:A}=o,C=A==="wrap"?"unwrap":"wrap";let F=b;C==="wrap"&&(b!=null&&b.gt(N))?F=N.sub(c()):C==="unwrap"&&(b!=null&&b.gt(x))&&(F=x),a(({...z})=>({...z,formType:C,amount:F}))},submit:async b=>{if(!b||b.lte(0))return Promise.reject(new Error("Amount is required"));l(!0);const{formType:N,balance:x,wRoseBalance:A}=o;let C=null;if(N==="wrap"){if(b.gt(x.sub(c())))return l(!1),Promise.reject(new Error("Insufficient balance"));try{C=await i(b.toString())}catch(F){throw l(!1),F}}else if(N==="unwrap"){if(b.gt(A))return l(!1),Promise.reject(new Error("Insufficient balance"));try{C=await s(b.toString())}catch(F){throw l(!1),F}}else return l(!1),Promise.reject(new Error("[formType] Invalid form type"));return l(!1),C}};return Pe.jsx(YS.Provider,{value:v,children:t})},qS=()=>{const t=we.useContext(YS);if(t===void 0)throw new Error("[useWrapForm] Component not wrapped within a Provider");return t},ML="_alert_166l2_1",BL="_alertDanger_166l2_12",OL="_alertWarn_166l2_16",UL="_alertInfo_166l2_20",Zd={alert:ML,alertDanger:BL,alertWarn:OL,alertInfo:UL},DL={danger:Zd.alertDanger,warn:Zd.alertWarn,info:Zd.alertInfo},b2=({children:t,variant:e="info"})=>Pe.jsx("p",{className:[Zd.alert,DL[e]].join(" "),children:t}),LL="_toggleButton_a8oi0_1",zL={toggleButton:LL},jL=()=>Pe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Pe.jsx("g",{clipPath:"url(#clip0_418_8629)",children:Pe.jsx("path",{d:"M19 8L15 12H18C18 15.31 15.31 18 12 18C10.99 18 10.03 17.75 9.2 17.3L7.74 18.76C8.97 19.54 10.43 20 12 20C16.42 20 20 16.42 20 12H23L19 8ZM6 12C6 8.69 8.69 6 12 6C13.01 6 13.97 6.25 14.8 6.7L16.26 5.24C15.03 4.46 13.57 4 12 4C7.58 4 4 7.58 4 12H1L5 16L9 12H6Z",fill:"white"})}),Pe.jsx("defs",{children:Pe.jsx("clipPath",{id:"clip0_418_8629",children:Pe.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),HL=({className:t,disabled:e,onClick:r})=>Pe.jsx("button",{className:[t,zL.toggleButton].join(" "),onClick:r,disabled:e,children:Pe.jsx(jL,{})}),CA="^[0-9]*[.,]?[0-9]*$",GL={[Co.WRAP]:{firstInputLabel:"ROSE",secondInputLabel:"wROSE",submitBtnLabel:"Wrap tokens"},[Co.UNWRAP]:{firstInputLabel:"wROSE",secondInputLabel:"ROSE",submitBtnLabel:"Unwrap tokens"}},VL=()=>{const t=T1(),{state:{formType:e,amount:r,isLoading:n,balance:i},toggleFormType:s,submit:o,getFeeAmount:a}=qS(),{firstInputLabel:l,secondInputLabel:u,submitBtnLabel:f}=GL[e],[c,p]=we.useState(""),[y,v]=we.useState("");we.useEffect(()=>{v("");const F=r?AR(r):"";p(F)},[p,r]);const b=F=>{p(F)},N=F=>{F.preventDefault(),F.stopPropagation(),s(c?jc(c,"ether"):null)},x=async F=>{v(""),F.preventDefault();try{const z=jc(c||"0","ether"),T=await o(z);t(`/tx/${T}?amount=${c}&action=${e}`)}catch(z){v((z==null?void 0:z.message)||JSON.stringify(z))}},A=e===Co.WRAP&&c?jc(c||"0","ether"):null,C=A&&A.gt(0)?jc(c,"ether").eq(i.sub(a())):!1;return Pe.jsx("div",{children:Pe.jsxs("form",{className:vd.wrapForm,onSubmit:x,children:[Pe.jsxs("div",{className:vd.wrapFormInputs,children:[Pe.jsx(FA,{disabled:n,type:"text",label:l,pattern:CA,placeholder:"0",inputMode:"decimal",value:c,valueChange:b}),Pe.jsx(FA,{disabled:n,type:"text",label:u,pattern:CA,placeholder:"0",inputMode:"decimal",value:c,valueChange:b}),Pe.jsx(HL,{className:vd.toggleBtn,onClick:N,disabled:n})]}),Pe.jsx("h4",{className:vd.gasEstimateLabel,children:"Estimated fee: <0.01 ROSE (~10 sec)"}),Pe.jsx(Na,{disabled:n,type:"submit",fullWidth:!0,children:f}),y&&Pe.jsx(b2,{variant:"danger",children:y}),C&&Pe.jsx(b2,{variant:"warn",children:"You will not be able to pay for gas in subsequent transactions if you convert all your ROSE into WROSE, are you sure?"})]})})},QL=[{label:"10%",value:Ee.from(10)},{label:"25%",value:Ee.from(25)},{label:"50%",value:Ee.from(50)},{label:"Max",value:Ee.from(100)}],$L=()=>{const{state:{isLoading:t,balance:e,wRoseBalance:r,formType:n},init:i,setAmount:s,getFeeAmount:o}=qS();we.useEffect(()=>{i()},[]);const a=u=>{if(n===Co.WRAP)if(u.eq(100)){const f=Xd.getPercentageAmount(e,u),c=o();s(f.sub(c))}else s(Xd.getPercentageAmount(e,u));else if(n===Co.UNWRAP)s(Xd.getPercentageAmount(r,u));else throw new Error("[formType] Invalid form type")},l=()=>{window.open(JU,"_blank","noopener,noreferrer")};return Pe.jsxs("div",{children:[Pe.jsxs("div",{className:Em.subHeader,children:[Pe.jsx("p",{children:"Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool."}),Pe.jsx(Na,{className:Em.testTokensBtn,onClick:l,children:"Request test tokens"})]}),Pe.jsx("div",{className:Em.amountPercList,children:QL.map(({label:u,value:f})=>Pe.jsx(Na,{disabled:t,onClick:()=>a(f),variant:"tertiary",children:u},u))}),Pe.jsx(VL,{})]})},KL="_subHeader_hb77m_1",JL="_haveAccount_hb77m_5",WL="_installMetaMaskBtn_hb77m_10",kA={subHeader:KL,haveAccount:JL,installMetaMaskBtn:WL},YL=()=>{const{connectWallet:t}=T0(),[e,r]=we.useState(!1),[n,i]=we.useState(""),[s,o]=we.useState(!1),a=async l=>{r(!0);try{let u;l===1?u=await aD():u=await lD(),await t(u)}catch(u){u instanceof MS?o(!0):i((u==null?void 0:u.message)||JSON.stringify(u))}finally{r(!1)}};return Pe.jsx(Pe.Fragment,{children:!s&&Pe.jsxs("div",{children:[Pe.jsxs("p",{className:kA.subHeader,children:["Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool.",Pe.jsx("br",{}),"Please connect with your AUTHZN account to get started."]}),Pe.jsx(Na,{onClick:()=>a(0),disabled:e,fullWidth:!0,children:"Login"}),Pe.jsx("p",{className:kA.haveAccount,children:"Not signed up yet?"}),Pe.jsx(Na,{variant:"secondary",onClick:()=>a(1),disabled:e,fullWidth:!0,children:"Register"}),n&&Pe.jsx(b2,{variant:"danger",children:n})]})})},qL=()=>Pe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Pe.jsx("g",{clipPath:"url(#clip0_429_3299)",children:Pe.jsx("path",{d:"M19 19H5V5H12V3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V12H19V19ZM14 3V5H17.59L7.76 14.83L9.17 16.24L19 6.41V10H21V3H14Z",fill:"white"})}),Pe.jsx("defs",{children:Pe.jsx("clipPath",{id:"clip0_429_3299",children:Pe.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),XL="_openInExplorerBtn_176pg_1",ZL="_spinnerContainer_176pg_10",ez="_subHeader_176pg_15",tz="_h100_176pg_20",Va={openInExplorerBtn:XL,spinnerContainer:ZL,subHeader:ez,h100:tz},rz="_spinner_1b22l_10",nz="_spin_1b22l_10",iz={spinner:rz,spin:nz},sz=({className:t})=>Pe.jsx("div",{className:[iz.spinner,t].join(" ")}),oz=()=>{const t=T1(),{txHash:e}=Ek(),[r]=Wk(),n=r.get("amount")??null,i=r.get("action")??Co.WRAP,{state:{explorerBaseUrl:s},getTransaction:o}=T0(),[a,l]=we.useState(0),[u,f]=we.useState(null);we.useEffect(()=>{(async()=>{e||t("/");try{(await o(e)).value.gt(0)?f(1):f(0),l(1)}catch{l(2)}})()},[o,t,e]);const c=()=>{if(s&&e){const y=$u.getTransactionUrl(s,e);window.open(y,"_blank","noopener,noreferrer")}},p=()=>{t("/wrapper")};return Pe.jsxs(Pe.Fragment,{children:[a===0&&Pe.jsxs("div",{children:[Pe.jsx("div",{className:Va.spinnerContainer,children:Pe.jsx(sz,{})}),Pe.jsxs("h3",{className:Va.subHeader,children:[i===Co.WRAP&&Pe.jsx(Pe.Fragment,{children:"Wrapping"}),i===Co.UNWRAP&&Pe.jsx(Pe.Fragment,{children:"Unwrapping"})," your tokens"]})]}),a===1&&Pe.jsxs("div",{children:[Pe.jsx("p",{className:Va.h100,children:"🎉"}),Pe.jsxs("h3",{className:Va.subHeader,children:["Congrats!",Pe.jsx("br",{}),"You received",u===1&&Pe.jsxs("b",{children:[" ",n," WROSE"]}),u===0&&Pe.jsxs("b",{children:[" ",n," ROSE"]})]}),s&&e&&Pe.jsxs(Na,{className:Va.openInExplorerBtn,onClick:c,fullWidth:!0,children:["View on explorer",Pe.jsx(qL,{})]}),Pe.jsx(Na,{variant:"secondary",onClick:p,fullWidth:!0,children:"Close"})]}),a===2&&Pe.jsxs("div",{children:[Pe.jsx("p",{className:Va.h100,children:"❕"}),Pe.jsxs("h3",{className:Va.subHeader,children:["There was an unexpected error.",Pe.jsx("br",{}),"Please try again."]}),Pe.jsx(Na,{onClick:p,fullWidth:!0,children:"Retry"})]})]})},az=Lk([{path:"/",element:Pe.jsx(gL,{}),children:[{path:"",element:Pe.jsx(YL,{})},{path:"wrapper",element:Pe.jsx(IL,{children:Pe.jsx($L,{})})},{path:"tx/:txHash",element:Pe.jsx(oz,{})}]}]),lz=()=>Pe.jsx(fD,{children:Pe.jsx(dD,{children:Pe.jsx(Kk,{router:az})})});j5(document.getElementById("root")).render(Pe.jsx(lz,{})); + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA512_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=f1:s&&(i=self);var a=!i.JS_SHA512_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],c=[24,16,8,0],p=[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],y=["hex","array","digest","arrayBuffer"],v=[];(i.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),l&&(i.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(T){return typeof T=="object"&&T.buffer&&T.buffer.constructor===ArrayBuffer});var b=function(T,z){return function(H){return new C(z,!0).update(H)[T]()}},N=function(T){var z=b("hex",T);z.create=function(){return new C(T)},z.update=function(ne){return z.create().update(ne)};for(var H=0;H>2]|=T[ne]<>2]|=K<>2]|=(192|K>>6)<>2]|=(128|K&63)<=57344?(_[te>>2]|=(224|K>>12)<>2]|=(128|K>>6&63)<>2]|=(128|K&63)<>2]|=(240|K>>18)<>2]|=(128|K>>12&63)<>2]|=(128|K>>6&63)<>2]|=(128|K&63)<=128?(this.block=_[32],this.start=te-128,this.hash(),this.hashed=!0):this.start=te}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var T=this.blocks,z=this.lastByteIndex;T[32]=this.block,T[z>>2]|=f[z&3],this.block=T[32],z>=112&&(this.hashed||this.hash(),T[0]=this.block,T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=T[16]=T[17]=T[18]=T[19]=T[20]=T[21]=T[22]=T[23]=T[24]=T[25]=T[26]=T[27]=T[28]=T[29]=T[30]=T[31]=T[32]=0),T[30]=this.hBytes<<3|this.bytes>>>29,T[31]=this.bytes<<3,this.hash()}},C.prototype.hash=function(){var T=this.h0h,z=this.h0l,H=this.h1h,K=this.h1l,ne=this.h2h,te=this.h2l,de=this.h3h,_=this.h3l,h=this.h4h,m=this.h4l,S=this.h5h,M=this.h5l,R=this.h6h,U=this.h6l,G=this.h7h,B=this.h7l,g=this.blocks,O,ve,E,J,oe,W,$,V,Z,he,Ue,pe,Be,ut,Je,Ye,pt,ze,ye,De,Ce,tt,Dt,yt,Ct;for(O=32;O<160;O+=2)De=g[O-30],Ce=g[O-29],ve=(De>>>1|Ce<<31)^(De>>>8|Ce<<24)^De>>>7,E=(Ce>>>1|De<<31)^(Ce>>>8|De<<24)^(Ce>>>7|De<<25),De=g[O-4],Ce=g[O-3],J=(De>>>19|Ce<<13)^(Ce>>>29|De<<3)^De>>>6,oe=(Ce>>>19|De<<13)^(De>>>29|Ce<<3)^(Ce>>>6|De<<26),De=g[O-32],Ce=g[O-31],tt=g[O-14],Dt=g[O-13],W=(Dt&65535)+(Ce&65535)+(E&65535)+(oe&65535),$=(Dt>>>16)+(Ce>>>16)+(E>>>16)+(oe>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+(ve&65535)+(J&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(ve>>>16)+(J>>>16)+(V>>>16),g[O]=Z<<16|V&65535,g[O+1]=$<<16|W&65535;var fr=T,Tt=z,It=H,Jt=K,Et=ne,kt=te,Kt=de,xt=_,vt=h,ir=m,St=S,_t=M,q=R,re=U,ae=G,ke=B;for(Ye=It&Et,pt=Jt&kt,O=0;O<160;O+=8)ve=(fr>>>28|Tt<<4)^(Tt>>>2|fr<<30)^(Tt>>>7|fr<<25),E=(Tt>>>28|fr<<4)^(fr>>>2|Tt<<30)^(fr>>>7|Tt<<25),J=(vt>>>14|ir<<18)^(vt>>>18|ir<<14)^(ir>>>9|vt<<23),oe=(ir>>>14|vt<<18)^(ir>>>18|vt<<14)^(vt>>>9|ir<<23),he=fr&It,Ue=Tt&Jt,ze=he^fr&Et^Ye,ye=Ue^Tt&kt^pt,yt=vt&St^~vt&q,Ct=ir&_t^~ir&re,De=g[O],Ce=g[O+1],tt=p[O],Dt=p[O+1],W=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(ke&65535),$=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(ke>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(J&65535)+(ae&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(J>>>16)+(ae>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=$<<16|W&65535,W=(ye&65535)+(E&65535),$=(ye>>>16)+(E>>>16)+(W>>>16),V=(ze&65535)+(ve&65535)+($>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=$<<16|W&65535,W=(xt&65535)+(Ce&65535),$=(xt>>>16)+(Ce>>>16)+(W>>>16),V=(Kt&65535)+(De&65535)+($>>>16),Z=(Kt>>>16)+(De>>>16)+(V>>>16),ae=Z<<16|V&65535,ke=$<<16|W&65535,W=(Dt&65535)+(Ce&65535),$=(Dt>>>16)+(Ce>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),Kt=Z<<16|V&65535,xt=$<<16|W&65535,ve=(Kt>>>28|xt<<4)^(xt>>>2|Kt<<30)^(xt>>>7|Kt<<25),E=(xt>>>28|Kt<<4)^(Kt>>>2|xt<<30)^(Kt>>>7|xt<<25),J=(ae>>>14|ke<<18)^(ae>>>18|ke<<14)^(ke>>>9|ae<<23),oe=(ke>>>14|ae<<18)^(ke>>>18|ae<<14)^(ae>>>9|ke<<23),pe=Kt&fr,Be=xt&Tt,ze=pe^Kt&It^he,ye=Be^xt&Jt^Ue,yt=ae&vt^~ae&St,Ct=ke&ir^~ke&_t,De=g[O+2],Ce=g[O+3],tt=p[O+2],Dt=p[O+3],W=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(re&65535),$=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(re>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(J&65535)+(q&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(J>>>16)+(q>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=$<<16|W&65535,W=(ye&65535)+(E&65535),$=(ye>>>16)+(E>>>16)+(W>>>16),V=(ze&65535)+(ve&65535)+($>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=$<<16|W&65535,W=(kt&65535)+(Ce&65535),$=(kt>>>16)+(Ce>>>16)+(W>>>16),V=(Et&65535)+(De&65535)+($>>>16),Z=(Et>>>16)+(De>>>16)+(V>>>16),q=Z<<16|V&65535,re=$<<16|W&65535,W=(Dt&65535)+(Ce&65535),$=(Dt>>>16)+(Ce>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),Et=Z<<16|V&65535,kt=$<<16|W&65535,ve=(Et>>>28|kt<<4)^(kt>>>2|Et<<30)^(kt>>>7|Et<<25),E=(kt>>>28|Et<<4)^(Et>>>2|kt<<30)^(Et>>>7|kt<<25),J=(q>>>14|re<<18)^(q>>>18|re<<14)^(re>>>9|q<<23),oe=(re>>>14|q<<18)^(re>>>18|q<<14)^(q>>>9|re<<23),ut=Et&Kt,Je=kt&xt,ze=ut^Et&fr^pe,ye=Je^kt&Tt^Be,yt=q&ae^~q&vt,Ct=re&ke^~re&ir,De=g[O+4],Ce=g[O+5],tt=p[O+4],Dt=p[O+5],W=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(_t&65535),$=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(_t>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(J&65535)+(St&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(J>>>16)+(St>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=$<<16|W&65535,W=(ye&65535)+(E&65535),$=(ye>>>16)+(E>>>16)+(W>>>16),V=(ze&65535)+(ve&65535)+($>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=$<<16|W&65535,W=(Jt&65535)+(Ce&65535),$=(Jt>>>16)+(Ce>>>16)+(W>>>16),V=(It&65535)+(De&65535)+($>>>16),Z=(It>>>16)+(De>>>16)+(V>>>16),St=Z<<16|V&65535,_t=$<<16|W&65535,W=(Dt&65535)+(Ce&65535),$=(Dt>>>16)+(Ce>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),It=Z<<16|V&65535,Jt=$<<16|W&65535,ve=(It>>>28|Jt<<4)^(Jt>>>2|It<<30)^(Jt>>>7|It<<25),E=(Jt>>>28|It<<4)^(It>>>2|Jt<<30)^(It>>>7|Jt<<25),J=(St>>>14|_t<<18)^(St>>>18|_t<<14)^(_t>>>9|St<<23),oe=(_t>>>14|St<<18)^(_t>>>18|St<<14)^(St>>>9|_t<<23),Ye=It&Et,pt=Jt&kt,ze=Ye^It&Kt^ut,ye=pt^Jt&xt^Je,yt=St&q^~St&ae,Ct=_t&re^~_t&ke,De=g[O+6],Ce=g[O+7],tt=p[O+6],Dt=p[O+7],W=(Dt&65535)+(Ce&65535)+(Ct&65535)+(oe&65535)+(ir&65535),$=(Dt>>>16)+(Ce>>>16)+(Ct>>>16)+(oe>>>16)+(ir>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+(yt&65535)+(J&65535)+(vt&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(yt>>>16)+(J>>>16)+(vt>>>16)+(V>>>16),De=Z<<16|V&65535,Ce=$<<16|W&65535,W=(ye&65535)+(E&65535),$=(ye>>>16)+(E>>>16)+(W>>>16),V=(ze&65535)+(ve&65535)+($>>>16),Z=(ze>>>16)+(ve>>>16)+(V>>>16),tt=Z<<16|V&65535,Dt=$<<16|W&65535,W=(Tt&65535)+(Ce&65535),$=(Tt>>>16)+(Ce>>>16)+(W>>>16),V=(fr&65535)+(De&65535)+($>>>16),Z=(fr>>>16)+(De>>>16)+(V>>>16),vt=Z<<16|V&65535,ir=$<<16|W&65535,W=(Dt&65535)+(Ce&65535),$=(Dt>>>16)+(Ce>>>16)+(W>>>16),V=(tt&65535)+(De&65535)+($>>>16),Z=(tt>>>16)+(De>>>16)+(V>>>16),fr=Z<<16|V&65535,Tt=$<<16|W&65535;W=(z&65535)+(Tt&65535),$=(z>>>16)+(Tt>>>16)+(W>>>16),V=(T&65535)+(fr&65535)+($>>>16),Z=(T>>>16)+(fr>>>16)+(V>>>16),this.h0h=Z<<16|V&65535,this.h0l=$<<16|W&65535,W=(K&65535)+(Jt&65535),$=(K>>>16)+(Jt>>>16)+(W>>>16),V=(H&65535)+(It&65535)+($>>>16),Z=(H>>>16)+(It>>>16)+(V>>>16),this.h1h=Z<<16|V&65535,this.h1l=$<<16|W&65535,W=(te&65535)+(kt&65535),$=(te>>>16)+(kt>>>16)+(W>>>16),V=(ne&65535)+(Et&65535)+($>>>16),Z=(ne>>>16)+(Et>>>16)+(V>>>16),this.h2h=Z<<16|V&65535,this.h2l=$<<16|W&65535,W=(_&65535)+(xt&65535),$=(_>>>16)+(xt>>>16)+(W>>>16),V=(de&65535)+(Kt&65535)+($>>>16),Z=(de>>>16)+(Kt>>>16)+(V>>>16),this.h3h=Z<<16|V&65535,this.h3l=$<<16|W&65535,W=(m&65535)+(ir&65535),$=(m>>>16)+(ir>>>16)+(W>>>16),V=(h&65535)+(vt&65535)+($>>>16),Z=(h>>>16)+(vt>>>16)+(V>>>16),this.h4h=Z<<16|V&65535,this.h4l=$<<16|W&65535,W=(M&65535)+(_t&65535),$=(M>>>16)+(_t>>>16)+(W>>>16),V=(S&65535)+(St&65535)+($>>>16),Z=(S>>>16)+(St>>>16)+(V>>>16),this.h5h=Z<<16|V&65535,this.h5l=$<<16|W&65535,W=(U&65535)+(re&65535),$=(U>>>16)+(re>>>16)+(W>>>16),V=(R&65535)+(q&65535)+($>>>16),Z=(R>>>16)+(q>>>16)+(V>>>16),this.h6h=Z<<16|V&65535,this.h6l=$<<16|W&65535,W=(B&65535)+(ke&65535),$=(B>>>16)+(ke>>>16)+(W>>>16),V=(G&65535)+(ae&65535)+($>>>16),Z=(G>>>16)+(ae>>>16)+(V>>>16),this.h7h=Z<<16|V&65535,this.h7l=$<<16|W&65535},C.prototype.hex=function(){this.finalize();var T=this.h0h,z=this.h0l,H=this.h1h,K=this.h1l,ne=this.h2h,te=this.h2l,de=this.h3h,_=this.h3l,h=this.h4h,m=this.h4l,S=this.h5h,M=this.h5l,R=this.h6h,U=this.h6l,G=this.h7h,B=this.h7l,g=this.bits,O=u[T>>28&15]+u[T>>24&15]+u[T>>20&15]+u[T>>16&15]+u[T>>12&15]+u[T>>8&15]+u[T>>4&15]+u[T&15]+u[z>>28&15]+u[z>>24&15]+u[z>>20&15]+u[z>>16&15]+u[z>>12&15]+u[z>>8&15]+u[z>>4&15]+u[z&15]+u[H>>28&15]+u[H>>24&15]+u[H>>20&15]+u[H>>16&15]+u[H>>12&15]+u[H>>8&15]+u[H>>4&15]+u[H&15]+u[K>>28&15]+u[K>>24&15]+u[K>>20&15]+u[K>>16&15]+u[K>>12&15]+u[K>>8&15]+u[K>>4&15]+u[K&15]+u[ne>>28&15]+u[ne>>24&15]+u[ne>>20&15]+u[ne>>16&15]+u[ne>>12&15]+u[ne>>8&15]+u[ne>>4&15]+u[ne&15]+u[te>>28&15]+u[te>>24&15]+u[te>>20&15]+u[te>>16&15]+u[te>>12&15]+u[te>>8&15]+u[te>>4&15]+u[te&15]+u[de>>28&15]+u[de>>24&15]+u[de>>20&15]+u[de>>16&15]+u[de>>12&15]+u[de>>8&15]+u[de>>4&15]+u[de&15];return g>=256&&(O+=u[_>>28&15]+u[_>>24&15]+u[_>>20&15]+u[_>>16&15]+u[_>>12&15]+u[_>>8&15]+u[_>>4&15]+u[_&15]),g>=384&&(O+=u[h>>28&15]+u[h>>24&15]+u[h>>20&15]+u[h>>16&15]+u[h>>12&15]+u[h>>8&15]+u[h>>4&15]+u[h&15]+u[m>>28&15]+u[m>>24&15]+u[m>>20&15]+u[m>>16&15]+u[m>>12&15]+u[m>>8&15]+u[m>>4&15]+u[m&15]+u[S>>28&15]+u[S>>24&15]+u[S>>20&15]+u[S>>16&15]+u[S>>12&15]+u[S>>8&15]+u[S>>4&15]+u[S&15]+u[M>>28&15]+u[M>>24&15]+u[M>>20&15]+u[M>>16&15]+u[M>>12&15]+u[M>>8&15]+u[M>>4&15]+u[M&15]),g==512&&(O+=u[R>>28&15]+u[R>>24&15]+u[R>>20&15]+u[R>>16&15]+u[R>>12&15]+u[R>>8&15]+u[R>>4&15]+u[R&15]+u[U>>28&15]+u[U>>24&15]+u[U>>20&15]+u[U>>16&15]+u[U>>12&15]+u[U>>8&15]+u[U>>4&15]+u[U&15]+u[G>>28&15]+u[G>>24&15]+u[G>>20&15]+u[G>>16&15]+u[G>>12&15]+u[G>>8&15]+u[G>>4&15]+u[G&15]+u[B>>28&15]+u[B>>24&15]+u[B>>20&15]+u[B>>16&15]+u[B>>12&15]+u[B>>8&15]+u[B>>4&15]+u[B&15]),O},C.prototype.toString=C.prototype.hex,C.prototype.digest=function(){this.finalize();var T=this.h0h,z=this.h0l,H=this.h1h,K=this.h1l,ne=this.h2h,te=this.h2l,de=this.h3h,_=this.h3l,h=this.h4h,m=this.h4l,S=this.h5h,M=this.h5l,R=this.h6h,U=this.h6l,G=this.h7h,B=this.h7l,g=this.bits,O=[T>>24&255,T>>16&255,T>>8&255,T&255,z>>24&255,z>>16&255,z>>8&255,z&255,H>>24&255,H>>16&255,H>>8&255,H&255,K>>24&255,K>>16&255,K>>8&255,K&255,ne>>24&255,ne>>16&255,ne>>8&255,ne&255,te>>24&255,te>>16&255,te>>8&255,te&255,de>>24&255,de>>16&255,de>>8&255,de&255];return g>=256&&O.push(_>>24&255,_>>16&255,_>>8&255,_&255),g>=384&&O.push(h>>24&255,h>>16&255,h>>8&255,h&255,m>>24&255,m>>16&255,m>>8&255,m&255,S>>24&255,S>>16&255,S>>8&255,S&255,M>>24&255,M>>16&255,M>>8&255,M&255),g==512&&O.push(R>>24&255,R>>16&255,R>>8&255,R&255,U>>24&255,U>>16&255,U>>8&255,U&255,G>>24&255,G>>16&255,G>>8&255,G&255,B>>24&255,B>>16&255,B>>8&255,B&255),O},C.prototype.array=C.prototype.digest,C.prototype.arrayBuffer=function(){this.finalize();var T=this.bits,z=new ArrayBuffer(T/8),H=new DataView(z);return H.setUint32(0,this.h0h),H.setUint32(4,this.h0l),H.setUint32(8,this.h1h),H.setUint32(12,this.h1l),H.setUint32(16,this.h2h),H.setUint32(20,this.h2l),H.setUint32(24,this.h3h),T>=256&&H.setUint32(28,this.h3l),T>=384&&(H.setUint32(32,this.h4h),H.setUint32(36,this.h4l),H.setUint32(40,this.h5h),H.setUint32(44,this.h5l)),T==512&&(H.setUint32(48,this.h6h),H.setUint32(52,this.h6l),H.setUint32(56,this.h7h),H.setUint32(60,this.h7l)),z},C.prototype.clone=function(){var T=new C(this.bits,!1);return this.copyTo(T),T},C.prototype.copyTo=function(T){var z=0,H=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(z=0;z>6,de[_++]=128|h&63):h<55296||h>=57344?(de[_++]=224|h>>12,de[_++]=128|h>>6&63,de[_++]=128|h&63):(h=65536+((h&1023)<<10|T.charCodeAt(++m)&1023),de[_++]=240|h>>18,de[_++]=128|h>>12&63,de[_++]=128|h>>6&63,de[_++]=128|h&63);T=de}T.length>128&&(T=new C(z,!0).update(T).array());for(var S=[],M=[],m=0;m<128;++m){var R=T[m]||0;S[m]=92^R,M[m]=54^R}C.call(this,z,H),this.update(M),this.oKeyPad=S,this.inner=!0,this.sharedMemory=H}F.prototype=new C,F.prototype.finalize=function(){if(C.prototype.finalize.call(this),this.inner){this.inner=!1;var T=this.array();C.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(T),C.prototype.finalize.call(this)}},F.prototype.clone=function(){var T=new F([],this.bits,!1);this.copyTo(T),T.inner=this.inner;for(var z=0;z>24&255,w[k+1]=P>>16&255,w[k+2]=P>>8&255,w[k+3]=P&255,w[k+4]=d>>24&255,w[k+5]=d>>16&255,w[k+6]=d>>8&255,w[k+7]=d&255}function b(w,k,P,d,I){var X,Y=0;for(X=0;X>>8)-1}function N(w,k,P,d){return b(w,k,P,d,16)}function x(w,k,P,d){return b(w,k,P,d,32)}function A(w,k,P,d){for(var I=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,X=P[0]&255|(P[1]&255)<<8|(P[2]&255)<<16|(P[3]&255)<<24,Y=P[4]&255|(P[5]&255)<<8|(P[6]&255)<<16|(P[7]&255)<<24,ue=P[8]&255|(P[9]&255)<<8|(P[10]&255)<<16|(P[11]&255)<<24,Se=P[12]&255|(P[13]&255)<<8|(P[14]&255)<<16|(P[15]&255)<<24,Re=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,Fe=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,qe=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Me=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,rt=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Ve=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,dt=P[16]&255|(P[17]&255)<<8|(P[18]&255)<<16|(P[19]&255)<<24,Ft=P[20]&255|(P[21]&255)<<8|(P[22]&255)<<16|(P[23]&255)<<24,gt=P[24]&255|(P[25]&255)<<8|(P[26]&255)<<16|(P[27]&255)<<24,Pt=P[28]&255|(P[29]&255)<<8|(P[30]&255)<<16|(P[31]&255)<<24,Nt=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Xe=I,st=X,Qe=Y,Ze=ue,et=Se,Ge=Re,fe=Fe,ce=qe,Ae=Me,ge=rt,xe=Ve,_e=dt,bt=Ft,Bt=gt,Lt=Pt,jt=Nt,Q,Qt=0;Qt<20;Qt+=2)Q=Xe+bt|0,et^=Q<<7|Q>>>32-7,Q=et+Xe|0,Ae^=Q<<9|Q>>>32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ae=Ae+Me|0,ge=ge+rt|0,xe=xe+Ve|0,_e=_e+dt|0,bt=bt+Ft|0,Bt=Bt+gt|0,Lt=Lt+Pt|0,jt=jt+Nt|0,w[0]=Xe>>>0&255,w[1]=Xe>>>8&255,w[2]=Xe>>>16&255,w[3]=Xe>>>24&255,w[4]=st>>>0&255,w[5]=st>>>8&255,w[6]=st>>>16&255,w[7]=st>>>24&255,w[8]=Qe>>>0&255,w[9]=Qe>>>8&255,w[10]=Qe>>>16&255,w[11]=Qe>>>24&255,w[12]=Ze>>>0&255,w[13]=Ze>>>8&255,w[14]=Ze>>>16&255,w[15]=Ze>>>24&255,w[16]=et>>>0&255,w[17]=et>>>8&255,w[18]=et>>>16&255,w[19]=et>>>24&255,w[20]=Ge>>>0&255,w[21]=Ge>>>8&255,w[22]=Ge>>>16&255,w[23]=Ge>>>24&255,w[24]=fe>>>0&255,w[25]=fe>>>8&255,w[26]=fe>>>16&255,w[27]=fe>>>24&255,w[28]=ce>>>0&255,w[29]=ce>>>8&255,w[30]=ce>>>16&255,w[31]=ce>>>24&255,w[32]=Ae>>>0&255,w[33]=Ae>>>8&255,w[34]=Ae>>>16&255,w[35]=Ae>>>24&255,w[36]=ge>>>0&255,w[37]=ge>>>8&255,w[38]=ge>>>16&255,w[39]=ge>>>24&255,w[40]=xe>>>0&255,w[41]=xe>>>8&255,w[42]=xe>>>16&255,w[43]=xe>>>24&255,w[44]=_e>>>0&255,w[45]=_e>>>8&255,w[46]=_e>>>16&255,w[47]=_e>>>24&255,w[48]=bt>>>0&255,w[49]=bt>>>8&255,w[50]=bt>>>16&255,w[51]=bt>>>24&255,w[52]=Bt>>>0&255,w[53]=Bt>>>8&255,w[54]=Bt>>>16&255,w[55]=Bt>>>24&255,w[56]=Lt>>>0&255,w[57]=Lt>>>8&255,w[58]=Lt>>>16&255,w[59]=Lt>>>24&255,w[60]=jt>>>0&255,w[61]=jt>>>8&255,w[62]=jt>>>16&255,w[63]=jt>>>24&255}function C(w,k,P,d){for(var I=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,X=P[0]&255|(P[1]&255)<<8|(P[2]&255)<<16|(P[3]&255)<<24,Y=P[4]&255|(P[5]&255)<<8|(P[6]&255)<<16|(P[7]&255)<<24,ue=P[8]&255|(P[9]&255)<<8|(P[10]&255)<<16|(P[11]&255)<<24,Se=P[12]&255|(P[13]&255)<<8|(P[14]&255)<<16|(P[15]&255)<<24,Re=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,Fe=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,qe=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Me=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,rt=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Ve=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,dt=P[16]&255|(P[17]&255)<<8|(P[18]&255)<<16|(P[19]&255)<<24,Ft=P[20]&255|(P[21]&255)<<8|(P[22]&255)<<16|(P[23]&255)<<24,gt=P[24]&255|(P[25]&255)<<8|(P[26]&255)<<16|(P[27]&255)<<24,Pt=P[28]&255|(P[29]&255)<<8|(P[30]&255)<<16|(P[31]&255)<<24,Nt=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Xe=I,st=X,Qe=Y,Ze=ue,et=Se,Ge=Re,fe=Fe,ce=qe,Ae=Me,ge=rt,xe=Ve,_e=dt,bt=Ft,Bt=gt,Lt=Pt,jt=Nt,Q,Qt=0;Qt<20;Qt+=2)Q=Xe+bt|0,et^=Q<<7|Q>>>32-7,Q=et+Xe|0,Ae^=Q<<9|Q>>>32-9,Q=Ae+et|0,bt^=Q<<13|Q>>>32-13,Q=bt+Ae|0,Xe^=Q<<18|Q>>>32-18,Q=Ge+st|0,ge^=Q<<7|Q>>>32-7,Q=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w[13]=jt>>>8&255,w[14]=jt>>>16&255,w[15]=jt>>>24&255,w[16]=fe>>>0&255,w[17]=fe>>>8&255,w[18]=fe>>>16&255,w[19]=fe>>>24&255,w[20]=ce>>>0&255,w[21]=ce>>>8&255,w[22]=ce>>>16&255,w[23]=ce>>>24&255,w[24]=Ae>>>0&255,w[25]=Ae>>>8&255,w[26]=Ae>>>16&255,w[27]=Ae>>>24&255,w[28]=ge>>>0&255,w[29]=ge>>>8&255,w[30]=ge>>>16&255,w[31]=ge>>>24&255}function F(w,k,P,d){A(w,k,P,d)}function L(w,k,P,d){C(w,k,P,d)}var T=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function z(w,k,P,d,I,X,Y){var ue=new Uint8Array(16),Se=new Uint8Array(64),Re,Fe;for(Fe=0;Fe<16;Fe++)ue[Fe]=0;for(Fe=0;Fe<8;Fe++)ue[Fe]=X[Fe];for(;I>=64;){for(F(Se,ue,Y,T),Fe=0;Fe<64;Fe++)w[k+Fe]=P[d+Fe]^Se[Fe];for(Re=1,Fe=8;Fe<16;Fe++)Re=Re+(ue[Fe]&255)|0,ue[Fe]=Re&255,Re>>>=8;I-=64,k+=64,d+=64}if(I>0)for(F(Se,ue,Y,T),Fe=0;Fe=64;){for(F(Y,X,I,T),Se=0;Se<64;Se++)w[k+Se]=Y[Se];for(ue=1,Se=8;Se<16;Se++)ue=ue+(X[Se]&255)|0,X[Se]=ue&255,ue>>>=8;P-=64,k+=64}if(P>0)for(F(Y,X,I,T),Se=0;Se>>13|P<<3)&8191,d=w[4]&255|(w[5]&255)<<8,this.r[2]=(P>>>10|d<<6)&7939,I=w[6]&255|(w[7]&255)<<8,this.r[3]=(d>>>7|I<<9)&8191,X=w[8]&255|(w[9]&255)<<8,this.r[4]=(I>>>4|X<<12)&255,this.r[5]=X>>>1&8190,Y=w[10]&255|(w[11]&255)<<8,this.r[6]=(X>>>14|Y<<2)&8191,ue=w[12]&255|(w[13]&255)<<8,this.r[7]=(Y>>>11|ue<<5)&8065,Se=w[14]&255|(w[15]&255)<<8,this.r[8]=(ue>>>8|Se<<8)&8191,this.r[9]=Se>>>5&127,this.pad[0]=w[16]&255|(w[17]&255)<<8,this.pad[1]=w[18]&255|(w[19]&255)<<8,this.pad[2]=w[20]&255|(w[21]&255)<<8,this.pad[3]=w[22]&255|(w[23]&255)<<8,this.pad[4]=w[24]&255|(w[25]&255)<<8,this.pad[5]=w[26]&255|(w[27]&255)<<8,this.pad[6]=w[28]&255|(w[29]&255)<<8,this.pad[7]=w[30]&255|(w[31]&255)<<8};te.prototype.blocks=function(w,k,P){for(var d=this.fin?0:2048,I,X,Y,ue,Se,Re,Fe,qe,Me,rt,Ve,dt,Ft,gt,Pt,Nt,Xe,st,Qe,Ze=this.h[0],et=this.h[1],Ge=this.h[2],fe=this.h[3],ce=this.h[4],Ae=this.h[5],ge=this.h[6],xe=this.h[7],_e=this.h[8],bt=this.h[9],Bt=this.r[0],Lt=this.r[1],jt=this.r[2],Q=this.r[3],Qt=this.r[4],sr=this.r[5],or=this.r[6],Vt=this.r[7],rr=this.r[8],nr=this.r[9];P>=16;)I=w[k+0]&255|(w[k+1]&255)<<8,Ze+=I&8191,X=w[k+2]&255|(w[k+3]&255)<<8,et+=(I>>>13|X<<3)&8191,Y=w[k+4]&255|(w[k+5]&255)<<8,Ge+=(X>>>10|Y<<6)&8191,ue=w[k+6]&255|(w[k+7]&255)<<8,fe+=(Y>>>7|ue<<9)&8191,Se=w[k+8]&255|(w[k+9]&255)<<8,ce+=(ue>>>4|Se<<12)&8191,Ae+=Se>>>1&8191,Re=w[k+10]&255|(w[k+11]&255)<<8,ge+=(Se>>>14|Re<<2)&8191,Fe=w[k+12]&255|(w[k+13]&255)<<8,xe+=(Re>>>11|Fe<<5)&8191,qe=w[k+14]&255|(w[k+15]&255)<<8,_e+=(Fe>>>8|qe<<8)&8191,bt+=qe>>>5|d,Me=0,rt=Me,rt+=Ze*Bt,rt+=et*(5*nr),rt+=Ge*(5*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&=8191;for(this.h[0]+=d*5,d=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=d,d=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=d,P[0]=this.h[0]+5,d=P[0]>>>13,P[0]&=8191,Y=1;Y<10;Y++)P[Y]=this.h[Y]+d,d=P[Y]>>>13,P[Y]&=8191;for(P[9]-=8192,I=(d^1)-1,Y=0;Y<10;Y++)P[Y]&=I;for(I=~I,Y=0;Y<10;Y++)this.h[Y]=this.h[Y]&I|P[Y];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,X=this.h[0]+this.pad[0],this.h[0]=X&65535,Y=1;Y<8;Y++)X=(this.h[Y]+this.pad[Y]|0)+(X>>>16)|0,this.h[Y]=X&65535;w[k+0]=this.h[0]>>>0&255,w[k+1]=this.h[0]>>>8&255,w[k+2]=this.h[1]>>>0&255,w[k+3]=this.h[1]>>>8&255,w[k+4]=this.h[2]>>>0&255,w[k+5]=this.h[2]>>>8&255,w[k+6]=this.h[3]>>>0&255,w[k+7]=this.h[3]>>>8&255,w[k+8]=this.h[4]>>>0&255,w[k+9]=this.h[4]>>>8&255,w[k+10]=this.h[5]>>>0&255,w[k+11]=this.h[5]>>>8&255,w[k+12]=this.h[6]>>>0&255,w[k+13]=this.h[6]>>>8&255,w[k+14]=this.h[7]>>>0&255,w[k+15]=this.h[7]>>>8&255},te.prototype.update=function(w,k,P){var d,I;if(this.leftover){for(I=16-this.leftover,I>P&&(I=P),d=0;d=16&&(I=P-P%16,this.blocks(w,k,I),k+=I,P-=I),P){for(d=0;d>16&1),X[P-1]&=65535;X[15]=Y[15]-32767-(X[14]>>16&1),I=X[15]>>16&1,X[14]&=65535,R(Y,X,1-I)}for(P=0;P<16;P++)w[2*P]=Y[P]&255,w[2*P+1]=Y[P]>>8}function G(w,k){var P=new Uint8Array(32),d=new Uint8Array(32);return U(P,w),U(d,k),x(P,0,d,0)}function B(w){var k=new Uint8Array(32);return U(k,w),k[0]&1}function g(w,k){var P;for(P=0;P<16;P++)w[P]=k[2*P]+(k[2*P+1]<<8);w[15]&=32767}function O(w,k,P){for(var d=0;d<16;d++)w[d]=k[d]+P[d]}function ve(w,k,P){for(var d=0;d<16;d++)w[d]=k[d]-P[d]}function E(w,k,P){var d,I,X=0,Y=0,ue=0,Se=0,Re=0,Fe=0,qe=0,Me=0,rt=0,Ve=0,dt=0,Ft=0,gt=0,Pt=0,Nt=0,Xe=0,st=0,Qe=0,Ze=0,et=0,Ge=0,fe=0,ce=0,Ae=0,ge=0,xe=0,_e=0,bt=0,Bt=0,Lt=0,jt=0,Q=P[0],Qt=P[1],sr=P[2],or=P[3],Vt=P[4],rr=P[5],nr=P[6],Lr=P[7],gr=P[8],Rr=P[9],Tr=P[10],Ir=P[11],Wr=P[12],xn=P[13],vn=P[14],wn=P[15];d=k[0],X+=d*Q,Y+=d*Qt,ue+=d*sr,Se+=d*or,Re+=d*Vt,Fe+=d*rr,qe+=d*nr,Me+=d*Lr,rt+=d*gr,Ve+=d*Rr,dt+=d*Tr,Ft+=d*Ir,gt+=d*Wr,Pt+=d*xn,Nt+=d*vn,Xe+=d*wn,d=k[1],Y+=d*Q,ue+=d*Qt,Se+=d*sr,Re+=d*or,Fe+=d*Vt,qe+=d*rr,Me+=d*nr,rt+=d*Lr,Ve+=d*gr,dt+=d*Rr,Ft+=d*Tr,gt+=d*Ir,Pt+=d*Wr,Nt+=d*xn,Xe+=d*vn,st+=d*wn,d=k[2],ue+=d*Q,Se+=d*Qt,Re+=d*sr,Fe+=d*or,qe+=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*vn,Lt+=d*wn,d=k[15],Xe+=d*Q,st+=d*Qt,Qe+=d*sr,Ze+=d*or,et+=d*Vt,Ge+=d*rr,fe+=d*nr,ce+=d*Lr,Ae+=d*gr,ge+=d*Rr,xe+=d*Tr,_e+=d*Ir,bt+=d*Wr,Bt+=d*xn,Lt+=d*vn,jt+=d*wn,X+=38*st,Y+=38*Qe,ue+=38*Ze,Se+=38*et,Re+=38*Ge,Fe+=38*fe,qe+=38*ce,Me+=38*Ae,rt+=38*ge,Ve+=38*xe,dt+=38*_e,Ft+=38*bt,gt+=38*Bt,Pt+=38*Lt,Nt+=38*jt,I=1,d=X+I+65535,I=Math.floor(d/65536),X=d-I*65536,d=Y+I+65535,I=Math.floor(d/65536),Y=d-I*65536,d=ue+I+65535,I=Math.floor(d/65536),ue=d-I*65536,d=Se+I+65535,I=Math.floor(d/65536),Se=d-I*65536,d=Re+I+65535,I=Math.floor(d/65536),Re=d-I*65536,d=Fe+I+65535,I=Math.floor(d/65536),Fe=d-I*65536,d=qe+I+65535,I=Math.floor(d/65536),qe=d-I*65536,d=Me+I+65535,I=Math.floor(d/65536),Me=d-I*65536,d=rt+I+65535,I=Math.floor(d/65536),rt=d-I*65536,d=Ve+I+65535,I=Math.floor(d/65536),Ve=d-I*65536,d=dt+I+65535,I=Math.floor(d/65536),dt=d-I*65536,d=Ft+I+65535,I=Math.floor(d/65536),Ft=d-I*65536,d=gt+I+65535,I=Math.floor(d/65536),gt=d-I*65536,d=Pt+I+65535,I=Math.floor(d/65536),Pt=d-I*65536,d=Nt+I+65535,I=Math.floor(d/65536),Nt=d-I*65536,d=Xe+I+65535,I=Math.floor(d/65536),Xe=d-I*65536,X+=I-1+37*(I-1),I=1,d=X+I+65535,I=Math.floor(d/65536),X=d-I*65536,d=Y+I+65535,I=Math.floor(d/65536),Y=d-I*65536,d=ue+I+65535,I=Math.floor(d/65536),ue=d-I*65536,d=Se+I+65535,I=Math.floor(d/65536),Se=d-I*65536,d=Re+I+65535,I=Math.floor(d/65536),Re=d-I*65536,d=Fe+I+65535,I=Math.floor(d/65536),Fe=d-I*65536,d=qe+I+65535,I=Math.floor(d/65536),qe=d-I*65536,d=Me+I+65535,I=Math.floor(d/65536),Me=d-I*65536,d=rt+I+65535,I=Math.floor(d/65536),rt=d-I*65536,d=Ve+I+65535,I=Math.floor(d/65536),Ve=d-I*65536,d=dt+I+65535,I=Math.floor(d/65536),dt=d-I*65536,d=Ft+I+65535,I=Math.floor(d/65536),Ft=d-I*65536,d=gt+I+65535,I=Math.floor(d/65536),gt=d-I*65536,d=Pt+I+65535,I=Math.floor(d/65536),Pt=d-I*65536,d=Nt+I+65535,I=Math.floor(d/65536),Nt=d-I*65536,d=Xe+I+65535,I=Math.floor(d/65536),Xe=d-I*65536,X+=I-1+37*(I-1),w[0]=X,w[1]=Y,w[2]=ue,w[3]=Se,w[4]=Re,w[5]=Fe,w[6]=qe,w[7]=Me,w[8]=rt,w[9]=Ve,w[10]=dt,w[11]=Ft,w[12]=gt,w[13]=Pt,w[14]=Nt,w[15]=Xe}function J(w,k){E(w,k,k)}function oe(w,k){var P=r(),d;for(d=0;d<16;d++)P[d]=k[d];for(d=253;d>=0;d--)J(P,P),d!==2&&d!==4&&E(P,P,k);for(d=0;d<16;d++)w[d]=P[d]}function W(w,k){var P=r(),d;for(d=0;d<16;d++)P[d]=k[d];for(d=250;d>=0;d--)J(P,P),d!==1&&E(P,P,k);for(d=0;d<16;d++)w[d]=P[d]}function $(w,k,P){var d=new Uint8Array(32),I=new Float64Array(80),X,Y,ue=r(),Se=r(),Re=r(),Fe=r(),qe=r(),Me=r();for(Y=0;Y<31;Y++)d[Y]=k[Y];for(d[31]=k[31]&127|64,d[0]&=248,g(I,P),Y=0;Y<16;Y++)Se[Y]=I[Y],Fe[Y]=ue[Y]=Re[Y]=0;for(ue[0]=Fe[0]=1,Y=254;Y>=0;--Y)X=d[Y>>>3]>>>(Y&7)&1,R(ue,Se,X),R(Re,Fe,X),O(qe,ue,Re),ve(ue,ue,Re),O(Re,Se,Fe),ve(Se,Se,Fe),J(Fe,qe),J(Me,ue),E(ue,Re,ue),E(Re,Se,qe),O(qe,ue,Re),ve(ue,ue,Re),J(Se,ue),ve(Re,Fe,Me),E(ue,Re,l),O(ue,ue,Fe),E(Re,Re,ue),E(ue,Fe,Me),E(Fe,Se,I),J(Se,qe),R(ue,Se,X),R(Re,Fe,X);for(Y=0;Y<16;Y++)I[Y+16]=ue[Y],I[Y+32]=Re[Y],I[Y+48]=Se[Y],I[Y+64]=Fe[Y];var rt=I.subarray(32),Ve=I.subarray(16);return oe(rt,rt),E(Ve,Ve,rt),U(w,Ve),0}function V(w,k){return $(w,k,s)}function Z(w,k){return n(k,32),V(w,k)}function he(w,k,P){var d=new Uint8Array(32);return $(d,P,k),L(w,i,d,T)}var Ue=h,pe=m;function Be(w,k,P,d,I,X){var Y=new Uint8Array(32);return he(Y,I,X),Ue(w,k,P,d,Y)}function ut(w,k,P,d,I,X){var Y=new Uint8Array(32);return he(Y,I,X),pe(w,k,P,d,Y)}var Je=[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 Ye(w,k,P,d){for(var I=new Int32Array(16),X=new Int32Array(16),Y,ue,Se,Re,Fe,qe,Me,rt,Ve,dt,Ft,gt,Pt,Nt,Xe,st,Qe,Ze,et,Ge,fe,ce,Ae,ge,xe,_e,bt=w[0],Bt=w[1],Lt=w[2],jt=w[3],Q=w[4],Qt=w[5],sr=w[6],or=w[7],Vt=k[0],rr=k[1],nr=k[2],Lr=k[3],gr=k[4],Rr=k[5],Tr=k[6],Ir=k[7],Wr=0;d>=128;){for(et=0;et<16;et++)Ge=8*et+Wr,I[et]=P[Ge+0]<<24|P[Ge+1]<<16|P[Ge+2]<<8|P[Ge+3],X[et]=P[Ge+4]<<24|P[Ge+5]<<16|P[Ge+6]<<8|P[Ge+7];for(et=0;et<80;et++)if(Y=bt,ue=Bt,Se=Lt,Re=jt,Fe=Q,qe=Qt,Me=sr,rt=or,Ve=Vt,dt=rr,Ft=nr,gt=Lr,Pt=gr,Nt=Rr,Xe=Tr,st=Ir,fe=or,ce=Ir,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=(Q>>>14|gr<<32-14)^(Q>>>18|gr<<32-18)^(gr>>>41-32|Q<<32-(41-32)),ce=(gr>>>14|Q<<32-14)^(gr>>>18|Q<<32-18)^(Q>>>41-32|gr<<32-(41-32)),Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=Q&Qt^~Q&sr,ce=gr&Rr^~gr&Tr,Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=Je[et*2],ce=Je[et*2+1],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=I[et%16],ce=X[et%16],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,Qe=xe&65535|_e<<16,Ze=Ae&65535|ge<<16,fe=Qe,ce=Ze,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=(bt>>>28|Vt<<32-28)^(Vt>>>34-32|bt<<32-(34-32))^(Vt>>>39-32|bt<<32-(39-32)),ce=(Vt>>>28|bt<<32-28)^(bt>>>34-32|Vt<<32-(34-32))^(bt>>>39-32|Vt<<32-(39-32)),Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,fe=bt&Bt^bt&Lt^Bt&Lt,ce=Vt&rr^Vt&nr^rr&nr,Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,rt=xe&65535|_e<<16,st=Ae&65535|ge<<16,fe=Re,ce=gt,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=Qe,ce=Ze,Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,Re=xe&65535|_e<<16,gt=Ae&65535|ge<<16,Bt=Y,Lt=ue,jt=Se,Q=Re,Qt=Fe,sr=qe,or=Me,bt=rt,rr=Ve,nr=dt,Lr=Ft,gr=gt,Rr=Pt,Tr=Nt,Ir=Xe,Vt=st,et%16===15)for(Ge=0;Ge<16;Ge++)fe=I[Ge],ce=X[Ge],Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=I[(Ge+9)%16],ce=X[(Ge+9)%16],Ae+=ce&65535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Ae&65535|ge<<16,fe=jt,ce=Lr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[3],ce=k[3],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[3]=jt=xe&65535|_e<<16,k[3]=Lr=Ae&65535|ge<<16,fe=Q,ce=gr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[4],ce=k[4],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[4]=Q=xe&65535|_e<<16,k[4]=gr=Ae&65535|ge<<16,fe=Qt,ce=Rr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[5],ce=k[5],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[5]=Qt=xe&65535|_e<<16,k[5]=Rr=Ae&65535|ge<<16,fe=sr,ce=Tr,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[6],ce=k[6],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[6]=sr=xe&65535|_e<<16,k[6]=Tr=Ae&65535|ge<<16,fe=or,ce=Ir,Ae=ce&65535,ge=ce>>>16,xe=fe&65535,_e=fe>>>16,fe=w[7],ce=k[7],Ae+=ce&65535,ge+=ce>>>16,xe+=fe&65535,_e+=fe>>>16,ge+=Ae>>>16,xe+=ge>>>16,_e+=xe>>>16,w[7]=or=xe&65535|_e<<16,k[7]=Ir=Ae&65535|ge<<16,Wr+=128,d-=128}return d}function pt(w,k,P){var d=new Int32Array(8),I=new Int32Array(8),X=new Uint8Array(256),Y,ue=P;for(d[0]=1779033703,d[1]=3144134277,d[2]=1013904242,d[3]=2773480762,d[4]=1359893119,d[5]=2600822924,d[6]=528734635,d[7]=1541459225,I[0]=4089235720,I[1]=2227873595,I[2]=4271175723,I[3]=1595750129,I[4]=2917565137,I[5]=725511199,I[6]=4215389547,I[7]=327033209,Ye(d,I,k,P),P%=128,Y=0;Y=0;--I)d=P[I/8|0]>>(I&7)&1,ye(w,k,d),ze(k,w),ze(w,w),ye(w,k,d)}function tt(w,k){var P=[r(),r(),r(),r()];S(P[0],c),S(P[1],p),S(P[2],a),E(P[3],c,p),Ce(w,P,k)}function Dt(w,k,P){var d=new Uint8Array(64),I=[r(),r(),r(),r()],X;for(P||n(k,32),pt(d,k,32),d[0]&=248,d[31]&=127,d[31]|=64,tt(I,d),De(w,I),X=0;X<32;X++)k[X+32]=w[X];return 0}var yt=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 Ct(w,k){var P,d,I,X;for(d=63;d>=32;--d){for(P=0,I=d-32,X=d-12;I>4)*yt[I],P=k[I]>>8,k[I]&=255;for(I=0;I<32;I++)k[I]-=P*yt[I];for(d=0;d<32;d++)k[d+1]+=k[d]>>8,w[d]=k[d]&255}function fr(w){var k=new Float64Array(64),P;for(P=0;P<64;P++)k[P]=w[P];for(P=0;P<64;P++)w[P]=0;Ct(w,k)}function Tt(w,k,P,d){var I=new Uint8Array(64),X=new Uint8Array(64),Y=new Uint8Array(64),ue,Se,Re=new Float64Array(64),Fe=[r(),r(),r(),r()];pt(I,d,32),I[0]&=248,I[31]&=127,I[31]|=64;var qe=P+64;for(ue=0;ue>7&&ve(w[0],o,w[0]),E(w[3],w[0],w[1]),0)}function Jt(w,k,P,d){var I,X=new Uint8Array(32),Y=new Uint8Array(64),ue=[r(),r(),r(),r()],Se=[r(),r(),r(),r()];if(P<64||It(Se,d))return-1;for(I=0;I=0},e.sign.keyPair=function(){var w=new Uint8Array(Le),k=new Uint8Array(ht);return Dt(w,k),{publicKey:w,secretKey:k}},e.sign.keyPair.fromSecretKey=function(w){if(We(w),w.length!==ht)throw new Error("bad secret key size");for(var k=new Uint8Array(Le),P=0;PReflect.get(n,r))):(...n)=>Un(this,void 0,void 0,function*(){return e.inner||(e.inner=Promise.resolve(t())),e.inner.then(i=>Reflect.get(i,r).apply(i,n))})}})}function im(t,e){var r;return Un(this,void 0,void 0,function*(){const{defaultGateway:n}=KD[t];if(!n)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(r=globalThis==null?void 0:globalThis.fetch)!==null&&r!==void 0?r:e==null?void 0:e.fetch,s=yield i?yM(n,i):mM(n);return ct(s.result.key)})}function mM(t){return Un(this,void 0,void 0,function*(){const e=yield ST(()=>import(t.split(":")[0]),[]),r=n8();return new Promise((n,i)=>{const s={method:"POST",headers:{"content-type":"application/json","content-length":r.length}},o=e.request(t,s,a=>{const l=[];a.on("error",u=>i(u)),a.on("data",u=>l.push(u)),a.on("end",()=>{n(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",a=>i(a)),o.write(r),o.end()})})}function yM(t,e){return Un(this,void 0,void 0,function*(){const r=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:n8()});if(!r.ok)throw new dh("Failed to fetch runtime public key.",r);return yield r.json()})}function n8(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:w2,params:[]})}const xM="6.8.1";function vM(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Mt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&vM(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function Fu(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(Fu).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return Fu(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${Fu(r)}: ${Fu(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function ps(t,e){return t&&t.code===e}function Vx(t){return ps(t,"CALL_EXCEPTION")}function $f(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${Fu(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+Fu(a))}}s.push(`code=${e}`),s.push(`version=${xM}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Mt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Mt(i,{shortMessage:n}),i}function Ne(t,e,r,n){if(!t)throw $f(e,r,n)}function se(t,e,r,n){Ne(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function i8(t,e,r){r==null&&(r=""),r&&(r=": "+r),Ne(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Ne(t<=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const wM=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const r=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(r!==n)throw new Error("broken")}t.push(e)}catch{}return t},[]);function bM(t){Ne(wM.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function $1(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Ne(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function s8(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+r3[i&15]}return r}function Zr(t){return"0x"+t.map(e=>mt(e).substring(2)).join("")}function Qu(t){return Dr(t,!0)?(t.length-2)/2:ur(t).length}function Br(t,e,r){const n=ur(t);return r!=null&&r>n.length&&Ne(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),mt(n.slice(e??0,r??n.length))}function o8(t,e,r){const n=ur(t);Ne(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),mt(i)}function Ol(t,e){return o8(t,e,!0)}function EM(t,e){return o8(t,e,!1)}const W1=BigInt(0),fs=BigInt(1),Cu=9007199254740991;function SM(t,e){const r=J1(t,"value"),n=BigInt(Wt(e,"width"));if(Ne(r>>n===W1,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-fs){const i=(fs<=-Cu&&t<=Cu,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){se(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}se(!1,"invalid BigNumberish value",e||"value",t)}function J1(t,e){const r=Rt(t,e);return Ne(r>=W1,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const n3="0123456789abcdef";function Qx(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=n3[r>>4],e+=n3[r&15];return BigInt(e)}return Rt(t)}function Wt(t,e){switch(typeof t){case"bigint":return se(t>=-Cu&&t<=Cu,"overflow",e||"value",t),Number(t);case"number":return se(Number.isInteger(t),"underflow",e||"value",t),se(t>=-Cu&&t<=Cu,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Wt(BigInt(t),e)}catch(r){se(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}se(!1,"invalid numeric value",e||"value",t)}function FM(t){return Wt(Qx(t))}function Oa(t,e){let n=J1(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Wt(e,"width");for(Ne(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function RM(t,e,r,n,i){return t==="OVERLONG"?(se(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),u8(t,e,r))}const TM=Object.freeze({error:NM,ignore:u8,replace:RM});function IM(t,e){e==null&&(e=TM.error);const r=ur(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let l=s&(1<<8-o-1)-1;for(let u=0;u1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,l);continue}if(l<=a){i+=e("OVERLONG",i-1-o,r,n,l);continue}n.push(l)}}return n}function Sl(t,e){e!=null&&(bM(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);se(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function MM(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Kx(t,e){return MM(IM(t,e))}function f8(t){async function e(r,n){const i=r.url.split(":")[0].toLowerCase();Ne(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Ne(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s;if(n){const c=new AbortController;s=c.signal,n.addListener(()=>{c.abort()})}const o={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:s},a=await fetch(r.url,o),l={};a.headers.forEach((c,p)=>{l[p.toLowerCase()]=c});const u=await a.arrayBuffer(),f=u==null?null:new Uint8Array(u);return{statusCode:a.status,statusMessage:a.statusText,headers:l,body:f}}return e}const BM=12,OM=250;let s3=f8();const UM=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),DM=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let sm=!1;async function c8(t,e){try{const r=t.match(UM);if(!r)throw new Error("invalid data");return new Pa(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?_M(r[3]):zM(r[3]))}catch{return new Pa(599,"BAD REQUEST (invalid data: URI)",{},null,new Ua(t))}}function h8(t){async function e(r,n){try{const i=r.match(DM);if(!i)throw new Error("invalid link");return new Ua(`${t}${i[2]}`)}catch{return new Pa(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Ua(r))}}return e}const cd={data:c8,ipfs:h8("https://gateway.ipfs.io/ipfs/")},d8=new WeakMap;var il,na;class LM{constructor(e){me(this,il,void 0);me(this,na,void 0);ee(this,il,[]),ee(this,na,!1),d8.set(e,()=>{if(!D(this,na)){ee(this,na,!0);for(const r of D(this,il))setTimeout(()=>{r()},0);ee(this,il,[])}})}addListener(e){Ne(!D(this,na),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),D(this,il).push(e)}get cancelled(){return D(this,na)}checkSignal(){Ne(!this.cancelled,"cancelled","CANCELLED",{})}}il=new WeakMap,na=new WeakMap;function hd(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Ju,Yu,is,uo,qu,Xu,en,li,fo,sl,ol,al,_s,co,ia,ll,Vc;const r1=class r1{constructor(e){me(this,ll);me(this,Ju,void 0);me(this,Yu,void 0);me(this,is,void 0);me(this,uo,void 0);me(this,qu,void 0);me(this,Xu,void 0);me(this,en,void 0);me(this,li,void 0);me(this,fo,void 0);me(this,sl,void 0);me(this,ol,void 0);me(this,al,void 0);me(this,_s,void 0);me(this,co,void 0);me(this,ia,void 0);ee(this,Xu,String(e)),ee(this,Ju,!1),ee(this,Yu,!0),ee(this,is,{}),ee(this,uo,""),ee(this,qu,3e5),ee(this,co,{slotInterval:OM,maxAttempts:BM}),ee(this,ia,null)}get url(){return D(this,Xu)}set url(e){ee(this,Xu,String(e))}get body(){return D(this,en)==null?null:new Uint8Array(D(this,en))}set body(e){if(e==null)ee(this,en,void 0),ee(this,li,void 0);else if(typeof e=="string")ee(this,en,Sl(e)),ee(this,li,"text/plain");else if(e instanceof Uint8Array)ee(this,en,e),ee(this,li,"application/octet-stream");else if(typeof e=="object")ee(this,en,Sl(JSON.stringify(e))),ee(this,li,"application/json");else throw new Error("invalid body")}hasBody(){return D(this,en)!=null}get method(){return D(this,uo)?D(this,uo):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),ee(this,uo,String(e).toUpperCase())}get headers(){const e=Object.assign({},D(this,is));return D(this,fo)&&(e.authorization=`Basic ${PM(Sl(D(this,fo)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&D(this,li)&&(e["content-type"]=D(this,li)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){D(this,is)[String(e).toLowerCase()]=String(r)}clearHeaders(){ee(this,is,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),ee(this,qu,e)}get preflightFunc(){return D(this,sl)||null}set preflightFunc(e){ee(this,sl,e)}get processFunc(){return D(this,ol)||null}set processFunc(e){ee(this,ol,e)}get retryFunc(){return D(this,al)||null}set retryFunc(e){ee(this,al,e)}get getUrlFunc(){return D(this,ia)||s3}set getUrlFunc(e){ee(this,ia,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(D(this,co).slotInterval=e.slotInterval),e.maxAttempts!=null&&(D(this,co).maxAttempts=e.maxAttempts)}send(){return Ne(D(this,_s)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),ee(this,_s,new LM(this)),ot(this,ll,Vc).call(this,0,o3()+this.timeout,0,this,new Pa(0,"",{},null,this))}cancel(){Ne(D(this,_s)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=d8.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Ne(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new r1(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,ee(i,is,Object.assign({},D(this,is))),D(this,en)&&ee(i,en,new Uint8Array(D(this,en))),ee(i,li,D(this,li)),i}clone(){const e=new r1(this.url);return ee(e,uo,D(this,uo)),D(this,en)&&ee(e,en,D(this,en)),ee(e,li,D(this,li)),ee(e,is,Object.assign({},D(this,is))),ee(e,fo,D(this,fo)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),ee(e,sl,D(this,sl)),ee(e,ol,D(this,ol)),ee(e,al,D(this,al)),ee(e,ia,D(this,ia)),e}static lockConfig(){sm=!0}static getGateway(e){return cd[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(sm)throw new Error("gateways locked");cd[e]=r}static registerGetUrl(e){if(sm)throw new Error("gateways locked");s3=e}static createGetUrlFunc(e){return f8()}static createDataGateway(){return c8}static createIpfsGatewayFunc(e){return h8(e)}};Ju=new WeakMap,Yu=new WeakMap,is=new WeakMap,uo=new WeakMap,qu=new WeakMap,Xu=new WeakMap,en=new WeakMap,li=new WeakMap,fo=new WeakMap,sl=new WeakMap,ol=new WeakMap,al=new WeakMap,_s=new WeakMap,co=new WeakMap,ia=new WeakMap,ll=new WeakSet,Vc=async function(e,r,n,i,s){var f,c,p;if(e>=D(this,co).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Ne(o3()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await jM(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in cd){const y=await cd[a](o.url,hd(D(i,_s)));if(y instanceof Pa){let v=y;if(this.processFunc){hd(D(i,_s));try{v=await this.processFunc(o,v)}catch(b){(b.throttle==null||typeof b.stall!="number")&&v.makeServerError("error in post-processing function",b).assertOk()}}return v}o=y}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,hd(D(i,_s)));let u=new Pa(l.statusCode,l.statusMessage,l.headers,l.body,i);if(u.statusCode===301||u.statusCode===302){try{const y=u.headers.location||"";return ot(f=o.redirect(y),ll,Vc).call(f,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const y=u.headers["retry-after"];let v=D(this,co).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof y=="string"&&y.match(/^[1-9][0-9]*$/)&&(v=parseInt(y)),ot(c=o.clone(),ll,Vc).call(c,e+1,r,v,i,u)}if(this.processFunc){hd(D(i,_s));try{u=await this.processFunc(o,u)}catch(y){(y.throttle==null||typeof y.stall!="number")&&u.makeServerError("error in post-processing function",y).assertOk();let v=D(this,co).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return y.stall>=0&&(v=y.stall),ot(p=o.clone(),ll,Vc).call(p,e+1,r,v,i,u)}}return u};let Ua=r1;var Zh,e0,t0,ss,Zu,ul;const gv=class gv{constructor(e,r,n,i,s){me(this,Zh,void 0);me(this,e0,void 0);me(this,t0,void 0);me(this,ss,void 0);me(this,Zu,void 0);me(this,ul,void 0);ee(this,Zh,e),ee(this,e0,r),ee(this,t0,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),ee(this,ss,i==null?null:new Uint8Array(i)),ee(this,Zu,s||null),ee(this,ul,{message:""})}toString(){return``}get statusCode(){return D(this,Zh)}get statusMessage(){return D(this,e0)}get headers(){return Object.assign({},D(this,t0))}get body(){return D(this,ss)==null?null:new Uint8Array(D(this,ss))}get bodyText(){try{return D(this,ss)==null?"":Kx(D(this,ss))}catch{Ne(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Ne(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Mt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return D(this,ss)!=null}get request(){return D(this,Zu)}ok(){return D(this,ul).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=D(this,ul);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),Ne(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r})}};Zh=new WeakMap,e0=new WeakMap,t0=new WeakMap,ss=new WeakMap,Zu=new WeakMap,ul=new WeakMap;let Pa=gv;function o3(){return new Date().getTime()}function zM(t){return Sl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function jM(t){return new Promise(e=>setTimeout(e,t))}function HM(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function a3(t,e,r){let n=0;for(let i=0;i{Ne(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=a3(t,e+1,n);return r(e+1+n+i),l3(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),l3(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=a3(t,e+1,n);r(e+1+n+i);const s=mt(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=mt(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:HM(t[e])}}function $x(t){const e=ur(t,"data"),r=p8(e,0);return se(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function u3(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function g8(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(g8(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=u3(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(ur(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=u3(e.length);return r.unshift(183+r.length),r.concat(e)}const f3="0123456789abcdef";function Vh(t){let e="0x";for(const r of g8(t))e+=f3[r>>4],e+=f3[r&15];return e}const zn=32,Gy=new Uint8Array(zn),GM=["then"],dd={};function Ic(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}var sa;const ph=class ph extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==dd&&(i=r,s=[],o=!1);super(i.length);me(this,sa,void 0);i.forEach((l,u)=>{this[u]=l});const a=s.reduce((l,u)=>(typeof u=="string"&&l.set(u,(l.get(u)||0)+1),l),new Map);if(ee(this,sa,Object.freeze(i.map((l,u)=>{const f=s[u];return f!=null&&a.get(f)===1?f:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,u,f)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const p=Wt(u,"%index");if(p<0||p>=this.length)throw new RangeError("out of result range");const y=l[p];return y instanceof Error&&Ic(`index ${p}`,y),y}if(GM.indexOf(u)>=0)return Reflect.get(l,u,f);const c=l[u];if(c instanceof Function)return function(...p){return c.apply(this===f?l:this,p)};if(!(u in l))return l.getValue.apply(this===f?l:this,[u])}return Reflect.get(l,u,f)}})}toArray(){const r=[];return this.forEach((n,i)=>{n instanceof Error&&Ic(`index ${i}`,n),r.push(n)}),r}toObject(){return D(this,sa).reduce((r,n,i)=>(Ne(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in r||(r[n]=this.getValue(n)),r),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=[],s=[];for(let o=r;o{D(this,ho)[e]=c3(r)}}}ho=new WeakMap,fl=new WeakMap,ef=new WeakSet,Vd=function(e){return D(this,ho).push(e),ee(this,fl,D(this,fl)+e.length),e.length};var ui,Pi,n1,m8;const mv=class mv{constructor(e,r){me(this,n1);le(this,"allowLoose");me(this,ui,void 0);me(this,Pi,void 0);Mt(this,{allowLoose:!!r}),ee(this,ui,Tn(e)),ee(this,Pi,0)}get data(){return mt(D(this,ui))}get dataLength(){return D(this,ui).length}get consumed(){return D(this,Pi)}get bytes(){return new Uint8Array(D(this,ui))}subReader(e){return new mv(D(this,ui).slice(D(this,Pi)+e),this.allowLoose)}readBytes(e,r){let n=ot(this,n1,m8).call(this,0,e,!!r);return ee(this,Pi,D(this,Pi)+n.length),n.slice(0,e)}readValue(){return Qx(this.readBytes(zn))}readIndex(){return FM(this.readBytes(zn))}};ui=new WeakMap,Pi=new WeakMap,n1=new WeakSet,m8=function(e,r,n){let i=Math.ceil(r/zn)*zn;return D(this,Pi)+i>D(this,ui).length&&(this.allowLoose&&n&&D(this,Pi)+r<=D(this,ui).length?i=r:Ne(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Tn(D(this,ui)),length:D(this,ui).length,offset:D(this,Pi)+i})),D(this,ui).slice(D(this,Pi),D(this,Pi)+i)};let Qy=mv;function Qp(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Wx(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function VM(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qp(t.outputLen),Qp(t.blockLen)}function Wf(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function y8(t,e){Wx(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,QM=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),am=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),As=(t,e)=>t<<32-e|t>>>e,KM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!KM)throw new Error("Non little-endian hardware is not supported");function $M(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Y1(t){if(typeof t=="string"&&(t=$M(t)),!x8(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function WM(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!x8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class Jx{clone(){return this._cloneInto()}}function v8(t){const e=n=>t().update(Y1(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function JM(t=32){if(om&&typeof om.getRandomValues=="function")return om.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class w8 extends Jx{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,VM(e);const n=Y1(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew w8(t,e).update(r).digest();b8.create=(t,e)=>new w8(t,e);function YM(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+u,a,n)}class qM extends Jx{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=am(this.buffer)}update(e){Wf(this);const{view:r,buffer:n,blockLen:i}=this;e=Y1(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let c=o;cf.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;ct&e^~t&r,ZM=(t,e,r)=>t&e^t&r^e&r,eB=new Uint32Array([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]),$o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Wo=new Uint32Array(64);class tB extends qM{constructor(){super(64,32,8,!1),this.A=$o[0]|0,this.B=$o[1]|0,this.C=$o[2]|0,this.D=$o[3]|0,this.E=$o[4]|0,this.F=$o[5]|0,this.G=$o[6]|0,this.H=$o[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:l}=this;return[e,r,n,i,s,o,a,l]}set(e,r,n,i,s,o,a,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,r){for(let c=0;c<16;c++,r+=4)Wo[c]=e.getUint32(r,!1);for(let c=16;c<64;c++){const p=Wo[c-15],y=Wo[c-2],v=As(p,7)^As(p,18)^p>>>3,b=As(y,17)^As(y,19)^y>>>10;Wo[c]=b+Wo[c-7]+v+Wo[c-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:u,H:f}=this;for(let c=0;c<64;c++){const p=As(a,6)^As(a,11)^As(a,25),y=f+p+XM(a,l,u)+eB[c]+Wo[c]|0,b=(As(n,2)^As(n,13)^As(n,22))+ZM(n,i,s)|0;f=u,u=l,l=a,a=o+y|0,o=s,s=i,i=n,n=y+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,l,u,f)}roundClean(){Wo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const rB=v8(()=>new tB),pd=BigInt(2**32-1),h3=BigInt(32);function nB(t,e=!1){return e?{h:Number(t&pd),l:Number(t>>h3&pd)}:{h:Number(t>>h3&pd)|0,l:Number(t&pd)|0}}function iB(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,oB=(t,e,r)=>e<>>32-r,aB=(t,e,r)=>e<>>64-r,lB=(t,e,r)=>t<>>64-r,[A8,E8,S8]=[[],[],[]],uB=BigInt(0),Mc=BigInt(1),fB=BigInt(2),cB=BigInt(7),hB=BigInt(256),dB=BigInt(113);for(let t=0,e=Mc,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],A8.push(2*(5*n+r)),E8.push((t+1)*(t+2)/2%64);let i=uB;for(let s=0;s<7;s++)e=(e<>cB)*dB)%hB,e&fB&&(i^=Mc<<(Mc<r>32?aB(t,e,r):sB(t,e,r),p3=(t,e,r)=>r>32?lB(t,e,r):oB(t,e,r);function mB(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=r[l],f=r[l+1],c=d3(u,f,1)^r[a],p=p3(u,f,1)^r[a+1];for(let y=0;y<50;y+=10)t[o+y]^=c,t[o+y+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=E8[o],l=d3(i,s,a),u=p3(i,s,a),f=A8[o];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=pB[n],t[1]^=gB[n]}r.fill(0)}class Yx extends Jx{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Qp(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=QM(this.state)}keccak(){mB(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Wf(this);const{blockLen:r,state:n}=this;e=Y1(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Qp(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(y8(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Yx(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const yB=(t,e,r)=>v8(()=>new Yx(e,t,r)),xB=yB(1,136,256/8);let F8=!1;const C8=function(t){return xB(t)};let k8=C8;function _r(t){const e=ur(t,"data");return mt(k8(e))}_r._=C8;_r.lock=function(){F8=!0};_r.register=function(t){if(F8)throw new TypeError("keccak256 is locked");k8=t};Object.freeze(_r);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _8=BigInt(0),q1=BigInt(1),vB=BigInt(2),X1=t=>t instanceof Uint8Array,wB=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Jf(t){if(!X1(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!X1(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function AB(t,e){if(t.length!==e.length)return!1;for(let r=0;r_8;t>>=q1,e+=1);return e}function FB(t,e){return t>>BigInt(e)&q1}const CB=(t,e,r)=>t|(r?q1:_8)<(vB<new Uint8Array(t),g3=t=>Uint8Array.from(t);function N8(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=lm(t),i=lm(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...c)=>r(i,n,...c),l=(c=lm())=>{i=a(g3([0]),c),n=a(),c.length!==0&&(i=a(g3([1]),c),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let c=0;const p=[];for(;c{o(),l(c);let y;for(;!(y=p(u()));)l();return o(),y}}const kB={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function k0(t,e,r={}){const n=(i,s,o)=>{const a=kB[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const _B=Object.freeze(Object.defineProperty({__proto__:null,bitGet:FB,bitLen:SB,bitMask:ev,bitSet:CB,bytesToHex:Jf,bytesToNumberBE:Fl,bytesToNumberLE:Xx,concatBytes:Qh,createHmacDrbg:N8,ensureBytes:ns,equalBytes:AB,hexToBytes:Yf,hexToNumber:qx,numberToBytesBE:qf,numberToBytesLE:Zx,numberToHexUnpadded:P8,numberToVarBytesBE:bB,utf8ToBytes:EB,validateObject:k0},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rn=BigInt(0),Vr=BigInt(1),$a=BigInt(2),PB=BigInt(3),Ky=BigInt(4),m3=BigInt(5),y3=BigInt(8);BigInt(9);BigInt(16);function Jn(t,e){const r=t%e;return r>=rn?r:e+r}function NB(t,e,r){if(r<=rn||e 0");if(r===Vr)return rn;let n=Vr;for(;e>rn;)e&Vr&&(n=n*t%r),t=t*t%r,e>>=Vr;return n}function Ei(t,e,r){let n=t;for(;e-- >rn;)n*=n,n%=r;return n}function $y(t,e){if(t===rn||e<=rn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Jn(t,e),n=e,i=rn,s=Vr;for(;r!==rn;){const a=n/r,l=n%r,u=i-s*a;n=r,r=l,i=s,s=u}if(n!==Vr)throw new Error("invert: does not exist");return Jn(i,e)}function RB(t){const e=(t-Vr)/$a;let r,n,i;for(r=t-Vr,n=0;r%$a===rn;r/=$a,n++);for(i=$a;i(n[i]="function",n),e);return k0(t,r)}function BB(t,e,r){if(r 0");if(r===rn)return t.ONE;if(r===Vr)return e;let n=t.ONE,i=e;for(;r>rn;)r&Vr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Vr;return n}function OB(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function R8(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function UB(t,e,r=!1,n={}){if(t<=rn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=R8(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=TB(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:ev(i),ZERO:rn,ONE:Vr,create:l=>Jn(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return rn<=l&&ll===rn,isOdd:l=>(l&Vr)===Vr,neg:l=>Jn(-l,t),eql:(l,u)=>l===u,sqr:l=>Jn(l*l,t),add:(l,u)=>Jn(l+u,t),sub:(l,u)=>Jn(l-u,t),mul:(l,u)=>Jn(l*u,t),pow:(l,u)=>BB(a,l,u),div:(l,u)=>Jn(l*$y(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>$y(l,t),sqrt:n.sqrt||(l=>o(a,l)),invertBatch:l=>OB(a,l),cmov:(l,u,f)=>f?u:l,toBytes:l=>r?Zx(l,s):qf(l,s),fromBytes:l=>{if(l.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${l.length}`);return r?Xx(l):Fl(l)}});return Object.freeze(a)}function T8(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function I8(t){const e=T8(t);return e+Math.ceil(e/2)}function DB(t,e,r=!1){const n=t.length,i=T8(e),s=I8(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?Fl(t):Xx(t),a=Jn(o,e-Vr)+Vr;return r?Zx(a,i):qf(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const LB=BigInt(0),um=BigInt(1);function zB(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>LB;)s&um&&(o=o.add(a)),a=a.double(),s>>=um;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),l=[];let u=i,f=u;for(let c=0;c>=y,N>l&&(N-=p,o+=um);const x=b,A=b+Math.abs(N)-1,C=v%2!==0,F=N<0;N===0?f=f.add(r(C,s[x])):u=u.add(r(F,s[A]))}return{p:u,f}},wNAFCached(i,s,o,a){const l=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&s.set(i,a(u))),this.wNAF(l,u,o)}}}function M8(t){return MB(t.Fp),k0(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...R8(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jB(t){const e=M8(t);k0(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:HB,hexToBytes:GB}=_B,el={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=el;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:HB(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=el,r=typeof t=="string"?GB(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=el._parseInt(r.subarray(2)),{d:o,l:a}=el._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},bo=BigInt(0),Bi=BigInt(1);BigInt(2);const x3=BigInt(3);BigInt(4);function VB(t){const e=jB(t),{Fp:r}=e,n=e.toBytes||((v,b,N)=>{const x=b.toAffine();return Qh(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(v=>{const b=v.subarray(1),N=r.fromBytes(b.subarray(0,r.BYTES)),x=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:N,y:x}});function s(v){const{a:b,b:N}=e,x=r.sqr(v),A=r.mul(x,v);return r.add(r.add(A,r.mul(v,b)),N)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&bor.eql(C,r.ZERO);return A(N)&&A(x)?c.ZERO:new c(N,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const N=r.invertBatch(b.map(x=>x.pz));return b.map((x,A)=>x.toAffine(N[A])).map(c.fromAffine)}static fromHex(b){const N=c.fromAffine(i(ns("pointHex",b)));return N.assertValidity(),N}static fromPrivateKey(b){return c.BASE.multiply(l(b))}_setWindowSize(b){this._WINDOW_SIZE=b,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:N}=this.toAffine();if(!r.isValid(b)||!r.isValid(N))throw new Error("bad point: x or y not FE");const x=r.sqr(N),A=s(b);if(!r.eql(x,A))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:N,py:x,pz:A}=this,{px:C,py:F,pz:L}=b,T=r.eql(r.mul(N,L),r.mul(C,A)),z=r.eql(r.mul(x,L),r.mul(F,A));return T&&z}negate(){return new c(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:N}=e,x=r.mul(N,x3),{px:A,py:C,pz:F}=this;let L=r.ZERO,T=r.ZERO,z=r.ZERO,H=r.mul(A,A),K=r.mul(C,C),ne=r.mul(F,F),te=r.mul(A,C);return te=r.add(te,te),z=r.mul(A,F),z=r.add(z,z),L=r.mul(b,z),T=r.mul(x,ne),T=r.add(L,T),L=r.sub(K,T),T=r.add(K,T),T=r.mul(L,T),L=r.mul(te,L),z=r.mul(x,z),ne=r.mul(b,ne),te=r.sub(H,ne),te=r.mul(b,te),te=r.add(te,z),z=r.add(H,H),H=r.add(z,H),H=r.add(H,ne),H=r.mul(H,te),T=r.add(T,H),ne=r.mul(C,F),ne=r.add(ne,ne),H=r.mul(ne,te),L=r.sub(L,H),z=r.mul(ne,K),z=r.add(z,z),z=r.add(z,z),new c(L,T,z)}add(b){f(b);const{px:N,py:x,pz:A}=this,{px:C,py:F,pz:L}=b;let T=r.ZERO,z=r.ZERO,H=r.ZERO;const K=e.a,ne=r.mul(e.b,x3);let te=r.mul(N,C),de=r.mul(x,F),_=r.mul(A,L),h=r.add(N,x),m=r.add(C,F);h=r.mul(h,m),m=r.add(te,de),h=r.sub(h,m),m=r.add(N,A);let S=r.add(C,L);return m=r.mul(m,S),S=r.add(te,_),m=r.sub(m,S),S=r.add(x,A),T=r.add(F,L),S=r.mul(S,T),T=r.add(de,_),S=r.sub(S,T),H=r.mul(K,m),T=r.mul(ne,_),H=r.add(T,H),T=r.sub(de,H),H=r.add(de,H),z=r.mul(T,H),de=r.add(te,te),de=r.add(de,te),_=r.mul(K,_),m=r.mul(ne,m),de=r.add(de,_),_=r.sub(te,_),_=r.mul(K,_),m=r.add(m,_),te=r.mul(de,m),z=r.add(z,te),te=r.mul(S,m),T=r.mul(h,T),T=r.sub(T,te),te=r.mul(h,de),H=r.mul(S,H),H=r.add(H,te),new c(T,z,H)}subtract(b){return this.add(b.negate())}is0(){return this.equals(c.ZERO)}wNAF(b){return y.wNAFCached(this,u,b,N=>{const x=r.invertBatch(N.map(A=>A.pz));return N.map((A,C)=>A.toAffine(x[C])).map(c.fromAffine)})}multiplyUnsafe(b){const N=c.ZERO;if(b===bo)return N;if(a(b),b===Bi)return this;const{endo:x}=e;if(!x)return y.unsafeLadder(this,b);let{k1neg:A,k1:C,k2neg:F,k2:L}=x.splitScalar(b),T=N,z=N,H=this;for(;C>bo||L>bo;)C&Bi&&(T=T.add(H)),L&Bi&&(z=z.add(H)),H=H.double(),C>>=Bi,L>>=Bi;return A&&(T=T.negate()),F&&(z=z.negate()),z=new c(r.mul(z.px,x.beta),z.py,z.pz),T.add(z)}multiply(b){a(b);let N=b,x,A;const{endo:C}=e;if(C){const{k1neg:F,k1:L,k2neg:T,k2:z}=C.splitScalar(N);let{p:H,f:K}=this.wNAF(L),{p:ne,f:te}=this.wNAF(z);H=y.constTimeNegate(F,H),ne=y.constTimeNegate(T,ne),ne=new c(r.mul(ne.px,C.beta),ne.py,ne.pz),x=H.add(ne),A=K.add(te)}else{const{p:F,f:L}=this.wNAF(N);x=F,A=L}return c.normalizeZ([x,A])[0]}multiplyAndAddUnsafe(b,N,x){const A=c.BASE,C=(L,T)=>T===bo||T===Bi||!L.equals(A)?L.multiplyUnsafe(T):L.multiply(T),F=C(this,N).add(C(b,x));return F.is0()?void 0:F}toAffine(b){const{px:N,py:x,pz:A}=this,C=this.is0();b==null&&(b=C?r.ONE:r.inv(A));const F=r.mul(N,b),L=r.mul(x,b),T=r.mul(A,b);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(T,r.ONE))throw new Error("invZ was invalid");return{x:F,y:L}}isTorsionFree(){const{h:b,isTorsionFree:N}=e;if(b===Bi)return!0;if(N)return N(c,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:N}=e;return b===Bi?this:N?N(c,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(c,this,b)}toHex(b=!0){return Jf(this.toRawBytes(b))}}c.BASE=new c(e.Gx,e.Gy,r.ONE),c.ZERO=new c(r.ZERO,r.ONE,r.ZERO);const p=e.nBitLength,y=zB(c,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function QB(t){const e=M8(t);return k0(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function KB(t){const e=QB(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return boJf(qf(m,e.nByteLength));function v(m){const S=n>>Bi;return m>S}function b(m){return v(m)?a(-m):m}const N=(m,S,M)=>Fl(m.slice(S,M));class x{constructor(S,M,R){this.r=S,this.s=M,this.recovery=R,this.assertValidity()}static fromCompact(S){const M=e.nByteLength;return S=ns("compactSignature",S,M*2),new x(N(S,0,M),N(S,M,2*M))}static fromDER(S){const{r:M,s:R}=el.toSig(ns("DER",S));return new x(M,R)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(S){return new x(this.r,this.s,S)}recoverPublicKey(S){const{r:M,s:R,recovery:U}=this,G=z(ns("msgHash",S));if(U==null||![0,1,2,3].includes(U))throw new Error("recovery id invalid");const B=U===2||U===3?M+e.n:M;if(B>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const g=U&1?"03":"02",O=u.fromHex(g+y(B)),ve=l(B),E=a(-G*ve),J=a(R*ve),oe=u.BASE.multiplyAndAddUnsafe(O,E,J);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Yf(this.toDERHex())}toDERHex(){return el.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Yf(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const A={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=I8(e.n);return DB(e.randomBytes(m),e.n)},precompute(m=8,S=u.BASE){return S._setWindowSize(m),S.multiply(BigInt(3)),S}};function C(m,S=!0){return u.fromPrivateKey(m).toRawBytes(S)}function F(m){const S=m instanceof Uint8Array,M=typeof m=="string",R=(S||M)&&m.length;return S?R===i||R===s:M?R===2*i||R===2*s:m instanceof u}function L(m,S,M=!0){if(F(m))throw new Error("first arg must be private key");if(!F(S))throw new Error("second arg must be public key");return u.fromHex(S).multiply(f(m)).toRawBytes(M)}const T=e.bits2int||function(m){const S=Fl(m),M=m.length*8-e.nBitLength;return M>0?S>>BigInt(M):S},z=e.bits2int_modN||function(m){return a(T(m))},H=ev(e.nBitLength);function K(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(bo<=m&&m$ in M))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:U}=e;let{lowS:G,prehash:B,extraEntropy:g}=M;G==null&&(G=!0),m=ns("msgHash",m),B&&(m=ns("prehashed msgHash",R(m)));const O=z(m),ve=f(S),E=[K(ve),K(O)];if(g!=null){const $=g===!0?U(r.BYTES):g;E.push(ns("extraEntropy",$))}const J=Qh(...E),oe=O;function W($){const V=T($);if(!p(V))return;const Z=l(V),he=u.BASE.multiply(V).toAffine(),Ue=a(he.x);if(Ue===bo)return;const pe=a(Z*a(oe+Ue*ve));if(pe===bo)return;let Be=(he.x===Ue?0:2)|Number(he.y&Bi),ut=pe;return G&&v(pe)&&(ut=b(pe),Be^=1),new x(Ue,ut,Be)}return{seed:J,k2sig:W}}const te={lowS:e.lowS,prehash:!1},de={lowS:e.lowS,prehash:!1};function _(m,S,M=te){const{seed:R,k2sig:U}=ne(m,S,M),G=e;return N8(G.hash.outputLen,G.nByteLength,G.hmac)(R,U)}u.BASE._setWindowSize(8);function h(m,S,M,R=de){var he;const U=m;if(S=ns("msgHash",S),M=ns("publicKey",M),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:G,prehash:B}=R;let g,O;try{if(typeof U=="string"||U instanceof Uint8Array)try{g=x.fromDER(U)}catch(Ue){if(!(Ue instanceof el.Err))throw Ue;g=x.fromCompact(U)}else if(typeof U=="object"&&typeof U.r=="bigint"&&typeof U.s=="bigint"){const{r:Ue,s:pe}=U;g=new x(Ue,pe)}else throw new Error("PARSE");O=u.fromHex(M)}catch(Ue){if(Ue.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(G&&g.hasHighS())return!1;B&&(S=e.hash(S));const{r:ve,s:E}=g,J=z(S),oe=l(E),W=a(J*oe),$=a(ve*oe),V=(he=u.BASE.multiplyAndAddUnsafe(O,W,$))==null?void 0:he.toAffine();return V?a(V.x)===ve:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:L,sign:_,verify:h,ProjectivePoint:u,Signature:x,utils:A}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $B(t){return{hash:t,hmac:(e,...r)=>b8(t,e,WM(...r)),randomBytes:JM}}function WB(t,e){const r=n=>KB({...t,...$B(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const B8=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),v3=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),JB=BigInt(1),Wy=BigInt(2),w3=(t,e)=>(t+e/Wy)/e;function YB(t){const e=B8,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,f=u*u*t%e,c=Ei(f,r,e)*f%e,p=Ei(c,r,e)*f%e,y=Ei(p,Wy,e)*u%e,v=Ei(y,i,e)*y%e,b=Ei(v,s,e)*v%e,N=Ei(b,a,e)*b%e,x=Ei(N,l,e)*N%e,A=Ei(x,a,e)*b%e,C=Ei(A,r,e)*f%e,F=Ei(C,o,e)*v%e,L=Ei(F,n,e)*u%e,T=Ei(L,Wy,e);if(!Jy.eql(Jy.sqr(T),t))throw new Error("Cannot find square root");return T}const Jy=UB(B8,void 0,void 0,{sqrt:YB}),qo=WB({a:BigInt(0),b:BigInt(7),Fp:Jy,n:v3,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=v3,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-JB*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=w3(s*t,e),l=w3(-n*t,e);let u=Jn(t-a*r-l*i,e),f=Jn(-a*n-l*s,e);const c=u>o,p=f>o;if(c&&(u=e-u),p&&(f=e-f),u>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:c,k1:u,k2neg:p,k2:f}}}},rB);BigInt(0);qo.ProjectivePoint;const Yy="0x0000000000000000000000000000000000000000",b3="0x0000000000000000000000000000000000000000000000000000000000000000",A3=BigInt(0),E3=BigInt(1),S3=BigInt(2),F3=BigInt(27),C3=BigInt(28),gd=BigInt(35),ql={};function k3(t){return Ol(mi(t),32)}var tf,rf,nf,cl;const Zi=class Zi{constructor(e,r,n,i){me(this,tf,void 0);me(this,rf,void 0);me(this,nf,void 0);me(this,cl,void 0);$1(e,ql,"Signature"),ee(this,tf,r),ee(this,rf,n),ee(this,nf,i),ee(this,cl,null)}get r(){return D(this,tf)}set r(e){se(Qu(e)===32,"invalid r","value",e),ee(this,tf,mt(e))}get s(){return D(this,rf)}set s(e){se(Qu(e)===32,"invalid s","value",e);const r=mt(e);se(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),ee(this,rf,r)}get v(){return D(this,nf)}set v(e){const r=Wt(e,"value");se(r===27||r===28,"invalid v","v",e),ee(this,nf,r)}get networkV(){return D(this,cl)}get legacyChainId(){const e=this.networkV;return e==null?null:Zi.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ur(this.s);return this.yParity&&(e[0]|=128),mt(e)}get compactSerialized(){return Zr([this.r,this.yParityAndS])}get serialized(){return Zr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Zi(ql,this.r,this.s,this.v);return this.networkV&&ee(e,cl,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Rt(e,"v");return r==F3||r==C3?A3:(se(r>=gd,"invalid EIP-155 v","v",e),(r-gd)/S3)}static getChainIdV(e,r){return Rt(e)*S3+BigInt(35+r-27)}static getNormalizedV(e){const r=Rt(e);return r===A3||r===F3?27:r===E3||r===C3?28:(se(r>=gd,"invalid v","v",e),r&E3?27:28)}static from(e){function r(u,f){se(u,f,"signature",e)}if(e==null)return new Zi(ql,b3,b3,27);if(typeof e=="string"){const u=ur(e,"signature");if(u.length===64){const f=mt(u.slice(0,32)),c=u.slice(32,64),p=c[0]&128?28:27;return c[0]&=127,new Zi(ql,f,mt(c),p)}if(u.length===65){const f=mt(u.slice(0,32)),c=u.slice(32,64);r((c[0]&128)===0,"non-canonical s");const p=Zi.getNormalizedV(u[64]);return new Zi(ql,f,mt(c),p)}r(!1,"invalid raw signature length")}if(e instanceof Zi)return e.clone();const n=e.r;r(n!=null,"missing r");const i=k3(n),s=function(u,f){if(u!=null)return k3(u);if(f!=null){r(Dr(f,32),"invalid yParityAndS");const c=ur(f);return c[0]&=127,mt(c)}r(!1,"missing s")}(e.s,e.yParityAndS);r((ur(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,f,c){if(u!=null){const p=Rt(u);return{networkV:p>=gd?p:void 0,v:Zi.getNormalizedV(p)}}if(f!=null)return r(Dr(f,32),"invalid yParityAndS"),{v:ur(f)[0]&128?28:27};if(c!=null){switch(Wt(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Zi(ql,i,s,a);return o&&ee(l,cl,o),r(e.yParity==null||Wt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};tf=new WeakMap,rf=new WeakMap,nf=new WeakMap,cl=new WeakMap;let xs=Zi;var po;const Wa=class Wa{constructor(e){me(this,po,void 0);se(Qu(e)===32,"invalid private key","privateKey","[REDACTED]"),ee(this,po,mt(e))}get privateKey(){return D(this,po)}get publicKey(){return Wa.computePublicKey(D(this,po))}get compressedPublicKey(){return Wa.computePublicKey(D(this,po),!0)}sign(e){se(Qu(e)===32,"invalid digest length","digest",e);const r=qo.sign(Tn(e),Tn(D(this,po)),{lowS:!0});return xs.from({r:Oa(r.r,32),s:Oa(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Wa.computePublicKey(e);return mt(qo.getSharedSecret(Tn(D(this,po)),ur(r),!1))}static computePublicKey(e,r){let n=ur(e,"key");if(n.length===32){const s=qo.getPublicKey(n,!!r);return mt(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=qo.ProjectivePoint.fromHex(n);return mt(i.toRawBytes(r))}static recoverPublicKey(e,r){se(Qu(e)===32,"invalid digest length","digest",e);const n=xs.from(r);let i=qo.Signature.fromCompact(Tn(Zr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Tn(e));return se(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=qo.ProjectivePoint.fromHex(Wa.computePublicKey(e).substring(2)),s=qo.ProjectivePoint.fromHex(Wa.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};po=new WeakMap;let Kh=Wa;const qB=BigInt(0),XB=BigInt(36);function _3(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ur(_r(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const tv={};for(let t=0;t<10;t++)tv[String(t)]=String(t);for(let t=0;t<26;t++)tv[String.fromCharCode(65+t)]=String(10+t);const P3=15;function ZB(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>tv[n]).join("");for(;e.length>=P3;){let n=e.substring(0,P3);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const eO=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function tO(t){t=t.toLowerCase();let e=qB;for(let r=0;re.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return D(this,hl)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return D(this,hl)===!0?-1:D(this,hl)===!1?this.value.length:null}static from(e,r){return new so(io,e,r)}static uint8(e){return nt(e,8)}static uint16(e){return nt(e,16)}static uint24(e){return nt(e,24)}static uint32(e){return nt(e,32)}static uint40(e){return nt(e,40)}static uint48(e){return nt(e,48)}static uint56(e){return nt(e,56)}static uint64(e){return nt(e,64)}static uint72(e){return nt(e,72)}static uint80(e){return nt(e,80)}static uint88(e){return nt(e,88)}static uint96(e){return nt(e,96)}static uint104(e){return nt(e,104)}static uint112(e){return nt(e,112)}static uint120(e){return nt(e,120)}static uint128(e){return nt(e,128)}static uint136(e){return nt(e,136)}static uint144(e){return nt(e,144)}static uint152(e){return nt(e,152)}static uint160(e){return nt(e,160)}static uint168(e){return nt(e,168)}static uint176(e){return nt(e,176)}static uint184(e){return nt(e,184)}static uint192(e){return nt(e,192)}static uint200(e){return nt(e,200)}static uint208(e){return nt(e,208)}static uint216(e){return nt(e,216)}static uint224(e){return nt(e,224)}static uint232(e){return nt(e,232)}static uint240(e){return nt(e,240)}static uint248(e){return nt(e,248)}static uint256(e){return nt(e,256)}static uint(e){return nt(e,256)}static int8(e){return nt(e,-8)}static int16(e){return nt(e,-16)}static int24(e){return nt(e,-24)}static int32(e){return nt(e,-32)}static int40(e){return nt(e,-40)}static int48(e){return nt(e,-48)}static int56(e){return nt(e,-56)}static int64(e){return nt(e,-64)}static int72(e){return nt(e,-72)}static int80(e){return nt(e,-80)}static int88(e){return nt(e,-88)}static int96(e){return nt(e,-96)}static int104(e){return nt(e,-104)}static int112(e){return nt(e,-112)}static int120(e){return nt(e,-120)}static int128(e){return nt(e,-128)}static int136(e){return nt(e,-136)}static int144(e){return nt(e,-144)}static int152(e){return nt(e,-152)}static int160(e){return nt(e,-160)}static int168(e){return nt(e,-168)}static int176(e){return nt(e,-176)}static int184(e){return nt(e,-184)}static int192(e){return nt(e,-192)}static int200(e){return nt(e,-200)}static int208(e){return nt(e,-208)}static int216(e){return nt(e,-216)}static int224(e){return nt(e,-224)}static int232(e){return nt(e,-232)}static int240(e){return nt(e,-240)}static int248(e){return nt(e,-248)}static int256(e){return nt(e,-256)}static int(e){return nt(e,-256)}static bytes1(e){return cr(e,1)}static bytes2(e){return cr(e,2)}static bytes3(e){return cr(e,3)}static bytes4(e){return cr(e,4)}static bytes5(e){return cr(e,5)}static bytes6(e){return cr(e,6)}static bytes7(e){return cr(e,7)}static bytes8(e){return cr(e,8)}static bytes9(e){return cr(e,9)}static bytes10(e){return cr(e,10)}static bytes11(e){return cr(e,11)}static bytes12(e){return cr(e,12)}static bytes13(e){return cr(e,13)}static bytes14(e){return cr(e,14)}static bytes15(e){return cr(e,15)}static bytes16(e){return cr(e,16)}static bytes17(e){return cr(e,17)}static bytes18(e){return cr(e,18)}static bytes19(e){return cr(e,19)}static bytes20(e){return cr(e,20)}static bytes21(e){return cr(e,21)}static bytes22(e){return cr(e,22)}static bytes23(e){return cr(e,23)}static bytes24(e){return cr(e,24)}static bytes25(e){return cr(e,25)}static bytes26(e){return cr(e,26)}static bytes27(e){return cr(e,27)}static bytes28(e){return cr(e,28)}static bytes29(e){return cr(e,29)}static bytes30(e){return cr(e,30)}static bytes31(e){return cr(e,31)}static bytes32(e){return cr(e,32)}static address(e){return new so(io,"address",e)}static bool(e){return new so(io,"bool",!!e)}static bytes(e){return new so(io,"bytes",e)}static string(e){return new so(io,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new so(io,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===N3}static dereference(e,r){if(so.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};hl=new WeakMap;let Mn=so;class nO extends Ho{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Mn.dereference(r,"string");try{n=yr(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return yr(Oa(e.readValue(),20))}}class iO extends Ho{constructor(r){super(r.name,r.type,"_",r.dynamic);le(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function U8(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return Ne(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),Ne(!l[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),l[f]=!0,r[f]})}else se(!1,"invalid tuple value","tuple",r);se(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Vy,s=new Vy,o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let p=i.writeUpdatableValue();o.push(y=>{p(y+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function D8(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),l=i.subReader(a);try{o=s.decode(l)}catch(u){if(ps(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(ps(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Vp.fromItems(r,n)}class sO extends Ho{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);le(this,"coder");le(this,"length");Mt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+hO))&&this._throwError("value out-of-bounds",n),i=a8(i,8*zn)}else(iGc(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=Gc(r.readValue(),this.size*8);return this.signed&&(n=SM(n,this.size*8)),n}}class gO extends L8{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Sl(Mn.dereference(r,"string")))}decode(e){return Kx(super.decode(e))}}class md extends Ho{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);le(this,"coders");Mt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=Mn.dereference(n,"tuple");return U8(r,this.coders,i)}decode(r){return D8(r,this.coders)}}function Ul(t){return _r(Sl(t))}var mO="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt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hz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const R3=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),T3=4;function yO(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let L=1;L>--l&1}const c=31,p=2**c,y=p>>>1,v=y>>1,b=p-1;let N=0;for(let L=0;L1;){let ne=T+z>>>1;L>>1|f(),H=H<<1^y,K=(K^y)<<1|y|1;A=H,C=1+K-H}let F=n-4;return x.map(L=>{switch(L-F){case 3:return F+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return F+256+(t[a++]<<8|t[a++]);case 1:return F+t[a++];default:return L-1}})}function xO(t){let e=0;return()=>t[e++]}function z8(t){return xO(yO(vO(t)))}function vO(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function wO(t){return t&1?~t>>1:t>>1}function bO(t,e){let r=Array(t);for(let n=0,i=0;n{let e=$h(t);if(e.length)return e})}function H8(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(AO(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(EO(r,t))}return e.flat()}function Wh(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function G8(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function AO(t,e){let r=1+e(),n=e(),i=Wh(e);return G8(i.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(i[a]).fill().map((f,c)=>{let p=c*n;return[l+c*r,u.map(y=>y+p)]})})}function EO(t,e){let r=1+e();return G8(r,1+t,e).map(i=>[i[0],i.slice(1)])}function SO(t){let e=[],r=$h(t);return i(n([]),[]),e;function n(s){let o=t(),a=Wh(()=>{let l=$h(t).map(u=>r[u]);if(l.length)return n(l)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,l){if(!(s&4&&l===a[a.length-1])){s&2&&(l=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let f of u.Q)i(u,[...a,f],l)}}}function FO(t){return t.toString(16).toUpperCase().padStart(2,"0")}function V8(t){return`{${FO(t)}}`}function CO(t){let e=[];for(let r=0,n=t.length;r>24&255}function $8(t){return t&16777215}let qy,I3,Xy,Qd;function MO(){let t=z8(_O);qy=new Map(j8(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),I3=new Set($h(t)),Xy=new Map,Qd=new Map;for(let[e,r]of H8(t)){if(!I3.has(e)&&r.length==2){let[n,i]=r,s=Qd.get(n);s||(s=new Map,Qd.set(n,s)),s.set(i,e)}Xy.set(e,r.reverse())}}function W8(t){return t>=Jh&&t=Kp&&t=$p&&eWp&&e0&&i(Wp+u)}else{let o=Xy.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Qc(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let l=BO(n,a);l>=0?n=l:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function Y8(t){return J8(t).map($8)}function UO(t){return OO(J8(t))}const M3=45,q8=".",X8=65039,Z8=1,ku=t=>Array.from(t);function Yh(t,e){return t.P.has(e)||t.Q.has(e)}class DO extends Array{get is_emoji(){return!0}}let Zy,eS,tl,e2,tS,Ku,cm,ou,rS,B3,t2;function rv(){if(Zy)return;let t=z8(mO);const e=()=>$h(t),r=()=>new Set(e());Zy=new Map(H8(t)),eS=r(),tl=e(),e2=new Set(e().map(f=>tl[f])),tl=new Set(tl),tS=r(),r();let n=j8(t),i=t();const s=()=>new Set(e().flatMap(f=>n[f]).concat(e()));Ku=Wh(f=>{let c=Wh(t).map(p=>p+96);if(c.length){let p=f>=i;c[0]-=32,c=Xf(c),p&&(c=`Restricted[${c}]`);let y=s(),v=s(),b=!t();return{N:c,P:y,Q:v,M:b,R:p}}}),cm=r(),ou=new Map;let o=e().concat(ku(cm)).sort((f,c)=>f-c);o.forEach((f,c)=>{let p=t(),y=o[c]=p?o[c-p]:{V:[],M:new Map};y.V.push(f),cm.has(f)||ou.set(f,y)});for(let{V:f,M:c}of new Set(ou.values())){let p=[];for(let v of f){let b=Ku.filter(x=>Yh(x,v)),N=p.find(({G:x})=>b.some(A=>x.has(A)));N||(N={G:new Set,V:[]},p.push(N)),N.V.push(v),b.forEach(x=>N.G.add(x))}let y=p.flatMap(v=>ku(v.G));for(let{G:v,V:b}of p){let N=new Set(y.filter(x=>!v.has(x)));for(let x of b)c.set(x,N)}}let a=new Set,l=new Set;const u=f=>a.has(f)?l.add(f):a.add(f);for(let f of Ku){for(let c of f.P)u(c);for(let c of f.Q)u(c)}for(let f of a)!ou.has(f)&&!l.has(f)&&ou.set(f,Z8);rS=new Set(ku(a).concat(ku(Y8(a)))),B3=SO(t).map(f=>DO.from(f)).sort(kO),t2=new Map;for(let f of B3){let c=[t2];for(let p of f){let y=c.map(v=>{let b=v.get(p);return b||(b=new Map,v.set(p,b)),b});p===X8?c.push(...y):c=y}for(let p of c)p.V=f}}function nv(t){return(nS(t)?"":`${iv(Z1([t]))} `)+V8(t)}function iv(t){return`"${t}"‎`}function LO(t){if(t.length>=4&&t[2]==M3&&t[3]==M3)throw new Error(`invalid label extension: "${Xf(t.slice(0,4))}"`)}function zO(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function jO(t){let e=t[0],r=R3.get(e);if(r)throw uh(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=CO(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=JO(s,e,r),l=a.length,u;if(!l)throw new Error("empty label");let f=o.output=a.flat();if(zO(f),!(o.emoji=l>1||a[0].is_emoji)&&f.every(p=>p<128))LO(f),u="ASCII";else{let p=a.flatMap(y=>y.is_emoji?[]:y);if(!p.length)u="Emoji";else{if(tl.has(f[0]))throw uh("leading combining mark");for(let b=1;bo.has(a)):ku(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Yh(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function KO(t){let e=Ku;for(let r of t){let n=e.filter(i=>Yh(i,r));if(!n.length)throw Ku.some(i=>Yh(i,r))?sS(e[0],r):iS(r);if(e=n,n.length==1)break}return e}function $O(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${iv(Z1(e))}: ${i}`)}return Xf(n)}).join(q8)}function iS(t){return new Error(`disallowed character: ${nv(t)}`)}function sS(t,e){let r=nv(e),n=Ku.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function uh(t){return new Error(`illegal placement: ${t}`)}function WO(t,e){for(let r of e)if(!Yh(t,r))throw sS(t,r);if(t.M){let r=Y8(e);for(let n=1,i=r.length;nT3)throw new Error(`excessive non-spacing marks: ${iv(Z1(r.slice(n-1,s)))} (${s-n}/${T3})`);n=s}}}function JO(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=qO(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(rS.has(o))i.push(o);else{let a=Zy.get(o);if(a)i.push(...a);else if(!eS.has(o))throw iS(o)}}}return i.length&&n.push(e(i)),n}function YO(t){return t.filter(e=>e!=X8)}function qO(t,e){let r=t2,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const oS=new Uint8Array(32);oS.fill(0);function O3(t){return se(t.length!==0,"invalid ENS name; empty component","comp",t),t}function aS(t){const e=Sl(XO(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function hm(t,e){return{address:yr(t),storageKeys:e.map((r,n)=>(se(Dr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function gc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(se(r.length===2,"invalid slot set",`value[${n}]`,r),hm(r[0],r[1])):(se(r!=null&&typeof r=="object","invalid address-slot set","value",t),hm(r.address,r.storageKeys)));se(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return hm(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function eU(t){let e;return typeof t=="string"?e=Kh.computePublicKey(t,!1):e=t.publicKey,yr(_r("0x"+e.substring(4)).substring(26))}function tU(t,e){return eU(Kh.recoverPublicKey(t,e))}const qn=BigInt(0),rU=BigInt(2),nU=BigInt(27),iU=BigInt(28),sU=BigInt(35),oU=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function sv(t){return t==="0x"?null:yr(t)}function lS(t,e){try{return gc(t)}catch(r){se(!1,r.message,e,t)}}function eg(t,e){return t==="0x"?0:Wt(t,e)}function Dn(t,e){if(t==="0x")return qn;const r=Rt(t,e);return se(r<=oU,"value exceeds uint size",e,r),r}function fn(t,e){const r=Rt(t,"value"),n=mi(r);return se(n.length<=32,"value too large",`tx.${e}`,r),n}function uS(t){return gc(t).map(e=>[e.address,e.storageKeys])}function aU(t){const e=$x(t);se(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:eg(e[0],"nonce"),gasPrice:Dn(e[1],"gasPrice"),gasLimit:Dn(e[2],"gasLimit"),to:sv(e[3]),value:Dn(e[4],"value"),data:mt(e[5]),chainId:qn};if(e.length===6)return r;const n=Dn(e[6],"v"),i=Dn(e[7],"r"),s=Dn(e[8],"s");if(i===qn&&s===qn)r.chainId=n;else{let o=(n-sU)/rU;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Ne(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Ne(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Ms.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Ms;if(typeof e=="string"){const n=ur(e);if(n[0]>=127)return Ms.from(aU(n));switch(n[0]){case 1:return Ms.from(uU(n));case 2:return Ms.from(lU(n))}Ne(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Ms;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=xs.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(se(r.isSigned(),"unsigned transaction cannot define hash","tx",e),se(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(se(r.isSigned(),"unsigned transaction cannot define from","tx",e),se(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}},go=new WeakMap,sf=new WeakMap,of=new WeakMap,af=new WeakMap,lf=new WeakMap,uf=new WeakMap,ff=new WeakMap,cf=new WeakMap,hf=new WeakMap,df=new WeakMap,pf=new WeakMap,gf=new WeakMap,Ms);const cS=new Uint8Array(32);cS.fill(0);const fU=BigInt(-1),hS=BigInt(0),dS=BigInt(1),cU=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hU(t){const e=ur(t),r=e.length%32;return r?Zr([e,cS.slice(r)]):mt(e)}const dU=Oa(dS,32),pU=Oa(hS,32),z3={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},dm=["name","version","chainId","verifyingContract","salt"];function j3(t){return function(e){return se(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const gU={name:j3("name"),version:j3("version"),chainId:function(t){const e=Rt(t,"domain.chainId");return se(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Za(e)},verifyingContract:function(t){try{return yr(t).toLowerCase()}catch{}se(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ur(t,"domain.salt");return se(e.length===32,'invalid domain value "salt"',"domain.salt",t),mt(e)}};function pm(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");se(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=Gc(cU,r?n-1:n),s=r?(i+dS)*fU:hS;return function(o){const a=Rt(o,"value");return se(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Oa(r?a8(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return se(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=ur(n);return se(i.length===r,`invalid length for ${t}`,"value",n),hU(n)}}}switch(t){case"address":return function(e){return Ol(yr(e),32)};case"bool":return function(e){return e?dU:pU};case"bytes":return function(e){return _r(e)};case"string":return function(e){return Ul(e)}}return null}function H3(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var r0,mo,mf,i1,pS;const ki=class ki{constructor(e){me(this,i1);le(this,"primaryType");me(this,r0,void 0);me(this,mo,void 0);me(this,mf,void 0);ee(this,r0,JSON.stringify(e)),ee(this,mo,new Map),ee(this,mf,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(a=>{r.set(a,new Set),n.set(a,[]),i.set(a,new Set)});for(const a in e){const l=new Set;for(const u of e[a]){se(!l.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;se(f!==a,`circular type reference to ${JSON.stringify(f)}`,"types",e),!pm(f)&&(se(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(a),r.get(a).add(f))}}const s=Array.from(n.keys()).filter(a=>n.get(a).length===0);se(s.length!==0,"missing primary type","types",e),se(s.length===1,`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Mt(this,{primaryType:s[0]});function o(a,l){se(!l.has(a),`circular type reference to ${JSON.stringify(a)}`,"types",e),l.add(a);for(const u of r.get(a))if(n.has(u)){o(u,l);for(const f of l)i.get(f).add(u)}l.delete(a)}o(this.primaryType,new Set);for(const[a,l]of i){const u=Array.from(l);u.sort(),D(this,mo).set(a,H3(a,e[a])+u.map(f=>H3(f,e[f])).join(""))}}get types(){return JSON.parse(D(this,r0))}getEncoder(e){let r=D(this,mf).get(e);return r||(r=ot(this,i1,pS).call(this,e),D(this,mf).set(e,r)),r}encodeType(e){const r=D(this,mo).get(e);return se(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return _r(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(pm(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return se(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(o=>this._visit(i[1],o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{});se(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new ki(e)}static getPrimaryType(e){return ki.from(e).primaryType}static hashStruct(e,r,n){return ki.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=z3[n];se(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>dm.indexOf(n.name)-dm.indexOf(i.name)),ki.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Zr(["0x1901",ki.hashDomain(e),ki.from(r).hash(n)])}static hash(e,r,n){return _r(ki.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Dr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=ki.from(r);o.visit(n,(a,l)=>(a==="address"&&!Dr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}}static getPayload(e,r,n){ki.hashDomain(e);const i={},s=[];dm.forEach(l=>{const u=e[l];u!=null&&(i[l]=gU[l](u),s.push({name:l,type:z3[l]}))});const o=ki.from(r),a=Object.assign({},r);return se(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return mt(ur(u));if(l.match(/^u?int/))return Rt(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return se(typeof u=="string","invalid string","value",u),u}se(!1,"unsupported type","type",l)})}}};r0=new WeakMap,mo=new WeakMap,mf=new WeakMap,i1=new WeakSet,pS=function(e){{const i=pm(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i);return o=>{se(!r[3]||parseInt(r[3])===o.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",o);let a=o.map(s);return D(this,mo).has(i)&&(a=a.map(_r)),_r(Zr(a))}}const n=this.types[e];if(n){const i=Ul(D(this,mo).get(e));return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return D(this,mo).has(l)?_r(u):u});return o.unshift(i),Zr(o)}}se(!1,`unknown type: ${e}`,"type",e)};let n2=ki;function jn(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const mU="external public payable",yU=jn(mU.split(" ")),gS="constant external internal payable private public pure view",xU=jn(gS.split(" ")),mS="constructor error event fallback function receive struct",yS=jn(mS.split(" ")),xS="calldata memory storage payable indexed",vU=jn(xS.split(" ")),wU="tuple returns",bU=[mS,xS,wU,gS].join(" "),AU=jn(bU.split(" ")),EU={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},SU=new RegExp("^(\\s*)"),FU=new RegExp("^([0-9]+)"),CU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),vS=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),wS=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ln,os,n0,i2;const s1=class s1{constructor(e){me(this,n0);me(this,ln,void 0);me(this,os,void 0);ee(this,ln,0),ee(this,os,e.slice())}get offset(){return D(this,ln)}get length(){return D(this,os).length-D(this,ln)}clone(){return new s1(D(this,os))}reset(){ee(this,ln,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=ot(this,n0,i2).call(this,D(this,ln)+1,e.match+1);return ee(this,ln,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;D(this,ln)=D(this,os).length)throw new Error("out-of-bounds");return D(this,os)[D(this,ln)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return lg(this,ln)._++,e}toString(){const e=[];for(let r=D(this,ln);r`}};ln=new WeakMap,os=new WeakMap,n0=new WeakSet,i2=function(e=0,r=0){return new s1(D(this,os).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let vs=s1;function Ga(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const c=e.pop().text;f=c+f,e[e.length-1].value=Wt(c)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(CU),a){if(l.text=a[1],s+=l.text.length,AU.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(wS)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(FU),a){l.text=a[1],l.type="NUMBER",s+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new vs(e.map(o=>Object.freeze(o)))}function G3(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function tg(t,e){if(e.peekKeyword(yS)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Bo(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function bS(t){let e=Bo(t,xU);return G3(e,jn("constant payable nonpayable".split(" "))),G3(e,jn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Co(t,e){return t.popParams().map(r=>pn.from(r,e))}function AS(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Rt(t.pop().text);throw new Error("invalid gas")}return null}function Dl(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const kU=new RegExp(/^(.*)\[([0-9]*)\]$/);function V3(t){const e=t.match(wS);if(se(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);se(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);se(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const kr={},oi=Symbol.for("_ethers_internal"),Q3="_ParamTypeInternal",K3="_ErrorInternal",$3="_EventInternal",W3="_ConstructorInternal",J3="_FallbackInternal",Y3="_FunctionInternal",q3="_StructInternal";var yf,Kd;const _i=class _i{constructor(e,r,n,i,s,o,a,l){me(this,yf);le(this,"name");le(this,"type");le(this,"baseType");le(this,"indexed");le(this,"components");le(this,"arrayLength");le(this,"arrayChildren");if($1(e,kr,"ParamType"),Object.defineProperty(this,oi,{value:Q3}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Mt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return ot(this,yf,Kd).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(_i.isParamType(e))return e;if(typeof e=="string")try{return _i.from(Ga(e),r)}catch{se(!1,"invalid param type","obj",e)}else if(e instanceof vs){let a="",l="",u=null;Bo(e,jn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(b=>_i.from(b)),a=`tuple(${u.map(b=>b.format()).join(",")})`):(a=V3(e.popType("TYPE")),l=a);let f=null,c=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new _i(kr,"",a,l,null,u,c,f),c=b.value,a+=b.text,l="array",u=null}let p=null;if(Bo(e,vU).has("indexed")){if(!r)throw new Error("");p=!0}const v=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new _i(kr,v,a,l,p,u,c,f)}const n=e.name;se(!n||typeof n=="string"&&n.match(vS),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(se(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(kU);if(o){const a=parseInt(o[2]||"-1"),l=_i.from({type:o[1],components:e.components});return new _i(kr,n||"",s,"array",i,null,a,l)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(u=>_i.from(u)):null;return new _i(kr,n||"",s,"tuple",i,a,null,null)}return s=V3(e.type),new _i(kr,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[oi]===Q3}};yf=new WeakSet,Kd=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((l,u)=>{var f;ot(f=o,yf,Kd).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in r))throw new Error(`missing value for component ${l.name}`);return r[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var f;ot(f=o[u],yf,Kd).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let pn=_i;class Ll{constructor(e,r,n){le(this,"type");le(this,"inputs");$1(e,kr,"Fragment"),n=Object.freeze(n.slice()),Mt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Ll.from(JSON.parse(e))}catch{}return Ll.from(Ga(e))}if(e instanceof vs)switch(e.peekKeyword(yS)){case"constructor":return So.from(e);case"error":return Xn.from(e);case"event":return Os.from(e);case"fallback":case"receive":return lo.from(e);case"function":return Us.from(e);case"struct":return Cl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return So.from(e);case"error":return Xn.from(e);case"event":return Os.from(e);case"fallback":case"receive":return lo.from(e);case"function":return Us.from(e);case"struct":return Cl.from(e)}Ne(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}se(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return So.isFragment(e)}static isError(e){return Xn.isFragment(e)}static isEvent(e){return Os.isFragment(e)}static isFunction(e){return Us.isFragment(e)}static isStruct(e){return Cl.isFragment(e)}}class rg extends Ll{constructor(r,n,i,s){super(r,n,s);le(this,"name");se(typeof i=="string"&&i.match(vS),"invalid identifier","name",i),s=Object.freeze(s.slice()),Mt(this,{name:i})}}function qh(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Xn extends rg{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,oi,{value:K3})}get selector(){return Ul(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+qh(e,this.inputs)),r.join(" ")}static from(e){if(Xn.isFragment(e))return e;if(typeof e=="string")return Xn.from(Ga(e));if(e instanceof vs){const r=tg("error",e),n=Co(e);return Dl(e),new Xn(kr,r,n)}return new Xn(kr,e.name,e.inputs?e.inputs.map(pn.from):[])}static isFragment(e){return e&&e[oi]===K3}}class Os extends rg{constructor(r,n,i,s){super(r,"event",n,i);le(this,"anonymous");Object.defineProperty(this,oi,{value:$3}),Mt(this,{anonymous:s})}get topicHash(){return Ul(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+qh(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>pn.from(s)),new Os(kr,r,n,!1).topicHash}static from(r){if(Os.isFragment(r))return r;if(typeof r=="string")try{return Os.from(Ga(r))}catch{se(!1,"invalid event fragment","obj",r)}else if(r instanceof vs){const n=tg("event",r),i=Co(r,!0),s=!!Bo(r,jn(["anonymous"])).has("anonymous");return Dl(r),new Os(kr,n,i,s)}return new Os(kr,r.name,r.inputs?r.inputs.map(n=>pn.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[oi]===$3}}class So extends Ll{constructor(r,n,i,s,o){super(r,n,i);le(this,"payable");le(this,"gas");Object.defineProperty(this,oi,{value:W3}),Mt(this,{payable:s,gas:o})}format(r){if(Ne(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${qh(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(So.isFragment(r))return r;if(typeof r=="string")try{return So.from(Ga(r))}catch{se(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof vs){Bo(r,jn(["constructor"]));const n=Co(r),i=!!Bo(r,yU).has("payable"),s=AS(r);return Dl(r),new So(kr,"constructor",n,i,s)}return new So(kr,"constructor",r.inputs?r.inputs.map(pn.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[oi]===W3}}class lo extends Ll{constructor(r,n,i){super(r,"fallback",n);le(this,"payable");Object.defineProperty(this,oi,{value:J3}),Mt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(lo.isFragment(r))return r;if(typeof r=="string")try{return lo.from(Ga(r))}catch{se(!1,"invalid fallback fragment","obj",r)}else if(r instanceof vs){const n=r.toString(),i=r.peekKeyword(jn(["fallback","receive"]));if(se(i,"type must be fallback or receive","obj",n),r.popKeyword(jn(["fallback","receive"]))==="receive"){const l=Co(r);return se(l.length===0,"receive cannot have arguments","obj.inputs",l),Bo(r,jn(["payable"])),Dl(r),new lo(kr,[],!0)}let o=Co(r);o.length?se(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[pn.from("bytes")];const a=bS(r);if(se(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Bo(r,jn(["returns"])).has("returns")){const l=Co(r);se(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return Dl(r),new lo(kr,o,a==="payable")}if(r.type==="receive")return new lo(kr,[],!0);if(r.type==="fallback"){const n=[pn.from("bytes")],i=r.stateMutability==="payable";return new lo(kr,n,i)}se(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[oi]===J3}}class Us extends rg{constructor(r,n,i,s,o,a){super(r,"function",n,s);le(this,"constant");le(this,"outputs");le(this,"stateMutability");le(this,"payable");le(this,"gas");Object.defineProperty(this,oi,{value:Y3}),o=Object.freeze(o.slice()),Mt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Ul(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+qh(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(qh(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>pn.from(s)),new Us(kr,r,"view",n,[],null).selector}static from(r){if(Us.isFragment(r))return r;if(typeof r=="string")try{return Us.from(Ga(r))}catch{se(!1,"invalid function fragment","obj",r)}else if(r instanceof vs){const i=tg("function",r),s=Co(r),o=bS(r);let a=[];Bo(r,jn(["returns"])).has("returns")&&(a=Co(r));const l=AS(r);return Dl(r),new Us(kr,i,o,s,a,l)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Us(kr,r.name,n,r.inputs?r.inputs.map(pn.from):[],r.outputs?r.outputs.map(pn.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[oi]===Y3}}class Cl extends rg{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,oi,{value:q3})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Cl.from(Ga(e))}catch{se(!1,"invalid struct fragment","obj",e)}else if(e instanceof vs){const r=tg("struct",e),n=Co(e);return Dl(e),new Cl(kr,r,n)}return new Cl(kr,e.name,e.inputs?e.inputs.map(pn.from):[])}static isFragment(e){return e&&e[oi]===q3}}const ws=new Map;ws.set(0,"GENERIC_PANIC");ws.set(1,"ASSERT_FALSE");ws.set(17,"OVERFLOW");ws.set(18,"DIVIDE_BY_ZERO");ws.set(33,"ENUM_RANGE_ERROR");ws.set(34,"BAD_STORAGE_DATA");ws.set(49,"STACK_UNDERFLOW");ws.set(50,"ARRAY_RANGE_ERROR");ws.set(65,"OUT_OF_MEMORY");ws.set(81,"UNINITIALIZED_FUNCTION_CALL");const _U=new RegExp(/^bytes([0-9]*)$/),PU=new RegExp(/^(u?int)([0-9]*)$/);let gm=null;function NU(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const u=ur(r);if(r=mt(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(mt(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(mt(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${ws.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?yr(e.to):null,data:e.data||"0x"};return e.from&&(l.from=yr(e.from)),$f(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:l,invocation:o,revert:a})}var oa,au;const o1=class o1{constructor(){me(this,oa)}getDefaultValue(e){const r=e.map(i=>ot(this,oa,au).call(this,pn.from(i)));return new md(r,"_").defaultValue()}encode(e,r){i8(r.length,e.length,"types/values length mismatch");const n=e.map(o=>ot(this,oa,au).call(this,pn.from(o))),i=new md(n,"_"),s=new Vy;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>ot(this,oa,au).call(this,pn.from(o)));return new md(i,"_").decode(new Qy(r,n))}static defaultAbiCoder(){return gm==null&&(gm=new o1),gm}static getBuiltinCallException(e,r,n){return NU(e,r,n,o1.defaultAbiCoder())}};oa=new WeakSet,au=function(e){if(e.isArray())return new sO(ot(this,oa,au).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new md(e.components.map(n=>ot(this,oa,au).call(this,n)),e.name);switch(e.baseType){case"address":return new nO(e.name);case"bool":return new oO(e.name);case"string":return new gO(e.name);case"bytes":return new aO(e.name);case"":return new fO(e.name)}let r=e.type.match(PU);if(r){let n=parseInt(r[2]||"256");return se(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new pO(n/8,r[1]==="int",e.name)}if(r=e.type.match(_U),r){let n=parseInt(r[1]);return se(n!==0&&n<=32,"invalid bytes length","param",e),new lO(n,e.name)}se(!1,"invalid type","type",e.type)};let Yp=o1;class RU{constructor(e,r,n){le(this,"fragment");le(this,"name");le(this,"signature");le(this,"topic");le(this,"args");const i=e.name,s=e.format();Mt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class TU{constructor(e,r,n,i){le(this,"fragment");le(this,"name");le(this,"args");le(this,"signature");le(this,"selector");le(this,"value");const s=e.name,o=e.format();Mt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class IU{constructor(e,r,n){le(this,"fragment");le(this,"name");le(this,"args");le(this,"signature");le(this,"selector");const i=e.name,s=e.format();Mt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class X3{constructor(e){le(this,"hash");le(this,"_isIndexed");Mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const Z3={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},eA={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&Z3[t.toString()]&&(e=Z3[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Ps,Ns,Rs,Sn,xf,$d,vf,Wd;const Pu=class Pu{constructor(e){me(this,xf);me(this,vf);le(this,"fragments");le(this,"deploy");le(this,"fallback");le(this,"receive");me(this,Ps,void 0);me(this,Ns,void 0);me(this,Rs,void 0);me(this,Sn,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ee(this,Rs,new Map),ee(this,Ps,new Map),ee(this,Ns,new Map);const n=[];for(const o of r)try{n.push(Ll.from(o))}catch(a){console.log("EE",a)}Mt(this,{fragments:Object.freeze(n)});let i=null,s=!1;ee(this,Sn,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Mt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(se(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":l=D(this,Rs);break;case"event":l=D(this,Ns);break;case"error":l=D(this,Ps);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Mt(this,{deploy:So.from("constructor()")}),Mt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Yp.defaultAbiCoder()}getFunctionName(e){const r=ot(this,xf,$d).call(this,e,null,!1);return se(r,"no matching function","key",e),r.name}hasFunction(e){return!!ot(this,xf,$d).call(this,e,null,!1)}getFunction(e,r){return ot(this,xf,$d).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(D(this,Rs).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");se(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=Xn.from(e).format(),e==="Error(string)")return Xn.from("error Error(string)");if(e==="Panic(uint256)")return Xn.from("error Panic(uint256)");const n=D(this,Ps).get(e);return n||null}forEachError(e){const r=Array.from(D(this,Ps).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?Ul(o):s.type==="bytes"?_r(mt(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=Oa(o):s.type.match(/^bytes/)?o=EM(o,32):s.type==="address"&&D(this,Sn).encode(["address"],[o]),Ol(mt(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){se(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?se(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);se(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),se(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(Ul(l));else if(o.type==="bytes")n.push(_r(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(D(this,Sn).encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:D(this,Sn).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const y=this.getEvent(e);se(y,"unknown event","eventFragment",e),e=y}if(n!=null&&!e.anonymous){const y=e.topicHash;se(Dr(n[0],32)&&n[0].toLowerCase()===y,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((y,v)=>{y.indexed?y.type==="string"||y.type==="bytes"||y.baseType==="tuple"||y.baseType==="array"?(i.push(pn.from({type:"bytes32",name:y.name})),o.push(!0)):(i.push(y),o.push(!1)):(s.push(y),o.push(!1))});const a=n!=null?D(this,Sn).decode(i,Zr(n)):null,l=D(this,Sn).decode(s,r,!0),u=[],f=[];let c=0,p=0;return e.inputs.forEach((y,v)=>{let b=null;if(y.indexed)if(a==null)b=new X3(null);else if(o[v])b=new X3(a[p++]);else try{b=a[p++]}catch(N){b=N}else try{b=l[c++]}catch(N){b=N}u.push(b),f.push(y.name||null)}),Vp.fromItems(u,f)}parseTransaction(e){const r=ur(e.data,"tx.data"),n=Rt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(mt(r.slice(0,4)));if(!i)return null;const s=D(this,Sn).decode(i.inputs,r.slice(4));return new TU(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new RU(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=mt(e),n=this.getError(Br(r,0,4));if(!n)return null;const i=D(this,Sn).decode(n.inputs,Br(r,4));return new IU(n,n.selector,i)}static from(e){return e instanceof Pu?e:typeof e=="string"?new Pu(JSON.parse(e)):typeof e.format=="function"?new Pu(e.format("json")):new Pu(e)}};Ps=new WeakMap,Ns=new WeakMap,Rs=new WeakMap,Sn=new WeakMap,xf=new WeakSet,$d=function(e,r,n){if(Dr(e)){const s=e.toLowerCase();for(const o of D(this,Rs).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of D(this,Rs))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,l=!0;Mn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=s.length-1;u>=0;u--){const f=s[u].inputs.length;f!==a&&(!l||f!==a-1)&&s.splice(u,1)}for(let u=s.length-1;u>=0;u--){const f=s[u].inputs;for(let c=0;c=f.length){if(r[c].type==="overrides")continue;s.splice(u,1);break}if(r[c].type!==f[c].baseType){s.splice(u,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");se(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=D(this,Rs).get(Us.from(e).format());return i||null},vf=new WeakSet,Wd=function(e,r,n){if(Dr(e)){const s=e.toLowerCase();for(const o of D(this,Ns).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of D(this,Ns))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let l=0;l1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");se(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=D(this,Ns).get(Os.from(e).format());return i||null};let s2=Pu;const ES=BigInt(0);function fh(t){return t??null}function Rn(t){return t==null?null:t.toString()}class tA{constructor(e,r,n){le(this,"gasPrice");le(this,"maxFeePerGas");le(this,"maxPriorityFeePerGas");Mt(this,{gasPrice:fh(e),maxFeePerGas:fh(r),maxPriorityFeePerGas:fh(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Rn(e),maxFeePerGas:Rn(r),maxPriorityFeePerGas:Rn(n)}}}function qp(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=mt(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Rt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Wt(t[i],`request.${i}`));return t.accessList&&(e.accessList=gc(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var yo;class MU{constructor(e,r){le(this,"provider");le(this,"number");le(this,"hash");le(this,"timestamp");le(this,"parentHash");le(this,"nonce");le(this,"difficulty");le(this,"gasLimit");le(this,"gasUsed");le(this,"miner");le(this,"extraData");le(this,"baseFeePerGas");me(this,yo,void 0);ee(this,yo,e.transactions.map(n=>typeof n!="string"?new Xh(n,r):n)),Mt(this,{provider:r,hash:fh(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:fh(e.baseFeePerGas)})}get transactions(){return D(this,yo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=D(this,yo).slice();return e.length===0?[]:(Ne(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:p}=this;return{_type:"Block",baseFeePerGas:Rn(e),difficulty:Rn(r),extraData:n,gasLimit:Rn(i),gasUsed:Rn(s),hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:p}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew _0(i,r))));let n=ES;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Mt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return D(this,i0)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:f,root:c}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Rn(this.cumulativeGasUsed),from:r,gasPrice:Rn(this.gasPrice),gasUsed:Rn(this.gasUsed),hash:i,index:s,logs:u,logsBloom:l,root:c,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:p,nonce:y}=await Wn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(y{if(p==null||p.status!==0)return p;Ne(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await l(),n===0)return null;return await new Promise((p,y)=>{const v=[],b=()=>{v.forEach(x=>x())};if(v.push(()=>{a=!0}),i>0){const x=setTimeout(()=>{b(),y($f("wait for transaction timeout","TIMEOUT"))},i);v.push(()=>{clearTimeout(x)})}const N=async x=>{if(await x.confirmations()>=n){b();try{p(u(x))}catch(A){y(A)}}};if(v.push(()=>{this.provider.off(this.hash,N)}),this.provider.on(this.hash,N),s>=0){const x=async()=>{try{await l()}catch(A){if(ps(A,"TRANSACTION_REPLACED")){b(),y(A);return}}a||this.provider.once("block",x)};v.push(()=>{this.provider.off("block",x)}),this.provider.once("block",x)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return Ne(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),CS(this)}reorderedEvent(e){return Ne(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ne(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),FS(this,e)}replaceableTransaction(e){se(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new yv(this,this.provider);return ee(r,aa,e),r}};aa=new WeakMap;let Xh=yv;function BU(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function FS(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function CS(t){return{orphan:"drop-transaction",tx:t}}function OU(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class av extends _0{constructor(r,n,i){super(r,r.provider);le(this,"interface");le(this,"fragment");le(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Mt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class kS extends _0{constructor(r,n){super(r,r.provider);le(this,"error");Mt(this,{error:n})}}var wf;class UU extends SS{constructor(r,n,i){super(i,n);me(this,wf,void 0);ee(this,wf,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?D(this,wf).getEvent(r.topics[0]):null;if(n)try{return new av(r,D(this,wf),n)}catch(i){return new kS(r,i)}return r})}}wf=new WeakMap;var s0;class lv extends Xh{constructor(r,n,i){super(i,n);me(this,s0,void 0);ee(this,s0,r)}async wait(r){const n=await super.wait(r);return n==null?null:new UU(D(this,s0),this.provider,n)}}s0=new WeakMap;class _S extends l8{constructor(r,n,i,s){super(r,n,i);le(this,"log");Mt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class DU extends _S{constructor(e,r,n,i,s){super(e,r,n,new av(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Mt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const rA=BigInt(0);function PS(t){return t&&typeof t.call=="function"}function NS(t){return t&&typeof t.estimateGas=="function"}function ng(t){return t&&typeof t.resolveName=="function"}function RS(t){return t&&typeof t.sendTransaction=="function"}function TS(t){if(t!=null){if(ng(t))return t;if(t.provider)return t.provider}}var o0;class LU{constructor(e,r,n){me(this,o0,void 0);le(this,"fragment");if(Mt(this,{fragment:r}),r.inputs.lengthn[l]==null?null:a.walkAsync(n[l],(f,c)=>f==="address"?Array.isArray(c)?Promise.all(c.map(p=>gs(p,s))):gs(c,s):c)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return D(this,o0)}}o0=new WeakMap;function zl(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function rl(t){return t==null?null:t.provider||null}async function IS(t,e){const r=Mn.dereference(t,"overrides");se(typeof r=="object","invalid overrides parameter","overrides",t);const n=qp(r);return se(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),se(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function zU(t,e,r){const n=zl(t,"resolveName"),i=ng(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,l)=>(l=Mn.dereference(l,a),a==="address"?gs(l,i):l))))}function jU(t){const e=async function(o){const a=await IS(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await gs(a.from,TS(t.runner)));const l=t.interface,u=Rt(a.value||rA,"overrides.value")===rA,f=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!f&&!u&&se(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),se(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const c=l.receive||l.fallback&&l.fallback.payable;return se(c||u,"cannot send value to non-payable fallback","overrides.value",a.value),se(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=zl(t.runner,"call");Ne(PS(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw Vx(u)&&u.data?t.interface.makeError(u.data,l):u}},n=async function(o){const a=t.runner;Ne(RS(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=rl(t.runner);return new lv(t.interface,u,l)},i=async function(o){const a=zl(t.runner,"estimateGas");return Ne(NS(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Mt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function HU(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return Ne(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let c={};if(f.inputs.length+1===u.length&&(c=await IS(u.pop()),c.from&&(c.from=await gs(c.from,TS(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const p=await zU(t.runner,f.inputs,u);return Object.assign({},c,await Wn({to:t.getAddress(),data:t.interface.encodeFunctionData(f,p)}))},i=async function(...u){const f=await a(...u);return f.length===1?f[0]:f},s=async function(...u){const f=t.runner;Ne(RS(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await f.sendTransaction(await n(...u)),p=rl(t.runner);return new lv(t.interface,p,c)},o=async function(...u){const f=zl(t.runner,"estimateGas");return Ne(NS(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},a=async function(...u){const f=zl(t.runner,"call");Ne(PS(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await n(...u);let p="0x";try{p=await f.call(c)}catch(v){throw Vx(v)&&v.data?t.interface.makeError(v.data,c):v}const y=r(...u);return t.interface.decodeFunctionResult(y,p)},l=async(...u)=>r(...u).constant?await i(...u):await s(...u);return Mt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return Ne(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function GU(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Ne(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new LU(t,r(...i),i)};return Mt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Ne(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const Xp=Symbol.for("_ethersInternal_contract"),MS=new WeakMap;function VU(t,e){MS.set(t[Xp],e)}function ai(t){return MS.get(t[Xp])}function QU(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function uv(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Dr(o,32))return o;const a=t.interface.getEvent(o);return se(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Dr(e,32)?r=[e]:(n=t.interface.getEvent(e),se(n,"unknown fragment","event",e),r=[n.topicHash]):QU(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):se(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Kc(t,e){const{subs:r}=ai(t);return r.get((await uv(t,e)).tag)||null}async function nA(t,e,r){const n=rl(t.runner);Ne(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await uv(t,r),{addr:a,subs:l}=ai(t);let u=l.get(s);if(!u){const c={address:a||t,topics:o},p=N=>{let x=i;if(x==null)try{x=t.interface.getEvent(N.topics[0])}catch{}if(x){const A=x,C=i?t.interface.decodeEventLog(i,N.data,N.topics):[];a2(t,r,C,F=>new DU(t,F,r,A,N))}else a2(t,r,[],A=>new _S(t,A,r,N))};let y=[];u={tag:s,listeners:[],start:()=>{y.length||y.push(n.on(c,p))},stop:async()=>{if(y.length==0)return;let N=y;y=[],await Promise.all(N),n.off(c,p)}},l.set(s,u)}return u}let o2=Promise.resolve();async function KU(t,e,r,n){await o2;const i=await Kc(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const l=Array.from(r);n&&l.push(n(a?null:o));try{o.call(t,...l)}catch{}return!a}),i.listeners.length===0&&(i.stop(),ai(t).subs.delete(i.tag)),s>0}async function a2(t,e,r,n){try{await o2}catch{}const i=KU(t,e,r,n);return o2=i,await i}const yd=["then"];var uz;const gh=class gh{constructor(e,r,n,i){le(this,"target");le(this,"interface");le(this,"runner");le(this,"filters");le(this,uz);le(this,"fallback");se(typeof e=="string"||O8(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=s2.from(r);Mt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,Xp,{value:{}});let o,a=null,l=null;if(i){const c=rl(n);l=new lv(this.interface,c,i)}let u=new Map;if(typeof e=="string")if(Dr(e))a=e,o=Promise.resolve(e);else{const c=zl(n,"resolveName");if(!ng(c))throw $f("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=c.resolveName(e).then(p=>{if(p==null)throw $f("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return ai(this).addr=p,p})}else o=e.getAddress().then(c=>{if(c==null)throw new Error("TODO");return ai(this).addr=c,c});VU(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const f=new Proxy({},{get:(c,p,y)=>{if(typeof p=="symbol"||yd.indexOf(p)>=0)return Reflect.get(c,p,y);try{return this.getEvent(p)}catch(v){if(!ps(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(c,p)=>yd.indexOf(p)>=0?Reflect.has(c,p):Reflect.has(c,p)||this.interface.hasEvent(String(p))});return Mt(this,{filters:f}),Mt(this,{fallback:s.receive||s.fallback?jU(this):null}),new Proxy(this,{get:(c,p,y)=>{if(typeof p=="symbol"||p in c||yd.indexOf(p)>=0)return Reflect.get(c,p,y);try{return c.getFunction(p)}catch(v){if(!ps(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(c,p)=>typeof p=="symbol"||p in c||yd.indexOf(p)>=0?Reflect.has(c,p):c.interface.hasFunction(p)})}connect(e){return new gh(this.target,this.interface,e)}attach(e){return new gh(e,this.interface,this.runner)}async getAddress(){return await ai(this).addrPromise}async getDeployedCode(){const e=rl(this.runner);Ne(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=rl(this.runner);return Ne(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return ai(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),HU(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),GU(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=ai(this),o=i||await s,{fragment:a,topics:l}=await uv(this,e),u={address:o,topics:l,fromBlock:r,toBlock:n},f=rl(this.runner);return Ne(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(c=>{let p=a;if(p==null)try{p=this.interface.getEvent(c.topics[0])}catch{}if(p)try{return new av(c,this.interface,p)}catch(y){return new kS(c,y)}return new _0(c,f)})}async on(e,r){const n=await nA(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await nA(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await a2(this,e,r,null)}async listenerCount(e){if(e){const i=await Kc(this,e);return i?i.listeners.length:0}const{subs:r}=ai(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Kc(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=ai(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Kc(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),ai(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Kc(this,e);if(!r)return this;r.stop(),ai(this).subs.delete(r.tag)}else{const{subs:r}=ai(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends gh{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};uz=Xp;let l2=gh;function $U(){return l2}class ch extends $U(){}function mm(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):se(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class WU{constructor(e){le(this,"name");Mt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const BS=new RegExp("^(ipfs)://(.*)$","i"),iA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),BS,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var la,dl,ua,lu,a1,OS;const Nu=class Nu{constructor(e,r,n){me(this,ua);le(this,"provider");le(this,"address");le(this,"name");me(this,la,void 0);me(this,dl,void 0);Mt(this,{provider:e,address:r,name:n}),ee(this,la,null),ee(this,dl,new ch(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return D(this,la)==null&&ee(this,la,(async()=>{try{return await D(this,dl).supportsInterface("0x9061b923")}catch(e){if(ps(e,"CALL_EXCEPTION"))return!1;throw ee(this,la,null),e}})()),await D(this,la)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await ot(this,ua,lu).call(this,"addr(bytes32)");return s==null||s===Yy?null:s}catch(s){if(ps(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await ot(this,ua,lu).call(this,"addr(bytes32,uint)",[s]);if(Dr(o,20))return yr(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof WU&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await ot(this,ua,lu).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Ne(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await ot(this,ua,lu).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await ot(this,ua,lu).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${kM("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Ne(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function P0(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Ne(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function JU(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}se(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function ec(t){return se(Dr(t,!0),"invalid data","value",t),t}function zi(t){return se(Dr(t,32),"invalid hash","value",t),t}const YU=P0({address:yr,blockHash:zi,blockNumber:Wt,data:ec,index:Wt,removed:Fr(JU,!1),topics:fv(zi),transactionHash:zi,transactionIndex:Wt},{index:["logIndex"]});function qU(t){return YU(t)}const XU=P0({hash:Fr(zi),parentHash:zi,number:Wt,timestamp:Wt,nonce:Fr(ec),difficulty:Rt,gasLimit:Rt,gasUsed:Rt,miner:Fr(yr),extraData:ec,baseFeePerGas:Fr(Rt)});function ZU(t){const e=XU(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:US(r)),e}const eD=P0({transactionIndex:Wt,blockNumber:Wt,transactionHash:zi,address:yr,topics:fv(zi),data:ec,index:Wt,blockHash:zi},{index:["logIndex"]});function tD(t){return eD(t)}const rD=P0({to:Fr(yr,null),from:Fr(yr,null),contractAddress:Fr(yr,null),index:Wt,root:Fr(mt),gasUsed:Rt,logsBloom:Fr(ec),blockHash:zi,hash:zi,logs:fv(tD),blockNumber:Wt,cumulativeGasUsed:Rt,effectiveGasPrice:Fr(Rt),status:Fr(Wt),type:Fr(Wt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function nD(t){return rD(t)}function US(t){t.to&&Rt(t.to)===sA&&(t.to="0x0000000000000000000000000000000000000000");const e=P0({hash:zi,type:r=>r==="0x"||r==null?0:Wt(r),accessList:Fr(gc,null),blockHash:Fr(zi,null),blockNumber:Fr(Wt,null),transactionIndex:Fr(Wt,null),from:yr,gasPrice:Fr(Rt),maxPriorityFeePerGas:Fr(Rt),maxFeePerGas:Fr(Rt),gasLimit:Rt,to:Fr(yr,null),value:Rt,nonce:Wt,data:ec,creates:Fr(yr,null),chainId:Fr(Rt,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=rO(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=xs.from(t.signature):e.signature=xs.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Rt(e.blockHash)===sA&&(e.blockHash=null),e}const iD="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class N0{constructor(e){le(this,"name");Mt(this,{name:e})}clone(){return new N0(this.name)}}class ig extends N0{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);le(this,"effectiveBlock");le(this,"txBase");le(this,"txCreate");le(this,"txDataZero");le(this,"txDataNonzero");le(this,"txAccessListStorageKey");le(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let l=(n||{})[o];l==null&&(l=a),se(typeof l=="number",`invalud value for ${o}`,"costs",n),i[o]=l}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Mt(this,i)}clone(){return new ig(this.effectiveBlock,this)}}class sg extends N0{constructor(r,n){super("org.ethers.plugins.network.Ens");le(this,"address");le(this,"targetNetwork");Mt(this,{address:r||iD,targetNetwork:n??1})}clone(){return new sg(this.address,this.targetNetwork)}}var a0,l0;class DS extends N0{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");me(this,a0,void 0);me(this,l0,void 0);ee(this,a0,r),ee(this,l0,n)}get url(){return D(this,a0)}get processFunc(){return D(this,l0)}clone(){return this}}a0=new WeakMap,l0=new WeakMap;const ym=new Map;var bf,Af,fa;const Ru=class Ru{constructor(e,r){me(this,bf,void 0);me(this,Af,void 0);me(this,fa,void 0);ee(this,bf,e),ee(this,Af,Rt(r)),ee(this,fa,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return D(this,bf)}set name(e){ee(this,bf,e)}get chainId(){return D(this,Af)}set chainId(e){ee(this,Af,Rt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Rt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Rt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Rt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(D(this,fa).values())}attachPlugin(e){if(D(this,fa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return D(this,fa).set(e.name,e.clone()),this}getPlugin(e){return D(this,fa).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new Ru(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new ig;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function aA(t){return new DS(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:oA(a.maxFee,9),maxPriorityFeePerGas:oA(a.maxPriorityFee,9)}}catch(s){Ne(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}function sD(t){return new DS("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const s=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:s+t,maxPriorityFeePerGas:t}})}let lA=!1;function oD(){if(lA)return;lA=!0;function t(e,r,n){const i=function(){const s=new nl(e,r);return n.ensNetwork!=null&&s.attachPlugin(new sg(null,n.ensNetwork)),s.attachPlugin(new ig),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};nl.register(e,i),nl.register(r,i),n.altNames&&n.altNames.forEach(s=>{nl.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[aA("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[aA("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[sD(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function u2(t){return JSON.parse(JSON.stringify(t))}var xo,Ni,ca,Ts,Ef,Jd;class aD{constructor(e){me(this,Ef);me(this,xo,void 0);me(this,Ni,void 0);me(this,ca,void 0);me(this,Ts,void 0);ee(this,xo,e),ee(this,Ni,null),ee(this,ca,4e3),ee(this,Ts,-2)}get pollingInterval(){return D(this,ca)}set pollingInterval(e){ee(this,ca,e)}start(){D(this,Ni)||(ee(this,Ni,D(this,xo)._setTimeout(ot(this,Ef,Jd).bind(this),D(this,ca))),ot(this,Ef,Jd).call(this))}stop(){D(this,Ni)&&(D(this,xo)._clearTimeout(D(this,Ni)),ee(this,Ni,null))}pause(e){this.stop(),e&&ee(this,Ts,-2)}resume(){this.start()}}xo=new WeakMap,Ni=new WeakMap,ca=new WeakMap,Ts=new WeakMap,Ef=new WeakSet,Jd=async function(){try{const e=await D(this,xo).getBlockNumber();if(D(this,Ts)===-2){ee(this,Ts,e);return}if(e!==D(this,Ts)){for(let r=D(this,Ts)+1;r<=e;r++){if(D(this,Ni)==null)return;await D(this,xo).emit("block",r)}ee(this,Ts,e)}}catch{}D(this,Ni)!=null&&ee(this,Ni,D(this,xo)._setTimeout(ot(this,Ef,Jd).bind(this),D(this,ca)))};var pl,gl,ha;class LS{constructor(e){me(this,pl,void 0);me(this,gl,void 0);me(this,ha,void 0);ee(this,pl,e),ee(this,ha,!1),ee(this,gl,r=>{this._poll(r,D(this,pl))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){D(this,ha)||(ee(this,ha,!0),D(this,gl).call(this,-2),D(this,pl).on("block",D(this,gl)))}stop(){D(this,ha)&&(ee(this,ha,!1),D(this,pl).off("block",D(this,gl)))}pause(e){this.stop()}resume(){this.start()}}pl=new WeakMap,gl=new WeakMap,ha=new WeakMap;var l1;class lD extends LS{constructor(r,n){super(r);me(this,l1,void 0);ee(this,l1,u2(n))}async _poll(r,n){throw new Error("@TODO")}}l1=new WeakMap;var Sf;class uD extends LS{constructor(r,n){super(r);me(this,Sf,void 0);ee(this,Sf,n)}async _poll(r,n){const i=await n.getTransactionReceipt(D(this,Sf));i&&n.emit(D(this,Sf),i)}}Sf=new WeakMap;var vo,Ff,Cf,da,Ri,u1,zS;class fD{constructor(e,r){me(this,u1);me(this,vo,void 0);me(this,Ff,void 0);me(this,Cf,void 0);me(this,da,void 0);me(this,Ri,void 0);ee(this,vo,e),ee(this,Ff,u2(r)),ee(this,Cf,ot(this,u1,zS).bind(this)),ee(this,da,!1),ee(this,Ri,-2)}start(){D(this,da)||(ee(this,da,!0),D(this,Ri)===-2&&D(this,vo).getBlockNumber().then(e=>{ee(this,Ri,e)}),D(this,vo).on("block",D(this,Cf)))}stop(){D(this,da)&&(ee(this,da,!1),D(this,vo).off("block",D(this,Cf)))}pause(e){this.stop(),e&&ee(this,Ri,-2)}resume(){this.start()}}vo=new WeakMap,Ff=new WeakMap,Cf=new WeakMap,da=new WeakMap,Ri=new WeakMap,u1=new WeakSet,zS=async function(e){if(D(this,Ri)===-2)return;const r=u2(D(this,Ff));r.fromBlock=D(this,Ri)+1,r.toBlock=e;const n=await D(this,vo).getLogs(r);if(n.length===0){D(this,Ri){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class dD{constructor(e){le(this,"name");Mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function pD(t){return JSON.parse(JSON.stringify(t))}function f2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function xm(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(Dr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:Yd("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:Yd("orphan",r),filter:pD(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?f2(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Dr(a)?i.push(a):s.push((async()=>{i.push(await gs(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=f2(i.map(a=>a.toLowerCase()))}return{filter:n,tag:Yd("event",n),type:"event"}}se(!1,"unknown ProviderEvent","event",t)}function vm(){return new Date().getTime()}const gD={cacheTimeout:250,pollingInterval:4e3};var Fn,pa,Cn,kf,fi,ml,ga,wo,u0,Ti,_f,Pf,$n,Fi,f0,c2,c0,h2,yl,$c,h0,d2,xl,Wc,Nf,qd;class mD{constructor(e,r){me(this,$n);me(this,f0);me(this,c0);me(this,yl);me(this,h0);me(this,xl);me(this,Nf);me(this,Fn,void 0);me(this,pa,void 0);me(this,Cn,void 0);me(this,kf,void 0);me(this,fi,void 0);me(this,ml,void 0);me(this,ga,void 0);me(this,wo,void 0);me(this,u0,void 0);me(this,Ti,void 0);me(this,_f,void 0);me(this,Pf,void 0);if(ee(this,Pf,Object.assign({},gD,r||{})),e==="any")ee(this,ml,!0),ee(this,fi,null);else if(e){const n=nl.from(e);ee(this,ml,!1),ee(this,fi,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else ee(this,ml,!1),ee(this,fi,null);ee(this,wo,-1),ee(this,ga,new Map),ee(this,Fn,new Map),ee(this,pa,new Map),ee(this,Cn,null),ee(this,kf,!1),ee(this,u0,1),ee(this,Ti,new Map),ee(this,_f,!1)}get pollingInterval(){return D(this,Pf).pollingInterval}get provider(){return this}get plugins(){return Array.from(D(this,pa).values())}attachPlugin(e){if(D(this,pa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return D(this,pa).set(e.name,e.connect(this)),this}getPlugin(e){return D(this,pa).get(e)||null}get disableCcipRead(){return D(this,_f)}set disableCcipRead(e){ee(this,_f,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${c}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:c}}),o.push(c)}Ne(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new MU(ZU(e),this)}_wrapLog(e,r){return new _0(qU(e),this)}_wrapTransactionReceipt(e,r){return new SS(nD(e),this)}_wrapTransactionResponse(e,r){return new Xh(US(e),this)}_detectNetwork(){Ne(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Ne(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Wt(await ot(this,$n,Fi).call(this,{method:"getBlockNumber"}),"%response");return D(this,wo)>=0&&ee(this,wo,e),e}_getAddress(e){return gs(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(Dr(e))return Dr(e,32)?e:Za(e);if(typeof e=="bigint"&&(e=Wt(e,"blockTag")),typeof e=="number")return e>=0?Za(e):D(this,wo)>=0?Za(D(this,wo)+e):this.getBlockNumber().then(r=>Za(r+e));se(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?f2(l.map(u=>u.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,u,f)=>{let c;switch(l.length){case 0:break;case 1:c=l[0];break;default:l.sort(),c=l}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const p={};return c&&(p.address=c),r.length&&(p.topics=r),u&&(p.fromBlock=u),f&&(p.toBlock=f),n&&(p.blockHash=n),p};let s=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)s.push(this._getAddress(l));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(l=>i(l[0],l[1],l[2])):i(s,o,a)}_getTransactionRequest(e){const r=qp(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=gs(r[i],this);xd(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);xd(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(D(this,fi)==null){const i=this._detectNetwork().then(s=>(this.emit("network",s,null),s),s=>{throw D(this,fi)===i&&ee(this,fi,null),s});return ee(this,fi,i),(await i).clone()}const e=D(this,fi),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(D(this,ml)?(this.emit("network",n,r),D(this,fi)===e&&ee(this,fi,Promise.resolve(n))):Ne(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s}=await Wn({_block:ot(this,h0,d2).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ot(this,$n,Fi).call(this,{method:"getGasPrice"});return Rt(u,"%response")}catch{}return null})()});let o=null,a=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(a=BigInt("1000000000"),o=l.baseFeePerGas*cD+a),new tA(s,o,a)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Ua(n.url),s=await n.processFunc(r,this,i);return new tA(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return xd(r)&&(r=await r),Rt(await ot(this,$n,Fi).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await Wn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ot(this,c0,h2).call(this,ot(this,f0,c2).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Rt(await ot(this,yl,$c).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return Wt(await ot(this,yl,$c).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return mt(await ot(this,yl,$c).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Rt(r,"position");return mt(await ot(this,yl,$c).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await Wn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=ov.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await Wn({network:this.getNetwork(),params:ot(this,h0,d2).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await Wn({network:this.getNetwork(),params:ot(this,$n,Fi).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await Wn({network:this.getNetwork(),params:ot(this,$n,Fi).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await ot(this,$n,Fi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await Wn({network:this.getNetwork(),result:ot(this,$n,Fi).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:mt(r)}async getLogs(e){let r=this._getFilter(e);xd(r)&&(r=await r);const{network:n,params:i}=await Wn({network:this.getNetwork(),params:ot(this,$n,Fi).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Ne(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Zp.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=yr(e);const r=r2(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Zp.getEnsAddress(this),s=await new ch(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===Yy)return null;const a=await new ch(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(ps(n,"BAD_DATA")&&n.value==="0x"||ps(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const l=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",l)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o($f("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){Ne(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=D(this,Ti).get(e);r&&(r.timer&&clearTimeout(r.timer),D(this,Ti).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=lg(this,u0)._++,i=()=>{D(this,Ti).delete(n),e()};if(this.paused)D(this,Ti).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);D(this,Ti).set(n,{timer:s,func:i,time:vm()})}return n}_forEachSubscriber(e){for(const r of D(this,Fn).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new dD(e.type);case"block":{const r=new aD(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new fD(this,e.filter);case"transaction":return new uD(this,e.hash);case"orphan":return new lD(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of D(this,Fn).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),D(this,Cn)!=null&&r.pause(D(this,Cn));break}}async on(e,r){const n=await ot(this,Nf,qd).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,D(this,Cn)!=null&&n.subscriber.pause(D(this,Cn))),this}async once(e,r){const n=await ot(this,Nf,qd).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,D(this,Cn)!=null&&n.subscriber.pause(D(this,Cn))),this}async emit(e,...r){const n=await ot(this,xl,Wc).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new l8(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),D(this,Fn).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await ot(this,xl,Wc).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of D(this,Fn).values())r+=n.length;return r}async listeners(e){if(e){const n=await ot(this,xl,Wc).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of D(this,Fn).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await ot(this,xl,Wc).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),D(this,Fn).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await ot(this,Nf,qd).call(this,e);n&&i.stop(),D(this,Fn).delete(r)}else for(const[r,{started:n,subscriber:i}]of D(this,Fn))n&&i.stop(),D(this,Fn).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return D(this,kf)}destroy(){this.removeAllListeners();for(const e of D(this,Ti).keys())this._clearTimeout(e);ee(this,kf,!0)}get paused(){return D(this,Cn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(ee(this,wo,-1),D(this,Cn)!=null){if(D(this,Cn)==!!e)return;Ne(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),ee(this,Cn,!!e);for(const r of D(this,Ti).values())r.timer&&clearTimeout(r.timer),r.time=vm()-r.time}resume(){if(D(this,Cn)!=null){this._forEachSubscriber(e=>e.resume()),ee(this,Cn,null);for(const e of D(this,Ti).values()){let r=e.time;r<0&&(r=0),e.time=vm(),setTimeout(e.func,r)}}}}Fn=new WeakMap,pa=new WeakMap,Cn=new WeakMap,kf=new WeakMap,fi=new WeakMap,ml=new WeakMap,ga=new WeakMap,wo=new WeakMap,u0=new WeakMap,Ti=new WeakMap,_f=new WeakMap,Pf=new WeakMap,$n=new WeakSet,Fi=async function(e){const r=D(this,Pf).cacheTimeout;if(r<0)return await this._perform(e);const n=Yd(e.method,e);let i=D(this,ga).get(n);return i||(i=this._perform(e),D(this,ga).set(n,i),setTimeout(()=>{D(this,ga).get(n)===i&&D(this,ga).delete(n)},r)),await i},f0=new WeakSet,c2=async function(e,r,n){Ne(n=0&&r==="latest"&&i.to!=null&&Br(s.data,0,4)==="0x556f1830"){const o=s.data,a=await gs(i.to,this);let l;try{l=bD(Br(s.data,4))}catch(c){Ne(!1,c.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Ne(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const u=await this.ccipReadFetch(i,l.calldata,l.urls);Ne(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:l.errorArgs}});const f={to:a,data:Zr([l.selector,wD([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const c=await ot(this,f0,c2).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:c}),c}catch(c){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:c}),c}}throw s}},c0=new WeakSet,h2=async function(e){const{value:r}=await Wn({network:this.getNetwork(),value:e});return r},yl=new WeakSet,$c=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await ot(this,c0,h2).call(this,ot(this,$n,Fi).call(this,Object.assign(e,{address:i,blockTag:s})))},h0=new WeakSet,d2=async function(e,r){if(Dr(e,32))return await ot(this,$n,Fi).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await ot(this,$n,Fi).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},xl=new WeakSet,Wc=async function(e,r){let n=await xm(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await xm({orphan:"drop-log",log:r[0]},this)),D(this,Fn).get(n.tag)||null},Nf=new WeakSet,qd=async function(e){const r=await xm(e,this),n=r.tag;let i=D(this,Fn).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},D(this,Fn).set(n,i)),i};function yD(t,e){try{const r=p2(t,e);if(r)return Kx(r)}catch{}return null}function p2(t,e){if(t==="0x")return null;try{const r=Wt(Br(t,e,e+32)),n=Wt(Br(t,r,r+32));return Br(t,r+32,r+32+n)}catch{}return null}function uA(t){const e=mi(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function xD(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const vD=new Uint8Array([]);function wD(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=Br(t,0,32);Ne(Br(r,0,12)===Br(fA,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Br(r,12);try{const n=[],i=Wt(Br(t,32,64)),s=Wt(Br(t,i,i+32)),o=Br(t,i+32);for(let a=0;ae[n]),e}function Xl(t,e){if(t.provider)return t.provider;Ne(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function cA(t,e){let r=qp(e);if(r.to!=null&&(r.to=gs(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),gs(n,t)]).then(([i,s])=>(se(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await Wn(r)}class AD{constructor(e){le(this,"provider");Mt(this,{provider:e||null})}async getNonce(e){return Xl(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await cA(this,e)}async populateTransaction(e){const r=Xl(this,"populateTransaction"),n=await cA(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Rt(n.chainId);se(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?se(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&se(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();Ne(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Ne(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Ne(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Wn(n)}async estimateGas(e){return Xl(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Xl(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Xl(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=Xl(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=ov.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var e1=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},hA=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xd,g2;const ED=1,SD=3e7,FD=0,CD=20,kD=4e3,_D="0x",PD=()=>`0x${"0".repeat(40)}`;class ND{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,r,n,i,s){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,s),this.cachedLeashes.set(r,{nonce:n.leash.nonce,block_number:n.leash.blockNumber,block_hash:n.leash.blockHash,block_range:n.leash.blockRange})}get(e,r){var n;return(n=this.cachedSignatures.get(e))===null||n===void 0?void 0:n.get(r)}getLeash(e){return this.cachedLeashes.get(e)}}const hh=new ND;function RD(t){return{domain:{name:"oasis-runtime-sdk/evm: signed query",version:"1.0.0",chainId:t},types:{Call:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"gasLimit",type:"uint64"},{name:"gasPrice",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"leash",type:"Leash"}],Leash:[{name:"nonce",type:"uint64"},{name:"blockNumber",type:"uint64"},{name:"blockHash",type:"bytes32"},{name:"blockRange",type:"uint64"}]}}}class R0{static make(e,r,n){return e1(this,void 0,void 0,function*(){const i=yield ID(r,n==null?void 0:n.leash);return new R0(i,yield BD(MD(e,i),r,{chainId:n==null?void 0:n.chainId}),e.data?jS(e.data):void 0)})}constructor(e,r,n){this.leash=e,this.signature=r,this.data=n,Xd.add(this)}encode(){return hA(this,Xd,"m",g2).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return e1(this,void 0,void 0,function*(){return this.data?hA(this,Xd,"m",g2).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}Xd=new WeakSet,g2=function(e){return mt(su({data:e||void 0,leash:this.leash,signature:this.signature}))};function jS(t){return Array.isArray(t)?new Uint8Array(t):Tn(t)}function TD(t){return Array.isArray(t)?mt(new Uint8Array(t)):mt(t)}function ID(t,e){var r;return e1(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&hh.clear();const n=e!=null&&e.nonce?e.nonce:"getNonce"in t?t.getNonce("pending"):t.getTransactionCount("pending");let i;if((e==null?void 0:e.block)!==void 0)i=e.block;else{if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const l=yield t.provider.getBlock("latest");if(!l)throw new Error("unable to get latest block");i=t.provider.getBlock(l.number-2)}const[s,o]=yield Promise.all([n,i]),a=(r=e==null?void 0:e.blockRange)!==null&&r!==void 0?r:kD;if((e==null?void 0:e.nonce)===void 0&&(e==null?void 0:e.block)===void 0){if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const{chainId:l}=yield t.provider.getNetwork(),u=hh.getLeash(BigInt(l));if(u!==void 0){if(u.nonce>s&&u.block_number+a>o.number+2)return u;hh.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:s+CD,block_number:o.number,block_hash:Tn(o.hash),block_range:a}})}function MD(t,e){var r,n,i,s,o;return{from:t.from,to:(r=t.to)!==null&&r!==void 0?r:PD(),gasLimit:Ee.from((i=(n=t.gas)!==null&&n!==void 0?n:t.gasLimit)!==null&&i!==void 0?i:SD).toNumber(),gasPrice:Ee.from((s=t.gasPrice)!==null&&s!==void 0?s:ED),value:Ee.from((o=t.value)!==null&&o!==void 0?o:FD),data:t.data?TD(t.data):_D,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function BD(t,e,r){return e1(this,void 0,void 0,function*(){const n=yield e.getAddress();let i;if(r!=null&&r.chainId)i=BigInt(r.chainId);else if(e.provider)({chainId:i}=yield e.provider.getNetwork());else throw new Error("must either connect provider or provide manual chainId override");const{domain:s,types:o}=RD(Number(i)),a=OD(s),l=UD(t),u=n2.hash(a,o,l);let f=hh.get(n,u);return"_signTypedData"in e?f=ur(yield e._signTypedData(s,o,t)):f=ur(yield e.signTypedData(a,o,l)),hh.cache(n,BigInt(i),t,u,f),f})}function OD(t){return Object.assign(Object.assign({},t),{salt:t.salt?jS(t.salt):void 0,chainId:t.chainId?Ee.from(t.chainId).toHexString():void 0})}function UD(t){const e=r=>{if(r!=null)return typeof r=="string"?r:r instanceof Ee?r.toHexString():Za(r)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?ur(t.data):void 0})}var sn=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},DD=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);isn(this,void 0,void 0,function*(){return BigInt(Oo)}),connect(s){return t1(n.connect(s),r)}};return _u(n,r,i)}if(cv(t)){let n;if(t.provider)try{n=t.connect(pA(t.provider,r,t))}catch(s){if(s.code!=="UNSUPPORTED_OPERATION")throw s;n=t}else n=t;const i={sendTransaction:mA(n.sendTransaction.bind(n),r),signTransaction:mA(n.signTransaction.bind(n),r),call:x2(n,"call",r),estimateGas:()=>sn(this,void 0,void 0,function*(){return Ee.from(Oo)}),connect(s){return t1(n.connect(s),r)}};return _u(n,r,i)}if(m2(t))return pA(t,r);if(y2(t))return gA(t,r);if("request"in t||"send"in t||"sendAsync"in t){const n=QS(t).getSigner(),i=LD(n,r),s=xA(i);let o=s;return"send"in t&&HS(t.send)&&(o=(a,l)=>i({method:a,params:l})),_u(t,r,{request:i,send:o,sendAsync:s})}throw new TypeError("Unable to wrap unsupported upstream signer.")}function HS(t){if(!t)return!1;try{const e=t();if(e instanceof Promise)return e.catch(()=>{}),!0}catch{}return!1}function dA(t){return gM(()=>sn(this,void 0,void 0,function*(){const e=yield QD(t);return Hp.ephemeral(e)}))}function _u(t,e,r){return new Proxy(t,{get(n,i){if(i===og)return{cipher:e};if(i in r)return Reflect.get(r,i);const s=Reflect.get(n,i);return typeof s=="function"?s.bind(n):s}})}function pA(t,e,r){if(Reflect.get(t,og)!==void 0)return t;const n=r?{sendTransaction:i=>sn(this,void 0,void 0,function*(){const s=yield VS(yield i,e,r);return t.sendTransaction(s)})}:{call:x2(t,"call",e),estimateGas:x2(t,"estimateGas",e)};return _u(t,e,n)}function gA(t,e,r){if(Reflect.get(t,og)!==void 0)return t;const n=r?{}:{call:v2(t,"call",e),estimateGas:v2(t,"estimateGas",e)};return _u(t,e,n)}function m2(t){return E0.isProvider(t)}function cv(t){return sc.isSigner(t)&&"_signTypedData"in t}function hv(t){return t instanceof AD}function y2(t){return t instanceof mD}function x2(t,e,r){const n=(i,s,o)=>sn(this,void 0,void 0,function*(){return i[e](Object.assign(Object.assign({},s),{data:r.encryptEncode(yield s.data)}),o)});return(i,s)=>sn(this,void 0,void 0,function*(){let o;if(cv(t)){const a=t;if(yield dv(i)){const l=yield R0.make(yield GS(i),a);o=yield a[e](Object.assign(Object.assign({},i),{data:l.encryptEncode(r)}),s)}else{if(!a.provider)throw new Error("unable to sign call");o=yield n(a.provider,i,s)}}else o=yield n(t,i,s);return typeof o=="string"?r.decryptEncoded(o):o})}function v2(t,e,r){const n=(i,s)=>sn(this,void 0,void 0,function*(){var o;return i[e](Object.assign(Object.assign({},s),{data:yield r.encryptEncode((o=s.data)!==null&&o!==void 0?o:new Uint8Array)}))});return i=>sn(this,void 0,void 0,function*(){let s;if(hv(t)){const o=t;if(!o.provider)throw new Error("signer not connected to a provider");const a=o.provider;if(yield dv(i)){const l=yield R0.make(yield GS(i),o);s=yield a[e](Object.assign(Object.assign({},i),{data:yield l.encryptEncode(r)}))}else s=yield n(a,i)}else s=yield n(t,i);return typeof s=="string"?r.decryptEncoded(s):s})}function mA(t,e){return(r,...n)=>sn(this,void 0,void 0,function*(){const i=yield r.data;return r.data=e.encryptEncode(i),r.gasLimit||(r.gasLimit=Oo),t(r,...n)})}function yA(t,e){return(r,...n)=>sn(this,void 0,void 0,function*(){return r.data&&(r.data=yield e.encryptEncode(r.data)),r.gasLimit||(r.gasLimit=Oo),t(r,...n)})}function dv(t){return sn(this,void 0,void 0,function*(){const[e,r]=yield Promise.all([t.from,t.to]);return!!r&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function GS(t){return sn(this,void 0,void 0,function*(){return Object.fromEntries(yield Promise.all(Object.entries(t).map(([e,r])=>sn(this,void 0,void 0,function*(){return[e,yield r]}))))})}function LD(t,e){return r=>sn(this,void 0,void 0,function*(){if(r.method==="eth_estimateGas")return Ee.from(Oo).toHexString();const{method:n,params:i}=yield jD(r,t,e),s=yield t.provider.send(n,i??[]);return n==="eth_call"?e.decryptEncoded(s):s})}function zD(t,e){return({method:r,params:n})=>sn(this,void 0,void 0,function*(){return r==="eth_estimateGas"?Ee.from(Oo).toHexString():r==="eth_call"&&n?(n[0].data=yield e.encryptEncode(n[0].data),n[0].gasLimit||(n[0].gasLimit=Oo),t.send(r,n)):t.send(r,n??[])})}function xA(t){return(e,r)=>{t(e).then(n=>r(null,{jsonrpc:"2.0",id:e.id,result:n})).catch(n=>r(n))}}function jD({method:t,params:e},r,n){return sn(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield VS(e[0],n,r)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield dv(e[0]))){const i=yield R0.make(e[0],r),s=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(n)});return{method:t,params:[s,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)?(e[0].data=yield n.encryptEncode(e[0].data),e[0].gasLimit||(e[0].gasLimit=Oo),{method:t,params:e}):{method:t,params:e}})}const HD="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function VS(t,e,r){var n;return sn(this,void 0,void 0,function*(){const s=O1(t),o=ct(s[5],{allowMissingPrefix:!0});try{const f=Hd(o),{format:c,body:p}=f,y=DD(f,["format","body"]);if(GD(c,p,y))return t;throw new vA("Bogus enveloped data found in sendRawTransaction.")}catch(f){if(f instanceof vA)throw f}const a=ov.from(t);if(a.isSigned()&&(!r||(yield r.getAddress())!=a.from))return a.serialized;const l=f=>{if(f)return Za(f)},u={to:a.to,from:a.from,data:a.data,nonce:a.nonce,gasLimit:l(a.gasLimit),gasPrice:(n=l(a.gasPrice))!==null&&n!==void 0?n:void 0,value:l(a.value),chainId:Number(a.chainId)};u.gasLimit||(u.gasLimit=l(BigInt(Oo)));try{return r.signTransaction(Object.assign(Object.assign({},u),{data:yield e.encryptEncode(o)}))}catch(f){throw new dh(HD,f)}})}function GD(t,e,r){return!(Object.keys(r).length>0||!e||t&&t!==Kf.Plain&&(Df(e)||!Df(e.data)))}class vA extends Error{}function VD(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}function QD(t){return sn(this,void 0,void 0,function*(){const e=cv(t)||hv(t),r=e?t.provider:t;if(r&&"send"in r)try{const i=r,s=VD(),o=function(l,u){u&&s.resolve(u.result),s.reject(l)};let a;if(!e&&!m2(r)&&!y2(r)){if(a=yield i.send({method:w2,params:[]},o),a===void 0&&(a=yield s.promise,a===void 0))throw Error("Got unexpected `undefined` from source.send callback!")}else a=yield i.send(w2,[]);if("key"in a){const l=a.key;return ct(l)}}catch{}if(m2(t)||y2(t)){const i=Number((yield t.getNetwork()).chainId);return im(i)}if(e){const i=Number((yield t.provider.getNetwork()).chainId);return im(i)}const n=(yield QS(t).getNetwork()).chainId;return im(n)})}function QS(t){let e;return"send"in t&&HS(t.send)?e={request:({method:r,params:n})=>t.send(r,n??[])}:e=t,new P4(e)}const wm={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},bm={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},Am={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},KD={mainnet:wm,testnet:bm,localnet:Am,[wm.chainId]:wm,[bm.chainId]:bm,[Am.chainId]:Am},w2="oasis_callDataPublicKey";class dh extends Error{constructor(e,r){super(e),this.response=r}}const wA={23294:{wRoseContractAddress:"0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3",explorerBaseUrl:"https://explorer.oasis.io/mainnet/sapphire",networkName:"Sapphire"},23295:{wRoseContractAddress:"0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94",explorerBaseUrl:"https://explorer.oasis.io/testnet/sapphire",networkName:"Sapphire Testnet"}},$D="https://faucet.testnet.oasis.dev/?paratime=sapphire",WD={version:"0.8.16+commit.07a7930e"},JD="Solidity",YD={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"dst",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],devdoc:{kind:"dev",methods:{"allowance(address,address)":{details:"See {IERC20-allowance}."},"approve(address,uint256)":{details:"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address."},"balanceOf(address)":{details:"See {IERC20-balanceOf}."},"burn(uint256)":{details:"Destroys `amount` tokens from the caller. See {ERC20-_burn}."},"burnFrom(address,uint256)":{details:"Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`."},"decimals()":{details:"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}."},"decreaseAllowance(address,uint256)":{details:"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`."},"increaseAllowance(address,uint256)":{details:"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address."},"name()":{details:"Returns the name of the token."},"symbol()":{details:"Returns the symbol of the token, usually a shorter version of the name."},"totalSupply()":{details:"See {IERC20-totalSupply}."},"transfer(address,uint256)":{details:"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`."},"transferFrom(address,address,uint256)":{details:"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`."}},version:1},userdoc:{kind:"user",methods:{},version:1}},qD={compilationTarget:{"contracts/WrappedROSE.sol":"WrappedROSE"},evmVersion:"london",libraries:{},metadata:{bytecodeHash:"ipfs"},optimizer:{enabled:!0,runs:0},remappings:[],viaIR:!0},XD={"@openzeppelin/contracts/token/ERC20/ERC20.sol":{keccak256:"0x24b04b8aacaaf1a4a0719117b29c9c3647b1f479c5ac2a60f5ff1bb6d839c238",license:"MIT",urls:["bzz-raw://43e46da9d9f49741ecd876a269e71bc7494058d7a8e9478429998adb5bc3eaa0","dweb:/ipfs/QmUtp4cqzf22C5rJ76AabKADquGWcjsc33yjYXxXC4sDvy"]},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{keccak256:"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b",license:"MIT",urls:["bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34","dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr"]},"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol":{keccak256:"0x0d19410453cda55960a818e02bd7c18952a5c8fe7a3036e81f0d599f34487a7b",license:"MIT",urls:["bzz-raw://4c0f62d3d5bef22b5ca00cc3903e7de6152cb68d2d22401a463f373cda54c00f","dweb:/ipfs/QmSfzjZux7LC7NW2f7rjCXTHeFMUCWERqDkhpCTBy7kxTe"]},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{keccak256:"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca",license:"MIT",urls:["bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd","dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8"]},"@openzeppelin/contracts/utils/Context.sol":{keccak256:"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7",license:"MIT",urls:["bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92","dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3"]},"contracts/WrappedROSE.sol":{keccak256:"0x4efa46ca0afc2256ce79193e3216fde354825d66fd7ef46ab4d6c3066fa7c8d4",license:"MIT",urls:["bzz-raw://a3126204c240f9aec1bf2fcd409f6778528c17e7c45baa447a44cbec1919c817","dweb:/ipfs/QmQ76bjcVBj13B7grnDQozmPiRLQJU6kFNHF9yMXoLtBeS"]}},ZD=1,eL={compiler:WD,language:JD,output:YD,settings:qD,sources:XD,version:ZD};class KS extends Error{constructor(e){super(e)}}function tL({mustBeMetaMask:t=!1,silent:e=!1,timeout:r=3e3}={}){i();let n=!1;return new Promise(s=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},r));function o(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:a}=window;a&&(!t||a.isMetaMask)?s(a):(!e&&console.error("@metamask/detect-provider:",t&&a?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),s(null))}});function i(){if(typeof t!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof r!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}var rL=tL;const nL=Uo(rL),iL=3e5,{VITE_BASE_AUTH_URL:sL}={VITE_SAPPHIRE_JSONRPC:"https://testnet.sapphire.oasis.dev",VITE_SAPPHIRE_CHAIN_ID:"0x5aff",BASE_URL:"/wrose-authzn",MODE:"production",DEV:!1,PROD:!0,SSR:!1},$S=sL??"https://playground.oasis.io";let Es=null,bA=null;const AA=(t,e)=>{if(t.origin!==$S)return!1;const{data:r}=t,n=new URLSearchParams(r);if(n.get("target")!=="authzn-popup")return!1;switch(e){case"login":case"register":{const i=n.get("username"),s=n.get("address"),o=new CustomEvent(e,{detail:{username:i,address:s}});window.dispatchEvent(o);return}case"sign":{const i=n.get("tx"),s=new CustomEvent(e,{detail:{signedTransaction:i}});window.dispatchEvent(s);return}}},pv=(t,e={})=>{const r={...e,origin:window.location.origin},n=new URLSearchParams(r).toString(),i=`${$S}/authzn/#/${t}?${n}`,s=`AuthNZ - ${t}`;window.removeEventListener("message",AA);const o="toolbar=no, menubar=no, width=1280, height=800, top=100, left=100";return Es===null||Es.closed?Es=window.open(i,s,o):bA!==i?(Es=window.open(i,s,o),Es==null||Es.focus()):Es.focus(),window.addEventListener("message",a=>AA(a,t),!1),bA=i,new Promise((a,l)=>{const u=setTimeout(()=>{window.removeEventListener(t,f),Es&&Es.close(),l("Register event timed out!")},iL),f=c=>{window.removeEventListener(t,f),clearInterval(u),a(c.detail)};window.addEventListener(t,f)})},oL=async()=>pv("register"),aL=async()=>pv("login"),EA=async t=>pv("sign",{unSignedTx:t}),lL={sapphireJsonRpc:"",sapphireChainId:-1},WS=we.createContext({}),uL=({children:t})=>{const[e,r]=we.useState({...lL});we.useEffect(()=>{const{VITE_SAPPHIRE_JSONRPC:i,VITE_SAPPHIRE_CHAIN_ID:s}={VITE_SAPPHIRE_JSONRPC:"https://testnet.sapphire.oasis.dev",VITE_SAPPHIRE_CHAIN_ID:"0x5aff",BASE_URL:"/wrose-authzn",MODE:"production",DEV:!1,PROD:!0,SSR:!1};r({sapphireJsonRpc:i,sapphireChainId:parseInt(s,16)})},[]);const n={state:e};return Pe.jsx(WS.Provider,{value:n,children:t})},fL=()=>{const t=we.useContext(WS);if(t===void 0)throw new Error("[useConfig] Component not wrapped within a Provider");return t},SA=Ee.from(1e5),cL={isConnected:!1,ethProvider:null,sapphireEthProvider:null,wRoseContractAddress:null,wRoseContract:null,account:null,explorerBaseUrl:null,networkName:null},JS=we.createContext({}),hL=({children:t})=>{const{state:{sapphireJsonRpc:e,sapphireChainId:r}}=fL(),[n,i]=we.useState({...cL}),s=async x=>{if(!r||!e)throw new Error("Configuration missing!");try{const A=new Rx(e),C=t1(A);if(!(r in wA))return Promise.reject(new KS("Unknown network!"));const{wRoseContractAddress:F,explorerBaseUrl:L,networkName:T}=wA[r],z=new zR(F,eL.output.abi,C);i(H=>({...H,isConnected:!0,ethProvider:A,sapphireEthProvider:C,wRoseContract:z,account:x,explorerBaseUrl:L,networkName:T,wRoseContractAddress:F}))}catch{throw i(C=>({...C,isConnected:!1})),new Error("[Web3Context] Unable to initialize providers!")}},o=async()=>{const{account:x,sapphireEthProvider:A}=n;if(!x||!A)throw new Error("[Web3Context] Unable to fetch balance!");return await A.getBalance(x).catch(()=>Ee.from(0))},a=async()=>{const{account:x,wRoseContract:A}=n;if(!x||!A)throw new Error("[Web3Context] Unable to fetch WROSE balance!");return await A.balanceOf(x).catch(()=>Ee.from(0))},l=async()=>{const x=await nL();return!!window.ethereum&&x===window.ethereum},u=async({address:x})=>{await s(x)},f=async x=>{var A,C;throw x===23294&&await((C=(A=window.ethereum).request)==null?void 0:C.call(A,{method:"wallet_addEthereumChain",params:[{chainId:"0x5afe",chainName:"Oasis Sapphire",nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}]})),new Error("Unable to automatically add the network, please do it manually!")},N={state:n,isMetaMaskInstalled:l,connectWallet:u,switchNetwork:async(x=23294)=>{var L,T;const A=new P4(window.ethereum);if((await t1(A).getNetwork()).chainId!==x)try{await((T=(L=window.ethereum).request)==null?void 0:T.call(L,{method:"wallet_switchEthereumChain",params:[{chainId:lt(x)}]}))}catch(z){const H=z;if((H==null?void 0:H.code)!==4902&&(H==null?void 0:H.code)!==-32603)throw H;f(x)}},wrap:async x=>{var te;if(!x)throw new Error("[amount] is required!");const{wRoseContract:A,account:C,sapphireEthProvider:F}=n;if(!A||!C||!F)throw new Error("[wRoseContract] not initialized!");const L=new Lh(C,F),z=await A.connect(L).populateTransaction.deposit();z.gasLimit=SA,z.value=Ee.from(x);const H=await L.populateTransaction(z),K=Object.entries(H).reduce((de,_)=>{const[h,m]=_,S=Ee.isBigNumber(m)?m.toString():m;return{...de,[h]:S}},{}),{signedTransaction:ne}=await EA(JSON.stringify(K));return await((te=n.sapphireEthProvider)==null?void 0:te.send("eth_sendRawTransaction",[ne]))},unwrap:async x=>{var te;if(!x)throw new Error("[amount] is required!");const{wRoseContract:A,account:C,sapphireEthProvider:F}=n;if(!A||!C||!F)throw new Error("[wRoseContract] not initialized!");const L=new Lh(C,F),z=await A.connect(L).populateTransaction.withdraw(x);z.gasLimit=SA,z.value=Ee.from(0);const H=await L.populateTransaction(z),K=Object.entries(H).reduce((de,_)=>{const[h,m]=_,S=Ee.isBigNumber(m)?m.toString():m;return{...de,[h]:S}},{}),{signedTransaction:ne}=await EA(JSON.stringify(K));return await((te=n.sapphireEthProvider)==null?void 0:te.send("eth_sendRawTransaction",[ne]))},getBalance:o,getBalanceOfWROSE:a,getTransaction:async x=>{if(!x)throw new Error("[txHash] is required!");const{sapphireEthProvider:A}=n;if(!A)throw new Error("[sapphireEthProvider] not initialized!");if((await A.waitForTransaction(x)).status===0)throw new Error("Transaction failed");return await A.getTransaction(x)},addTokenToWallet:async()=>{var C,F;const{wRoseContractAddress:x}=n,A="WROSE";try{await((F=(C=window.ethereum).request)==null?void 0:F.call(C,{method:"wallet_watchAsset",params:{type:"ERC20",options:{address:x,symbol:A,decimals:18}}}))}catch(L){console.error(L)}}};return Pe.jsx(JS.Provider,{value:N,children:t})},T0=()=>{const t=we.useContext(JS);if(t===void 0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t},dL=({address:t,networkName:e})=>{const r=Y9.useMediaQuery({query:"(min-width: 1000px)"}),{state:{explorerBaseUrl:n}}=T0(),i=()=>{n&&window.open(Lu.getAccountUrl(n,t),"_blank","noopener,noreferrer")},s=async o=>{o.preventDefault(),o.stopPropagation();try{await navigator.clipboard.writeText(t),window.alert("Copied to clipboard!")}catch{}};return Pe.jsxs("div",{className:Y0.account,onClick:i,children:[Pe.jsx(J9,{size:r?60:30,address:t}),Pe.jsxs("p",{onClick:s,className:Y0.accountDetails,children:[Pe.jsx("abbr",{title:t,className:Y0.accountAddress,children:Lu.truncateAddress(t)}),Pe.jsx("span",{className:Y0.network,children:e})]})]})},pL=()=>Pe.jsxs("svg",{width:"75",height:"48",viewBox:"0 0 75 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pe.jsx("rect",{x:"0.5",y:"10",width:"74",height:"37",rx:"10.5",fill:"#6665D8",stroke:"#6665D8"}),Pe.jsx("path",{d:"M12.848 43.2C11.8667 41.8987 10.9707 40.4907 10.16 38.976C9.34933 37.44 8.70933 35.8187 8.24 34.112C7.77067 32.4053 7.536 30.6347 7.536 28.8C7.536 26.944 7.77067 25.1733 8.24 23.488C8.70933 21.7813 9.34933 20.1707 10.16 18.656C10.9707 17.12 11.8667 15.7013 12.848 14.4H17.008C16.0267 15.7653 15.1307 17.2267 14.32 18.784C13.5093 20.3413 12.8693 21.9627 12.4 23.648C11.9307 25.312 11.696 27.0293 11.696 28.8C11.696 30.5493 11.9307 32.2667 12.4 33.952C12.8693 35.6373 13.5093 37.2587 14.32 38.816C15.1307 40.352 16.0267 41.8133 17.008 43.2H12.848ZM61.7198 43.2H57.5598C58.5624 41.8133 59.4584 40.352 60.2478 38.816C61.0584 37.2587 61.6984 35.6373 62.1678 33.952C62.6371 32.2667 62.8718 30.5493 62.8718 28.8C62.8718 27.0293 62.6371 25.312 62.1678 23.648C61.6984 21.9627 61.0584 20.3413 60.2478 18.784C59.4584 17.2267 58.5624 15.7653 57.5598 14.4H61.7198C62.7224 15.7013 63.6184 17.12 64.4078 18.656C65.2184 20.1707 65.8584 21.7813 66.3278 23.488C66.7971 25.1733 67.0318 26.944 67.0318 28.8C67.0318 30.6347 66.7971 32.4053 66.3278 34.112C65.8584 35.8187 65.2184 37.44 64.4078 38.976C63.6184 40.4907 62.7224 41.8987 61.7198 43.2Z",fill:"white"}),Pe.jsx("path",{d:"M31.384 38L31.128 35.056V22H35.352V38H31.384ZM20.536 31.152V22H24.76V30.192L20.536 31.152ZM24.76 30.192C24.76 31.2587 24.8773 32.1013 25.112 32.72C25.368 33.3173 25.72 33.7547 26.168 34.032C26.6373 34.288 27.16 34.416 27.736 34.416C28.8453 34.4373 29.688 34.1067 30.264 33.424C30.84 32.72 31.128 31.7067 31.128 30.384H32.568C32.568 32.0907 32.312 33.5413 31.8 34.736C31.3093 35.9093 30.6053 36.816 29.688 37.456C28.792 38.0747 27.736 38.384 26.52 38.384C24.6 38.384 23.1173 37.7973 22.072 36.624C21.048 35.4293 20.536 33.6053 20.536 31.152L24.76 30.192ZM39.0115 38V22H42.9795L43.2355 24.944V38H39.0115ZM49.6035 38V29.808L53.8275 28.848V38H49.6035ZM49.6035 29.808C49.6035 28.72 49.4755 27.8773 49.2195 27.28C48.9848 26.6827 48.6435 26.256 48.1955 26C47.7475 25.7227 47.2248 25.584 46.6275 25.584C45.5395 25.5627 44.6968 25.8933 44.0995 26.576C43.5235 27.2587 43.2355 28.272 43.2355 29.616H41.8275C41.8275 27.9093 42.0728 26.4693 42.5635 25.296C43.0755 24.1013 43.7795 23.1947 44.6755 22.576C45.5715 21.936 46.6275 21.616 47.8435 21.616C49.7848 21.616 51.2675 22.2133 52.2915 23.408C53.3368 24.5813 53.8488 26.3947 53.8275 28.848L49.6035 29.808Z",fill:"white"})]}),gL=()=>{const{state:{isConnected:t,account:e,networkName:r}}=T0(),{pathname:n}=R1(),i=T1();return we.useEffect(()=>{n.startsWith("/tx")||(!t&&n!=="/"?i("/"):t&&n==="/"&&i("/wrapper"))},[t,n,i]),Pe.jsxs("main",{className:Vw.layout,children:[t&&e&&Pe.jsx(dL,{address:e,networkName:r??""}),Pe.jsxs("h2",{className:Vw.header,children:["ROSE ",Pe.jsx(pL,{})," wrapper"]}),Pe.jsx(Bk,{})]})},mL="_subHeader_v987d_1",yL="_amountPercList_v987d_8",xL="_testTokensBtn_v987d_15",Em={subHeader:mL,amountPercList:yL,testTokensBtn:xL},vL="_button_1lv9p_1",wL="_buttonPrimary_1lv9p_18",bL="_buttonSecondary_1lv9p_23",AL="_buttonTertiary_1lv9p_28",EL="_buttonDisabled_1lv9p_39",SL="_fullWidth_1lv9p_46",$u={button:vL,buttonPrimary:wL,buttonSecondary:bL,buttonTertiary:AL,buttonDisabled:EL,fullWidth:SL},FL={primary:$u.buttonPrimary,secondary:$u.buttonSecondary,tertiary:$u.buttonTertiary},Na=({className:t,children:e,disabled:r,variant:n="primary",fullWidth:i,onClick:s,type:o})=>Pe.jsx("button",{className:[t,$u.button,...r?[$u.buttonDisabled]:[],...i?[$u.fullWidth]:[],FL[n]].join(" "),onClick:s,disabled:r,type:o,children:e}),CL="_inputGroup_mjar4_1",kL={inputGroup:CL},FA=({type:t,label:e,pattern:r,placeholder:n,id:i,disabled:s,inputMode:o,value:a,valueChange:l})=>{const u=we.useId(),f=i||u;return Pe.jsxs("div",{className:kL.inputGroup,children:[Pe.jsx("label",{htmlFor:f,children:e}),Pe.jsx("input",{id:f,type:t,inputMode:o,autoComplete:"off",autoCorrect:"off",pattern:r,placeholder:n,disabled:s,value:a,onChange:({target:{value:c}})=>l(c)})]})},_L="_wrapForm_n3r3u_1",PL="_wrapFormInputs_n3r3u_7",NL="_toggleBtn_n3r3u_14",RL="_gasEstimateLabel_n3r3u_21",vd={wrapForm:_L,wrapFormInputs:PL,toggleBtn:NL,gasEstimateLabel:RL},TL="_alert_ucbd7_1",IL="_alertDanger_ucbd7_12",ML="_alertWarn_ucbd7_16",BL="_alertInfo_ucbd7_20",Zd={alert:TL,alertDanger:IL,alertWarn:ML,alertInfo:BL},OL={danger:Zd.alertDanger,warn:Zd.alertWarn,info:Zd.alertInfo},b2=({children:t,variant:e="info"})=>Pe.jsx("p",{className:[Zd.alert,OL[e]].join(" "),children:t}),UL="_toggleButton_1q9d3_1",DL={toggleButton:UL},LL=()=>Pe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Pe.jsx("g",{clipPath:"url(#clip0_418_8629)",children:Pe.jsx("path",{d:"M19 8L15 12H18C18 15.31 15.31 18 12 18C10.99 18 10.03 17.75 9.2 17.3L7.74 18.76C8.97 19.54 10.43 20 12 20C16.42 20 20 16.42 20 12H23L19 8ZM6 12C6 8.69 8.69 6 12 6C13.01 6 13.97 6.25 14.8 6.7L16.26 5.24C15.03 4.46 13.57 4 12 4C7.58 4 4 7.58 4 12H1L5 16L9 12H6Z",fill:"white"})}),Pe.jsx("defs",{children:Pe.jsx("clipPath",{id:"clip0_418_8629",children:Pe.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),zL=({className:t,disabled:e,onClick:r})=>Pe.jsx("button",{className:[t,DL.toggleButton].join(" "),onClick:r,disabled:e,children:Pe.jsx(LL,{})});var cn=(t=>(t.WRAP="wrap",t.UNWRAP="unwrap",t))(cn||{});const jL={isLoading:!1,amount:null,formType:cn.UNWRAP,balance:Ee.from(0),wRoseBalance:Ee.from(0)},YS=we.createContext({}),HL=({children:t})=>{const{state:{isConnected:e},getBalance:r,getBalanceOfWROSE:n,wrap:i,unwrap:s}=T0(),[o,a]=we.useState({...jL}),l=b=>{a(N=>({...N,isLoading:b}))},u=async()=>{if(!e)return;l(!0);const[b,N]=await Promise.all([r(),n()]);a(x=>({...x,balance:b,wRoseBalance:N,isLoading:!1}))},f=async b=>{try{const N=Ee.from(b),x=N.lte(0)?Ee.from(0):N;a(A=>({...A,amount:x}))}catch(N){console.error(N)}},c=()=>jc("0.01","ether"),v={state:o,init:u,getFeeAmount:c,setAmount:f,toggleFormType:b=>{const{balance:N,wRoseBalance:x,formType:A}=o,C=A===cn.WRAP?cn.UNWRAP:cn.WRAP;let F=b;C===cn.WRAP&&(b!=null&&b.gt(N))?F=N.sub(c()):C===cn.UNWRAP&&(b!=null&&b.gt(x))&&(F=x),a(({...L})=>({...L,formType:C,amount:F}))},submit:async b=>{if(!b||b.lte(0))return Promise.reject(new Error("Amount is required"));l(!0);const{formType:N,balance:x,wRoseBalance:A}=o;let C=null;if(N===cn.WRAP){if(b.gt(x.sub(c())))return l(!1),Promise.reject(new Error("Insufficient balance"));try{C=await i(b.toString())}catch(F){throw l(!1),F}}else if(N===cn.UNWRAP){if(b.gt(A))return l(!1),Promise.reject(new Error("Insufficient balance"));try{C=await s(b.toString())}catch(F){throw l(!1),F}}else return l(!1),Promise.reject(new Error("[formType] Invalid form type"));return l(!1),C}};return Pe.jsx(YS.Provider,{value:v,children:t})},qS=()=>{const t=we.useContext(YS);if(t===void 0)throw new Error("[useWrapForm] Component not wrapped within a Provider");return t},CA="^[0-9]*[.,]?[0-9]*$",GL={[cn.WRAP]:{firstInputLabel:"ROSE",secondInputLabel:"wROSE",submitBtnLabel:"Wrap tokens"},[cn.UNWRAP]:{firstInputLabel:"wROSE",secondInputLabel:"ROSE",submitBtnLabel:"Unwrap tokens"}},VL=()=>{const t=T1(),{state:{formType:e,amount:r,isLoading:n,balance:i},toggleFormType:s,submit:o,getFeeAmount:a}=qS(),{firstInputLabel:l,secondInputLabel:u,submitBtnLabel:f}=GL[e],[c,p]=we.useState(""),[y,v]=we.useState("");we.useEffect(()=>{v("");const F=r?bT(r):"";p(F)},[p,r]);const b=F=>{p(F)},N=F=>{F.preventDefault(),F.stopPropagation(),s(c?jc(c,"ether"):null)},x=async F=>{v(""),F.preventDefault();try{const L=jc(c||"0","ether"),T=await o(L);t(`/tx/${T}?amount=${c}&action=${e}`)}catch(L){v((L==null?void 0:L.message)||JSON.stringify(L))}},A=e===cn.WRAP&&c?jc(c||"0","ether"):null,C=A&&A.gt(0)?jc(c,"ether").eq(i.sub(a())):!1;return Pe.jsx("div",{children:Pe.jsxs("form",{className:vd.wrapForm,onSubmit:x,children:[Pe.jsxs("div",{className:vd.wrapFormInputs,children:[Pe.jsx(FA,{disabled:n,type:"text",label:l,pattern:CA,placeholder:"0",inputMode:"decimal",value:c,valueChange:b}),Pe.jsx(FA,{disabled:n,type:"text",label:u,pattern:CA,placeholder:"0",inputMode:"decimal",value:c,valueChange:b}),Pe.jsx(zL,{className:vd.toggleBtn,onClick:N,disabled:n})]}),Pe.jsx("h4",{className:vd.gasEstimateLabel,children:"Estimated fee: <0.01 ROSE (~10 sec)"}),Pe.jsx(Na,{disabled:n,type:"submit",fullWidth:!0,children:f}),y&&Pe.jsx(b2,{variant:"danger",children:y}),C&&Pe.jsx(b2,{variant:"warn",children:"You will not be able to pay for gas in subsequent transactions if you convert all your ROSE into WROSE, are you sure?"})]})})},QL=[{label:"10%",value:Ee.from(10)},{label:"25%",value:Ee.from(25)},{label:"50%",value:Ee.from(50)},{label:"Max",value:Ee.from(100)}],KL=()=>{const{state:{isLoading:t,balance:e,wRoseBalance:r,formType:n},init:i,setAmount:s,getFeeAmount:o}=qS();we.useEffect(()=>{i()},[]);const a=u=>{if(n===cn.WRAP)if(u.eq(100)){const f=Td.getPercentageAmount(e,u),c=o();s(f.sub(c))}else s(Td.getPercentageAmount(e,u));else if(n===cn.UNWRAP)s(Td.getPercentageAmount(r,u));else throw new Error("[formType] Invalid form type")},l=()=>{window.open($D,"_blank","noopener,noreferrer")};return Pe.jsxs("div",{children:[Pe.jsxs("div",{className:Em.subHeader,children:[Pe.jsx("p",{children:"Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool."}),Pe.jsx(Na,{className:Em.testTokensBtn,onClick:l,children:"Request test tokens"})]}),Pe.jsx("div",{className:Em.amountPercList,children:QL.map(({label:u,value:f})=>Pe.jsx(Na,{disabled:t,onClick:()=>a(f),variant:"tertiary",children:u},u))}),Pe.jsx(VL,{})]})},$L="_subHeader_tvx5f_1",WL="_haveAccount_tvx5f_5",JL="_installMetaMaskBtn_tvx5f_10",kA={subHeader:$L,haveAccount:WL,installMetaMaskBtn:JL},YL=()=>{const{connectWallet:t}=T0(),[e,r]=we.useState(!1),[n,i]=we.useState(""),[s,o]=we.useState(!1),a=async l=>{r(!0);try{let u;l===1?u=await oL():u=await aL(),await t(u)}catch(u){u instanceof KS?o(!0):i((u==null?void 0:u.message)||JSON.stringify(u))}finally{r(!1)}};return Pe.jsx(Pe.Fragment,{children:!s&&Pe.jsxs("div",{children:[Pe.jsxs("p",{className:kA.subHeader,children:["Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool.",Pe.jsx("br",{}),"Please connect with your AUTHZN account to get started."]}),Pe.jsx(Na,{onClick:()=>a(0),disabled:e,fullWidth:!0,children:"Login"}),Pe.jsx("p",{className:kA.haveAccount,children:"Not signed up yet?"}),Pe.jsx(Na,{variant:"secondary",onClick:()=>a(1),disabled:e,fullWidth:!0,children:"Register"}),n&&Pe.jsx(b2,{variant:"danger",children:n})]})})},qL=()=>Pe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Pe.jsx("g",{clipPath:"url(#clip0_429_3299)",children:Pe.jsx("path",{d:"M19 19H5V5H12V3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V12H19V19ZM14 3V5H17.59L7.76 14.83L9.17 16.24L19 6.41V10H21V3H14Z",fill:"white"})}),Pe.jsx("defs",{children:Pe.jsx("clipPath",{id:"clip0_429_3299",children:Pe.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),XL="_openInExplorerBtn_iyisx_1",ZL="_spinnerContainer_iyisx_10",ez="_subHeader_iyisx_15",tz="_h100_iyisx_20",Va={openInExplorerBtn:XL,spinnerContainer:ZL,subHeader:ez,h100:tz},rz="_spinner_an95n_10",nz="_spin_an95n_10",iz={spinner:rz,spin:nz},sz=({className:t})=>Pe.jsx("div",{className:[iz.spinner,t].join(" ")}),oz=()=>{const t=T1(),{txHash:e}=Ek(),[r]=Jk(),n=r.get("amount")??null,i=r.get("action")??cn.WRAP,{state:{explorerBaseUrl:s},getTransaction:o}=T0(),[a,l]=we.useState(0),[u,f]=we.useState(null);we.useEffect(()=>{(async()=>{e||t("/");try{(await o(e)).value.gt(0)?f(1):f(0),l(1)}catch{l(2)}})()},[o,t,e]);const c=()=>{if(s&&e){const y=Lu.getTransactionUrl(s,e);window.open(y,"_blank","noopener,noreferrer")}},p=()=>{t("/wrapper")};return Pe.jsxs(Pe.Fragment,{children:[a===0&&Pe.jsxs("div",{children:[Pe.jsx("div",{className:Va.spinnerContainer,children:Pe.jsx(sz,{})}),Pe.jsxs("h3",{className:Va.subHeader,children:[i===cn.WRAP&&Pe.jsx(Pe.Fragment,{children:"Wrapping"}),i===cn.UNWRAP&&Pe.jsx(Pe.Fragment,{children:"Unwrapping"})," your tokens"]})]}),a===1&&Pe.jsxs("div",{children:[Pe.jsx("p",{className:Va.h100,children:"🎉"}),Pe.jsxs("h3",{className:Va.subHeader,children:["Congrats!",Pe.jsx("br",{}),"You received",u===1&&Pe.jsxs("b",{children:[" ",n," WROSE"]}),u===0&&Pe.jsxs("b",{children:[" ",n," ROSE"]})]}),s&&e&&Pe.jsxs(Na,{className:Va.openInExplorerBtn,onClick:c,fullWidth:!0,children:["View on explorer",Pe.jsx(qL,{})]}),Pe.jsx(Na,{variant:"secondary",onClick:p,fullWidth:!0,children:"Close"})]}),a===2&&Pe.jsxs("div",{children:[Pe.jsx("p",{className:Va.h100,children:"❕"}),Pe.jsxs("h3",{className:Va.subHeader,children:["There was an unexpected error.",Pe.jsx("br",{}),"Please try again."]}),Pe.jsx(Na,{onClick:p,fullWidth:!0,children:"Retry"})]})]})},az=Lk([{path:"/",element:Pe.jsx(gL,{}),children:[{path:"",element:Pe.jsx(YL,{})},{path:"wrapper",element:Pe.jsx(HL,{children:Pe.jsx(KL,{})})},{path:"tx/:txHash",element:Pe.jsx(oz,{})}]}]),lz=()=>Pe.jsx(uL,{children:Pe.jsx(hL,{children:Pe.jsx($k,{router:az})})});j5(document.getElementById("root")).render(Pe.jsx(lz,{})); diff --git a/wrose-authzn/assets/index-8e19271c.css b/wrose-authzn/assets/index-8e19271c.css new file mode 100644 index 0000000..8d05ed5 --- /dev/null +++ b/wrose-authzn/assets/index-8e19271c.css @@ -0,0 +1 @@ +._layout_1ybug_1{margin:0 auto;width:100%;padding:6.875rem 1.875rem 1.875rem}._header_1ybug_7{margin-bottom:1rem}._header_1ybug_7>svg{display:inline-block;position:relative;top:.5rem}@media screen and (min-width: 1000px){._layout_1ybug_1{max-width:620px;padding:4.625rem 0 0}._header_1ybug_7{margin-bottom:2rem}}._account_yrsie_1{position:absolute;top:1.25rem;display:flex;justify-items:center;width:calc(100% - 3.75rem);gap:1rem;border:3px solid var(--brand-extra-dark);border-radius:12px;background:var(--white);padding:.7125rem;cursor:pointer}._accountDetails_yrsie_15{display:inline-flex;flex-direction:row-reverse;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:100%;color:var(--brand-extra-dark);text-align:left;margin-bottom:0}._accountAddress_yrsie_27{flex:1 0 65%;font-family:monospace;text-decoration:none;font-size:22px;font-weight:700;line-height:143%;text-align:right}._network_yrsie_37{flex:0 0 35%;overflow:hidden;max-height:28px;font-size:20px;font-weight:400;line-height:140%;text-transform:capitalize}@media screen and (min-width: 1000px){._account_yrsie_1{position:fixed;display:inline-flex;width:auto;top:2.875rem;right:2.5rem;padding:1rem}._accountDetails_yrsie_15{flex-direction:column;justify-items:center;text-align:right}._accountAddress_yrsie_27,._network_yrsie_37{flex:unset}}._jazzIcon_ti0z0_1{display:inline-block}._subHeader_v987d_1{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.5rem}._amountPercList_v987d_8{display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:1.625rem}._testTokensBtn_v987d_15._testTokensBtn_v987d_15{display:flex;justify-content:center;padding:.5rem;font-size:14px;font-style:normal;font-weight:700;text-transform:none;border-radius:10px}@media screen and (min-width: 1000px){._subHeader_v987d_1{gap:1rem;margin-bottom:4.85rem}._testTokensBtn_v987d_15._testTokensBtn_v987d_15{justify-content:flex-end;margin-left:auto}._amountPercList_v987d_8{width:75%;margin:0 auto 1.5rem}}._button_1lv9p_1{border-radius:46px;border:1px solid transparent;box-shadow:none;cursor:pointer;font-size:18px;font-style:normal;font-weight:700;line-height:125%;outline:none;padding:1.125rem 1.5rem;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:capitalize;color:var(--white)}._buttonPrimary_1lv9p_18{border-color:var(--gray-medium-light);background-color:var(--brand-medium)}._buttonSecondary_1lv9p_23{border-color:var(--gray-medium-light);background-color:transparent}._buttonTertiary_1lv9p_28{border-width:2px;border-color:var(--gray-medium-light);background-color:transparent;min-width:75px;padding:.4rem;line-height:120%;border-radius:10px;font-size:13.5px}._buttonDisabled_1lv9p_39{cursor:not-allowed;border-color:var(--gray-medium-light);background-color:var(--gray-medium-dark);opacity:.5}._fullWidth_1lv9p_46{width:100%}@media screen and (min-width: 1000px){._buttonTertiary_1lv9p_28{min-width:100px;padding:.58rem 1.5rem;font-size:18px}}._inputGroup_mjar4_1{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;width:100%;border-radius:46px;border:1px solid var(--white);background:var(--white);padding:1.125rem 2.8125rem}._inputGroup_mjar4_1>label{color:var(--gray-extra-dark);font-size:18px;font-style:normal;font-weight:400;line-height:125%;opacity:.7;flex:0 1 auto}._inputGroup_mjar4_1>input{margin:0;flex:1 1 auto;max-width:60%;outline:none;border:none;background-image:none;background-color:transparent;box-shadow:none;font-size:22px;font-style:normal;font-weight:700;line-height:125%;text-align:right}._inputGroup_mjar4_1>input::placeholder{opacity:.75}@media screen and (min-width: 1000px){@media screen and (min-width: 1000px){._inputGroup_mjar4_1>input{max-width:75%}}}._wrapForm_n3r3u_1{display:flex;flex-direction:column;position:relative}._wrapFormInputs_n3r3u_7{position:relative;display:flex;flex-direction:column;gap:.625rem}._toggleBtn_n3r3u_14{position:absolute;left:2.8125rem;top:50%;transform:translateY(-50%)}._gasEstimateLabel_n3r3u_21{text-align:center;margin:2rem 0 1rem}@media screen and (min-width: 1000px){._toggleBtn_n3r3u_14{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}._gasEstimateLabel_n3r3u_21{margin:3.875rem 0 1.5rem}}._alert_ucbd7_1{padding:.5rem .25rem;background-color:#fff;font-size:14px;line-height:120%;border-radius:10px;margin-top:1rem;text-align:center;word-wrap:break-word}._alertDanger_ucbd7_12{color:var(--danger)}._alertWarn_ucbd7_16{color:var(--warn)}._alertInfo_ucbd7_20{color:var(--brand-dark)}._toggleButton_1q9d3_1{display:flex;justify-content:center;align-items:center;width:38px;height:38px;border-radius:50%;border:1px solid transparent;box-shadow:none;cursor:pointer;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;color:var(--white);background:var(--brand-dark)}@media screen and (min-width: 1000px){._toggleButton_1q9d3_1{width:48px;height:48px}}._subHeader_tvx5f_1{margin-bottom:34dvh}._haveAccount_tvx5f_5{margin:.5rem 0;text-align:center}._installMetaMaskBtn_tvx5f_10{margin-bottom:1.5rem}@media screen and (min-width: 1000px){._subHeader_tvx5f_1{margin-bottom:4.85rem}}._openInExplorerBtn_iyisx_1{display:flex;justify-content:center;align-items:center;gap:.5rem;padding:1.06rem 1.5rem;margin-bottom:1.5rem}._spinnerContainer_iyisx_10{margin-top:5rem;margin-bottom:2.625rem}._subHeader_iyisx_15{text-align:center;margin-bottom:3.625rem}._h100_iyisx_20{font-size:75px;font-weight:400;line-height:150%;text-align:center}@media screen and (min-width: 1000px){._spinnerContainer_iyisx_10{margin-top:unset}}@keyframes _spin_an95n_10{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._spinner_an95n_10{margin:0 auto;border:12px solid var(--white);border-top:12px solid var(--brand-medium);border-radius:50%;width:96px;height:96px;animation:_spin_an95n_10 1.5s linear infinite}:root{--white: #fff;--brand-medium: #0092f6;--brand-dark: #3333c4;--brand-extra-dark: #000062;--gray-medium-dark: #565b61;--gray-medium-light: #e3e8ed;--gray-extra-dark: #06152b;--warn: #664d03;--danger: #e9162b}*,*:before,*:after{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:150%;color:var(--white);text-align:left;background-color:var(--brand-dark);background-image:url(/wrose-authzn/background.webp);background-size:contain;background-position:left bottom;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:.5rem}h2{font-size:32px;font-weight:700;line-height:140%}h3{font-size:24px;font-weight:700;line-height:140%}h4{font-size:18px;font-weight:700;line-height:120%}p{font-size:16px;font-weight:400;line-height:150%} diff --git a/wrose-authzn/assets/index-b3852aeb.css b/wrose-authzn/assets/index-b3852aeb.css deleted file mode 100644 index 3aa7dad..0000000 --- a/wrose-authzn/assets/index-b3852aeb.css +++ /dev/null @@ -1 +0,0 @@ -._layout_fdlct_1{margin:0 auto;width:100%;padding:6.875rem 1.875rem 1.875rem}._header_fdlct_7{margin-bottom:1rem}._header_fdlct_7>svg{display:inline-block;position:relative;top:.5rem}@media screen and (min-width: 1000px){._layout_fdlct_1{max-width:620px;padding:4.625rem 0 0}._header_fdlct_7{margin-bottom:2rem}}._account_ec5ym_1{position:absolute;top:1.25rem;display:flex;justify-items:center;width:calc(100% - 3.75rem);gap:1rem;border:3px solid var(--brand-extra-dark);border-radius:12px;background:var(--white);padding:.7125rem;cursor:pointer}._accountDetails_ec5ym_15{display:inline-flex;flex-direction:row-reverse;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:100%;color:var(--brand-extra-dark);text-align:left;margin-bottom:0}._accountAddress_ec5ym_27{flex:1 0 65%;font-family:monospace;text-decoration:none;font-size:22px;font-weight:700;line-height:143%;text-align:right}._network_ec5ym_37{flex:0 0 35%;overflow:hidden;max-height:28px;font-size:20px;font-weight:400;line-height:140%;text-transform:capitalize}@media screen and (min-width: 1000px){._account_ec5ym_1{position:fixed;display:inline-flex;width:auto;top:2.875rem;right:2.5rem;padding:1rem}._accountDetails_ec5ym_15{flex-direction:column;justify-items:center;text-align:right}._accountAddress_ec5ym_27,._network_ec5ym_37{flex:unset}}._jazzIcon_f50tk_1{display:inline-block}._subHeader_au1gt_1{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.5rem}._amountPercList_au1gt_8{display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:1.625rem}._testTokensBtn_au1gt_15._testTokensBtn_au1gt_15{display:flex;justify-content:center;padding:.5rem;font-size:14px;font-style:normal;font-weight:700;text-transform:none;border-radius:10px}@media screen and (min-width: 1000px){._subHeader_au1gt_1{gap:1rem;margin-bottom:4.85rem}._testTokensBtn_au1gt_15._testTokensBtn_au1gt_15{justify-content:flex-end;margin-left:auto}._amountPercList_au1gt_8{width:75%;margin:0 auto 1.5rem}}._button_i479a_1{border-radius:46px;border:1px solid transparent;box-shadow:none;cursor:pointer;font-size:18px;font-style:normal;font-weight:700;line-height:125%;outline:none;padding:1.125rem 1.5rem;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:capitalize;color:var(--white)}._buttonPrimary_i479a_18{border-color:var(--gray-medium-light);background-color:var(--brand-medium)}._buttonSecondary_i479a_23{border-color:var(--gray-medium-light);background-color:transparent}._buttonTertiary_i479a_28{border-width:2px;border-color:var(--gray-medium-light);background-color:transparent;min-width:75px;padding:.4rem;line-height:120%;border-radius:10px;font-size:13.5px}._buttonDisabled_i479a_39{cursor:not-allowed;border-color:var(--gray-medium-light);background-color:var(--gray-medium-dark);opacity:.5}._fullWidth_i479a_46{width:100%}@media screen and (min-width: 1000px){._buttonTertiary_i479a_28{min-width:100px;padding:.58rem 1.5rem;font-size:18px}}._inputGroup_9s8on_1{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;width:100%;border-radius:46px;border:1px solid var(--white);background:var(--white);padding:1.125rem 2.8125rem}._inputGroup_9s8on_1>label{color:var(--gray-extra-dark);font-size:18px;font-style:normal;font-weight:400;line-height:125%;opacity:.7;flex:0 1 auto}._inputGroup_9s8on_1>input{margin:0;flex:1 1 auto;max-width:60%;outline:none;border:none;background-image:none;background-color:transparent;box-shadow:none;font-size:22px;font-style:normal;font-weight:700;line-height:125%;text-align:right}._inputGroup_9s8on_1>input::placeholder{opacity:.75}@media screen and (min-width: 1000px){@media screen and (min-width: 1000px){._inputGroup_9s8on_1>input{max-width:75%}}}._wrapForm_ik4r8_1{display:flex;flex-direction:column;position:relative}._wrapFormInputs_ik4r8_7{position:relative;display:flex;flex-direction:column;gap:.625rem}._toggleBtn_ik4r8_14{position:absolute;left:2.8125rem;top:50%;transform:translateY(-50%)}._gasEstimateLabel_ik4r8_21{text-align:center;margin:2rem 0 1rem}@media screen and (min-width: 1000px){._toggleBtn_ik4r8_14{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}._gasEstimateLabel_ik4r8_21{margin:3.875rem 0 1.5rem}}._alert_166l2_1{padding:.5rem .25rem;background-color:#fff;font-size:14px;line-height:120%;border-radius:10px;margin-top:1rem;text-align:center;word-wrap:break-word}._alertDanger_166l2_12{color:var(--danger)}._alertWarn_166l2_16{color:var(--warn)}._alertInfo_166l2_20{color:var(--brand-dark)}._toggleButton_a8oi0_1{display:flex;justify-content:center;align-items:center;width:38px;height:38px;border-radius:50%;border:1px solid transparent;box-shadow:none;cursor:pointer;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;color:var(--white);background:var(--brand-dark)}@media screen and (min-width: 1000px){._toggleButton_a8oi0_1{width:48px;height:48px}}._subHeader_hb77m_1{margin-bottom:34dvh}._haveAccount_hb77m_5{margin:.5rem 0;text-align:center}._installMetaMaskBtn_hb77m_10{margin-bottom:1.5rem}@media screen and (min-width: 1000px){._subHeader_hb77m_1{margin-bottom:4.85rem}}._openInExplorerBtn_176pg_1{display:flex;justify-content:center;align-items:center;gap:.5rem;padding:1.06rem 1.5rem;margin-bottom:1.5rem}._spinnerContainer_176pg_10{margin-top:5rem;margin-bottom:2.625rem}._subHeader_176pg_15{text-align:center;margin-bottom:3.625rem}._h100_176pg_20{font-size:75px;font-weight:400;line-height:150%;text-align:center}@media screen and (min-width: 1000px){._spinnerContainer_176pg_10{margin-top:unset}}@keyframes _spin_1b22l_10{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._spinner_1b22l_10{margin:0 auto;border:12px solid var(--white);border-top:12px solid var(--brand-medium);border-radius:50%;width:96px;height:96px;animation:_spin_1b22l_10 1.5s linear infinite}:root{--white: #fff;--brand-medium: #0092f6;--brand-dark: #3333c4;--brand-extra-dark: #000062;--gray-medium-dark: #565b61;--gray-medium-light: #e3e8ed;--gray-extra-dark: #06152B;--warn: #664d03;--danger: #e9162b}*,*:before,*:after{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:150%;color:var(--white);text-align:left;background-color:var(--brand-dark);background-image:url(/wrose-authzn/background.webp);background-size:contain;background-position:left bottom;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:.5rem}h2{font-size:32px;font-weight:700;line-height:140%}h3{font-size:24px;font-weight:700;line-height:140%}h4{font-size:18px;font-weight:700;line-height:120%}p{font-size:16px;font-weight:400;line-height:150%} diff --git a/wrose-authzn/index.html b/wrose-authzn/index.html index f50b5f6..d657e1b 100644 --- a/wrose-authzn/index.html +++ b/wrose-authzn/index.html @@ -4,10 +4,13 @@ - + ROSE (un) wrapper - - + +