diff --git a/votee/assets/index-CunTQBS8.css b/votee/assets/index-CunTQBS8.css new file mode 100644 index 0000000..80ad77c --- /dev/null +++ b/votee/assets/index-CunTQBS8.css @@ -0,0 +1 @@ +._layout_ppbjw_1{min-height:100dvh;display:flex;flex-direction:column;justify-content:space-between}._main_ppbjw_8{margin:0 auto;width:100%;max-width:1200px}._header_ppbjw_14{display:flex;justify-content:space-between;vertical-align:middle;align-items:center;padding-top:2.8125rem;padding-bottom:1.5625rem;border-bottom:1px solid var(--white)}._subHeader_ppbjw_24{margin:1.125rem 0 .5625rem;text-align:center;padding:1.875rem 0}._button_6vyky_1{width:auto;border-radius:8px;border:1px transparent solid;box-shadow:none;cursor:pointer;font-style:normal;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:capitalize;text-align:center}._button_6vyky_1>label{display:flex;vertical-align:middle;align-items:center;gap:.75rem}._buttonSmall_6vyky_22{font-size:14px;line-height:140%;font-weight:400;padding:.326rem 1.75rem;letter-spacing:0}._buttonMedium_6vyky_30{font-size:24px;font-weight:500;line-height:125%;padding:.5rem 2.25rem;letter-spacing:-.03em}._buttonSolid_6vyky_38._buttonPrimary_6vyky_39{background-color:var(--palatinate-blue);color:var(--white)}._buttonSolid_6vyky_38._buttonSecondary_6vyky_44{background-color:var(--white);color:var(--palatinate-blue)}._buttonOutline_6vyky_50._buttonPrimary_6vyky_39{background-color:var(--palatinate-blue);color:var(--white);border:1px var(--white) solid}._buttonOutline_6vyky_50._buttonSecondary_6vyky_44{background-color:var(--white);color:var(--palatinate-blue);border:1px var(--palatinate-blue) solid}._buttonText_6vyky_64._buttonPrimary_6vyky_39,._buttonText_6vyky_64._buttonSecondary_6vyky_44{background-color:transparent;color:var(--old-silver);border:transparent;text-decoration:underline;text-underline-offset:.5rem;font-size:16px;font-weight:400;line-height:137%;letter-spacing:-.03em;padding:.5rem}._buttonDisabled_6vyky_80{cursor:not-allowed;background-color:var(--bright-gray);opacity:.5}._fullWidth_6vyky_86{width:100%}._connectedAccount_1fimt_1{display:flex;justify-items:center;gap:1rem;min-width:350px;border-radius:12px;background:var(--white);padding:.9375rem .75rem;text-decoration:none;cursor:pointer}._connectedAccountDetails_1fimt_13{display:inline-flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:270px;color:var(--navy-blue);text-align:end;margin-bottom:0}._connectedAccountAddress_1fimt_24{flex:1 1 60%;font-family:monospace;text-decoration:none;font-size:22px;font-weight:700;line-height:140%;letter-spacing:0;text-align:right}._network_1fimt_35{flex:0 0 40%;overflow:hidden;max-height:28px;font-size:20px;font-weight:400;line-height:140%;letter-spacing:0;text-align:left;text-transform:capitalize}._jazzIcon_ti0z0_1{display:inline-block}._alert_da1x7_1{text-align:center}._alert_da1x7_1 h2{color:var(--palatinate-blue);margin-top:6rem;margin-bottom:1rem}._alert_da1x7_1 p{max-width:335px;font-size:14px;font-weight:400;line-height:120%;letter-spacing:0;margin:0 auto;margin-bottom:2.375rem}._alert_da1x7_1 ._icon_da1x7_20{margin:0 auto;margin-bottom:1.125rem}._alert_da1x7_1 ._actions_da1x7_25:empty{display:none}._alert_da1x7_1 ._actions_da1x7_25 span{font-size:22px;font-weight:500;line-height:150%;letter-spacing:-.03em;color:var(--palatinate-blue)}._alertError_da1x7_40 svg{color:var(--mystic)}._alertSuccess_da1x7_46 svg{color:var(--green-sheen)}@keyframes _rotating_da1x7_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._alertLoading_da1x7_61 ._icon_da1x7_20{display:flex;justify-content:center;align-items:center;width:106px;height:106px;border-radius:50%;background:linear-gradient(302.43deg,var(--medium-blue) -18.46%,var(--azure) 93.84%)}._alertLoading_da1x7_61 svg{color:var(--white);animation:_rotating_da1x7_1 3s linear infinite}._alertInsufficientBalance_da1x7_78 ._icon_da1x7_20{display:flex;justify-content:center;align-items:center;width:106px;height:106px;border-radius:50%;background:linear-gradient(282.09deg,var(--mystic) 6.24%,var(--rose-red) 102.94%)}._alertInsufficientBalance_da1x7_78 svg{color:var(--white)}._card_1tc1z_1{display:flex;flex-direction:column;margin:0 auto;width:100%;max-width:876px;min-height:688px;padding:2.25rem 4.6875rem 1.875rem;border-radius:12px;background:var(--white);box-shadow:0 4px 4px #00000040;color:var(--dark-gunmetal)}._cardHeaderText_1s14o_1{font-size:18px;font-weight:400;line-height:23px;letter-spacing:0;text-align:center;margin-bottom:1.5625rem;opacity:.8}._mascotCards_1s14o_11{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:2.0625rem;margin-bottom:2.5rem}._mascotCardActions_1s14o_18{display:flex;justify-content:center;margin-top:auto}._cardAction_1s14o_24{display:flex;justify-content:center;margin-bottom:2rem}._voteBtnLabel_1s14o_30{cursor:pointer;-webkit-user-select:none;user-select:none}._voteBtnLabelDisabled_1s14o_35{cursor:not-allowed;-webkit-user-select:none;user-select:none}._cardFooterText_1s14o_40{font-size:14px;font-weight:500;line-height:21px;letter-spacing:0;text-align:center;color:var(--palatinate-blue)}._insufficientBalanceAlertActions_1s14o_49{display:flex;flex-direction:column;gap:.75rem}._insufficientBalanceAlertActions_1s14o_49>*{align-self:center}._mascotCard_1ytay_1{display:flex;margin:0 auto;width:100%;border-radius:8px;background:var(--white);border:1px var(--palatinate-blue) solid}._mascotCard_1ytay_1._mascotCardSelected_1ytay_9{border:3px solid var(--green-sheen)}._mascotCard_1ytay_1._mascotCardVertical_1ytay_13{flex-direction:column;justify-content:flex-start;max-width:218px;padding:.75rem 1.125rem 1.25rem;text-align:center}._mascotCard_1ytay_1._mascotCardVertical_1ytay_13 img{margin-bottom:.75rem;width:182px;height:182px}._mascotCard_1ytay_1._mascotCardVertical_1ytay_13:not(._mascotCardSelected_1ytay_9){padding:.875rem 1.25rem 1.375rem}._mascotCard_1ytay_1._mascotCardHorizontal_1ytay_31{position:relative;flex-direction:row;gap:1.3125rem;padding:1.0625rem 1.375rem 1.5rem;text-align:left;align-items:center}._mascotCard_1ytay_1._mascotCardHorizontal_1ytay_31 img{width:196px;height:auto}._mascotCardTitle_1ytay_46{color:var(--palatinate-blue);margin-bottom:.5625rem}._mascotCardDescription_1ytay_51{font-size:18px;font-weight:400;line-height:120%;letter-spacing:0;margin-bottom:1.625rem}._cardHeaderText_4qxvn_1{font-size:18px;font-weight:400;line-height:150%;letter-spacing:0;text-align:center;margin-bottom:2rem;opacity:.8}._winningMascot_4qxvn_11{margin-bottom:2rem}._winningMascotBadge_4qxvn_15{position:absolute;top:1.0625rem;right:1.625rem;display:flex;align-items:center;gap:.5rem;padding:.25rem .75rem;border-radius:4px;color:var(--white);background-color:var(--green-sheen);font-size:14px;font-weight:500;line-height:150%;letter-spacing:-.03em}._mascotPollData_4qxvn_32{display:flex;gap:2.125rem;justify-content:space-between;margin-bottom:2.5rem}._cardFooterText_4qxvn_39{font-size:14px;font-weight:500;line-height:120%;letter-spacing:-.03em;text-align:center;color:var(--palatinate-blue)}._mascotResultsTable_4qxvn_48{table-layout:fixed}._mascotResultsTable_4qxvn_48 tr th:last-child,._mascotResultsTable_4qxvn_48 tr td:last-child{text-align:right}._mascotResultsTable_4qxvn_48 tr th:nth-child(2),._mascotResultsTable_4qxvn_48 tr td:nth-child(2){text-align:center}._answerColName_4qxvn_64{font-size:16px;font-weight:500;line-height:137%;letter-spacing:-.03em}._answerColName_4qxvn_64:before{padding-right:10px;content:"⬤";vertical-align:text-bottom}._pieChart_154k8_1{min-width:250px;height:250px}._pieChartCell_154k8_6{stroke-width:8px;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0px 7.5px 7.5px rgba(0,0,98,.25))}._table_139rl_1{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent;border-collapse:collapse}._table_139rl_1 thead th{font-size:20px;font-weight:600;line-height:150%;letter-spacing:-.03em;vertical-align:bottom;padding-bottom:1.125rem;border-bottom:1px solid var(--table-border-dark);color:var(--palatinate-blue)}._table_139rl_1 tbody tr:not(:last-child){border-bottom:1px solid var(--table-border-light)}._table_139rl_1 tbody tr:last-child{border-bottom:1px solid var(--table-border-dark)}._table_139rl_1 tbody td{padding-top:.5rem;padding-bottom:.5rem;font-size:16px;font-weight:400;line-height:150%;letter-spacing:-.03em}:root{--white: #fff;--palatinate-blue: #2c3bd5;--bright-gray: #eae6f0;--dark-gunmetal: #242629;--navy-blue: #000062;--mystic: #d44c7d;--green-sheen: #66bfa0;--azure: #008cff;--rose-red: #cc1e5c;--medium-blue: #0d00d2;--table-border-light: rgba(143, 142, 223, .39);--table-border-dark: rgba(36, 38, 41, .8);--old-silver: #858486}*,*: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(--palatinate-blue);background-image:url(/votee/background.webp);background-size:cover;background-position:center center;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin:0}h1{font-size:56px;font-weight:500;line-height:130%;letter-spacing:-.03em}h2{font-size:30px;font-weight:500;line-height:140%;letter-spacing:-.03em}h3{font-size:26px;font-weight:500;line-height:130%;letter-spacing:-.03em} diff --git a/votee/assets/index-DuodweYd.js b/votee/assets/index-DuodweYd.js new file mode 100644 index 0000000..336d4ec --- /dev/null +++ b/votee/assets/index-DuodweYd.js @@ -0,0 +1,146 @@ +var rH=Object.defineProperty;var iH=(t,e,n)=>e in t?rH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var I=(t,e,n)=>(iH(t,typeof e!="symbol"?e+"":e,n),n),KA=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var g=(t,e,n)=>(KA(t,e,"read from private field"),n?n.call(t):e.get(t)),R=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},O=(t,e,n,r)=>(KA(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var ms=(t,e,n,r)=>({set _(i){O(t,e,i,n)},get _(){return g(t,e,r)}}),te=(t,e,n)=>(KA(t,e,"access private method"),n);function sM(t,e){for(var n=0;nr[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"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var vv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function aH(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var lM={exports:{}},h2={},cM={exports:{}},_t={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Gm=Symbol.for("react.element"),oH=Symbol.for("react.portal"),sH=Symbol.for("react.fragment"),lH=Symbol.for("react.strict_mode"),cH=Symbol.for("react.profiler"),uH=Symbol.for("react.provider"),fH=Symbol.for("react.context"),hH=Symbol.for("react.forward_ref"),dH=Symbol.for("react.suspense"),pH=Symbol.for("react.memo"),gH=Symbol.for("react.lazy"),_4=Symbol.iterator;function yH(t){return t===null||typeof t!="object"?null:(t=_4&&t[_4]||t["@@iterator"],typeof t=="function"?t:null)}var uM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fM=Object.assign,hM={};function qp(t,e,n){this.props=t,this.context=e,this.refs=hM,this.updater=n||uM}qp.prototype.isReactComponent={};qp.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")};qp.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function dM(){}dM.prototype=qp.prototype;function dS(t,e,n){this.props=t,this.context=e,this.refs=hM,this.updater=n||uM}var pS=dS.prototype=new dM;pS.constructor=dS;fM(pS,qp.prototype);pS.isPureReactComponent=!0;var I4=Array.isArray,pM=Object.prototype.hasOwnProperty,gS={current:null},gM={key:!0,ref:!0,__self:!0,__source:!0};function yM(t,e,n){var r,i={},a=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)pM.call(e,r)&&!gM.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,be=K[we];if(0>>1;wei(Be,he))gti(Vt,Be)?(K[we]=Vt,K[gt]=he,we=gt):(K[we]=Be,K[at]=he,we=at);else if(gti(Vt,he))K[we]=Vt,K[gt]=he,we=gt;else break e}}return ee}function i(K,ee){var he=K.sortIndex-ee.sortIndex;return he!==0?he:K.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,h=3,d=!1,y=!1,p=!1,m=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(K){for(var ee=n(c);ee!==null;){if(ee.callback===null)r(c);else if(ee.startTime<=K)r(c),ee.sortIndex=ee.expirationTime,e(l,ee);else break;ee=n(c)}}function E(K){if(p=!1,x(K),!y)if(n(l)!==null)y=!0,G(P);else{var ee=n(c);ee!==null&&q(E,ee.startTime-K)}}function P(K,ee){y=!1,p&&(p=!1,v(N),N=-1),d=!0;var he=h;try{for(x(ee),f=n(l);f!==null&&(!(f.expirationTime>ee)||K&&!F());){var we=f.callback;if(typeof we=="function"){f.callback=null,h=f.priorityLevel;var be=we(f.expirationTime<=ee);ee=t.unstable_now(),typeof be=="function"?f.callback=be:f===n(l)&&r(l),x(ee)}else r(l);f=n(l)}if(f!==null)var Ye=!0;else{var at=n(c);at!==null&&q(E,at.startTime-ee),Ye=!1}return Ye}finally{f=null,h=he,d=!1}}var A=!1,k=null,N=-1,D=5,L=-1;function F(){return!(t.unstable_now()-LK||125we?(K.sortIndex=he,e(c,K),n(l)===null&&K===n(c)&&(p?(v(N),N=-1):p=!0,q(E,he-we))):(K.sortIndex=be,e(l,K),y||d||(y=!0,G(P))),K},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(K){var ee=h;return function(){var he=h;h=ee;try{return K.apply(this,arguments)}finally{h=he}}}})(wM);bM.exports=wM;var CH=bM.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var xM=U,la=CH;function ve(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),B5=Object.prototype.hasOwnProperty,kH=/^[: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]*$/,M4={},B4={};function NH(t){return B5.call(B4,t)?!0:B5.call(M4,t)?!1:kH.test(t)?B4[t]=!0:(M4[t]=!0,!1)}function _H(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function IH(t,e,n,r){if(e===null||typeof e>"u"||_H(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 gi(t,e,n,r,i,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var Or={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Or[t]=new gi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Or[e]=new gi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Or[t]=new gi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Or[t]=new gi(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){Or[t]=new gi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Or[t]=new gi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Or[t]=new gi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Or[t]=new gi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Or[t]=new gi(t,5,!1,t.toLowerCase(),null,!1,!1)});var mS=/[\-:]([a-z])/g;function vS(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(mS,vS);Or[e]=new gi(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(mS,vS);Or[e]=new gi(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(mS,vS);Or[e]=new gi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Or[t]=new gi(t,1,!1,t.toLowerCase(),null,!1,!1)});Or.xlinkHref=new gi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Or[t]=new gi(t,1,!1,t.toLowerCase(),null,!0,!0)});function bS(t,e,n,r){var i=Or.hasOwnProperty(e)?Or[e]:null;(i!==null?i.type!==0:r||!(2s||i[o]!==a[s]){var l=` +`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=s);break}}}finally{YA=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Gg(t):""}function RH(t){switch(t.tag){case 5:return Gg(t.type);case 16:return Gg("Lazy");case 13:return Gg("Suspense");case 19:return Gg("SuspenseList");case 0:case 2:case 15:return t=XA(t.type,!1),t;case 11:return t=XA(t.type.render,!1),t;case 1:return t=XA(t.type,!0),t;default:return""}}function U5(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 Qh:return"Fragment";case Vh:return"Portal";case D5:return"Profiler";case wS:return"StrictMode";case L5:return"Suspense";case $5:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case SM:return(t.displayName||"Context")+".Consumer";case EM:return(t._context.displayName||"Context")+".Provider";case xS:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case AS:return e=t.displayName||null,e!==null?e:U5(t.type)||"Memo";case Vl:e=t._payload,t=t._init;try{return U5(t(e))}catch{}}return null}function MH(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 U5(e);case 8:return e===wS?"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 Yc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function OM(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function BH(t){var e=OM(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function xv(t){t._valueTracker||(t._valueTracker=BH(t))}function TM(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=OM(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function fw(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 F5(t,e){var n=e.checked;return Tn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function L4(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Yc(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function CM(t,e){e=e.checked,e!=null&&bS(t,"checked",e,!1)}function j5(t,e){CM(t,e);var n=Yc(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?z5(t,e.type,n):e.hasOwnProperty("defaultValue")&&z5(t,e.type,Yc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function $4(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function z5(t,e,n){(e!=="number"||fw(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vg=Array.isArray;function bd(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Av.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $y(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var hy={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},DH=["Webkit","ms","Moz","O"];Object.keys(hy).forEach(function(t){DH.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),hy[e]=hy[t]})});function IM(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||hy.hasOwnProperty(t)&&hy[t]?(""+e).trim():e+"px"}function RM(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=IM(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var LH=Tn({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 V5(t,e){if(e){if(LH[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ve(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ve(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ve(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ve(62))}}function Q5(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 K5=null;function ES(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var W5=null,wd=null,xd=null;function j4(t){if(t=Km(t)){if(typeof W5!="function")throw Error(ve(280));var e=t.stateNode;e&&(e=m2(e),W5(t.stateNode,t.type,e))}}function MM(t){wd?xd?xd.push(t):xd=[t]:wd=t}function BM(){if(wd){var t=wd,e=xd;if(xd=wd=null,j4(t),e)for(t=0;t>>=0,t===0?32:31-(WH(t)/JH|0)|0}var Ev=64,Sv=4194304;function Qg(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 gw(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=Qg(s):(a&=o,a!==0&&(r=Qg(a)))}else o=n&~i,o!==0?r=Qg(o):a!==0&&(r=Qg(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Vm(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-xo(e),t[e]=n}function qH(t,e){var n=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 r=t.eventTimes;for(t=t.expirationTimes;0=py),Y4=" ",X4=!1;function tB(t,e){switch(t){case"keyup":return TG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nB(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Kh=!1;function kG(t,e){switch(t){case"compositionend":return nB(e);case"keypress":return e.which!==32?null:(X4=!0,Y4);case"textInput":return t=e.data,t===Y4&&X4?null:t;default:return null}}function NG(t,e){if(Kh)return t==="compositionend"||!_S&&tB(t,e)?(t=qM(),Tb=CS=_c=null,Kh=!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:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tT(n)}}function oB(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?oB(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function sB(){for(var t=window,e=fw();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=fw(t.document)}return e}function IS(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 UG(t){var e=sB(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&oB(n.ownerDocument.documentElement,n)){if(r!==null&&IS(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=nT(n,a);var o=nT(n,r);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(),a>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wh=null,eE=null,yy=null,tE=!1;function rT(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tE||Wh==null||Wh!==fw(r)||(r=Wh,"selectionStart"in r&&IS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),yy&&Gy(yy,r)||(yy=r,r=vw(eE,"onSelect"),0Xh||(t.current=sE[Xh],sE[Xh]=null,Xh--)}function on(t,e){Xh++,sE[Xh]=t.current,t.current=e}var Xc={},Kr=tu(Xc),_i=tu(!1),Wf=Xc;function up(t,e){var n=t.type.contextTypes;if(!n)return Xc;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ii(t){return t=t.childContextTypes,t!=null}function ww(){dn(_i),dn(Kr)}function uT(t,e,n){if(Kr.current!==Xc)throw Error(ve(168));on(Kr,e),on(_i,n)}function yB(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ve(108,MH(t)||"Unknown",i));return Tn({},n,r)}function xw(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Xc,Wf=Kr.current,on(Kr,t),on(_i,_i.current),!0}function fT(t,e,n){var r=t.stateNode;if(!r)throw Error(ve(169));n?(t=yB(t,e,Wf),r.__reactInternalMemoizedMergedChildContext=t,dn(_i),dn(Kr),on(Kr,t)):dn(_i),on(_i,n)}var Ps=null,v2=!1,f6=!1;function mB(t){Ps===null?Ps=[t]:Ps.push(t)}function XG(t){v2=!0,mB(t)}function nu(){if(!f6&&Ps!==null){f6=!0;var t=0,e=qt;try{var n=Ps;for(qt=1;t>=o,i-=o,tl=1<<32-xo(e)+i|n<N?(D=k,k=null):D=k.sibling;var L=h(v,k,x[N],E);if(L===null){k===null&&(k=D);break}t&&k&&L.alternate===null&&e(v,k),w=a(L,w,N),A===null?P=L:A.sibling=L,A=L,k=D}if(N===x.length)return n(v,k),yn&&bu(v,N),P;if(k===null){for(;NN?(D=k,k=null):D=k.sibling;var F=h(v,k,L.value,E);if(F===null){k===null&&(k=D);break}t&&k&&F.alternate===null&&e(v,k),w=a(F,w,N),A===null?P=F:A.sibling=F,A=F,k=D}if(L.done)return n(v,k),yn&&bu(v,N),P;if(k===null){for(;!L.done;N++,L=x.next())L=f(v,L.value,E),L!==null&&(w=a(L,w,N),A===null?P=L:A.sibling=L,A=L);return yn&&bu(v,N),P}for(k=r(v,k);!L.done;N++,L=x.next())L=d(k,v,N,L.value,E),L!==null&&(t&&L.alternate!==null&&k.delete(L.key===null?N:L.key),w=a(L,w,N),A===null?P=L:A.sibling=L,A=L);return t&&k.forEach(function($){return e(v,$)}),yn&&bu(v,N),P}function m(v,w,x,E){if(typeof x=="object"&&x!==null&&x.type===Qh&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case wv:e:{for(var P=x.key,A=w;A!==null;){if(A.key===P){if(P=x.type,P===Qh){if(A.tag===7){n(v,A.sibling),w=i(A,x.props.children),w.return=v,v=w;break e}}else if(A.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Vl&&vT(P)===A.type){n(v,A.sibling),w=i(A,x.props),w.ref=Sg(v,A,x),w.return=v,v=w;break e}n(v,A);break}else e(v,A);A=A.sibling}x.type===Qh?(w=Df(x.props.children,v.mode,E,x.key),w.return=v,v=w):(E=Bb(x.type,x.key,x.props,null,v.mode,E),E.ref=Sg(v,w,x),E.return=v,v=E)}return o(v);case Vh:e:{for(A=x.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(v,w.sibling),w=i(w,x.children||[]),w.return=v,v=w;break e}else{n(v,w);break}else e(v,w);w=w.sibling}w=b6(x,v.mode,E),w.return=v,v=w}return o(v);case Vl:return A=x._init,m(v,w,A(x._payload),E)}if(Vg(x))return y(v,w,x,E);if(bg(x))return p(v,w,x,E);_v(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(v,w.sibling),w=i(w,x),w.return=v,v=w):(n(v,w),w=v6(x,v.mode,E),w.return=v,v=w),o(v)):n(v,w)}return m}var hp=PB(!0),OB=PB(!1),Wm={},rs=tu(Wm),Wy=tu(Wm),Jy=tu(Wm);function _u(t){if(t===Wm)throw Error(ve(174));return t}function jS(t,e){switch(on(Jy,e),on(Wy,t),on(rs,Wm),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:G5(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=G5(e,t)}dn(rs),on(rs,e)}function dp(){dn(rs),dn(Wy),dn(Jy)}function TB(t){_u(Jy.current);var e=_u(rs.current),n=G5(e,t.type);e!==n&&(on(Wy,t),on(rs,n))}function zS(t){Wy.current===t&&(dn(rs),dn(Wy))}var xn=tu(0);function Tw(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 h6=[];function HS(){for(var t=0;tn?n:4,t(!0);var r=d6.transition;d6.transition={};try{t(!1),e()}finally{qt=n,d6.transition=r}}function HB(){return Ha().memoizedState}function tV(t,e,n){var r=Gc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},GB(t))VB(e,n);else if(n=xB(t,e,n,r),n!==null){var i=hi();Ao(n,t,r,i),QB(n,e,r)}}function nV(t,e,n){var r=Gc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(GB(t))VB(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,So(s,o)){var l=e.interleaved;l===null?(i.next=i,US(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=xB(t,e,i,r),n!==null&&(i=hi(),Ao(n,t,r,i),QB(n,e,r))}}function GB(t){var e=t.alternate;return t===On||e!==null&&e===On}function VB(t,e){my=Cw=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function QB(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,PS(t,n)}}var kw={readContext:za,useCallback:_r,useContext:_r,useEffect:_r,useImperativeHandle:_r,useInsertionEffect:_r,useLayoutEffect:_r,useMemo:_r,useReducer:_r,useRef:_r,useState:_r,useDebugValue:_r,useDeferredValue:_r,useTransition:_r,useMutableSource:_r,useSyncExternalStore:_r,useId:_r,unstable_isNewReconciler:!1},rV={readContext:za,useCallback:function(t,e){return Mo().memoizedState=[t,e===void 0?null:e],t},useContext:za,useEffect:wT,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,_b(4194308,4,$B.bind(null,e,t),n)},useLayoutEffect:function(t,e){return _b(4194308,4,t,e)},useInsertionEffect:function(t,e){return _b(4,2,t,e)},useMemo:function(t,e){var n=Mo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Mo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=tV.bind(null,On,t),[r.memoizedState,t]},useRef:function(t){var e=Mo();return t={current:t},e.memoizedState=t},useState:bT,useDebugValue:WS,useDeferredValue:function(t){return Mo().memoizedState=t},useTransition:function(){var t=bT(!1),e=t[0];return t=eV.bind(null,t[1]),Mo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=On,i=Mo();if(yn){if(n===void 0)throw Error(ve(407));n=n()}else{if(n=e(),fr===null)throw Error(ve(349));Yf&30||NB(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,wT(IB.bind(null,r,a,t),[t]),r.flags|=2048,Zy(9,_B.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=Mo(),e=fr.identifierPrefix;if(yn){var n=nl,r=tl;n=(r&~(1<<32-xo(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Yy++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Yo]=e,t[Ky]=r,t7(t,e,!1,!1),e.stateNode=t;e:{switch(o=Q5(n,r),n){case"dialog":cn("cancel",t),cn("close",t),i=r;break;case"iframe":case"object":case"embed":cn("load",t),i=r;break;case"video":case"audio":for(i=0;igp&&(e.flags|=128,r=!0,Pg(a,!1),e.lanes=4194304)}else{if(!r)if(t=Tw(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Pg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!yn)return Ir(e),null}else 2*jn()-a.renderingStartTime>gp&&n!==1073741824&&(e.flags|=128,r=!0,Pg(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(n=a.last,n!==null?n.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=jn(),e.sibling=null,n=xn.current,on(xn,r?n&1|2:n&1),e):(Ir(e),null);case 22:case 23:return eP(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ea&1073741824&&(Ir(e),e.subtreeFlags&6&&(e.flags|=8192)):Ir(e),null;case 24:return null;case 25:return null}throw Error(ve(156,e.tag))}function fV(t,e){switch(MS(e),e.tag){case 1:return Ii(e.type)&&ww(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return dp(),dn(_i),dn(Kr),HS(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return zS(e),null;case 13:if(dn(xn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ve(340));fp()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return dn(xn),null;case 4:return dp(),null;case 10:return $S(e.type._context),null;case 22:case 23:return eP(),null;case 24:return null;default:return null}}var Rv=!1,jr=!1,hV=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function td(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Bn(t,e,r)}else n.current=null}function bE(t,e,n){try{n()}catch(r){Bn(t,e,r)}}var kT=!1;function dV(t,e){if(nE=yw,t=sB(),IS(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||i!==0&&f.nodeType!==3||(s=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===i&&(s=o),h===a&&++u===r&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(rE={focusedElem:t,selectionRange:n},yw=!1,Fe=e;Fe!==null;)if(e=Fe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Fe=t;else for(;Fe!==null;){e=Fe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var p=y.memoizedProps,m=y.memoizedState,v=e.stateNode,w=v.getSnapshotBeforeUpdate(e.elementType===e.type?p:to(e.type,p),m);v.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ve(163))}}catch(E){Bn(e,e.return,E)}if(t=e.sibling,t!==null){t.return=e.return,Fe=t;break}Fe=e.return}return y=kT,kT=!1,y}function vy(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&bE(e,n,a)}i=i.next}while(i!==r)}}function x2(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function wE(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function i7(t){var e=t.alternate;e!==null&&(t.alternate=null,i7(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Yo],delete e[Ky],delete e[oE],delete e[JG],delete e[YG])),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 a7(t){return t.tag===5||t.tag===3||t.tag===4}function NT(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||a7(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 xE(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=bw));else if(r!==4&&(t=t.child,t!==null))for(xE(t,e,n),t=t.sibling;t!==null;)xE(t,e,n),t=t.sibling}function AE(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(AE(t,e,n),t=t.sibling;t!==null;)AE(t,e,n),t=t.sibling}var br=null,fo=!1;function Ll(t,e,n){for(n=n.child;n!==null;)o7(t,e,n),n=n.sibling}function o7(t,e,n){if(ns&&typeof ns.onCommitFiberUnmount=="function")try{ns.onCommitFiberUnmount(d2,n)}catch{}switch(n.tag){case 5:jr||td(n,e);case 6:var r=br,i=fo;br=null,Ll(t,e,n),br=r,fo=i,br!==null&&(fo?(t=br,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):br.removeChild(n.stateNode));break;case 18:br!==null&&(fo?(t=br,n=n.stateNode,t.nodeType===8?u6(t.parentNode,n):t.nodeType===1&&u6(t,n),zy(t)):u6(br,n.stateNode));break;case 4:r=br,i=fo,br=n.stateNode.containerInfo,fo=!0,Ll(t,e,n),br=r,fo=i;break;case 0:case 11:case 14:case 15:if(!jr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&bE(n,e,o),i=i.next}while(i!==r)}Ll(t,e,n);break;case 1:if(!jr&&(td(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Bn(n,e,s)}Ll(t,e,n);break;case 21:Ll(t,e,n);break;case 22:n.mode&1?(jr=(r=jr)||n.memoizedState!==null,Ll(t,e,n),jr=r):Ll(t,e,n);break;default:Ll(t,e,n)}}function _T(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new hV),e.forEach(function(r){var i=AV.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Xa(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=jn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gV(r/1960))-r,10t?16:t,Ic===null)var r=!1;else{if(t=Ic,Ic=null,Iw=0,jt&6)throw Error(ve(331));var i=jt;for(jt|=4,Fe=t.current;Fe!==null;){var a=Fe,o=a.child;if(Fe.flags&16){var s=a.deletions;if(s!==null){for(var l=0;ljn()-ZS?Bf(t,0):XS|=n),Ri(t,e)}function p7(t,e){e===0&&(t.mode&1?(e=Sv,Sv<<=1,!(Sv&130023424)&&(Sv=4194304)):e=1);var n=hi();t=yl(t,e),t!==null&&(Vm(t,e,n),Ri(t,n))}function xV(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),p7(t,n)}function AV(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ve(314))}r!==null&&r.delete(e),p7(t,n)}var g7;g7=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||_i.current)ki=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ki=!1,cV(t,e,n);ki=!!(t.flags&131072)}else ki=!1,yn&&e.flags&1048576&&vB(e,Ew,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Ib(t,e),t=e.pendingProps;var i=up(e,Kr.current);Ed(e,n),i=VS(null,e,r,t,i,n);var a=QS();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,Ii(r)?(a=!0,xw(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,FS(e),i.updater=b2,e.stateNode=i,i._reactInternals=e,hE(e,r,t,n),e=gE(null,e,r,!0,a,n)):(e.tag=0,yn&&a&&RS(e),Zr(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Ib(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=SV(r),t=to(r,t),i){case 0:e=pE(null,e,r,t,n);break e;case 1:e=OT(null,e,r,t,n);break e;case 11:e=ST(null,e,r,t,n);break e;case 14:e=PT(null,e,r,to(r.type,t),n);break e}throw Error(ve(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:to(r,i),pE(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:to(r,i),OT(t,e,r,i,n);case 3:e:{if(ZB(e),t===null)throw Error(ve(387));r=e.pendingProps,a=e.memoizedState,i=a.element,AB(t,e),Ow(e,r,null,n);var o=e.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=pp(Error(ve(423)),e),e=TT(t,e,r,n,i);break e}else if(r!==i){i=pp(Error(ve(424)),e),e=TT(t,e,r,n,i);break e}else for(ia=jc(e.stateNode.containerInfo.firstChild),sa=e,yn=!0,mo=null,n=OB(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fp(),r===i){e=ml(t,e,n);break e}Zr(t,e,r,n)}e=e.child}return e;case 5:return TB(e),t===null&&cE(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,iE(r,i)?o=null:a!==null&&iE(r,a)&&(e.flags|=32),XB(t,e),Zr(t,e,o,n),e.child;case 6:return t===null&&cE(e),null;case 13:return qB(t,e,n);case 4:return jS(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=hp(e,null,r,n):Zr(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:to(r,i),ST(t,e,r,i,n);case 7:return Zr(t,e,e.pendingProps,n),e.child;case 8:return Zr(t,e,e.pendingProps.children,n),e.child;case 12:return Zr(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,o=i.value,on(Sw,r._currentValue),r._currentValue=o,a!==null)if(So(a.value,o)){if(a.children===i.children&&!_i.current){e=ml(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=ol(-1,n&-n),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),uE(a.return,n,e),s.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ve(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),uE(o,n,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Zr(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ed(e,n),i=za(i),r=r(i),e.flags|=1,Zr(t,e,r,n),e.child;case 14:return r=e.type,i=to(r,e.pendingProps),i=to(r.type,i),PT(t,e,r,i,n);case 15:return JB(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:to(r,i),Ib(t,e),e.tag=1,Ii(r)?(t=!0,xw(e)):t=!1,Ed(e,n),SB(e,r,i),hE(e,r,i,n),gE(null,e,r,!0,t,n);case 19:return e7(t,e,n);case 22:return YB(t,e,n)}throw Error(ve(156,e.tag))};function y7(t,e){return zM(t,e)}function EV(t,e,n,r){this.tag=t,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function La(t,e,n,r){return new EV(t,e,n,r)}function nP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function SV(t){if(typeof t=="function")return nP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===xS)return 11;if(t===AS)return 14}return 2}function Vc(t,e){var n=t.alternate;return n===null?(n=La(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Bb(t,e,n,r,i,a){var o=2;if(r=t,typeof t=="function")nP(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Qh:return Df(n.children,i,a,e);case wS:o=8,i|=8;break;case D5:return t=La(12,n,e,i|2),t.elementType=D5,t.lanes=a,t;case L5:return t=La(13,n,e,i),t.elementType=L5,t.lanes=a,t;case $5:return t=La(19,n,e,i),t.elementType=$5,t.lanes=a,t;case PM:return E2(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case EM:o=10;break e;case SM:o=9;break e;case xS:o=11;break e;case AS:o=14;break e;case Vl:o=16,r=null;break e}throw Error(ve(130,t==null?t:typeof t,""))}return e=La(o,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function Df(t,e,n,r){return t=La(7,t,r,e),t.lanes=n,t}function E2(t,e,n,r){return t=La(22,t,r,e),t.elementType=PM,t.lanes=n,t.stateNode={isHidden:!1},t}function v6(t,e,n){return t=La(6,t,null,e),t.lanes=n,t}function b6(t,e,n){return e=La(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function PV(t,e,n,r,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=qA(0),this.expirationTimes=qA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qA(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function rP(t,e,n,r,i,a,o,s,l){return t=new PV(t,e,n,s,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=La(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},FS(a),t}function OV(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w7)}catch(t){console.error(t)}}w7(),vM.exports=ca;var sP=vM.exports;const _V=Gt(sP),IV=sM({__proto__:null,default:_V},[sP]);var UT=sP;M5.createRoot=UT.createRoot,M5.hydrateRoot=UT.hydrateRoot;/** + * @remix-run/router v1.15.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Dn(){return Dn=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function qf(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function MV(){return Math.random().toString(36).substr(2,8)}function jT(t,e){return{usr:t.state,key:t.key,idx:e}}function e1(t,e,n,r){return n===void 0&&(n=null),Dn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ds(e):e,{state:n,key:e&&e.key||r||MV()})}function Jm(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ds(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function BV(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=Un.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Dn({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function f(){s=Un.Pop;let m=u(),v=m==null?null:m-c;c=m,l&&l({action:s,location:p.location,delta:v})}function h(m,v){s=Un.Push;let w=e1(p.location,m,v);n&&n(w,m),c=u()+1;let x=jT(w,c),E=p.createHref(w);try{o.pushState(x,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(E)}a&&l&&l({action:s,location:p.location,delta:1})}function d(m,v){s=Un.Replace;let w=e1(p.location,m,v);n&&n(w,m),c=u();let x=jT(w,c),E=p.createHref(w);o.replaceState(x,"",E),a&&l&&l({action:s,location:p.location,delta:0})}function y(m){let v=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof m=="string"?m:Jm(m);return w=w.replace(/ $/,"%20"),Ct(v,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,v)}let p={get action(){return s},get location(){return t(i,o)},listen(m){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(FT,f),l=m,()=>{i.removeEventListener(FT,f),l=null}},createHref(m){return e(i,m)},createURL:y,encodeLocation(m){let v=y(m);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:d,go(m){return o.go(m)}};return p}var In;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(In||(In={}));const DV=new Set(["lazy","caseSensitive","path","id","index","children"]);function LV(t){return t.index===!0}function TE(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if(Ct(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ct(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),LV(i)){let l=Dn({},i,e(i),{id:s});return r[s]=l,l}else{let l=Dn({},i,e(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=TE(i.children,e,o,r)),l}})}function rd(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?ds(e):e,i=Ym(r.pathname||"/",n);if(i==null)return null;let a=x7(t);UV(a);let o=null;for(let s=0;o==null&&s{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Ct(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Qc([r,l.relativePath]),u=n.concat(l);a.children&&a.children.length>0&&(Ct(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),x7(a.children,e,u,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:QV(c,a.index),routesMeta:u})};return t.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of A7(a.path))i(a,o,l)}),e}function A7(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=A7(r.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function UV(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:KV(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const FV=/^:[\w-]+$/,jV=3,zV=2,HV=1,GV=10,VV=-2,zT=t=>t==="*";function QV(t,e){let n=t.split("/"),r=n.length;return n.some(zT)&&(r+=VV),e&&(r+=zV),n.filter(i=>!zT(i)).reduce((i,a)=>i+(FV.test(a)?jV:a===""?HV:GV),r)}function KV(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function WV(t,e){let{routesMeta:n}=t,r={},i="/",a=[];for(let o=0;o{let{paramName:h,isOptional:d}=u;if(h==="*"){let p=s[f]||"";o=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const y=s[f];return d&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:o,pattern:t}}function YV(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),qf(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 r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function XV(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return qf(!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 Ym(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function ZV(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?ds(t):t;return{pathname:n?n.startsWith("/")?n:qV(n,e):e,search:tQ(r),hash:nQ(i)}}function qV(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function w6(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function E7(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function lP(t,e){let n=E7(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function cP(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=ds(t):(i=Dn({},t),Ct(!i.pathname||!i.pathname.includes("?"),w6("?","pathname","search",i)),Ct(!i.pathname||!i.pathname.includes("#"),w6("#","pathname","hash",i)),Ct(!i.search||!i.search.includes("#"),w6("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?e[f]:"/"}let l=ZV(i,s),c=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Qc=t=>t.join("/").replace(/\/\/+/g,"/"),eQ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),tQ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,nQ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class uP{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function S7(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const P7=["post","put","patch","delete"],rQ=new Set(P7),iQ=["get",...P7],aQ=new Set(iQ),oQ=new Set([301,302,303,307,308]),sQ=new Set([307,308]),x6={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},lQ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tg={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},O7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cQ=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),T7="remix-router-transitions";function uQ(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Ct(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 V=t.detectErrorBoundary;i=Z=>({hasErrorBoundary:V(Z)})}else i=cQ;let a={},o=TE(t.routes,i,void 0,a),s,l=t.basename||"/",c=Dn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),u=null,f=new Set,h=null,d=null,y=null,p=t.hydrationData!=null,m=rd(o,t.history.location,l),v=null;if(m==null){let V=ka(404,{pathname:t.history.location.pathname}),{matches:Z,route:ae}=YT(o);m=Z,v={[ae.id]:V}}let w,x=m.some(V=>V.route.lazy),E=m.some(V=>V.route.loader);if(x)w=!1;else if(!E)w=!0;else if(c.v7_partialHydration){let V=t.hydrationData?t.hydrationData.loaderData:null,Z=t.hydrationData?t.hydrationData.errors:null;w=m.every(ae=>ae.route.loader&&ae.route.loader.hydrate!==!0&&(V&&V[ae.route.id]!==void 0||Z&&Z[ae.route.id]!==void 0))}else w=t.hydrationData!=null;let P,A={historyAction:t.history.action,location:t.history.location,matches:m,initialized:w,navigation:x6,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||v,fetchers:new Map,blockers:new Map},k=Un.Pop,N=!1,D,L=!1,F=new Map,$=null,z=!1,J=!1,H=[],G=[],q=new Map,K=0,ee=-1,he=new Map,we=new Set,be=new Map,Ye=new Map,at=new Set,Be=new Map,gt=new Map,Vt=!1;function pn(){if(u=t.history.listen(V=>{let{action:Z,location:ae,delta:Ae}=V;if(Vt){Vt=!1;return}qf(gt.size===0||Ae!=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 Le=da({currentLocation:A.location,nextLocation:ae,historyAction:Z});if(Le&&Ae!=null){Vt=!0,t.history.go(Ae*-1),Jr(Le,{state:"blocked",location:ae,proceed(){Jr(Le,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),t.history.go(Ae)},reset(){let ht=new Map(A.blockers);ht.set(Le,Tg),We({blockers:ht})}});return}return It(Z,ae)}),n){xQ(e,F);let V=()=>AQ(e,F);e.addEventListener("pagehide",V),$=()=>e.removeEventListener("pagehide",V)}return A.initialized||It(Un.Pop,A.location,{initialHydration:!0}),P}function xe(){u&&u(),$&&$(),f.clear(),D&&D.abort(),A.fetchers.forEach((V,Z)=>Wr(Z)),A.blockers.forEach((V,Z)=>Fi(Z))}function Ve(V){return f.add(V),()=>f.delete(V)}function We(V,Z){Z===void 0&&(Z={}),A=Dn({},A,V);let ae=[],Ae=[];c.v7_fetcherPersist&&A.fetchers.forEach((Le,ht)=>{Le.state==="idle"&&(at.has(ht)?Ae.push(ht):ae.push(ht))}),[...f].forEach(Le=>Le(A,{deletedFetchers:Ae,unstable_viewTransitionOpts:Z.viewTransitionOpts,unstable_flushSync:Z.flushSync===!0})),c.v7_fetcherPersist&&(ae.forEach(Le=>A.fetchers.delete(Le)),Ae.forEach(Le=>Wr(Le)))}function se(V,Z,ae){var Ae,Le;let{flushSync:ht}=ae===void 0?{}:ae,ot=A.actionData!=null&&A.navigation.formMethod!=null&&ho(A.navigation.formMethod)&&A.navigation.state==="loading"&&((Ae=V.state)==null?void 0:Ae._isRedirect)!==!0,et;Z.actionData?Object.keys(Z.actionData).length>0?et=Z.actionData:et=null:ot?et=A.actionData:et=null;let Ie=Z.loaderData?JT(A.loaderData,Z.loaderData,Z.matches||[],Z.errors):A.loaderData,wt=A.blockers;wt.size>0&&(wt=new Map(wt),wt.forEach((C,b)=>wt.set(b,Tg)));let S=N===!0||A.navigation.formMethod!=null&&ho(A.navigation.formMethod)&&((Le=V.state)==null?void 0:Le._isRedirect)!==!0;s&&(o=s,s=void 0),z||k===Un.Pop||(k===Un.Push?t.history.push(V,V.state):k===Un.Replace&&t.history.replace(V,V.state));let T;if(k===Un.Pop){let C=F.get(A.location.pathname);C&&C.has(V.pathname)?T={currentLocation:A.location,nextLocation:V}:F.has(V.pathname)&&(T={currentLocation:V,nextLocation:A.location})}else if(L){let C=F.get(A.location.pathname);C?C.add(V.pathname):(C=new Set([V.pathname]),F.set(A.location.pathname,C)),T={currentLocation:A.location,nextLocation:V}}We(Dn({},Z,{actionData:et,loaderData:Ie,historyAction:k,location:V,initialized:!0,navigation:x6,revalidation:"idle",restoreScrollPosition:pu(V,Z.matches||A.matches),preventScrollReset:S,blockers:wt}),{viewTransitionOpts:T,flushSync:ht===!0}),k=Un.Pop,N=!1,L=!1,z=!1,J=!1,H=[],G=[]}async function bt(V,Z){if(typeof V=="number"){t.history.go(V);return}let ae=CE(A.location,A.matches,l,c.v7_prependBasename,V,c.v7_relativeSplatPath,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:Ae,submission:Le,error:ht}=HT(c.v7_normalizeFormMethod,!1,ae,Z),ot=A.location,et=e1(A.location,Ae,Z&&Z.state);et=Dn({},et,t.history.encodeLocation(et));let Ie=Z&&Z.replace!=null?Z.replace:void 0,wt=Un.Push;Ie===!0?wt=Un.Replace:Ie===!1||Le!=null&&ho(Le.formMethod)&&Le.formAction===A.location.pathname+A.location.search&&(wt=Un.Replace);let S=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,T=(Z&&Z.unstable_flushSync)===!0,C=da({currentLocation:ot,nextLocation:et,historyAction:wt});if(C){Jr(C,{state:"blocked",location:et,proceed(){Jr(C,{state:"proceeding",proceed:void 0,reset:void 0,location:et}),bt(V,Z)},reset(){let b=new Map(A.blockers);b.set(C,Tg),We({blockers:b})}});return}return await It(wt,et,{submission:Le,pendingError:ht,preventScrollReset:S,replace:Z&&Z.replace,enableViewTransition:Z&&Z.unstable_viewTransition,flushSync:T})}function ut(){if(Tr(),We({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){It(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}It(k||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function It(V,Z,ae){D&&D.abort(),D=null,k=V,z=(ae&&ae.startUninterruptedRevalidation)===!0,du(A.location,A.matches),N=(ae&&ae.preventScrollReset)===!0,L=(ae&&ae.enableViewTransition)===!0;let Ae=s||o,Le=ae&&ae.overrideNavigation,ht=rd(Ae,Z,l),ot=(ae&&ae.flushSync)===!0;if(!ht){let b=ka(404,{pathname:Z.pathname}),{matches:_,route:j}=YT(Ae);Ja(),se(Z,{matches:_,loaderData:{},errors:{[j.id]:b}},{flushSync:ot});return}if(A.initialized&&!J&&gQ(A.location,Z)&&!(ae&&ae.submission&&ho(ae.submission.formMethod))){se(Z,{matches:ht},{flushSync:ot});return}D=new AbortController;let et=kg(t.history,Z,D.signal,ae&&ae.submission),Ie,wt;if(ae&&ae.pendingError)wt={[xy(ht).route.id]:ae.pendingError};else if(ae&&ae.submission&&ho(ae.submission.formMethod)){let b=await Yt(et,Z,ae.submission,ht,{replace:ae.replace,flushSync:ot});if(b.shortCircuited)return;Ie=b.pendingActionData,wt=b.pendingActionError,Le=A6(Z,ae.submission),ot=!1,et=new Request(et.url,{signal:et.signal})}let{shortCircuited:S,loaderData:T,errors:C}=await Cn(et,Z,ht,Le,ae&&ae.submission,ae&&ae.fetcherSubmission,ae&&ae.replace,ae&&ae.initialHydration===!0,ot,Ie,wt);S||(D=null,se(Z,Dn({matches:ht},Ie?{actionData:Ie}:{},{loaderData:T,errors:C})))}async function Yt(V,Z,ae,Ae,Le){Le===void 0&&(Le={}),Tr();let ht=bQ(Z,ae);We({navigation:ht},{flushSync:Le.flushSync===!0});let ot,et=NE(Ae,Z);if(!et.route.action&&!et.route.lazy)ot={type:In.error,error:ka(405,{method:V.method,pathname:Z.pathname,routeId:et.route.id})};else if(ot=await Cg("action",V,et,Ae,a,i,l,c.v7_relativeSplatPath),V.signal.aborted)return{shortCircuited:!0};if(Ru(ot)){let Ie;return Le&&Le.replace!=null?Ie=Le.replace:Ie=ot.location===A.location.pathname+A.location.search,await Vn(A,ot,{submission:ae,replace:Ie}),{shortCircuited:!0}}if(id(ot)){let Ie=xy(Ae,et.route.id);return(Le&&Le.replace)!==!0&&(k=Un.Push),{pendingActionData:{},pendingActionError:{[Ie.route.id]:ot.error}}}if(Iu(ot))throw ka(400,{type:"defer-action"});return{pendingActionData:{[et.route.id]:ot.data}}}async function Cn(V,Z,ae,Ae,Le,ht,ot,et,Ie,wt,S){let T=Ae||A6(Z,Le),C=Le||ht||qT(T),b=s||o,[_,j]=GT(t.history,A,ae,C,Z,c.v7_partialHydration&&et===!0,J,H,G,at,be,we,b,l,wt,S);if(Ja(Se=>!(ae&&ae.some(Pe=>Pe.route.id===Se))||_&&_.some(Pe=>Pe.route.id===Se)),ee=++K,_.length===0&&j.length===0){let Se=Wa();return se(Z,Dn({matches:ae,loaderData:{},errors:S||null},wt?{actionData:wt}:{},Se?{fetchers:new Map(A.fetchers)}:{}),{flushSync:Ie}),{shortCircuited:!0}}if(!z&&(!c.v7_partialHydration||!et)){j.forEach(Pe=>{let He=A.fetchers.get(Pe.key),it=Ng(void 0,He?He.data:void 0);A.fetchers.set(Pe.key,it)});let Se=wt||A.actionData;We(Dn({navigation:T},Se?Object.keys(Se).length===0?{actionData:null}:{actionData:Se}:{},j.length>0?{fetchers:new Map(A.fetchers)}:{}),{flushSync:Ie})}j.forEach(Se=>{q.has(Se.key)&&Ui(Se.key),Se.controller&&q.set(Se.key,Se.controller)});let W=()=>j.forEach(Se=>Ui(Se.key));D&&D.signal.addEventListener("abort",W);let{results:oe,loaderResults:ye,fetcherResults:_e}=await ha(A.matches,ae,_,j,V);if(V.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",W),j.forEach(Se=>q.delete(Se.key));let Ee=XT(oe);if(Ee){if(Ee.idx>=_.length){let Se=j[Ee.idx-_.length].key;we.add(Se)}return await Vn(A,Ee.result,{replace:ot}),{shortCircuited:!0}}let{loaderData:Pt,errors:Ce}=WT(A,ae,_,ye,S,j,_e,Be);Be.forEach((Se,Pe)=>{Se.subscribe(He=>{(He||Se.done)&&Be.delete(Pe)})}),c.v7_partialHydration&&et&&A.errors&&Object.entries(A.errors).filter(Se=>{let[Pe]=Se;return!_.some(He=>He.route.id===Pe)}).forEach(Se=>{let[Pe,He]=Se;Ce=Object.assign(Ce||{},{[Pe]:He})});let rt=Wa(),Ze=Bl(ee),ct=rt||Ze||j.length>0;return Dn({loaderData:Pt,errors:Ce},ct?{fetchers:new Map(A.fetchers)}:{})}function Yn(V,Z,ae,Ae){if(r)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.");q.has(V)&&Ui(V);let Le=(Ae&&Ae.unstable_flushSync)===!0,ht=s||o,ot=CE(A.location,A.matches,l,c.v7_prependBasename,ae,c.v7_relativeSplatPath,Z,Ae==null?void 0:Ae.relative),et=rd(ht,ot,l);if(!et){Ka(V,Z,ka(404,{pathname:ot}),{flushSync:Le});return}let{path:Ie,submission:wt,error:S}=HT(c.v7_normalizeFormMethod,!0,ot,Ae);if(S){Ka(V,Z,S,{flushSync:Le});return}let T=NE(et,Ie);if(N=(Ae&&Ae.preventScrollReset)===!0,wt&&ho(wt.formMethod)){pr(V,Z,Ie,T,et,Le,wt);return}be.set(V,{routeId:Z,path:Ie}),gr(V,Z,Ie,T,et,Le,wt)}async function pr(V,Z,ae,Ae,Le,ht,ot){if(Tr(),be.delete(V),!Ae.route.action&&!Ae.route.lazy){let Pe=ka(405,{method:ot.formMethod,pathname:ae,routeId:Z});Ka(V,Z,Pe,{flushSync:ht});return}let et=A.fetchers.get(V);ir(V,wQ(ot,et),{flushSync:ht});let Ie=new AbortController,wt=kg(t.history,ae,Ie.signal,ot);q.set(V,Ie);let S=K,T=await Cg("action",wt,Ae,Le,a,i,l,c.v7_relativeSplatPath);if(wt.signal.aborted){q.get(V)===Ie&&q.delete(V);return}if(c.v7_fetcherPersist&&at.has(V)){if(Ru(T)||id(T)){ir(V,Gl(void 0));return}}else{if(Ru(T))if(q.delete(V),ee>S){ir(V,Gl(void 0));return}else return we.add(V),ir(V,Ng(ot)),Vn(A,T,{fetcherSubmission:ot});if(id(T)){Ka(V,Z,T.error);return}}if(Iu(T))throw ka(400,{type:"defer-action"});let C=A.navigation.location||A.location,b=kg(t.history,C,Ie.signal),_=s||o,j=A.navigation.state!=="idle"?rd(_,A.navigation.location,l):A.matches;Ct(j,"Didn't find any matches after fetcher action");let W=++K;he.set(V,W);let oe=Ng(ot,T.data);A.fetchers.set(V,oe);let[ye,_e]=GT(t.history,A,j,ot,C,!1,J,H,G,at,be,we,_,l,{[Ae.route.id]:T.data},void 0);_e.filter(Pe=>Pe.key!==V).forEach(Pe=>{let He=Pe.key,it=A.fetchers.get(He),Re=Ng(void 0,it?it.data:void 0);A.fetchers.set(He,Re),q.has(He)&&Ui(He),Pe.controller&&q.set(He,Pe.controller)}),We({fetchers:new Map(A.fetchers)});let Ee=()=>_e.forEach(Pe=>Ui(Pe.key));Ie.signal.addEventListener("abort",Ee);let{results:Pt,loaderResults:Ce,fetcherResults:rt}=await ha(A.matches,j,ye,_e,b);if(Ie.signal.aborted)return;Ie.signal.removeEventListener("abort",Ee),he.delete(V),q.delete(V),_e.forEach(Pe=>q.delete(Pe.key));let Ze=XT(Pt);if(Ze){if(Ze.idx>=ye.length){let Pe=_e[Ze.idx-ye.length].key;we.add(Pe)}return Vn(A,Ze.result)}let{loaderData:ct,errors:Se}=WT(A,A.matches,ye,Ce,void 0,_e,rt,Be);if(A.fetchers.has(V)){let Pe=Gl(T.data);A.fetchers.set(V,Pe)}Bl(W),A.navigation.state==="loading"&&W>ee?(Ct(k,"Expected pending action"),D&&D.abort(),se(A.navigation.location,{matches:j,loaderData:ct,errors:Se,fetchers:new Map(A.fetchers)})):(We({errors:Se,loaderData:JT(A.loaderData,ct,j,Se),fetchers:new Map(A.fetchers)}),J=!1)}async function gr(V,Z,ae,Ae,Le,ht,ot){let et=A.fetchers.get(V);ir(V,Ng(ot,et?et.data:void 0),{flushSync:ht});let Ie=new AbortController,wt=kg(t.history,ae,Ie.signal);q.set(V,Ie);let S=K,T=await Cg("loader",wt,Ae,Le,a,i,l,c.v7_relativeSplatPath);if(Iu(T)&&(T=await N7(T,wt.signal,!0)||T),q.get(V)===Ie&&q.delete(V),!wt.signal.aborted){if(at.has(V)){ir(V,Gl(void 0));return}if(Ru(T))if(ee>S){ir(V,Gl(void 0));return}else{we.add(V),await Vn(A,T);return}if(id(T)){Ka(V,Z,T.error);return}Ct(!Iu(T),"Unhandled fetcher deferred data"),ir(V,Gl(T.data))}}async function Vn(V,Z,ae){let{submission:Ae,fetcherSubmission:Le,replace:ht}=ae===void 0?{}:ae;Z.revalidate&&(J=!0);let ot=e1(V.location,Z.location,{_isRedirect:!0});if(Ct(ot,"Expected a location on the redirect navigation"),n){let C=!1;if(Z.reloadDocument)C=!0;else if(O7.test(Z.location)){const b=t.history.createURL(Z.location);C=b.origin!==e.location.origin||Ym(b.pathname,l)==null}if(C){ht?e.location.replace(Z.location):e.location.assign(Z.location);return}}D=null;let et=ht===!0?Un.Replace:Un.Push,{formMethod:Ie,formAction:wt,formEncType:S}=V.navigation;!Ae&&!Le&&Ie&&wt&&S&&(Ae=qT(V.navigation));let T=Ae||Le;if(sQ.has(Z.status)&&T&&ho(T.formMethod))await It(et,ot,{submission:Dn({},T,{formAction:Z.location}),preventScrollReset:N});else{let C=A6(ot,Ae);await It(et,ot,{overrideNavigation:C,fetcherSubmission:Le,preventScrollReset:N})}}async function ha(V,Z,ae,Ae,Le){let ht=await Promise.all([...ae.map(Ie=>Cg("loader",Le,Ie,Z,a,i,l,c.v7_relativeSplatPath)),...Ae.map(Ie=>Ie.matches&&Ie.match&&Ie.controller?Cg("loader",kg(t.history,Ie.path,Ie.controller.signal),Ie.match,Ie.matches,a,i,l,c.v7_relativeSplatPath):{type:In.error,error:ka(404,{pathname:Ie.path})})]),ot=ht.slice(0,ae.length),et=ht.slice(ae.length);return await Promise.all([ZT(V,ae,ot,ot.map(()=>Le.signal),!1,A.loaderData),ZT(V,Ae.map(Ie=>Ie.match),et,Ae.map(Ie=>Ie.controller?Ie.controller.signal:null),!0)]),{results:ht,loaderResults:ot,fetcherResults:et}}function Tr(){J=!0,H.push(...Ja()),be.forEach((V,Z)=>{q.has(Z)&&(G.push(Z),Ui(Z))})}function ir(V,Z,ae){ae===void 0&&(ae={}),A.fetchers.set(V,Z),We({fetchers:new Map(A.fetchers)},{flushSync:(ae&&ae.flushSync)===!0})}function Ka(V,Z,ae,Ae){Ae===void 0&&(Ae={});let Le=xy(A.matches,Z);Wr(V),We({errors:{[Le.route.id]:ae},fetchers:new Map(A.fetchers)},{flushSync:(Ae&&Ae.flushSync)===!0})}function ys(V){return c.v7_fetcherPersist&&(Ye.set(V,(Ye.get(V)||0)+1),at.has(V)&&at.delete(V)),A.fetchers.get(V)||lQ}function Wr(V){let Z=A.fetchers.get(V);q.has(V)&&!(Z&&Z.state==="loading"&&he.has(V))&&Ui(V),be.delete(V),he.delete(V),we.delete(V),at.delete(V),A.fetchers.delete(V)}function fu(V){if(c.v7_fetcherPersist){let Z=(Ye.get(V)||0)-1;Z<=0?(Ye.delete(V),at.add(V)):Ye.set(V,Z)}else Wr(V);We({fetchers:new Map(A.fetchers)})}function Ui(V){let Z=q.get(V);Ct(Z,"Expected fetch controller: "+V),Z.abort(),q.delete(V)}function hu(V){for(let Z of V){let ae=ys(Z),Ae=Gl(ae.data);A.fetchers.set(Z,Ae)}}function Wa(){let V=[],Z=!1;for(let ae of we){let Ae=A.fetchers.get(ae);Ct(Ae,"Expected fetcher: "+ae),Ae.state==="loading"&&(we.delete(ae),V.push(ae),Z=!0)}return hu(V),Z}function Bl(V){let Z=[];for(let[ae,Ae]of he)if(Ae0}function Dl(V,Z){let ae=A.blockers.get(V)||Tg;return gt.get(V)!==Z&>.set(V,Z),ae}function Fi(V){A.blockers.delete(V),gt.delete(V)}function Jr(V,Z){let ae=A.blockers.get(V)||Tg;Ct(ae.state==="unblocked"&&Z.state==="blocked"||ae.state==="blocked"&&Z.state==="blocked"||ae.state==="blocked"&&Z.state==="proceeding"||ae.state==="blocked"&&Z.state==="unblocked"||ae.state==="proceeding"&&Z.state==="unblocked","Invalid blocker state transition: "+ae.state+" -> "+Z.state);let Ae=new Map(A.blockers);Ae.set(V,Z),We({blockers:Ae})}function da(V){let{currentLocation:Z,nextLocation:ae,historyAction:Ae}=V;if(gt.size===0)return;gt.size>1&&qf(!1,"A router only supports one blocker at a time");let Le=Array.from(gt.entries()),[ht,ot]=Le[Le.length-1],et=A.blockers.get(ht);if(!(et&&et.state==="proceeding")&&ot({currentLocation:Z,nextLocation:ae,historyAction:Ae}))return ht}function Ja(V){let Z=[];return Be.forEach((ae,Ae)=>{(!V||V(Ae))&&(ae.cancel(),Z.push(Ae),Be.delete(Ae))}),Z}function No(V,Z,ae){if(h=V,y=Z,d=ae||null,!p&&A.navigation===x6){p=!0;let Ae=pu(A.location,A.matches);Ae!=null&&We({restoreScrollPosition:Ae})}return()=>{h=null,y=null,d=null}}function Ya(V,Z){return d&&d(V,Z.map(Ae=>$V(Ae,A.loaderData)))||V.key}function du(V,Z){if(h&&y){let ae=Ya(V,Z);h[ae]=y()}}function pu(V,Z){if(h){let ae=Ya(V,Z),Ae=h[ae];if(typeof Ae=="number")return Ae}return null}function Eh(V){a={},s=TE(V,i,void 0,a)}return P={get basename(){return l},get future(){return c},get state(){return A},get routes(){return o},get window(){return e},initialize:pn,subscribe:Ve,enableScrollRestoration:No,navigate:bt,fetch:Yn,revalidate:ut,createHref:V=>t.history.createHref(V),encodeLocation:V=>t.history.encodeLocation(V),getFetcher:ys,deleteFetcher:fu,dispose:xe,getBlocker:Dl,deleteBlocker:Fi,_internalFetchControllers:q,_internalActiveDeferreds:Be,_internalSetRoutes:Eh},P}function fQ(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function CE(t,e,n,r,i,a,o,s){let l,c;if(o){l=[];for(let f of e)if(l.push(f),f.route.id===o){c=f;break}}else l=e,c=e[e.length-1];let u=cP(i||".",lP(l,a),Ym(t.pathname,n)||t.pathname,s==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!fP(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Qc([n,u.pathname])),Jm(u)}function HT(t,e,n,r){if(!r||!fQ(r))return{path:n};if(r.formMethod&&!vQ(r.formMethod))return{path:n,error:ka(405,{method:r.formMethod})};let i=()=>({path:n,error:ka(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=t?a.toUpperCase():a.toLowerCase(),s=k7(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ho(o))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((d,y)=>{let[p,m]=y;return""+d+p+"="+m+` +`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!ho(o))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}Ct(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=kE(r.formData),c=r.formData;else if(r.body instanceof FormData)l=kE(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=KT(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=KT(l)}catch{return i()}let u={formMethod:o,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(ho(u.formMethod))return{path:n,submission:u};let f=ds(n);return e&&f.search&&fP(f.search)&&l.append("index",""),f.search="?"+l,{path:Jm(f),submission:u}}function hQ(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function GT(t,e,n,r,i,a,o,s,l,c,u,f,h,d,y,p){let m=p?Object.values(p)[0]:y?Object.values(y)[0]:void 0,v=t.createURL(e.location),w=t.createURL(i),x=p?Object.keys(p)[0]:void 0,P=hQ(n,x).filter((k,N)=>{let{route:D}=k;if(D.lazy)return!0;if(D.loader==null)return!1;if(a)return D.loader.hydrate?!0:e.loaderData[D.id]===void 0&&(!e.errors||e.errors[D.id]===void 0);if(dQ(e.loaderData,e.matches[N],k)||s.some($=>$===k.route.id))return!0;let L=e.matches[N],F=k;return VT(k,Dn({currentUrl:v,currentParams:L.params,nextUrl:w,nextParams:F.params},r,{actionResult:m,defaultShouldRevalidate:o||v.pathname+v.search===w.pathname+w.search||v.search!==w.search||C7(L,F)}))}),A=[];return u.forEach((k,N)=>{if(a||!n.some(z=>z.route.id===k.routeId)||c.has(N))return;let D=rd(h,k.path,d);if(!D){A.push({key:N,routeId:k.routeId,path:k.path,matches:null,match:null,controller:null});return}let L=e.fetchers.get(N),F=NE(D,k.path),$=!1;f.has(N)?$=!1:l.includes(N)?$=!0:L&&L.state!=="idle"&&L.data===void 0?$=o:$=VT(F,Dn({currentUrl:v,currentParams:e.matches[e.matches.length-1].params,nextUrl:w,nextParams:n[n.length-1].params},r,{actionResult:m,defaultShouldRevalidate:o})),$&&A.push({key:N,routeId:k.routeId,path:k.path,matches:D,match:F,controller:new AbortController})}),[P,A]}function dQ(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function C7(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function VT(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function QT(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Ct(i,"No route found in manifest");let a={};for(let o in r){let l=i[o]!==void 0&&o!=="hasErrorBoundary";qf(!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&&!DV.has(o)&&(a[o]=r[o])}Object.assign(i,a),Object.assign(i,Dn({},e(i),{lazy:void 0}))}async function Cg(t,e,n,r,i,a,o,s,l){l===void 0&&(l={});let c,u,f,h=p=>{let m,v=new Promise((w,x)=>m=x);return f=()=>m(),e.signal.addEventListener("abort",f),Promise.race([p({request:e,params:n.params,context:l.requestContext}),v])};try{let p=n.route[t];if(n.route.lazy)if(p){let m,v=await Promise.all([h(p).catch(w=>{m=w}),QT(n.route,a,i)]);if(m)throw m;u=v[0]}else if(await QT(n.route,a,i),p=n.route[t],p)u=await h(p);else if(t==="action"){let m=new URL(e.url),v=m.pathname+m.search;throw ka(405,{method:e.method,pathname:v,routeId:n.route.id})}else return{type:In.data,data:void 0};else if(p)u=await h(p);else{let m=new URL(e.url),v=m.pathname+m.search;throw ka(404,{pathname:v})}Ct(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(p){c=In.error,u=p}finally{f&&e.signal.removeEventListener("abort",f)}if(mQ(u)){let p=u.status;if(oQ.has(p)){let v=u.headers.get("Location");if(Ct(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!O7.test(v))v=CE(new URL(e.url),r.slice(0,r.indexOf(n)+1),o,!0,v,s);else if(!l.isStaticRequest){let w=new URL(e.url),x=v.startsWith("//")?new URL(w.protocol+v):new URL(v),E=Ym(x.pathname,o)!=null;x.origin===w.origin&&E&&(v=x.pathname+x.search+x.hash)}if(l.isStaticRequest)throw u.headers.set("Location",v),u;return{type:In.redirect,status:p,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===In.error?In.error:In.data,response:u};let m;try{let v=u.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?u.body==null?m=null:m=await u.json():m=await u.text()}catch(v){return{type:In.error,error:v}}return c===In.error?{type:c,error:new uP(p,u.statusText,m),headers:u.headers}:{type:In.data,data:m,statusCode:u.status,headers:u.headers}}if(c===In.error)return{type:c,error:u};if(yQ(u)){var d,y;return{type:In.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((y=u.init)==null?void 0:y.headers)&&new Headers(u.init.headers)}}return{type:In.data,data:u}}function kg(t,e,n,r){let i=t.createURL(k7(e)).toString(),a={signal:n};if(r&&ho(r.formMethod)){let{formMethod:o,formEncType:s}=r;a.method=o.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=kE(r.formData):a.body=r.formData}return new Request(i,a)}function kE(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function KT(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function pQ(t,e,n,r,i){let a={},o=null,s,l=!1,c={};return n.forEach((u,f)=>{let h=e[f].route.id;if(Ct(!Ru(u),"Cannot handle redirect results in processLoaderData"),id(u)){let d=xy(t,h),y=u.error;r&&(y=Object.values(r)[0],r=void 0),o=o||{},o[d.route.id]==null&&(o[d.route.id]=y),a[h]=void 0,l||(l=!0,s=S7(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else Iu(u)?(i.set(h,u.deferredData),a[h]=u.deferredData.data):a[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(s=u.statusCode),u.headers&&(c[h]=u.headers)}),r&&(o=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function WT(t,e,n,r,i,a,o,s){let{loaderData:l,errors:c}=pQ(e,n,r,i,s);for(let u=0;ur.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function YT(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function ka(t,e){let{pathname:n,routeId:r,method:i,type:a}=e===void 0?{}:e,o="Unknown Server Error",s="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?s="defer() is not supported in actions":a==="invalid-body"&&(s="Unable to encode submission body")):t===403?(o="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",s='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new uP(t||500,o,new Error(s),!0)}function XT(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Ru(n))return{result:n,idx:e}}}function k7(t){let e=typeof t=="string"?ds(t):t;return Jm(Dn({},e,{hash:""}))}function gQ(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Iu(t){return t.type===In.deferred}function id(t){return t.type===In.error}function Ru(t){return(t&&t.type)===In.redirect}function yQ(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 mQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function vQ(t){return aQ.has(t.toLowerCase())}function ho(t){return rQ.has(t.toLowerCase())}async function ZT(t,e,n,r,i,a){for(let o=0;of.route.id===l.route.id),u=c!=null&&!C7(c,l)&&(a&&a[l.route.id])!==void 0;if(Iu(s)&&(i||u)){let f=r[o];Ct(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await N7(s,f,i).then(h=>{h&&(n[o]=h||n[o])})}}}async function N7(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:In.data,data:t.deferredData.unwrappedData}}catch(i){return{type:In.error,error:i}}return{type:In.data,data:t.deferredData.data}}}function fP(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function NE(t,e){let n=typeof e=="string"?ds(e).search:e.search;if(t[t.length-1].route.index&&fP(n||""))return t[t.length-1];let r=E7(t);return r[r.length-1]}function qT(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:a,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function A6(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 bQ(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 Ng(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 wQ(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 Gl(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 xQ(t,e){try{let n=t.sessionStorage.getItem(T7);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&e.set(i,new Set(a||[]))}}catch{}}function AQ(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(T7,JSON.stringify(n))}catch(r){qf(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.22.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function t1(){return t1=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),U.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let f=cP(c,JSON.parse(o),a,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Qc([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,o,a,t])}const PQ=U.createContext(null);function OQ(t){let e=U.useContext(ru).outlet;return e&&U.createElement(PQ.Provider,{value:t},e)}function TQ(t,e,n,r){Zm()||Ct(!1);let{navigator:i}=U.useContext(Xm),{matches:a}=U.useContext(ru),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=hP(),u;if(e){var f;let m=typeof e=="string"?ds(e):e;l==="/"||(f=m.pathname)!=null&&f.startsWith(l)||Ct(!1),u=m}else u=c;let h=u.pathname||"/",d=h;if(l!=="/"){let m=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(m.length).join("/")}let y=rd(t,{pathname:d}),p=IQ(y&&y.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Qc([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Qc([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),a,n,r);return e&&p?U.createElement(k2.Provider,{value:{location:t1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Un.Pop}},p):p}function CQ(){let t=DQ(),e=S7(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},e),n?U.createElement("pre",{style:i},n):null,null)}const kQ=U.createElement(CQ,null);class NQ extends U.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?U.createElement(ru.Provider,{value:this.props.routeContext},U.createElement(I7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _Q(t){let{routeContext:e,match:n,children:r}=t,i=U.useContext(C2);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),U.createElement(ru.Provider,{value:e},r)}function IQ(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var a;if((a=n)!=null&&a.errors)t=n.matches;else return null}let o=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id]));u>=0||Ct(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,f,h)=>{let d,y=!1,p=null,m=null;n&&(d=s&&f.route.id?s[f.route.id]:void 0,p=f.route.errorElement||kQ,l&&(c<0&&h===0?($Q("route-fallback",!1),y=!0,m=null):c===h&&(y=!0,m=f.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,h+1)),w=()=>{let x;return d?x=p:y?x=m:f.route.Component?x=U.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=u,U.createElement(_Q,{match:f,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?U.createElement(NQ,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:w(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):w()},null)}var M7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(M7||{}),Bw=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}(Bw||{});function RQ(t){let e=U.useContext(C2);return e||Ct(!1),e}function MQ(t){let e=U.useContext(_7);return e||Ct(!1),e}function BQ(t){let e=U.useContext(ru);return e||Ct(!1),e}function B7(t){let e=BQ(),n=e.matches[e.matches.length-1];return n.route.id||Ct(!1),n.route.id}function DQ(){var t;let e=U.useContext(I7),n=MQ(Bw.UseRouteError),r=B7(Bw.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function LQ(){let{router:t}=RQ(M7.UseNavigateStable),e=B7(Bw.UseNavigateStable),n=U.useRef(!1);return R7(()=>{n.current=!0}),U.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,t1({fromRouteId:e},a)))},[t,e])}const eC={};function $Q(t,e,n){!e&&!eC[t]&&(eC[t]=!0)}function D7(t){let{to:e,replace:n,state:r,relative:i}=t;Zm()||Ct(!1);let{future:a,static:o}=U.useContext(Xm),{matches:s}=U.useContext(ru),{pathname:l}=hP(),c=EQ(),u=cP(e,lP(s,a.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return U.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function UQ(t){return OQ(t.context)}function FQ(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Un.Pop,navigator:a,static:o=!1,future:s}=t;Zm()&&Ct(!1);let l=e.replace(/^\/*/,"/"),c=U.useMemo(()=>({basename:l,navigator:a,static:o,future:t1({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof r=="string"&&(r=ds(r));let{pathname:u="/",search:f="",hash:h="",state:d=null,key:y="default"}=r,p=U.useMemo(()=>{let m=Ym(u,l);return m==null?null:{location:{pathname:m,search:f,hash:h,state:d,key:y},navigationType:i}},[l,u,f,h,d,y,i]);return p==null?null:U.createElement(Xm.Provider,{value:c},U.createElement(k2.Provider,{children:n,value:p}))}new Promise(()=>{});function jQ(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:U.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:U.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:U.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + * React Router DOM v6.22.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Dw(){return Dw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function ZQ(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=U.useState(n.state),[o,s]=U.useState(),[l,c]=U.useState({isTransitioning:!1}),[u,f]=U.useState(),[h,d]=U.useState(),[y,p]=U.useState(),m=U.useRef(new Map),{v7_startTransition:v}=r||{},w=U.useCallback(k=>{v?YQ(k):k()},[v]),x=U.useCallback((k,N)=>{let{deletedFetchers:D,unstable_flushSync:L,unstable_viewTransitionOpts:F}=N;D.forEach(z=>m.current.delete(z)),k.fetchers.forEach((z,J)=>{z.data!==void 0&&m.current.set(J,z.data)});let $=n.window==null||typeof n.window.document.startViewTransition!="function";if(!F||$){L?_g(()=>a(k)):w(()=>a(k));return}if(L){_g(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:F.currentLocation,nextLocation:F.nextLocation})});let z=n.window.document.startViewTransition(()=>{_g(()=>a(k))});z.finished.finally(()=>{_g(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})})}),_g(()=>d(z));return}h?(u&&u.resolve(),h.skipTransition(),p({state:k,currentLocation:F.currentLocation,nextLocation:F.nextLocation})):(s(k),c({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}))},[n.window,h,u,m,w]);U.useLayoutEffect(()=>n.subscribe(x),[n,x]),U.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new XQ)},[l]),U.useEffect(()=>{if(u&&o&&n.window){let k=o,N=u.promise,D=n.window.document.startViewTransition(async()=>{w(()=>a(k)),await N});D.finished.finally(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})}),d(D)}},[w,o,u,n.window]),U.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,h,i.location,o]),U.useEffect(()=>{!l.isTransitioning&&y&&(s(y.state),c({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),p(void 0))},[l.isTransitioning,y]),U.useEffect(()=>{},[]);let E=U.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:k=>n.navigate(k),push:(k,N,D)=>n.navigate(k,{state:N,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(k,N,D)=>n.navigate(k,{replace:!0,state:N,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[n]),P=n.basename||"/",A=U.useMemo(()=>({router:n,navigator:E,static:!1,basename:P}),[n,E,P]);return U.createElement(U.Fragment,null,U.createElement(C2.Provider,{value:A},U.createElement(_7.Provider,{value:i},U.createElement(KQ.Provider,{value:m.current},U.createElement(QQ.Provider,{value:l},U.createElement(FQ,{basename:P,location:i.location,navigationType:i.historyAction,navigator:E,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?U.createElement(qQ,{routes:n.routes,future:n.future,state:i}):e))))),null)}function qQ(t){let{routes:e,future:n,state:r}=t;return TQ(e,void 0,r,n)}var rC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(rC||(rC={}));var iC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(iC||(iC={}));const eK="_layout_ppbjw_1",tK="_main_ppbjw_8",nK="_header_ppbjw_14",rK="_subHeader_ppbjw_24",Dv={layout:eK,main:tK,header:nK,subHeader:rK},iK=()=>ie.jsxs("svg",{width:"153",height:"50",viewBox:"0 0 153 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ie.jsx("path",{d:"M65.882 36L59.031 20.5H63.712L67.804 30.42L71.896 20.5H76.639L69.757 36H65.882ZM90.2073 34.016C88.616 35.566 86.694 36.341 84.4413 36.341C82.1886 36.341 80.2666 35.566 78.6753 34.016C77.084 32.4453 76.2883 30.5233 76.2883 28.25C76.2883 25.9973 77.084 24.0857 78.6753 22.515C80.2666 20.9443 82.1886 20.159 84.4413 20.159C86.694 20.159 88.616 20.9443 90.2073 22.515C91.7986 24.0857 92.5943 25.9973 92.5943 28.25C92.5943 30.5233 91.7986 32.4453 90.2073 34.016ZM84.4413 32.373C85.5366 32.373 86.446 31.9907 87.1693 31.226C87.9133 30.4407 88.2853 29.4487 88.2853 28.25C88.2853 27.0513 87.9133 26.0697 87.1693 25.305C86.446 24.5197 85.5366 24.127 84.4413 24.127C83.3253 24.127 82.3953 24.5197 81.6513 25.305C80.928 26.0697 80.5663 27.0513 80.5663 28.25C80.5663 29.4487 80.928 30.4407 81.6513 31.226C82.3953 31.9907 83.3253 32.373 84.4413 32.373ZM96.3453 36V18.268H90.4863V13.99H106.792V18.268H100.871V36H96.3453ZM108.973 36V13.99H122.675V18.268H113.468V22.794H120.815V27.072H113.468V31.722H122.675V36H108.973ZM125.663 36V13.99H139.365V18.268H130.158V22.794H137.505V27.072H130.158V31.722H139.365V36H125.663Z",fill:"white"}),ie.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.438 11.9201C37.0276 7.57101 32.0669 4.81953 26.5305 4.81953C15.8563 4.81953 8.06102 14.7604 8.06102 25.5444C8.06102 33.0444 13.0217 38.6805 18.5581 38.6805C19.0896 38.6805 19.5768 38.6361 20.1083 38.5473C16.3878 35.7959 13.9961 30.8254 13.9961 25.5C13.9961 16.9793 19.7539 10.3669 26.5305 10.3669C33.9272 10.3669 39.065 17.7337 39.065 25.5C39.065 31.2692 36.9833 36.9941 33.3957 41.2101C30.251 44.8935 26.1762 47.2456 21.7028 47.9556C21.7028 47.9556 22.0571 48 22.5443 48C34.9459 48 45 37.926 45 25.5C45 20.3965 43.3169 15.6923 40.438 11.9201ZM37.0276 25.5C37.0276 18 32.0669 12.3639 26.5305 12.3639C25.999 12.3639 25.5118 12.4083 24.9803 12.497C28.7008 15.2041 31.0482 20.1302 31.0482 25.5C31.0482 34.0207 25.2904 40.6331 18.5138 40.6331C11.1171 40.6331 5.97933 33.2663 5.97933 25.5C5.97933 19.7308 8.06102 14.0059 11.6486 9.78994C14.7933 6.10651 18.8681 3.75444 23.3415 3.04438C23.3415 3.04438 22.9872 3 22.4557 3C10.0541 3 0 13.074 0 25.5C0 30.6035 1.68307 35.3077 4.56201 39.0799C7.97244 43.429 12.9774 46.1805 18.4695 46.1805C29.2323 46.2249 37.0276 36.284 37.0276 25.5Z",fill:"white"})]}),L7=U.createContext({}),qm=()=>{const t=U.useContext(L7);if(t===void 0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t},Lw=new Map([[23294n,{chainId:"0x5afe",chainName:"Oasis Sapphire",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}],[23295n,{chainId:"0x5aff",chainName:"Oasis Sapphire Testnet",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"TEST",symbol:"TEST",decimals:18},rpcUrls:["https://testnet.sapphire.oasis.dev/","wss://testnet.sapphire.oasis.dev/ws"],blockExplorerUrls:["https://explorer.oasis.io/testnet/sapphire"]}]]),aK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},oK=150000n,_E=Object.freeze([{name:"Desert Owl",description:"A wise owl with scrolls in its claws, symbolizing the knowledge pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Capybara",description:"A friendly capybara with a rose on its head, symbolizing the interoperability pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Fennec Fox",description:"A nimble fox with sunglasses on its eyes, symbolizing the integrity pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"}]),sK="https://metamask.io/",lK="_button_6vyky_1",cK="_buttonSmall_6vyky_22",uK="_buttonMedium_6vyky_30",fK="_buttonSolid_6vyky_38",hK="_buttonPrimary_6vyky_39",dK="_buttonSecondary_6vyky_44",pK="_buttonOutline_6vyky_50",gK="_buttonText_6vyky_64",yK="_buttonDisabled_6vyky_80",mK="_fullWidth_6vyky_86",is={button:lK,buttonSmall:cK,buttonMedium:uK,buttonSolid:fK,buttonPrimary:hK,buttonSecondary:dK,buttonOutline:pK,buttonText:gK,buttonDisabled:yK,fullWidth:mK},vK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class ta{}I(ta,"truncateAddress",e=>{const n=e.match(vK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),I(ta,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),I(ta,"getAccountUrl",(e,n)=>`${e}/address/${n}`),I(ta,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),I(ta,"getNetworkFriendlyName",e=>aK[e]??"Unknown network");const bK={small:is.buttonSmall,medium:is.buttonMedium},wK={primary:is.buttonPrimary,secondary:is.buttonSecondary},xK={solid:is.buttonSolid,outline:is.buttonOutline,text:is.buttonText},Zl=({className:t,children:e,disabled:n,color:r="primary",size:i="medium",variant:a="solid",fullWidth:o,onClick:s,type:l})=>ie.jsx("button",{className:ta.clsx(t,is.button,n?is.buttonDisabled:void 0,o?is.fullWidth:void 0,wK[r],bK[i],xK[a]),onClick:s,disabled:n,type:l,children:e});class IE extends Error{constructor(e){super(e)}}const AK="_connectedAccount_1fimt_1",EK="_connectedAccountDetails_1fimt_13",SK="_connectedAccountAddress_1fimt_24",PK="_network_1fimt_35",Lv={connectedAccount:AK,connectedAccountDetails:EK,connectedAccountAddress:SK,network:PK};var Tl=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)};Tl.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}};Tl.prototype.init_by_array=function(t,e){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>e?this.N:e;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[r]+r,this.mt[n]>>>=0,n++,r++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=e&&(r=0)}for(i=this.N-1;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Tl.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^e[t&1];for(;n>>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};Tl.prototype.random_int31=function(){return this.random_int()>>>1};Tl.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Tl.prototype.random=function(){return this.random_int()*(1/4294967296)};Tl.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Tl.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var OK=Tl;function TK(t,e){var n=document.createElement("div");return n.style.borderRadius="50px",n.style.overflow="hidden",n.style.padding="0px",n.style.margin="0px",n.style.width=""+t+"px",n.style.height=""+t+"px",n.style.display="inline-block",n.style.background=e,{container:n}}var CK=TK,$7={exports:{}};(function(t){var e=function(){function n(l,c,u,f){typeof c=="object"&&(u=c.depth,f=c.prototype,c.filter,c=c.circular);var h=[],d=[],y=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof u>"u"&&(u=1/0);function p(m,v){if(m===null)return null;if(v==0)return m;var w,x;if(typeof m!="object")return m;if(n.__isArray(m))w=[];else if(n.__isRegExp(m))w=new RegExp(m.source,s(m)),m.lastIndex&&(w.lastIndex=m.lastIndex);else if(n.__isDate(m))w=new Date(m.getTime());else{if(y&&Buffer.isBuffer(m))return Buffer.allocUnsafe?w=Buffer.allocUnsafe(m.length):w=new Buffer(m.length),m.copy(w),w;typeof f>"u"?(x=Object.getPrototypeOf(m),w=Object.create(x)):(w=Object.create(f),x=f)}if(c){var E=h.indexOf(m);if(E!=-1)return d[E];h.push(m),d.push(w)}for(var P in m){var A;x&&(A=Object.getOwnPropertyDescriptor(x,P)),!(A&&A.set==null)&&(w[P]=p(m[P],v-1))}return w}return p(l,u)}n.clonePrototype=function(c){if(c===null)return null;var u=function(){};return u.prototype=c,new u};function r(l){return Object.prototype.toString.call(l)}n.__objToStr=r;function i(l){return typeof l=="object"&&r(l)==="[object Date]"}n.__isDate=i;function a(l){return typeof l=="object"&&r(l)==="[object Array]"}n.__isArray=a;function o(l){return typeof l=="object"&&r(l)==="[object RegExp]"}n.__isRegExp=o;function s(l){var c="";return l.global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c}return n.__getRegExpFlags=s,n}();t.exports&&(t.exports=e)})($7);var kK=$7.exports,U7={exports:{}},NK={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]},Lf=NK,F7={};for(var E6 in Lf)Lf.hasOwnProperty(E6)&&(F7[Lf[E6]]=E6);var Qe=U7.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 yi in Qe)if(Qe.hasOwnProperty(yi)){if(!("channels"in Qe[yi]))throw new Error("missing channels property: "+yi);if(!("labels"in Qe[yi]))throw new Error("missing channel labels property: "+yi);if(Qe[yi].labels.length!==Qe[yi].channels)throw new Error("channel and label counts mismatch: "+yi);var _K=Qe[yi].channels,IK=Qe[yi].labels;delete Qe[yi].channels,delete Qe[yi].labels,Object.defineProperty(Qe[yi],"channels",{value:_K}),Object.defineProperty(Qe[yi],"labels",{value:IK})}Qe.rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=a-i,s,l,c;return a===i?s=0:e===a?s=(n-r)/o:n===a?s=2+(r-e)/o:r===a&&(s=4+(e-n)/o),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+a)/2,a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};Qe.rgb.hsv=function(t){var e,n,r,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(h){return(c-h)/6/u+1/2};return u===0?i=a=0:(a=u/c,e=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+e-r:l===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};Qe.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2],i=Qe.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,a*100,r*100]};Qe.rgb.cmyk=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i,a,o,s;return s=Math.min(1-e,1-n,1-r),i=(1-e-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function RK(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}Qe.rgb.keyword=function(t){var e=F7[t];if(e)return e;var n=1/0,r;for(var i in Lf)if(Lf.hasOwnProperty(i)){var a=Lf[i],o=RK(t,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+n*.3576+r*.1805,a=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};Qe.rgb.lab=function(t){var e=Qe.rgb.xyz(t),n=e[0],r=e[1],i=e[2],a,o,s;return n/=95.047,r/=100,i/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(n-r),s=200*(r-i),[a,o,s]};Qe.hsl.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,a,o,s,l;if(n===0)return l=r*255,[l,l,l];r<.5?a=r*(1+n):a=r+n-r*n,i=2*r-a,s=[0,0,0];for(var c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[c]=l*255;return s};Qe.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,a=Math.max(r,.01),o,s;return r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+n)/2,o=r===0?2*i/(a+i):2*n/(r+n),[e,o*100,s*100]};Qe.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};Qe.hsv.hsl=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-n)*r,a=(2-n)*i,o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Qe.hwb.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,a,o,s,l;i>1&&(n/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,a&1&&(s=1-s),l=n+s*(o-n);var c,u,f;switch(a){default:case 6:case 0:c=o,u=l,f=n;break;case 1:c=l,u=o,f=n;break;case 2:c=n,u=o,f=l;break;case 3:c=n,u=l,f=o;break;case 4:c=l,u=n,f=o;break;case 5:c=o,u=n,f=l;break}return[c*255,u*255,f*255]};Qe.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};Qe.xyz.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i,a,o;return i=e*3.2406+n*-1.5372+r*-.4986,a=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*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),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Qe.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return e/=95.047,n/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*n-16,a=500*(e-n),o=200*(n-r),[i,a,o]};Qe.lab.xyz=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;a=(e+16)/116,i=n/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),c=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Qe.lab.lch=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return i=Math.atan2(r,n),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(n*n+r*r),[e,o,a]};Qe.lch.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return o=r/360*2*Math.PI,i=n*Math.cos(o),a=n*Math.sin(o),[e,i,a]};Qe.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:Qe.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};Qe.hsv.ansi16=function(t){return Qe.rgb.ansi16(Qe.hsv.rgb(t),t[2])};Qe.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];if(e===n&&n===r)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(n/255*5)+Math.round(r/255*5);return i};Qe.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 n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,a=(e>>2&1)*n*255;return[r,i,a]};Qe.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var n,r=Math.floor(t/36)/5*255,i=Math.floor((n=t%36)/6)/5*255,a=n%6/5*255;return[r,i,a]};Qe.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};Qe.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 n=e[0];e[0].length===3&&(n=n.split("").map(function(s){return s+s}).join(""));var r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};Qe.rgb.hcg=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),a=Math.min(Math.min(e,n),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(n-r)/o%6:i===n?l=2+(r-e)/o:l=4+(e-n)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};Qe.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return n<.5?r=2*e*n:r=2*e*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};Qe.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};Qe.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,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]=s,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]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};Qe.hcg.hsv=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};Qe.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100,r=n*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};Qe.hcg.hwb=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};Qe.hwb.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[t[0],i*100,a*100]};Qe.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};Qe.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};Qe.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};Qe.gray.hsl=Qe.gray.hsv=function(t){return[0,0,t[0]]};Qe.gray.hwb=function(t){return[0,100,t[0]]};Qe.gray.cmyk=function(t){return[0,0,0,t[0]]};Qe.gray.lab=function(t){return[t[0],0,0]};Qe.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,n=(e<<16)+(e<<8)+e,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};Qe.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var j7=U7.exports,$w=j7;function MK(){for(var t={},e=Object.keys($w),n=e.length,r=0;r1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function zK(t){var e=function(n){if(n==null)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var r=t(n);if(typeof r=="object")for(var i=r.length,a=0;an?(e+.05)/(n+.05):(n+.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 n=this,r=t,i=e===void 0?.5:e,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new as;return t.values=tW(this.values),t}};as.prototype.getValues=function(t){for(var e={},n=0;n{const n=U.useRef(null);return U.useEffect(()=>{var r;if(n!=null&&n.current){const i=mW.jsNumberForAddress(t),a=pW(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),ie.jsx("div",{ref:n,style:{width:e,height:e},className:yW.jazzIcon})},bW=U.memo(vW),wW=({address:t,chainName:e})=>{const{state:{explorerBaseUrl:n}}=qm(),r=n?ta.getAccountUrl(n,t):void 0,i=ta.getNetworkFriendlyName(e);return ie.jsxs("a",{href:r,className:Lv.connectedAccount,target:"_blank",rel:"nofollow noreferrer",children:[ie.jsx(bW,{size:30,address:t}),ie.jsxs("p",{className:Lv.connectedAccountDetails,children:[ie.jsx("span",{className:Lv.network,children:i}),ie.jsx("abbr",{title:t,className:Lv.connectedAccountAddress,children:ta.truncateAddress(t)})]})]})},xW=()=>{const[t,e]=U.useState(!1),[n,r]=U.useState(!0),[i,a]=U.useState(!1),[,o]=U.useState(""),{state:{isConnected:s,account:l,chainName:c},connectWallet:u,switchNetwork:f,isProviderAvailable:h}=qm();U.useEffect(()=>{(async()=>{e(!0),r(await h()),e(!1)})()},[]);const d=async()=>{e(!0);try{await f(),a(!1)}catch(p){o((p==null?void 0:p.message)||JSON.stringify(p))}finally{e(!1)}},y=async()=>{e(!0);try{await u()}catch(p){p instanceof IE?a(!0):o((p==null?void 0:p.message)||JSON.stringify(p))}finally{e(!1)}};return ie.jsxs(ie.Fragment,{children:[!s&&!n&&ie.jsx("a",{href:sK,target:"_blank",rel:"noopener noreferrer",children:ie.jsx(Zl,{color:"secondary",disabled:t,children:"Install MetaMask"})}),!s&&n&&i&&ie.jsx(Zl,{color:"secondary",disabled:t,onClick:d,children:"Switch Network"}),!s&&n&&!i&&ie.jsx(Zl,{color:"secondary",disabled:t,onClick:y,children:"Connect wallet"}),s&&l&&ie.jsx(wW,{address:l,chainName:c})]})},AW="_alert_da1x7_1",EW="_icon_da1x7_20",SW="_actions_da1x7_25",PW="_alertError_da1x7_40",OW="_alertSuccess_da1x7_46",TW="_alertLoading_da1x7_61",CW="_rotating_da1x7_1",kW="_alertInsufficientBalance_da1x7_78",Mu={alert:AW,icon:EW,actions:SW,alertError:PW,alertSuccess:OW,alertLoading:TW,rotating:CW,alertInsufficientBalance:kW},NW="_card_1tc1z_1",_W={card:NW},gP=({children:t,className:e})=>ie.jsx("div",{className:ta.clsx(_W.card,e),children:t}),IW=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},U.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"})),RW={small:{width:14,height:14},medium:{width:30,height:30},large:{width:64,height:64},xlarge:{width:100,height:100}},ng=({children:t,size:e="medium"})=>U.cloneElement(t,{...RW[e]}),MW=()=>ie.jsx(ng,{size:"xlarge",children:ie.jsx(IW,{})}),BW=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},U.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})),DW=()=>ie.jsx(ng,{size:"xlarge",children:ie.jsx(BW,{})}),LW=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},U.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})),$W=()=>ie.jsx(ng,{size:"large",children:ie.jsx(LW,{})}),UW=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},U.createElement("path",{d:"M192,116a12,12,0,1,1-12-12A12,12,0,0,1,192,116ZM152,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm96,48v32a24,24,0,0,1-24,24h-2.36l-16.21,45.38A16,16,0,0,1,190.36,224H177.64a16,16,0,0,1-15.07-10.62L160.65,208h-57.3l-1.92,5.38A16,16,0,0,1,86.36,224H73.64a16,16,0,0,1-15.07-10.62L46,178.22a87.69,87.69,0,0,1-21.44-48.38A16,16,0,0,0,16,144a8,8,0,0,1-16,0,32,32,0,0,1,24.28-31A88.12,88.12,0,0,1,112,32H216a8,8,0,0,1,0,16H194.61a87.93,87.93,0,0,1,30.17,37c.43,1,.85,2,1.25,3A24,24,0,0,1,248,112Zm-16,0a8,8,0,0,0-8-8h-3.66a8,8,0,0,1-7.64-5.6A71.9,71.9,0,0,0,144,48H112A72,72,0,0,0,58.91,168.64a8,8,0,0,1,1.64,2.71L73.64,208H86.36l3.82-10.69A8,8,0,0,1,97.71,192h68.58a8,8,0,0,1,7.53,5.31L177.64,208h12.72l18.11-50.69A8,8,0,0,1,216,152h8a8,8,0,0,0,8-8Z"})),FW=()=>ie.jsx(ng,{size:"large",children:ie.jsx(UW,{})}),jW={error:{header:"Something went wrong",icon:ie.jsx(MW,{})},success:{header:"Vote cast",icon:ie.jsx(DW,{})},loading:{header:"Casting your vote",icon:ie.jsx($W,{})},"insufficient-balance":{header:"Insufficient balance",icon:ie.jsx(FW,{})}},zW={error:Mu.alertError,success:Mu.alertSuccess,loading:Mu.alertLoading,"insufficient-balance":Mu.alertInsufficientBalance},Wg=({children:t,type:e,actions:n,headerText:r})=>{const{header:i,icon:a}=jW[e];return ie.jsx(gP,{className:zW[e],children:ie.jsxs("div",{className:Mu.alert,children:[ie.jsx("h2",{children:r??i}),ie.jsx("p",{children:t}),ie.jsx("div",{className:Mu.icon,children:a}),ie.jsx("div",{className:Mu.actions,children:n})]})})},J7=U.createContext({}),yP=()=>{const t=U.useContext(J7);if(t===void 0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},HW=()=>{const{state:{isInitialLoading:t}}=yP();return ie.jsx("div",{className:Dv.layout,children:ie.jsxs("main",{className:Dv.main,children:[ie.jsxs("header",{className:Dv.header,children:[ie.jsx(iK,{}),ie.jsx(xW,{})]}),ie.jsx("section",{className:Dv.subHeader,children:ie.jsx("h1",{children:"Oasis Mascot"})}),ie.jsxs("section",{children:[t&&ie.jsx(Wg,{headerText:"Please wait",type:"loading",actions:ie.jsx("span",{children:"Fetching poll..."})}),!t&&ie.jsx(UQ,{})]})]})})},GW=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},U.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})),VW=()=>ie.jsx(ng,{children:ie.jsx(GW,{})}),QW="_cardHeaderText_1s14o_1",KW="_mascotCards_1s14o_11",WW="_mascotCardActions_1s14o_18",JW="_cardAction_1s14o_24",YW="_voteBtnLabel_1s14o_30",XW="_voteBtnLabelDisabled_1s14o_35",ZW="_cardFooterText_1s14o_40",qW="_insufficientBalanceAlertActions_1s14o_49",$l={cardHeaderText:QW,mascotCards:KW,mascotCardActions:WW,cardAction:JW,voteBtnLabel:YW,voteBtnLabelDisabled:XW,cardFooterText:ZW,insufficientBalanceAlertActions:qW},eJ="_mascotCard_1ytay_1",tJ="_mascotCardSelected_1ytay_9",nJ="_mascotCardVertical_1ytay_13",rJ="_mascotCardHorizontal_1ytay_31",iJ="_mascotCardTitle_1ytay_46",aJ="_mascotCardDescription_1ytay_51",ad={mascotCard:eJ,mascotCardSelected:tJ,mascotCardVertical:nJ,mascotCardHorizontal:rJ,mascotCardTitle:iJ,mascotCardDescription:aJ},oJ={vertical:ad.mascotCardVertical,horizontal:ad.mascotCardHorizontal},Y7=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>ie.jsxs("div",{className:ta.clsx(ad.mascotCard,i?ad.mascotCardSelected:void 0,oJ[a]),children:[t,ie.jsxs("div",{children:[ie.jsx("h3",{className:ad.mascotCardTitle,children:e}),ie.jsx("p",{className:ad.mascotCardDescription,children:n})]}),r]}),sJ=new Intl.DateTimeFormat("en-GB",{timeStyle:"long",dateStyle:"long"});class od{static intlDateFormat(e){return sJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const lJ=()=>{var m;const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=qm(),{state:{poll:i}}=yP(),[a,o]=U.useState(null),[s,l]=U.useState(null),[c,u]=U.useState(!1),[f,h]=U.useState("");U.useEffect(()=>{o(null),l(null)},[e]);const d=v=>{o(v)},y=async()=>{if(a!==null){u(!0);try{if(!await r()){l("insufficient-balance");return}l("loading"),await n(a),l("success")}catch(v){console.error(v),h(v.message??JSON.stringify(v)),l("error")}finally{u(!1)}}},p=()=>{l(null)};return(i==null?void 0:i.active)===!1?ie.jsx(D7,{to:"/results",replace:!0}):ie.jsxs(ie.Fragment,{children:[s==="loading"&&ie.jsx(Wg,{type:"loading",actions:ie.jsx("span",{children:"Submitting vote..."}),children:"Once you confirm this vote you will not be able to cancel it."}),s==="error"&&f&&ie.jsx(Wg,{type:"error",actions:ie.jsx(Zl,{disabled:c,onClick:p,children:"Try again"}),children:f}),s==="success"&&ie.jsx(Wg,{type:"success",actions:ie.jsxs("span",{children:["Your vote has successfully submitted.",ie.jsx("br",{}),"Thank you for your participation."]})}),s==="insufficient-balance"&&ie.jsx(Wg,{type:"insufficient-balance",actions:ie.jsxs("div",{className:$l.insufficientBalanceAlertActions,children:[ie.jsx(Zl,{disabled:c,onClick:y,children:"Try again"}),ie.jsx(Zl,{variant:"text",disabled:c,onClick:p,children:"< Cancel "})]}),children:"Please note there is a 100 ROSE threshold in order to cast your vote."}),s===null&&ie.jsxs(gP,{children:[ie.jsx("p",{className:$l.cardHeaderText,children:"Select your preferred mascot option. Once you confirm this vote you will not be able to cancel it. Read more about the campaign on our website."}),ie.jsx("div",{className:$l.mascotCards,children:_E.map(({name:v,description:w,imagePath:x},E)=>ie.jsx(Y7,{title:v,description:w,image:ie.jsx("img",{alt:v,src:x}),selected:E===a,actions:ie.jsx("div",{className:$l.mascotCardActions,children:ie.jsx(Zl,{variant:"outline",size:"small",color:"secondary",disabled:c,onClick:()=>d(E),children:"Select"})})},v))}),ie.jsx("div",{className:$l.cardAction,children:ie.jsx(Zl,{disabled:c||a===null||!t,onClick:y,children:ie.jsxs("label",{className:ta.clsx(a===null||!t?$l.voteBtnLabelDisabled:$l.voteBtnLabel),children:[(t||a===null)&&ie.jsx(ie.Fragment,{children:"Continue"}),!t&&a!==null&&ie.jsx(ie.Fragment,{children:"Wallet not connected"}),ie.jsx(VW,{})]})})}),ie.jsxs("p",{className:$l.cardFooterText,children:["Please note there is a 100 ROSE threshold in order to cast your vote.",!!(i!=null&&i.params.closeTimestamp)&&ie.jsxs(ie.Fragment,{children:[ie.jsx("br",{}),ie.jsxs("span",{children:["Poll closes on ",od.intlDateFormat(od.unixFormatToDate((m=i==null?void 0:i.params)==null?void 0:m.closeTimestamp))]})]})]})]})]})},cJ="6.11.1";function uJ(t,e,n){const r=e.split("|").map(a=>a.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function st(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&uJ(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function sd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(sd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return sd(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(n=>`${sd(n)}: ${sd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Gr(t,e){return t&&t.code===e}function mP(t){return Gr(t,"CALL_EXCEPTION")}function Qn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${sd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+sd(s))}}a.push(`code=${e}`),a.push(`version=${cJ}`),a.length&&(t+=" ("+a.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 st(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&&st(i,{shortMessage:r}),i}function pe(t,e,n,r){if(!t)throw Qn(e,n,r)}function Q(t,e,n,r){pe(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function X7(t,e,n){n==null&&(n=""),n&&(n=": "+n),pe(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),pe(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const fJ=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function hJ(t){pe(fJ.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function N2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),pe(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function Z7(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+sC[i&15]}return n}function Gn(t){return"0x"+t.map(e=>Xe(e).substring(2)).join("")}function Pd(t){return sn(t,!0)?(t.length-2)/2:zt(t).length}function Rn(t,e,n){const r=zt(t);return n!=null&&n>r.length&&pe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Xe(r.slice(e??0,n??r.length))}function q7(t,e,n){const r=zt(t);pe(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Xe(i)}function eh(t,e){return q7(t,e,!0)}function pJ(t,e){return q7(t,e,!1)}const _2=BigInt(0),vo=BigInt(1),ld=9007199254740991;function gJ(t,e){const n=I2(t,"value"),r=BigInt(Tt(e,"width"));if(pe(n>>r===_2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-vo){const i=(vo<=-ld&&t<=ld,"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(n){Q(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Q(!1,"invalid BigNumberish value",e||"value",t)}function I2(t,e){const n=Ke(t,e);return pe(n>=_2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const lC="0123456789abcdef";function vP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=lC[n>>4],e+=lC[n&15];return BigInt(e)}return Ke(t)}function Tt(t,e){switch(typeof t){case"bigint":return Q(t>=-ld&&t<=ld,"overflow",e||"value",t),Number(t);case"number":return Q(Number.isInteger(t),"underflow",e||"value",t),Q(t>=-ld&&t<=ld,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Tt(BigInt(t),e)}catch(n){Q(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Q(!1,"invalid numeric value",e||"value",t)}function yJ(t){return Tt(vP(t))}function cs(t,e){let r=I2(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Tt(e,"width");for(pe(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function xJ(t,e,n,r,i){return t==="OVERLONG"?(Q(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),nD(t,e,n))}const AJ=Object.freeze({error:wJ,ignore:nD,replace:xJ});function EJ(t,e){e==null&&(e=AJ.error);const n=zt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function sl(t,e){Q(typeof t=="string","invalid string value","str",t),e!=null&&(hJ(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);Q(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function SJ(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Uw(t,e){return SJ(EJ(t,e))}function rD(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();pe(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),pe(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const PJ=12,OJ=250;let fC=rD();const TJ=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),CJ=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let P6=!1;async function iD(t,e){try{const n=t.match(TJ);if(!n)throw new Error("invalid data");return new Od(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?vJ(n[3]):NJ(n[3]))}catch{return new Od(599,"BAD REQUEST (invalid data: URI)",{},null,new th(t))}}function aD(t){async function e(n,r){try{const i=n.match(CJ);if(!i)throw new Error("invalid link");return new th(`${t}${i[2]}`)}catch{return new Od(599,"BAD REQUEST (invalid IPFS URI)",{},null,new th(n))}}return e}const $v={data:iD,ipfs:aD("https://gateway.ipfs.io/ipfs/")},oD=new WeakMap;var Gu,ql,FR;let kJ=(FR=class{constructor(e){R(this,Gu,void 0);R(this,ql,void 0);O(this,Gu,[]),O(this,ql,!1),oD.set(e,()=>{if(!g(this,ql)){O(this,ql,!0);for(const n of g(this,Gu))setTimeout(()=>{n()},0);O(this,Gu,[])}})}addListener(e){pe(!g(this,ql),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),g(this,Gu).push(e)}get cancelled(){return g(this,ql)}checkSignal(){pe(!this.cancelled,"cancelled","CANCELLED",{})}},Gu=new WeakMap,ql=new WeakMap,FR);function Uv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Dd,Ld,io,Cs,$d,Ud,ar,Qi,ks,Vu,Qu,Ku,Bo,Ns,ec,Wu,Yg,Yp;let th=(Yp=class{constructor(e){R(this,Wu);R(this,Dd,void 0);R(this,Ld,void 0);R(this,io,void 0);R(this,Cs,void 0);R(this,$d,void 0);R(this,Ud,void 0);R(this,ar,void 0);R(this,Qi,void 0);R(this,ks,void 0);R(this,Vu,void 0);R(this,Qu,void 0);R(this,Ku,void 0);R(this,Bo,void 0);R(this,Ns,void 0);R(this,ec,void 0);O(this,Ud,String(e)),O(this,Dd,!1),O(this,Ld,!0),O(this,io,{}),O(this,Cs,""),O(this,$d,3e5),O(this,Ns,{slotInterval:OJ,maxAttempts:PJ}),O(this,ec,null)}get url(){return g(this,Ud)}set url(e){O(this,Ud,String(e))}get body(){return g(this,ar)==null?null:new Uint8Array(g(this,ar))}set body(e){if(e==null)O(this,ar,void 0),O(this,Qi,void 0);else if(typeof e=="string")O(this,ar,sl(e)),O(this,Qi,"text/plain");else if(e instanceof Uint8Array)O(this,ar,e),O(this,Qi,"application/octet-stream");else if(typeof e=="object")O(this,ar,sl(JSON.stringify(e))),O(this,Qi,"application/json");else throw new Error("invalid body")}hasBody(){return g(this,ar)!=null}get method(){return g(this,Cs)?g(this,Cs):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Cs,String(e).toUpperCase())}get headers(){const e=Object.assign({},g(this,io));return g(this,ks)&&(e.authorization=`Basic ${bJ(sl(g(this,ks)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&g(this,Qi)&&(e["content-type"]=g(this,Qi)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){g(this,io)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,io,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,$d,e)}get preflightFunc(){return g(this,Vu)||null}set preflightFunc(e){O(this,Vu,e)}get processFunc(){return g(this,Qu)||null}set processFunc(e){O(this,Qu,e)}get retryFunc(){return g(this,Ku)||null}set retryFunc(e){O(this,Ku,e)}get getUrlFunc(){return g(this,ec)||fC}set getUrlFunc(e){O(this,ec,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(g(this,Ns).slotInterval=e.slotInterval),e.maxAttempts!=null&&(g(this,Ns).maxAttempts=e.maxAttempts)}send(){return pe(g(this,Bo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Bo,new kJ(this)),te(this,Wu,Yg).call(this,0,hC()+this.timeout,0,this,new Od(0,"",{},null,this))}cancel(){pe(g(this,Bo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=oD.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();pe(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Yp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,io,Object.assign({},g(this,io))),g(this,ar)&&O(i,ar,new Uint8Array(g(this,ar))),O(i,Qi,g(this,Qi)),i}clone(){const e=new Yp(this.url);return O(e,Cs,g(this,Cs)),g(this,ar)&&O(e,ar,g(this,ar)),O(e,Qi,g(this,Qi)),O(e,io,Object.assign({},g(this,io))),O(e,ks,g(this,ks)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,Vu,g(this,Vu)),O(e,Qu,g(this,Qu)),O(e,Ku,g(this,Ku)),O(e,ec,g(this,ec)),e}static lockConfig(){P6=!0}static getGateway(e){return $v[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(P6)throw new Error("gateways locked");$v[e]=n}static registerGetUrl(e){if(P6)throw new Error("gateways locked");fC=e}static createGetUrlFunc(e){return rD()}static createDataGateway(){return iD}static createIpfsGatewayFunc(e){return aD(e)}},Dd=new WeakMap,Ld=new WeakMap,io=new WeakMap,Cs=new WeakMap,$d=new WeakMap,Ud=new WeakMap,ar=new WeakMap,Qi=new WeakMap,ks=new WeakMap,Vu=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,Bo=new WeakMap,Ns=new WeakMap,ec=new WeakMap,Wu=new WeakSet,Yg=async function(e,n,r,i,a){var u,f,h;if(e>=g(this,Ns).maxAttempts)return a.makeServerError("exceeded maximum retry limit");pe(hC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await _J(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in $v){const d=await $v[s](o.url,Uv(g(i,Bo)));if(d instanceof Od){let y=d;if(this.processFunc){Uv(g(i,Bo));try{y=await this.processFunc(o,y)}catch(p){(p.throttle==null||typeof p.stall!="number")&&y.makeServerError("error in post-processing function",p).assertOk()}}return y}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Uv(g(i,Bo)));let c=new Od(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return te(u=o.redirect(d),Wu,Yg).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let y=g(this,Ns).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(y=parseInt(d)),te(f=o.clone(),Wu,Yg).call(f,e+1,n,y,i,c)}if(this.processFunc){Uv(g(i,Bo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let y=g(this,Ns).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(y=d.stall),te(h=o.clone(),Wu,Yg).call(h,e+1,n,y,i,c)}}return c},Yp);var am,om,sm,Ki,Fd,Ju,lm;let Od=(lm=class{constructor(e,n,r,i,a){R(this,am,void 0);R(this,om,void 0);R(this,sm,void 0);R(this,Ki,void 0);R(this,Fd,void 0);R(this,Ju,void 0);O(this,am,e),O(this,om,n),O(this,sm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,Ki,i==null?null:new Uint8Array(i)),O(this,Fd,a||null),O(this,Ju,{message:""})}toString(){return``}get statusCode(){return g(this,am)}get statusMessage(){return g(this,om)}get headers(){return Object.assign({},g(this,sm))}get body(){return g(this,Ki)==null?null:new Uint8Array(g(this,Ki))}get bodyText(){try{return g(this,Ki)==null?"":Uw(g(this,Ki))}catch{pe(!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{pe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw st(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return g(this,Ki)!=null}get request(){return g(this,Fd)}ok(){return g(this,Ju).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=g(this,Ju);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{g(this,Ki)&&(i=Uw(g(this,Ki)))}catch{}pe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},am=new WeakMap,om=new WeakMap,sm=new WeakMap,Ki=new WeakMap,Fd=new WeakMap,Ju=new WeakMap,lm);function hC(){return new Date().getTime()}function NJ(t){return sl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function _J(t){return new Promise(e=>setTimeout(e,t))}function IJ(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function dC(t,e,n){let r=0;for(let i=0;i{pe(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=dC(t,e+1,r);return n(e+1+r+i),pC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),pC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=dC(t,e+1,r);n(e+1+r+i);const a=Xe(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=Xe(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:IJ(t[e])}}function R2(t){const e=zt(t,"data"),n=sD(e,0);return Q(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function gC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function lD(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(lD(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=gC(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(zt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=gC(e.length);return n.unshift(183+n.length),n.concat(e)}const yC="0123456789abcdef";function yp(t){let e="0x";for(const n of lD(t))e+=yC[n>>4],e+=yC[n&15];return e}const ai=32,BE=new Uint8Array(ai),RJ=["then"],Fv={};function Ig(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var tc,Qf;let cD=(Qf=class extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==Fv&&(i=n,a=[],o=!1);super(i.length);R(this,tc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,tc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Tt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Ig(`index ${h}`,d),d}if(RJ.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Ig(`index ${i}`,r),n.push(r)}),n}toObject(){return g(this,tc).reduce((n,r,i)=>(pe(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{g(this,_s)[e]=mC(n)}}},_s=new WeakMap,Yu=new WeakMap,jd=new WeakSet,Db=function(e){return g(this,_s).push(e),O(this,Yu,g(this,Yu)+e.length),e.length},jR);var mi,Wi,Xu,Zu,nc,cm,LE,qx,uD,um;let MJ=(um=class{constructor(e,n,r){R(this,cm);R(this,qx);I(this,"allowLoose");R(this,mi,void 0);R(this,Wi,void 0);R(this,Xu,void 0);R(this,Zu,void 0);R(this,nc,void 0);st(this,{allowLoose:!!n}),O(this,mi,ri(e)),O(this,Xu,0),O(this,Zu,null),O(this,nc,r??1024),O(this,Wi,0)}get data(){return Xe(g(this,mi))}get dataLength(){return g(this,mi).length}get consumed(){return g(this,Wi)}get bytes(){return new Uint8Array(g(this,mi))}subReader(e){const n=new um(g(this,mi).slice(g(this,Wi)+e),this.allowLoose,g(this,nc));return O(n,Zu,this),n}readBytes(e,n){let r=te(this,qx,uD).call(this,0,e,!!n);return te(this,cm,LE).call(this,e),O(this,Wi,g(this,Wi)+r.length),r.slice(0,e)}readValue(){return vP(this.readBytes(ai))}readIndex(){return yJ(this.readBytes(ai))}},mi=new WeakMap,Wi=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,nc=new WeakMap,cm=new WeakSet,LE=function(e){var n;if(g(this,Zu))return te(n=g(this,Zu),cm,LE).call(n,e);O(this,Xu,g(this,Xu)+e),pe(g(this,nc)<1||g(this,Xu)<=g(this,nc)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${g(this,nc)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ri(g(this,mi)),offset:g(this,Wi),length:e,info:{bytesRead:g(this,Xu),dataLength:this.dataLength}})},qx=new WeakSet,uD=function(e,n,r){let i=Math.ceil(n/ai)*ai;return g(this,Wi)+i>g(this,mi).length&&(this.allowLoose&&r&&g(this,Wi)+n<=g(this,mi).length?i=n:pe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ri(g(this,mi)),length:g(this,mi).length,offset:g(this,Wi)+i})),g(this,mi).slice(g(this,Wi),g(this,Wi)+i)},um);function Fw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function bP(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 BJ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fw(t.outputLen),Fw(t.blockLen)}function mp(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 fD(t,e){bP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,DJ=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),T6=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Io=(t,e)=>t<<32-e|t>>>e,LJ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!LJ)throw new Error("Non little-endian hardware is not supported");function $J(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function M2(t){if(typeof t=="string"&&(t=$J(t)),!hD(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function UJ(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!hD(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let wP=class{clone(){return this._cloneInto()}};function xP(t){const e=r=>t().update(M2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function FJ(t=32){if(O6&&typeof O6.getRandomValues=="function")return O6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class dD extends wP{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,BJ(e);const r=M2(n);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,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let o=0;onew dD(t,e).update(n).digest();AP.create=(t,e)=>new dD(t,e);function jJ(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),l=r?4:0,c=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+c,s,r)}class pD extends wP{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=T6(this.buffer)}update(e){mp(this);const{view:n,buffer:r,blockLen:i}=this;e=M2(e);const a=e.length;for(let o=0;oi-o&&(this.process(r,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,HJ=(t,e,n)=>t&e^t&n^e&n,GJ=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]),Ul=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Fl=new Uint32Array(64);class VJ extends pD{constructor(){super(64,32,8,!1),this.A=Ul[0]|0,this.B=Ul[1]|0,this.C=Ul[2]|0,this.D=Ul[3]|0,this.E=Ul[4]|0,this.F=Ul[5]|0,this.G=Ul[6]|0,this.H=Ul[7]|0}get(){const{A:e,B:n,C:r,D:i,E:a,F:o,G:s,H:l}=this;return[e,n,r,i,a,o,s,l]}set(e,n,r,i,a,o,s,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Fl[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const h=Fl[f-15],d=Fl[f-2],y=Io(h,7)^Io(h,18)^h>>>3,p=Io(d,17)^Io(d,19)^d>>>10;Fl[f]=p+Fl[f-7]+y+Fl[f-16]|0}let{A:r,B:i,C:a,D:o,E:s,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Io(s,6)^Io(s,11)^Io(s,25),d=u+h+zJ(s,l,c)+GJ[f]+Fl[f]|0,p=(Io(r,2)^Io(r,13)^Io(r,22))+HJ(r,i,a)|0;u=c,c=l,l=s,s=o+d|0,o=a,a=i,i=r,r=d+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,a,o,s,l,c,u)}roundClean(){Fl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const QJ=xP(()=>new VJ),jv=BigInt(2**32-1),$E=BigInt(32);function gD(t,e=!1){return e?{h:Number(t&jv),l:Number(t>>$E&jv)}:{h:Number(t>>$E&jv)|0,l:Number(t&jv)|0}}function yD(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<<$E|BigInt(e>>>0),WJ=(t,e,n)=>t>>>n,JJ=(t,e,n)=>t<<32-n|e>>>n,YJ=(t,e,n)=>t>>>n|e<<32-n,XJ=(t,e,n)=>t<<32-n|e>>>n,ZJ=(t,e,n)=>t<<64-n|e>>>n-32,qJ=(t,e,n)=>t>>>n-32|e<<64-n,eY=(t,e)=>e,tY=(t,e)=>t,mD=(t,e,n)=>t<>>32-n,vD=(t,e,n)=>e<>>32-n,bD=(t,e,n)=>e<>>64-n,wD=(t,e,n)=>t<>>64-n;function nY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const rY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),iY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,aY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),oY=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,sY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),lY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Et={fromBig:gD,split:yD,toBig:KJ,shrSH:WJ,shrSL:JJ,rotrSH:YJ,rotrSL:XJ,rotrBH:ZJ,rotrBL:qJ,rotr32H:eY,rotr32L:tY,rotlSH:mD,rotlSL:vD,rotlBH:bD,rotlBL:wD,add:nY,add3L:rY,add3H:iY,add4L:aY,add4H:oY,add5H:lY,add5L:sY},[cY,uY]=Et.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),jl=new Uint32Array(80),zl=new Uint32Array(80);class fY extends pD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:o,Dh:s,Dl:l,Eh:c,El:u,Fh:f,Fl:h,Gh:d,Gl:y,Hh:p,Hl:m}=this;return[e,n,r,i,a,o,s,l,c,u,f,h,d,y,p,m]}set(e,n,r,i,a,o,s,l,c,u,f,h,d,y,p,m){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=o|0,this.Dh=s|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=d|0,this.Gl=y|0,this.Hh=p|0,this.Hl=m|0}process(e,n){for(let x=0;x<16;x++,n+=4)jl[x]=e.getUint32(n),zl[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const E=jl[x-15]|0,P=zl[x-15]|0,A=Et.rotrSH(E,P,1)^Et.rotrSH(E,P,8)^Et.shrSH(E,P,7),k=Et.rotrSL(E,P,1)^Et.rotrSL(E,P,8)^Et.shrSL(E,P,7),N=jl[x-2]|0,D=zl[x-2]|0,L=Et.rotrSH(N,D,19)^Et.rotrBH(N,D,61)^Et.shrSH(N,D,6),F=Et.rotrSL(N,D,19)^Et.rotrBL(N,D,61)^Et.shrSL(N,D,6),$=Et.add4L(k,F,zl[x-7],zl[x-16]),z=Et.add4H($,A,L,jl[x-7],jl[x-16]);jl[x]=z|0,zl[x]=$|0}let{Ah:r,Al:i,Bh:a,Bl:o,Ch:s,Cl:l,Dh:c,Dl:u,Eh:f,El:h,Fh:d,Fl:y,Gh:p,Gl:m,Hh:v,Hl:w}=this;for(let x=0;x<80;x++){const E=Et.rotrSH(f,h,14)^Et.rotrSH(f,h,18)^Et.rotrBH(f,h,41),P=Et.rotrSL(f,h,14)^Et.rotrSL(f,h,18)^Et.rotrBL(f,h,41),A=f&d^~f&p,k=h&y^~h&m,N=Et.add5L(w,P,k,uY[x],zl[x]),D=Et.add5H(N,v,E,A,cY[x],jl[x]),L=N|0,F=Et.rotrSH(r,i,28)^Et.rotrBH(r,i,34)^Et.rotrBH(r,i,39),$=Et.rotrSL(r,i,28)^Et.rotrBL(r,i,34)^Et.rotrBL(r,i,39),z=r&a^r&s^a&s,J=i&o^i&l^o&l;v=p|0,w=m|0,p=d|0,m=y|0,d=f|0,y=h|0,{h:f,l:h}=Et.add(c|0,u|0,D|0,L|0),c=s|0,u=l|0,s=a|0,l=o|0,a=r|0,o=i|0;const H=Et.add3L(L,$,J);r=Et.add3H(H,D,F,z),i=H|0}({h:r,l:i}=Et.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:o}=Et.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:s,l}=Et.add(this.Ch|0,this.Cl|0,s|0,l|0),{h:c,l:u}=Et.add(this.Dh|0,this.Dl|0,c|0,u|0),{h:f,l:h}=Et.add(this.Eh|0,this.El|0,f|0,h|0),{h:d,l:y}=Et.add(this.Fh|0,this.Fl|0,d|0,y|0),{h:p,l:m}=Et.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:v,l:w}=Et.add(this.Hh|0,this.Hl|0,v|0,w|0),this.set(r,i,a,o,s,l,c,u,f,h,d,y,p,m,v,w)}roundClean(){jl.fill(0),zl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class hY extends fY{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const dY=xP(()=>new hY),[xD,AD,ED]=[[],[],[]],pY=BigInt(0),Rg=BigInt(1),gY=BigInt(2),yY=BigInt(7),mY=BigInt(256),vY=BigInt(113);for(let t=0,e=Rg,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],xD.push(2*(5*r+n)),AD.push((t+1)*(t+2)/2%64);let i=pY;for(let a=0;a<7;a++)e=(e<>yY)*vY)%mY,e&gY&&(i^=Rg<<(Rg<n>32?bD(t,e,n):mD(t,e,n),bC=(t,e,n)=>n>32?wD(t,e,n):vD(t,e,n);function xY(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,l=(o+2)%10,c=n[l],u=n[l+1],f=vC(c,u,1)^n[s],h=bC(c,u,1)^n[s+1];for(let d=0;d<50;d+=10)t[o+d]^=f,t[o+d+1]^=h}let i=t[2],a=t[3];for(let o=0;o<24;o++){const s=AD[o],l=vC(i,a,s),c=bC(i,a,s),u=xD[o];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=t[o+s];for(let s=0;s<10;s++)t[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}t[0]^=bY[r],t[1]^=wY[r]}n.fill(0)}class EP extends wP{constructor(e,n,r,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fw(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=DJ(this.state)}keccak(){xY(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){mp(this);const{blockLen:n,state:r}=this;e=M2(e);const i=e.length;for(let a=0;a=r&&this.keccak();const o=Math.min(r-this.posOut,a-i);e.set(n.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 Fw(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(fD(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:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return e||(e=new EP(n,r,i,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const AY=(t,e,n)=>xP(()=>new EP(e,t,n)),SD=AY(1,136,256/8);let PD=!1;const OD=function(t){return SD(t)};let TD=OD;function mn(t){const e=zt(t,"data");return Xe(TD(e))}mn._=OD;mn.lock=function(){PD=!0};mn.register=function(t){if(PD)throw new TypeError("keccak256 is locked");TD=t};Object.freeze(mn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const CD=BigInt(0),B2=BigInt(1),EY=BigInt(2),D2=t=>t instanceof Uint8Array,SY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function vp(t){if(!D2(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!D2(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function OY(t,e){if(t.length!==e.length)return!1;for(let n=0;nCD;t>>=B2,e+=1);return e}function kY(t,e){return t>>BigInt(e)&B2}const NY=(t,e,n)=>t|(n?B2:CD)<(EY<new Uint8Array(t),wC=t=>Uint8Array.from(t);function ND(t,e,n){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 n!="function")throw new Error("hmacFn must be a function");let r=C6(t),i=C6(t),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...f)=>n(i,r,...f),l=(f=C6())=>{i=s(wC([0]),f),r=s(),f.length!==0&&(i=s(wC([1]),f),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{o(),l(f);let d;for(;!(d=h(c()));)l();return o(),d}}const _Y={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 ev(t,e,n={}){const r=(i,a,o)=>{const s=_Y[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!s(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${a}`)};for(const[i,a]of Object.entries(e))r(i,a,!1);for(const[i,a]of Object.entries(n))r(i,a,!0);return t}const IY=Object.freeze(Object.defineProperty({__proto__:null,bitGet:kY,bitLen:CY,bitMask:TP,bitSet:NY,bytesToHex:vp,bytesToNumberBE:Uf,bytesToNumberLE:PP,concatBytes:n1,createHmacDrbg:ND,ensureBytes:ro,equalBytes:OY,hexToBytes:bp,hexToNumber:SP,numberToBytesBE:wp,numberToBytesLE:OP,numberToHexUnpadded:kD,numberToVarBytesBE:PY,utf8ToBytes:TY,validateObject:ev},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ur=BigInt(0),zn=BigInt(1),Ou=BigInt(2),RY=BigInt(3),UE=BigInt(4),xC=BigInt(5),AC=BigInt(8);BigInt(9);BigInt(16);function Pi(t,e){const n=t%e;return n>=ur?n:e+n}function MY(t,e,n){if(n<=ur||e 0");if(n===zn)return ur;let r=zn;for(;e>ur;)e&zn&&(r=r*t%n),t=t*t%n,e>>=zn;return r}function pa(t,e,n){let r=t;for(;e-- >ur;)r*=r,r%=n;return r}function FE(t,e){if(t===ur||e<=ur)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Pi(t,e),r=e,i=ur,a=zn;for(;n!==ur;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==zn)throw new Error("invert: does not exist");return Pi(i,e)}function BY(t){const e=(t-zn)/Ou;let n,r,i;for(n=t-zn,r=0;n%Ou===ur;n/=Ou,r++);for(i=Ou;i(r[i]="function",r),e);return ev(t,n)}function UY(t,e,n){if(n 0");if(n===ur)return t.ONE;if(n===zn)return e;let r=t.ONE,i=e;for(;n>ur;)n&zn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=zn;return r}function FY(t,e){const n=new Array(e.length),r=e.reduce((a,o,s)=>t.is0(o)?a:(n[s]=a,t.mul(a,o)),t.ONE),i=t.inv(r);return e.reduceRight((a,o,s)=>t.is0(o)?a:(n[s]=t.mul(a,n[s]),t.mul(a,o)),i),n}function _D(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function jY(t,e,n=!1,r={}){if(t<=ur)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=_D(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=DY(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:TP(i),ZERO:ur,ONE:zn,create:l=>Pi(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return ur<=l&&ll===ur,isOdd:l=>(l&zn)===zn,neg:l=>Pi(-l,t),eql:(l,c)=>l===c,sqr:l=>Pi(l*l,t),add:(l,c)=>Pi(l+c,t),sub:(l,c)=>Pi(l-c,t),mul:(l,c)=>Pi(l*c,t),pow:(l,c)=>UY(s,l,c),div:(l,c)=>Pi(l*FE(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>FE(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>FY(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?OP(l,a):wp(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return n?PP(l):Uf(l)}});return Object.freeze(s)}function ID(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 RD(t){const e=ID(t);return e+Math.ceil(e/2)}function zY(t,e,n=!1){const r=t.length,i=ID(e),a=RD(e);if(r<16||r1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?Uf(t):PP(t),s=Pi(o,e-zn)+zn;return n?OP(s,i):wp(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const HY=BigInt(0),k6=BigInt(1);function GY(t,e){const n=(i,a)=>{const o=a.negate();return i?o:a},r=i=>{const a=Math.ceil(e/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,a){let o=t.ZERO,s=i;for(;a>HY;)a&k6&&(o=o.add(s)),s=s.double(),a>>=k6;return o},precomputeWindow(i,a){const{windows:o,windowSize:s}=r(a),l=[];let c=i,u=c;for(let f=0;f>=d,m>l&&(m-=h,o+=k6);const v=p,w=p+Math.abs(m)-1,x=y%2!==0,E=m<0;m===0?u=u.add(n(x,a[v])):c=c.add(n(E,a[w]))}return{p:c,f:u}},wNAFCached(i,a,o,s){const l=i._WINDOW_SIZE||1;let c=a.get(i);return c||(c=this.precomputeWindow(i,l),l!==1&&a.set(i,s(c))),this.wNAF(l,c,o)}}}function MD(t){return $Y(t.Fp),ev(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({..._D(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function VY(t){const e=MD(t);ev(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:QY,hexToBytes:KY}=IY,Bu={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Bu;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:QY(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Bu,n=typeof t=="string"?KY(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=Bu._parseInt(n.subarray(2)),{d:o,l:s}=Bu._parseInt(a);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=e(n(t.s)),i=e(n(t.r)),a=r.length/2,o=i.length/2,s=n(a),l=n(o);return`30${n(o+a+4)}02${l}${i}02${s}${r}`}},qs=BigInt(0),Na=BigInt(1);BigInt(2);const EC=BigInt(3);BigInt(4);function WY(t){const e=VY(t),{Fp:n}=e,r=e.toBytes||((y,p,m)=>{const v=p.toAffine();return n1(Uint8Array.from([4]),n.toBytes(v.x),n.toBytes(v.y))}),i=e.fromBytes||(y=>{const p=y.subarray(1),m=n.fromBytes(p.subarray(0,n.BYTES)),v=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:m,y:v}});function a(y){const{a:p,b:m}=e,v=n.sqr(y),w=n.mul(v,y);return n.add(n.add(w,n.mul(y,p)),m)}if(!n.eql(n.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return typeof y=="bigint"&&qsn.eql(x,n.ZERO);return w(m)&&w(v)?f.ZERO:new f(m,v,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const m=n.invertBatch(p.map(v=>v.pz));return p.map((v,w)=>v.toAffine(m[w])).map(f.fromAffine)}static fromHex(p){const m=f.fromAffine(i(ro("pointHex",p)));return m.assertValidity(),m}static fromPrivateKey(p){return f.BASE.multiply(l(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:m}=this.toAffine();if(!n.isValid(p)||!n.isValid(m))throw new Error("bad point: x or y not FE");const v=n.sqr(m),w=a(p);if(!n.eql(v,w))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);const{px:m,py:v,pz:w}=this,{px:x,py:E,pz:P}=p,A=n.eql(n.mul(m,P),n.mul(x,w)),k=n.eql(n.mul(v,P),n.mul(E,w));return A&&k}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:m}=e,v=n.mul(m,EC),{px:w,py:x,pz:E}=this;let P=n.ZERO,A=n.ZERO,k=n.ZERO,N=n.mul(w,w),D=n.mul(x,x),L=n.mul(E,E),F=n.mul(w,x);return F=n.add(F,F),k=n.mul(w,E),k=n.add(k,k),P=n.mul(p,k),A=n.mul(v,L),A=n.add(P,A),P=n.sub(D,A),A=n.add(D,A),A=n.mul(P,A),P=n.mul(F,P),k=n.mul(v,k),L=n.mul(p,L),F=n.sub(N,L),F=n.mul(p,F),F=n.add(F,k),k=n.add(N,N),N=n.add(k,N),N=n.add(N,L),N=n.mul(N,F),A=n.add(A,N),L=n.mul(x,E),L=n.add(L,L),N=n.mul(L,F),P=n.sub(P,N),k=n.mul(L,D),k=n.add(k,k),k=n.add(k,k),new f(P,A,k)}add(p){u(p);const{px:m,py:v,pz:w}=this,{px:x,py:E,pz:P}=p;let A=n.ZERO,k=n.ZERO,N=n.ZERO;const D=e.a,L=n.mul(e.b,EC);let F=n.mul(m,x),$=n.mul(v,E),z=n.mul(w,P),J=n.add(m,v),H=n.add(x,E);J=n.mul(J,H),H=n.add(F,$),J=n.sub(J,H),H=n.add(m,w);let G=n.add(x,P);return H=n.mul(H,G),G=n.add(F,z),H=n.sub(H,G),G=n.add(v,w),A=n.add(E,P),G=n.mul(G,A),A=n.add($,z),G=n.sub(G,A),N=n.mul(D,H),A=n.mul(L,z),N=n.add(A,N),A=n.sub($,N),N=n.add($,N),k=n.mul(A,N),$=n.add(F,F),$=n.add($,F),z=n.mul(D,z),H=n.mul(L,H),$=n.add($,z),z=n.sub(F,z),z=n.mul(D,z),H=n.add(H,z),F=n.mul($,H),k=n.add(k,F),F=n.mul(G,H),A=n.mul(J,A),A=n.sub(A,F),F=n.mul(J,$),N=n.mul(G,N),N=n.add(N,F),new f(A,k,N)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return d.wNAFCached(this,c,p,m=>{const v=n.invertBatch(m.map(w=>w.pz));return m.map((w,x)=>w.toAffine(v[x])).map(f.fromAffine)})}multiplyUnsafe(p){const m=f.ZERO;if(p===qs)return m;if(s(p),p===Na)return this;const{endo:v}=e;if(!v)return d.unsafeLadder(this,p);let{k1neg:w,k1:x,k2neg:E,k2:P}=v.splitScalar(p),A=m,k=m,N=this;for(;x>qs||P>qs;)x&Na&&(A=A.add(N)),P&Na&&(k=k.add(N)),N=N.double(),x>>=Na,P>>=Na;return w&&(A=A.negate()),E&&(k=k.negate()),k=new f(n.mul(k.px,v.beta),k.py,k.pz),A.add(k)}multiply(p){s(p);let m=p,v,w;const{endo:x}=e;if(x){const{k1neg:E,k1:P,k2neg:A,k2:k}=x.splitScalar(m);let{p:N,f:D}=this.wNAF(P),{p:L,f:F}=this.wNAF(k);N=d.constTimeNegate(E,N),L=d.constTimeNegate(A,L),L=new f(n.mul(L.px,x.beta),L.py,L.pz),v=N.add(L),w=D.add(F)}else{const{p:E,f:P}=this.wNAF(m);v=E,w=P}return f.normalizeZ([v,w])[0]}multiplyAndAddUnsafe(p,m,v){const w=f.BASE,x=(P,A)=>A===qs||A===Na||!P.equals(w)?P.multiplyUnsafe(A):P.multiply(A),E=x(this,m).add(x(p,v));return E.is0()?void 0:E}toAffine(p){const{px:m,py:v,pz:w}=this,x=this.is0();p==null&&(p=x?n.ONE:n.inv(w));const E=n.mul(m,p),P=n.mul(v,p),A=n.mul(w,p);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(A,n.ONE))throw new Error("invZ was invalid");return{x:E,y:P}}isTorsionFree(){const{h:p,isTorsionFree:m}=e;if(p===Na)return!0;if(m)return m(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:m}=e;return p===Na?this:m?m(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(f,this,p)}toHex(p=!0){return vp(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=GY(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function JY(t){const e=MD(t);return ev(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function YY(t){const e=JY(t),{Fp:n,n:r}=e,i=n.BYTES+1,a=2*n.BYTES+1;function o(H){return qsvp(wp(H,e.nByteLength));function y(H){const G=r>>Na;return H>G}function p(H){return y(H)?s(-H):H}const m=(H,G,q)=>Uf(H.slice(G,q));class v{constructor(G,q,K){this.r=G,this.s=q,this.recovery=K,this.assertValidity()}static fromCompact(G){const q=e.nByteLength;return G=ro("compactSignature",G,q*2),new v(m(G,0,q),m(G,q,2*q))}static fromDER(G){const{r:q,s:K}=Bu.toSig(ro("DER",G));return new v(q,K)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(G){return new v(this.r,this.s,G)}recoverPublicKey(G){const{r:q,s:K,recovery:ee}=this,he=k(ro("msgHash",G));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const we=ee===2||ee===3?q+e.n:q;if(we>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const be=ee&1?"03":"02",Ye=c.fromHex(be+d(we)),at=l(we),Be=s(-he*at),gt=s(K*at),Vt=c.BASE.multiplyAndAddUnsafe(Ye,Be,gt);if(!Vt)throw new Error("point at infinify");return Vt.assertValidity(),Vt}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return bp(this.toDERHex())}toDERHex(){return Bu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return bp(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const w={isValidPrivateKey(H){try{return u(H),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const H=RD(e.n);return zY(e.randomBytes(H),e.n)},precompute(H=8,G=c.BASE){return G._setWindowSize(H),G.multiply(BigInt(3)),G}};function x(H,G=!0){return c.fromPrivateKey(H).toRawBytes(G)}function E(H){const G=H instanceof Uint8Array,q=typeof H=="string",K=(G||q)&&H.length;return G?K===i||K===a:q?K===2*i||K===2*a:H instanceof c}function P(H,G,q=!0){if(E(H))throw new Error("first arg must be private key");if(!E(G))throw new Error("second arg must be public key");return c.fromHex(G).multiply(u(H)).toRawBytes(q)}const A=e.bits2int||function(H){const G=Uf(H),q=H.length*8-e.nBitLength;return q>0?G>>BigInt(q):G},k=e.bits2int_modN||function(H){return s(A(H))},N=TP(e.nBitLength);function D(H){if(typeof H!="bigint")throw new Error("bigint expected");if(!(qs<=H&&Hxe in q))throw new Error("sign() legacy options not supported");const{hash:K,randomBytes:ee}=e;let{lowS:he,prehash:we,extraEntropy:be}=q;he==null&&(he=!0),H=ro("msgHash",H),we&&(H=ro("prehashed msgHash",K(H)));const Ye=k(H),at=u(G),Be=[D(at),D(Ye)];if(be!=null){const xe=be===!0?ee(n.BYTES):be;Be.push(ro("extraEntropy",xe))}const gt=n1(...Be),Vt=Ye;function pn(xe){const Ve=A(xe);if(!h(Ve))return;const We=l(Ve),se=c.BASE.multiply(Ve).toAffine(),bt=s(se.x);if(bt===qs)return;const ut=s(We*s(Vt+bt*at));if(ut===qs)return;let It=(se.x===bt?0:2)|Number(se.y&Na),Yt=ut;return he&&y(ut)&&(Yt=p(ut),It^=1),new v(bt,Yt,It)}return{seed:gt,k2sig:pn}}const F={lowS:e.lowS,prehash:!1},$={lowS:e.lowS,prehash:!1};function z(H,G,q=F){const{seed:K,k2sig:ee}=L(H,G,q),he=e;return ND(he.hash.outputLen,he.nByteLength,he.hmac)(K,ee)}c.BASE._setWindowSize(8);function J(H,G,q,K=$){var se;const ee=H;if(G=ro("msgHash",G),q=ro("publicKey",q),"strict"in K)throw new Error("options.strict was renamed to lowS");const{lowS:he,prehash:we}=K;let be,Ye;try{if(typeof ee=="string"||ee instanceof Uint8Array)try{be=v.fromDER(ee)}catch(bt){if(!(bt instanceof Bu.Err))throw bt;be=v.fromCompact(ee)}else if(typeof ee=="object"&&typeof ee.r=="bigint"&&typeof ee.s=="bigint"){const{r:bt,s:ut}=ee;be=new v(bt,ut)}else throw new Error("PARSE");Ye=c.fromHex(q)}catch(bt){if(bt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(he&&be.hasHighS())return!1;we&&(G=e.hash(G));const{r:at,s:Be}=be,gt=k(G),Vt=l(Be),pn=s(gt*Vt),xe=s(at*Vt),Ve=(se=c.BASE.multiplyAndAddUnsafe(Ye,pn,xe))==null?void 0:se.toAffine();return Ve?s(Ve.x)===at:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:P,sign:z,verify:J,ProjectivePoint:c,Signature:v,utils:w}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function XY(t){return{hash:t,hmac:(e,...n)=>AP(t,e,UJ(...n)),randomBytes:FJ}}function ZY(t,e){const n=r=>YY({...t,...XY(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const BD=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),SC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),qY=BigInt(1),jE=BigInt(2),PC=(t,e)=>(t+e/jE)/e;function eX(t){const e=BD,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=pa(u,n,e)*u%e,h=pa(f,n,e)*u%e,d=pa(h,jE,e)*c%e,y=pa(d,i,e)*d%e,p=pa(y,a,e)*y%e,m=pa(p,s,e)*p%e,v=pa(m,l,e)*m%e,w=pa(v,s,e)*p%e,x=pa(w,n,e)*u%e,E=pa(x,o,e)*y%e,P=pa(E,r,e)*c%e,A=pa(P,jE,e);if(!zE.eql(zE.sqr(A),t))throw new Error("Cannot find square root");return A}const zE=jY(BD,void 0,void 0,{sqrt:eX}),ti=ZY({a:BigInt(0),b:BigInt(7),Fp:zE,n:SC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=SC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-qY*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=PC(a*t,e),l=PC(-r*t,e);let c=Pi(t-s*n-l*i,e),u=Pi(-s*r-l*a,e);const f=c>o,h=u>o;if(f&&(c=e-c),h&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},QJ);BigInt(0);ti.ProjectivePoint;const r1="0x0000000000000000000000000000000000000000",OC="0x0000000000000000000000000000000000000000000000000000000000000000",TC=BigInt(0),CC=BigInt(1),kC=BigInt(2),NC=BigInt(27),_C=BigInt(28),zv=BigInt(35),Ph={};function IC(t){return eh(ii(t),32)}var zd,Hd,Gd,qu,qi;let vl=(qi=class{constructor(e,n,r,i){R(this,zd,void 0);R(this,Hd,void 0);R(this,Gd,void 0);R(this,qu,void 0);N2(e,Ph,"Signature"),O(this,zd,n),O(this,Hd,r),O(this,Gd,i),O(this,qu,null)}get r(){return g(this,zd)}set r(e){Q(Pd(e)===32,"invalid r","value",e),O(this,zd,Xe(e))}get s(){return g(this,Hd)}set s(e){Q(Pd(e)===32,"invalid s","value",e);const n=Xe(e);Q(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,Hd,n)}get v(){return g(this,Gd)}set v(e){const n=Tt(e,"value");Q(n===27||n===28,"invalid v","v",e),O(this,Gd,n)}get networkV(){return g(this,qu)}get legacyChainId(){const e=this.networkV;return e==null?null:qi.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=zt(this.s);return this.yParity&&(e[0]|=128),Xe(e)}get compactSerialized(){return Gn([this.r,this.yParityAndS])}get serialized(){return Gn([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 qi(Ph,this.r,this.s,this.v);return this.networkV&&O(e,qu,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 n=Ke(e,"v");return n==NC||n==_C?TC:(Q(n>=zv,"invalid EIP-155 v","v",e),(n-zv)/kC)}static getChainIdV(e,n){return Ke(e)*kC+BigInt(35+n-27)}static getNormalizedV(e){const n=Ke(e);return n===TC||n===NC?27:n===CC||n===_C?28:(Q(n>=zv,"invalid v","v",e),n&CC?27:28)}static from(e){function n(c,u){Q(c,u,"signature",e)}if(e==null)return new qi(Ph,OC,OC,27);if(typeof e=="string"){const c=zt(e,"signature");if(c.length===64){const u=Xe(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new qi(Ph,u,Xe(f),h)}if(c.length===65){const u=Xe(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=qi.getNormalizedV(c[64]);return new qi(Ph,u,Xe(f),h)}n(!1,"invalid raw signature length")}if(e instanceof qi)return e.clone();const r=e.r;n(r!=null,"missing r");const i=IC(r),a=function(c,u){if(c!=null)return IC(c);if(u!=null){n(sn(u,32),"invalid yParityAndS");const f=zt(u);return f[0]&=127,Xe(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((zt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=Ke(c);return{networkV:h>=zv?h:void 0,v:qi.getNormalizedV(h)}}if(u!=null)return n(sn(u,32),"invalid yParityAndS"),{v:zt(u)[0]&128?28:27};if(f!=null){switch(Tt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new qi(Ph,i,a,s);return o&&O(l,qu,o),n(e.yParity==null||Tt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}},zd=new WeakMap,Hd=new WeakMap,Gd=new WeakMap,qu=new WeakMap,qi);var Is,el;let CP=(el=class{constructor(e){R(this,Is,void 0);Q(Pd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Is,Xe(e))}get privateKey(){return g(this,Is)}get publicKey(){return el.computePublicKey(g(this,Is))}get compressedPublicKey(){return el.computePublicKey(g(this,Is),!0)}sign(e){Q(Pd(e)===32,"invalid digest length","digest",e);const n=ti.sign(ri(e),ri(g(this,Is)),{lowS:!0});return vl.from({r:cs(n.r,32),s:cs(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=el.computePublicKey(e);return Xe(ti.getSharedSecret(ri(g(this,Is)),zt(n),!1))}static computePublicKey(e,n){let r=zt(e,"key");if(r.length===32){const a=ti.getPublicKey(r,!!n);return Xe(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ti.ProjectivePoint.fromHex(r);return Xe(i.toRawBytes(n))}static recoverPublicKey(e,n){Q(Pd(e)===32,"invalid digest length","digest",e);const r=vl.from(n);let i=ti.Signature.fromCompact(ri(Gn([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(ri(e));return Q(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ti.ProjectivePoint.fromHex(el.computePublicKey(e).substring(2)),a=ti.ProjectivePoint.fromHex(el.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}},Is=new WeakMap,el);const tX=BigInt(0),nX=BigInt(36);function RC(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=zt(mn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const kP={};for(let t=0;t<10;t++)kP[String(t)]=String(t);for(let t=0;t<26;t++)kP[String.fromCharCode(65+t)]=String(10+t);const MC=15;function rX(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>kP[r]).join("");for(;e.length>=MC;){let r=e.substring(0,MC);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const iX=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function aX(t){t=t.toLowerCase();let e=tX;for(let n=0;ne.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 g(this,ef)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return g(this,ef)===!0?-1:g(this,ef)===!1?this.value.length:null}static from(e,n){return new go(ws,e,n)}static uint8(e){return $e(e,8)}static uint16(e){return $e(e,16)}static uint24(e){return $e(e,24)}static uint32(e){return $e(e,32)}static uint40(e){return $e(e,40)}static uint48(e){return $e(e,48)}static uint56(e){return $e(e,56)}static uint64(e){return $e(e,64)}static uint72(e){return $e(e,72)}static uint80(e){return $e(e,80)}static uint88(e){return $e(e,88)}static uint96(e){return $e(e,96)}static uint104(e){return $e(e,104)}static uint112(e){return $e(e,112)}static uint120(e){return $e(e,120)}static uint128(e){return $e(e,128)}static uint136(e){return $e(e,136)}static uint144(e){return $e(e,144)}static uint152(e){return $e(e,152)}static uint160(e){return $e(e,160)}static uint168(e){return $e(e,168)}static uint176(e){return $e(e,176)}static uint184(e){return $e(e,184)}static uint192(e){return $e(e,192)}static uint200(e){return $e(e,200)}static uint208(e){return $e(e,208)}static uint216(e){return $e(e,216)}static uint224(e){return $e(e,224)}static uint232(e){return $e(e,232)}static uint240(e){return $e(e,240)}static uint248(e){return $e(e,248)}static uint256(e){return $e(e,256)}static uint(e){return $e(e,256)}static int8(e){return $e(e,-8)}static int16(e){return $e(e,-16)}static int24(e){return $e(e,-24)}static int32(e){return $e(e,-32)}static int40(e){return $e(e,-40)}static int48(e){return $e(e,-48)}static int56(e){return $e(e,-56)}static int64(e){return $e(e,-64)}static int72(e){return $e(e,-72)}static int80(e){return $e(e,-80)}static int88(e){return $e(e,-88)}static int96(e){return $e(e,-96)}static int104(e){return $e(e,-104)}static int112(e){return $e(e,-112)}static int120(e){return $e(e,-120)}static int128(e){return $e(e,-128)}static int136(e){return $e(e,-136)}static int144(e){return $e(e,-144)}static int152(e){return $e(e,-152)}static int160(e){return $e(e,-160)}static int168(e){return $e(e,-168)}static int176(e){return $e(e,-176)}static int184(e){return $e(e,-184)}static int192(e){return $e(e,-192)}static int200(e){return $e(e,-200)}static int208(e){return $e(e,-208)}static int216(e){return $e(e,-216)}static int224(e){return $e(e,-224)}static int232(e){return $e(e,-232)}static int240(e){return $e(e,-240)}static int248(e){return $e(e,-248)}static int256(e){return $e(e,-256)}static int(e){return $e(e,-256)}static bytes1(e){return Qt(e,1)}static bytes2(e){return Qt(e,2)}static bytes3(e){return Qt(e,3)}static bytes4(e){return Qt(e,4)}static bytes5(e){return Qt(e,5)}static bytes6(e){return Qt(e,6)}static bytes7(e){return Qt(e,7)}static bytes8(e){return Qt(e,8)}static bytes9(e){return Qt(e,9)}static bytes10(e){return Qt(e,10)}static bytes11(e){return Qt(e,11)}static bytes12(e){return Qt(e,12)}static bytes13(e){return Qt(e,13)}static bytes14(e){return Qt(e,14)}static bytes15(e){return Qt(e,15)}static bytes16(e){return Qt(e,16)}static bytes17(e){return Qt(e,17)}static bytes18(e){return Qt(e,18)}static bytes19(e){return Qt(e,19)}static bytes20(e){return Qt(e,20)}static bytes21(e){return Qt(e,21)}static bytes22(e){return Qt(e,22)}static bytes23(e){return Qt(e,23)}static bytes24(e){return Qt(e,24)}static bytes25(e){return Qt(e,25)}static bytes26(e){return Qt(e,26)}static bytes27(e){return Qt(e,27)}static bytes28(e){return Qt(e,28)}static bytes29(e){return Qt(e,29)}static bytes30(e){return Qt(e,30)}static bytes31(e){return Qt(e,31)}static bytes32(e){return Qt(e,32)}static address(e){return new go(ws,"address",e)}static bool(e){return new go(ws,"bool",!!e)}static bytes(e){return new go(ws,"bytes",e)}static string(e){return new go(ws,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new go(ws,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===BC}static dereference(e,n){if(go.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}},ef=new WeakMap,go),oX=class extends Cl{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Mi.dereference(n,"string");try{r=nn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return nn(cs(e.readValue(),20))}},sX=class extends Cl{constructor(n){super(n.name,n.type,"_",n.dynamic);I(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}};function $D(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return pe(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),pe(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else Q(!1,"invalid tuple value","tuple",n);Q(e.length===r.length,"types/value length mismatch","tuple",n);let i=new DE,a=new DE,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function UD(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Gr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Gr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),cD.fromItems(n,r)}let lX=class extends Cl{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);I(this,"coder");I(this,"length");st(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+gX))&&this._throwError("value out-of-bounds",r),i=eD(i,8*ai)}else(iJg(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=Jg(n.readValue(),this.size*8);return this.signed&&(r=gJ(r,this.size*8)),r}},vX=class extends FD{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,sl(Mi.dereference(n,"string")))}decode(e){return Uw(super.decode(e))}},Hv=class extends Cl{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);I(this,"coders");st(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Mi.dereference(r,"tuple");return $D(n,this.coders,i)}decode(n){return UD(n,this.coders)}};function nh(t){return mn(sl(t))}var bX="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";const DC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),LC=4;function wX(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let P=1;P>--l&1}const f=31,h=2**f,d=h>>>1,y=d>>1,p=h-1;let m=0;for(let P=0;P1;){let L=A+k>>>1;P>>1|u(),N=N<<1^d,D=(D^d)<<1|d|1;w=N,x=1+D-N}let E=r-4;return v.map(P=>{switch(P-E){case 3:return E+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return E+256+(t[s++]<<8|t[s++]);case 1:return E+t[s++];default:return P-1}})}function xX(t){let e=0;return()=>t[e++]}function jD(t){return xX(wX(AX(t)))}function AX(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function EX(t){return t&1?~t>>1:t>>1}function SX(t,e){let n=Array(t);for(let r=0,i=0;r{let e=i1(t);if(e.length)return e})}function HD(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(PX(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(OX(n,t))}return e.flat()}function a1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function GD(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function PX(t,e){let n=1+e(),r=e(),i=a1(e);return GD(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function OX(t,e){let n=1+e();return GD(n,1+t,e).map(i=>[i[0],i.slice(1)])}function TX(t){let e=[],n=i1(t);return i(r([]),[]),e;function r(a){let o=t(),s=a1(()=>{let l=i1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function CX(t){return t.toString(16).toUpperCase().padStart(2,"0")}function VD(t){return`{${CX(t)}}`}function kX(t){let e=[];for(let n=0,r=t.length;n>24&255}function WD(t){return t&16777215}let HE,$C,GE,Lb;function LX(){let t=jD(_X);HE=new Map(zD(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),$C=new Set(i1(t)),GE=new Map,Lb=new Map;for(let[e,n]of HD(t)){if(!$C.has(e)&&n.length==2){let[r,i]=n,a=Lb.get(r);a||(a=new Map,Lb.set(r,a)),a.set(i,e)}GE.set(e,n.reverse())}}function JD(t){return t>=o1&&t=jw&&t=zw&&eHw&&e0&&i(Hw+c)}else{let o=GE.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=Xg(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=$X(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function XD(t){return YD(t).map(WD)}function FX(t){return UX(YD(t))}const UC=45,ZD=".",qD=65039,eL=1,Vw=t=>Array.from(t);function s1(t,e){return t.P.has(e)||t.Q.has(e)}let jX=class extends Array{get is_emoji(){return!0}},VE,tL,Du,QE,nL,Td,_6,Mh,xu,FC,KE;function NP(){if(VE)return;let t=jD(bX);const e=()=>i1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));VE=new Map(HD(t)),tL=n(),Du=e(),QE=new Set(e().map(u=>Du[u])),Du=new Set(Du),nL=n(),n();let i=zD(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};Td=a1(u=>{let f=a1(t).map(h=>h+96);if(f.length){let h=u>=a;f[0]-=32,f=xp(f),h&&(f=`Restricted[${f}]`);let d=o(),y=o(),p=!t();return{N:f,P:d,Q:y,M:p,R:h}}}),_6=n(),Mh=new Map;let s=e().concat(Vw(_6)).sort((u,f)=>u-f);s.forEach((u,f)=>{let h=t(),d=s[f]=h?s[f-h]:{V:[],M:new Map};d.V.push(u),_6.has(u)||Mh.set(u,d)});for(let{V:u,M:f}of new Set(Mh.values())){let h=[];for(let y of u){let p=Td.filter(v=>s1(v,y)),m=h.find(({G:v})=>p.some(w=>v.has(w)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(y),r(m.G,p)}let d=h.flatMap(y=>Vw(y.G));for(let{G:y,V:p}of h){let m=new Set(d.filter(v=>!y.has(v)));for(let v of p)f.set(v,m)}}xu=new Set;let l=new Set;const c=u=>xu.has(u)?l.add(u):xu.add(u);for(let u of Td){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of xu)!Mh.has(u)&&!l.has(u)&&Mh.set(u,eL);r(xu,XD(xu)),FC=TX(t).map(u=>jX.from(u)).sort(NX),KE=new Map;for(let u of FC){let f=[KE];for(let h of u){let d=f.map(y=>{let p=y.get(h);return p||(p=new Map,y.set(h,p)),p});h===qD?f.push(...d):f=d}for(let h of f)h.V=u}}function _P(t){return(rL(t)?"":`${IP(L2([t]))} `)+VD(t)}function IP(t){return`"${t}"‎`}function zX(t){if(t.length>=4&&t[2]==UC&&t[3]==UC)throw new Error(`invalid label extension: "${xp(t.slice(0,4))}"`)}function HX(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function GX(t){let e=t[0],n=DC.get(e);if(n)throw Ay(`leading ${n}`);let r=t.length,i=-1;for(let a=1;ae&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,a=t.length;for(let o=0;o{let a=kX(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=ZX(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(HX(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))zX(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(Du.has(u[0]))throw Ay("leading combining mark");for(let p=1;po.has(s)):Vw(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>s1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function JX(t){let e=Td;for(let n of t){let r=e.filter(i=>s1(i,n));if(!r.length)throw Td.some(i=>s1(i,n))?aL(e[0],n):iL(n);if(e=r,r.length==1)break}return e}function YX(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${IP(L2(e,63))}: ${i}`)}return xp(r)}).join(ZD)}function iL(t){return new Error(`disallowed character: ${_P(t)}`)}function aL(t,e){let n=_P(e),r=Td.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Ay(t){return new Error(`illegal placement: ${t}`)}function XX(t,e){for(let n of e)if(!s1(t,n))throw aL(t,n);if(t.M){let n=XD(e);for(let r=1,i=n.length;rLC)throw new Error(`excessive non-spacing marks: ${IP(L2(n.slice(r-1,a)))} (${a-r}/${LC})`);r=a}}}function ZX(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=eZ(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(xu.has(o))i.push(o);else{let s=VE.get(o);if(s)i.push(...s);else if(!tL.has(o))throw iL(o)}}}return i.length&&r.push(e(i)),r}function qX(t){return t.filter(e=>e!=qD)}function eZ(t,e){let n=KE,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const oL=new Uint8Array(32);oL.fill(0);function jC(t){return Q(t.length!==0,"invalid ENS name; empty component","comp",t),t}function sL(t){const e=sl(tZ(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{Q(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}function I6(t,e){return{address:nn(t),storageKeys:e.map((n,r)=>(Q(sn(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function dh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(Q(n.length===2,"invalid slot set",`value[${r}]`,n),I6(n[0],n[1])):(Q(n!=null&&typeof n=="object","invalid address-slot set","value",t),I6(n.address,n.storageKeys)));Q(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return I6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function rZ(t){let e;return typeof t=="string"?e=CP.computePublicKey(t,!1):e=t.publicKey,nn(mn("0x"+e.substring(4)).substring(26))}function iZ(t,e){return rZ(CP.recoverPublicKey(t,e))}const cr=BigInt(0),aZ=BigInt(2),oZ=BigInt(27),sZ=BigInt(28),lZ=BigInt(35),cZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function $2(t){return t==="0x"?null:nn(t)}function RP(t,e){try{return dh(t)}catch(n){Q(!1,n.message,e,t)}}function tv(t,e){return t==="0x"?0:Tt(t,e)}function Hn(t,e){if(t==="0x")return cr;const n=Ke(t,e);return Q(n<=cZ,"value exceeds uint size",e,n),n}function hn(t,e){const n=Ke(t,"value"),r=ii(n);return Q(r.length<=32,"value too large",`tx.${e}`,n),r}function MP(t){return dh(t).map(e=>[e.address,e.storageKeys])}function uZ(t,e){Q(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=g(this,tf)!=null||g(this,nf);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&pe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),pe(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),pe(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):n?a.push(2):e?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return yo.from(this)}toJSON(){const e=n=>n==null?null:n.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 yo;if(typeof e=="string"){const r=zt(e);if(r[0]>=127)return yo.from(fZ(r));switch(r[0]){case 1:return yo.from(dZ(r));case 2:return yo.from(hZ(r));case 3:return yo.from(pZ(r))}pe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new yo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=vl.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.hash!=null&&(Q(n.isSigned(),"unsigned transaction cannot define hash","tx",e),Q(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Q(n.isSigned(),"unsigned transaction cannot define from","tx",e),Q(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}},Do=new WeakMap,Vd=new WeakMap,Qd=new WeakMap,Kd=new WeakMap,Wd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd=new WeakMap,qd=new WeakMap,e0=new WeakMap,t0=new WeakMap,tf=new WeakMap,nf=new WeakMap,yo);const cL=new Uint8Array(32);cL.fill(0);const gZ=BigInt(-1),uL=BigInt(0),fL=BigInt(1),yZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function mZ(t){const e=zt(t),n=e.length%32;return n?Gn([e,cL.slice(n)]):Xe(e)}const vZ=cs(fL,32),bZ=cs(uL,32),QC={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},R6=["name","version","chainId","verifyingContract","salt"];function KC(t){return function(e){return Q(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const wZ={name:KC("name"),version:KC("version"),chainId:function(t){const e=Ke(t,"domain.chainId");return Q(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):cd(e)},verifyingContract:function(t){try{return nn(t).toLowerCase()}catch{}Q(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=zt(t,"domain.salt");return Q(e.length===32,'invalid domain value "salt"',"domain.salt",t),Xe(e)}};function M6(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);Q(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=Jg(yZ,n?r-1:r),a=n?(i+fL)*gZ:uL;return function(o){const s=Ke(o,"value");return Q(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),cs(n?eD(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Q(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=zt(r);return Q(i.length===n,`invalid length for ${t}`,"value",r),mZ(r)}}}switch(t){case"address":return function(e){return eh(nn(e),32)};case"bool":return function(e){return e?vZ:bZ};case"bytes":return function(e){return mn(e)};case"string":return function(e){return nh(e)}}return null}function WC(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Gv(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var fm,Rs,n0,e2,hL,Ei;let JC=(Ei=class{constructor(e){R(this,e2);I(this,"primaryType");R(this,fm,void 0);R(this,Rs,void 0);R(this,n0,void 0);O(this,Rs,new Map),O(this,n0,new Map);const n=new Map,r=new Map,i=new Map,a={};Object.keys(e).forEach(l=>{a[l]=e[l].map(({name:c,type:u})=>{let{base:f,index:h}=Gv(u);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:c,type:f+(h||"")}}),n.set(l,new Set),r.set(l,[]),i.set(l,new Set)}),O(this,fm,JSON.stringify(a));for(const l in a){const c=new Set;for(const u of a[l]){Q(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",e),c.add(u.name);const f=Gv(u.type).base;Q(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!M6(f)&&(Q(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);Q(o.length!==0,"missing primary type","types",e),Q(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),st(this,{primaryType:o[0]});function s(l,c){Q(!c.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),c.add(l);for(const u of n.get(l))if(r.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(l)}s(this.primaryType,new Set);for(const[l,c]of i){const u=Array.from(c);u.sort(),g(this,Rs).set(l,WC(l,a[l])+u.map(f=>WC(f,a[f])).join(""))}}get types(){return JSON.parse(g(this,fm))}getEncoder(e){let n=g(this,n0).get(e);return n||(n=te(this,e2,hL).call(this,e),g(this,n0).set(e,n)),n}encodeType(e){const n=g(this,Rs).get(e);return Q(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return mn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(M6(e))return r(e,n);const i=Gv(e).array;if(i)return Q(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(o=>this._visit(i.prefix,o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});Q(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Ei(e)}static getPrimaryType(e){return Ei.from(e).primaryType}static hashStruct(e,n,r){return Ei.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=QC[r];Q(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>R6.indexOf(r.name)-R6.indexOf(i.name)),Ei.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return Gn(["0x1901",Ei.hashDomain(e),Ei.from(n).hash(r)])}static hash(e,n,r){return mn(Ei.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!sn(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=Ei.from(n);o.visit(r,(s,l)=>(s==="address"&&!sn(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){Ei.hashDomain(e);const i={},a=[];R6.forEach(l=>{const c=e[l];c!=null&&(i[l]=wZ[l](c),a.push({name:l,type:QC[l]}))});const o=Ei.from(n);n=o.types;const s=Object.assign({},n);return Q(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return Xe(zt(c));if(l.match(/^u?int/))return Ke(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return Q(typeof c=="string","invalid string","value",c),c}Q(!1,"unsupported type","type",l)})}}},fm=new WeakMap,Rs=new WeakMap,n0=new WeakMap,e2=new WeakSet,hL=function(e){{const i=M6(e);if(i)return i}const n=Gv(e).array;if(n){const i=n.prefix,a=this.getEncoder(i);return o=>{Q(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let s=o.map(a);return g(this,Rs).has(i)&&(s=s.map(mn)),mn(Gn(s))}}const r=this.types[e];if(r){const i=nh(g(this,Rs).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return g(this,Rs).has(l)?mn(c):c});return o.unshift(i),Gn(o)}}Q(!1,`unknown type: ${e}`,"type",e)},Ei);function si(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const xZ="external public payable override",AZ=si(xZ.split(" ")),dL="constant external internal payable private public pure view override",EZ=si(dL.split(" ")),pL="constructor error event fallback function receive struct",gL=si(pL.split(" ")),yL="calldata memory storage payable indexed",SZ=si(yL.split(" ")),PZ="tuple returns",OZ=[pL,yL,PZ,dL].join(" "),TZ=si(OZ.split(" ")),CZ={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},kZ=new RegExp("^(\\s*)"),NZ=new RegExp("^([0-9]+)"),_Z=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),mL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),vL=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var yr,ao,hm,JE,Xp;let kl=(Xp=class{constructor(e){R(this,hm);R(this,yr,void 0);R(this,ao,void 0);O(this,yr,0),O(this,ao,e.slice())}get offset(){return g(this,yr)}get length(){return g(this,ao).length-g(this,yr)}clone(){return new Xp(g(this,ao))}reset(){O(this,yr,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=te(this,hm,JE).call(this,g(this,yr)+1,e.match+1);return O(this,yr,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;g(this,yr)=g(this,ao).length)throw new Error("out-of-bounds");return g(this,ao)[g(this,yr)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return ms(this,yr)._++,e}toString(){const e=[];for(let n=g(this,yr);n`}},yr=new WeakMap,ao=new WeakMap,hm=new WeakSet,JE=function(e=0,n=0){return new Xp(g(this,ao).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))},Xp);function iu(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Tt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(_Z),s){if(l.text=s[1],a+=l.text.length,TZ.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(vL)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(NZ),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new kl(e.map(o=>Object.freeze(o)))}function YC(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function U2(t,e){if(e.peekKeyword(gL)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function bl(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function bL(t){let e=bl(t,EZ);return YC(e,si("constant payable nonpayable".split(" "))),YC(e,si("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 ll(t,e){return t.popParams().map(n=>di.from(n,e))}function wL(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Ke(t.pop().text);throw new Error("invalid gas")}return null}function rh(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const IZ=new RegExp(/^(.*)\[([0-9]*)\]$/);function XC(t){const e=t.match(vL);if(Q(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);Q(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);Q(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const An={},Di=Symbol.for("_ethers_internal"),ZC="_ParamTypeInternal",qC="_ErrorInternal",ek="_EventInternal",tk="_ConstructorInternal",nk="_FallbackInternal",rk="_FunctionInternal",ik="_StructInternal";var r0,$b,Si;let di=(Si=class{constructor(e,n,r,i,a,o,s,l){R(this,r0);I(this,"name");I(this,"type");I(this,"baseType");I(this,"indexed");I(this,"components");I(this,"arrayLength");I(this,"arrayChildren");if(N2(e,An,"ParamType"),Object.defineProperty(this,Di,{value:ZC}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");st(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){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 r=this;return e.map(i=>r.arrayChildren.walk(i,n))}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 r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return te(this,r0,$b).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(Si.isParamType(e))return e;if(typeof e=="string")try{return Si.from(iu(e),n)}catch{Q(!1,"invalid param type","obj",e)}else if(e instanceof kl){let s="",l="",c=null;bl(e,si(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>Si.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=XC(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new Si(An,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(bl(e,SZ).has("indexed")){if(!n)throw new Error("");h=!0}const y=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Si(An,y,s,l,h,c,f,u)}const r=e.name;Q(!r||typeof r=="string"&&r.match(mL),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(Q(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(IZ);if(o){const s=parseInt(o[2]||"-1"),l=Si.from({type:o[1],components:e.components});return new Si(An,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>Si.from(c)):null;return new Si(An,r||"",a,"tuple",i,s,null,null)}return a=XC(e.type),new Si(An,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Di]===ZC}},r0=new WeakSet,$b=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;te(u=o,r0,$b).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;te(u=o[c],r0,$b).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)},Si),F2=class YE{constructor(e,n,r){I(this,"type");I(this,"inputs");N2(e,An,"Fragment"),r=Object.freeze(r.slice()),st(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{YE.from(JSON.parse(e))}catch{}return YE.from(iu(e))}if(e instanceof kl)switch(e.peekKeyword(gL)){case"constructor":return Fb.from(e);case"error":return Os.from(e);case"event":return Ub.from(e);case"fallback":case"receive":return ak.from(e);case"function":return jb.from(e);case"struct":return B6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Fb.from(e);case"error":return Os.from(e);case"event":return Ub.from(e);case"fallback":case"receive":return ak.from(e);case"function":return jb.from(e);case"struct":return B6.from(e)}pe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Q(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Fb.isFragment(e)}static isError(e){return Os.isFragment(e)}static isEvent(e){return Ub.isFragment(e)}static isFunction(e){return jb.isFragment(e)}static isStruct(e){return B6.isFragment(e)}},j2=class extends F2{constructor(n,r,i,a){super(n,r,a);I(this,"name");Q(typeof i=="string"&&i.match(mL),"invalid identifier","name",i),a=Object.freeze(a.slice()),st(this,{name:i})}};function l1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}let Os=class Zg extends j2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Di,{value:qC})}get selector(){return nh(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(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+l1(e,this.inputs)),n.join(" ")}static from(e){if(Zg.isFragment(e))return e;if(typeof e=="string")return Zg.from(iu(e));if(e instanceof kl){const n=U2("error",e),r=ll(e);return rh(e),new Zg(An,n,r)}return new Zg(An,e.name,e.inputs?e.inputs.map(di.from):[])}static isFragment(e){return e&&e[Di]===qC}},Ub=class Bh extends j2{constructor(n,r,i,a){super(n,"event",r,i);I(this,"anonymous");Object.defineProperty(this,Di,{value:ek}),st(this,{anonymous:a})}get topicHash(){return nh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+l1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>di.from(a)),new Bh(An,n,r,!1).topicHash}static from(n){if(Bh.isFragment(n))return n;if(typeof n=="string")try{return Bh.from(iu(n))}catch{Q(!1,"invalid event fragment","obj",n)}else if(n instanceof kl){const r=U2("event",n),i=ll(n,!0),a=!!bl(n,si(["anonymous"])).has("anonymous");return rh(n),new Bh(An,r,i,a)}return new Bh(An,n.name,n.inputs?n.inputs.map(r=>di.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[Di]===ek}},Fb=class qg extends F2{constructor(n,r,i,a,o){super(n,r,i);I(this,"payable");I(this,"gas");Object.defineProperty(this,Di,{value:tk}),st(this,{payable:a,gas:o})}format(n){if(pe(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="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(n)))});const r=[`constructor${l1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(qg.isFragment(n))return n;if(typeof n=="string")try{return qg.from(iu(n))}catch{Q(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof kl){bl(n,si(["constructor"]));const r=ll(n),i=!!bl(n,AZ).has("payable"),a=wL(n);return rh(n),new qg(An,"constructor",r,i,a)}return new qg(An,"constructor",n.inputs?n.inputs.map(di.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Di]===tk}},ak=class Au extends F2{constructor(n,r,i){super(n,"fallback",r);I(this,"payable");Object.defineProperty(this,Di,{value:nk}),st(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Au.isFragment(n))return n;if(typeof n=="string")try{return Au.from(iu(n))}catch{Q(!1,"invalid fallback fragment","obj",n)}else if(n instanceof kl){const r=n.toString(),i=n.peekKeyword(si(["fallback","receive"]));if(Q(i,"type must be fallback or receive","obj",r),n.popKeyword(si(["fallback","receive"]))==="receive"){const l=ll(n);return Q(l.length===0,"receive cannot have arguments","obj.inputs",l),bl(n,si(["payable"])),rh(n),new Au(An,[],!0)}let o=ll(n);o.length?Q(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[di.from("bytes")];const s=bL(n);if(Q(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),bl(n,si(["returns"])).has("returns")){const l=ll(n);Q(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return rh(n),new Au(An,o,s==="payable")}if(n.type==="receive")return new Au(An,[],!0);if(n.type==="fallback"){const r=[di.from("bytes")],i=n.stateMutability==="payable";return new Au(An,r,i)}Q(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Di]===nk}},jb=class Dh extends j2{constructor(n,r,i,a,o,s){super(n,"function",r,a);I(this,"constant");I(this,"outputs");I(this,"stateMutability");I(this,"payable");I(this,"gas");Object.defineProperty(this,Di,{value:rk}),o=Object.freeze(o.slice()),st(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return nh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="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(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+l1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(l1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>di.from(a)),new Dh(An,n,"view",r,[],null).selector}static from(n){if(Dh.isFragment(n))return n;if(typeof n=="string")try{return Dh.from(iu(n))}catch{Q(!1,"invalid function fragment","obj",n)}else if(n instanceof kl){const i=U2("function",n),a=ll(n),o=bL(n);let s=[];bl(n,si(["returns"])).has("returns")&&(s=ll(n));const l=wL(n);return rh(n),new Dh(An,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new Dh(An,n.name,r,n.inputs?n.inputs.map(di.from):[],n.outputs?n.outputs.map(di.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Di]===rk}},B6=class zb extends j2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Di,{value:ik})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return zb.from(iu(e))}catch{Q(!1,"invalid struct fragment","obj",e)}else if(e instanceof kl){const n=U2("struct",e),r=ll(e);return rh(e),new zb(An,n,r)}return new zb(An,e.name,e.inputs?e.inputs.map(di.from):[])}static isFragment(e){return e&&e[Di]===ik}};const To=new Map;To.set(0,"GENERIC_PANIC");To.set(1,"ASSERT_FALSE");To.set(17,"OVERFLOW");To.set(18,"DIVIDE_BY_ZERO");To.set(33,"ENUM_RANGE_ERROR");To.set(34,"BAD_STORAGE_DATA");To.set(49,"STACK_UNDERFLOW");To.set(50,"ARRAY_RANGE_ERROR");To.set(65,"OUT_OF_MEMORY");To.set(81,"UNINITIALIZED_FUNCTION_CALL");const RZ=new RegExp(/^bytes([0-9]*)$/),MZ=new RegExp(/^(u?int)([0-9]*)$/);let D6=null,ok=1024;function BZ(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=zt(n);if(n=Xe(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Xe(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Xe(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${To.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?nn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=nn(e.from)),Qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var rc,Lh,Zp;let XE=(Zp=class{constructor(){R(this,rc)}getDefaultValue(e){const n=e.map(i=>te(this,rc,Lh).call(this,di.from(i)));return new Hv(n,"_").defaultValue()}encode(e,n){X7(n.length,e.length,"types/values length mismatch");const r=e.map(o=>te(this,rc,Lh).call(this,di.from(o))),i=new Hv(r,"_"),a=new DE;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>te(this,rc,Lh).call(this,di.from(o)));return new Hv(i,"_").decode(new MJ(n,r,ok))}static _setDefaultMaxInflation(e){Q(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),ok=e}static defaultAbiCoder(){return D6==null&&(D6=new Zp),D6}static getBuiltinCallException(e,n,r){return BZ(e,n,r,Zp.defaultAbiCoder())}},rc=new WeakSet,Lh=function(e){if(e.isArray())return new lX(te(this,rc,Lh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Hv(e.components.map(r=>te(this,rc,Lh).call(this,r)),e.name);switch(e.baseType){case"address":return new oX(e.name);case"bool":return new cX(e.name);case"string":return new vX(e.name);case"bytes":return new uX(e.name);case"":return new dX(e.name)}let n=e.type.match(MZ);if(n){let r=parseInt(n[2]||"256");return Q(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new mX(r/8,n[1]==="int",e.name)}if(n=e.type.match(RZ),n){let r=parseInt(n[1]);return Q(r!==0&&r<=32,"invalid bytes length","param",e),new fX(r,e.name)}Q(!1,"invalid type","type",e.type)},Zp),DZ=class{constructor(e,n,r){I(this,"fragment");I(this,"name");I(this,"signature");I(this,"topic");I(this,"args");const i=e.name,a=e.format();st(this,{fragment:e,name:i,signature:a,topic:n,args:r})}},LZ=class{constructor(e,n,r,i){I(this,"fragment");I(this,"name");I(this,"args");I(this,"signature");I(this,"selector");I(this,"value");const a=e.name,o=e.format();st(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}},$Z=class{constructor(e,n,r){I(this,"fragment");I(this,"name");I(this,"args");I(this,"signature");I(this,"selector");const i=e.name,a=e.format();st(this,{fragment:e,name:i,args:r,signature:a,selector:n})}},sk=class{constructor(e){I(this,"hash");I(this,"_isIndexed");st(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const lk={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"},ck={"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&&lk[t.toString()]&&(e=lk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Lo,$o,Uo,Mr,i0,Hb,a0,Gb,Dc;let DP=(Dc=class{constructor(e){R(this,i0);R(this,a0);I(this,"fragments");I(this,"deploy");I(this,"fallback");I(this,"receive");R(this,Lo,void 0);R(this,$o,void 0);R(this,Uo,void 0);R(this,Mr,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,Uo,new Map),O(this,Lo,new Map),O(this,$o,new Map);const r=[];for(const o of n)try{r.push(F2.from(o))}catch(s){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,s.message)}st(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Mr,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}st(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(Q(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=g(this,Uo);break;case"event":l=g(this,$o);break;case"error":l=g(this,Lo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||st(this,{deploy:Fb.from("constructor()")}),st(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return XE.defaultAbiCoder()}getFunctionName(e){const n=te(this,i0,Hb).call(this,e,null,!1);return Q(n,"no matching function","key",e),n.name}hasFunction(e){return!!te(this,i0,Hb).call(this,e,null,!1)}getFunction(e,n){return te(this,i0,Hb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(g(this,Uo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Q(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=Os.from(e).format(),e==="Error(string)")return Os.from("error Error(string)");if(e==="Panic(uint256)")return Os.from("error Panic(uint256)");const r=g(this,Lo).get(e);return r||null}forEachError(e){const n=Array.from(g(this,Lo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?nh(o):a.type==="bytes"?mn(Xe(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=cs(o):a.type.match(/^bytes/)?o=pJ(o,32):a.type==="address"&&g(this,Mr).encode(["address"],[o]),eh(Xe(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){Q(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?Q(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);Q(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),Q(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(nh(l));else if(o.type==="bytes")r.push(mn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(g(this,Mr).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:g(this,Mr).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);Q(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;Q(sn(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,y)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(di.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?g(this,Mr).decode(i,Gn(r)):null,l=g(this,Mr).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,y)=>{let p=null;if(d.indexed)if(s==null)p=new sk(null);else if(o[y])p=new sk(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),cD.fromItems(c,u)}parseTransaction(e){const n=zt(e.data,"tx.data"),r=Ke(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Xe(n.slice(0,4)));if(!i)return null;const a=g(this,Mr).decode(i.inputs,n.slice(4));return new LZ(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new DZ(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=Xe(e),r=this.getError(Rn(n,0,4));if(!r)return null;const i=g(this,Mr).decode(r.inputs,Rn(n,4));return new $Z(r,r.selector,i)}static from(e){return e instanceof Dc?e:typeof e=="string"?new Dc(JSON.parse(e)):typeof e.format=="function"?new Dc(e.format("json")):new Dc(e)}},Lo=new WeakMap,$o=new WeakMap,Uo=new WeakMap,Mr=new WeakMap,i0=new WeakSet,Hb=function(e,n,r){if(sn(e)){const a=e.toLowerCase();for(const o of g(this,Uo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of g(this,Uo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Mi.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Q(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=g(this,Uo).get(jb.from(e).format());return i||null},a0=new WeakSet,Gb=function(e,n,r){if(sn(e)){const a=e.toLowerCase();for(const o of g(this,$o).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of g(this,$o))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Q(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=g(this,$o).get(Ub.from(e).format());return i||null},Dc);const xL=BigInt(0);function Ey(t){return t??null}function Fn(t){return t==null?null:t.toString()}let uk=class{constructor(e,n,r){I(this,"gasPrice");I(this,"maxFeePerGas");I(this,"maxPriorityFeePerGas");st(this,{gasPrice:Ey(e),maxFeePerGas:Ey(n),maxPriorityFeePerGas:Ey(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Fn(e),maxFeePerGas:Fn(n),maxPriorityFeePerGas:Fn(r)}}};function Qw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Xe(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Ke(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Tt(t[i],`request.${i}`));return t.accessList&&(e.accessList=dh(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 Ms,zR;let UZ=(zR=class{constructor(e,n){I(this,"provider");I(this,"number");I(this,"hash");I(this,"timestamp");I(this,"parentHash");I(this,"parentBeaconBlockRoot");I(this,"nonce");I(this,"difficulty");I(this,"gasLimit");I(this,"gasUsed");I(this,"stateRoot");I(this,"receiptsRoot");I(this,"blobGasUsed");I(this,"excessBlobGas");I(this,"miner");I(this,"extraData");I(this,"baseFeePerGas");R(this,Ms,void 0);O(this,Ms,e.transactions.map(r=>typeof r!="string"?new LP(r,n):r)),st(this,{provider:n,hash:Ey(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,extraData:e.extraData,baseFeePerGas:Ey(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return g(this,Ms).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=g(this,Ms).slice();return e.length===0?[]:(pe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,timestamp:y,transactions:p}=this;return{_type:"Block",baseFeePerGas:Fn(e),difficulty:Fn(n),extraData:r,gasLimit:Fn(i),gasUsed:Fn(a),blobGasUsed:Fn(this.blobGasUsed),excessBlobGas:Fn(this.excessBlobGas),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:y,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,transactions:p}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew nv(i,n))));let r=xL;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),st(this,{provider:n,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,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return g(this,dm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Fn(this.cumulativeGasUsed),from:n,gasPrice:Fn(this.gasPrice),blobGasUsed:Fn(this.blobGasUsed),blobGasPrice:Fn(this.blobGasPrice),gasUsed:Fn(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await qr({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;pe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const y=[],p=()=>{y.forEach(v=>v())};if(y.push(()=>{s=!0}),i>0){const v=setTimeout(()=>{p(),d(Qn("wait for transaction timeout","TIMEOUT"))},i);y.push(()=>{clearTimeout(v)})}const m=async v=>{if(await v.confirmations()>=r){p();try{h(c(v))}catch(w){d(w)}}};if(y.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const v=async()=>{try{await l()}catch(w){if(Gr(w,"TRANSACTION_REPLACED")){p(),d(w);return}}s||this.provider.once("block",v)};y.push(()=>{this.provider.off("block",v)}),this.provider.once("block",v)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return pe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),SL(this)}reorderedEvent(e){return pe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),pe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),EL(this,e)}replaceableTransaction(e){Q(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new pm(this,this.provider);return O(n,ic,e),n}},ic=new WeakMap,pm);function FZ(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function EL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function SL(t){return{orphan:"drop-transaction",tx:t}}function jZ(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}}}let $P=class extends nv{constructor(n,r,i){super(n,n.provider);I(this,"interface");I(this,"fragment");I(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);st(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},PL=class extends nv{constructor(n,r){super(n,n.provider);I(this,"error");st(this,{error:r})}};var o0,GR;let zZ=(GR=class extends AL{constructor(n,r,i){super(i,r);R(this,o0,void 0);O(this,o0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?g(this,o0).getEvent(n.topics[0]):null;if(r)try{return new $P(n,g(this,o0),r)}catch(i){return new PL(n,i)}return n})}},o0=new WeakMap,GR);var gm,VR;let UP=(VR=class extends LP{constructor(n,r,i){super(i,r);R(this,gm,void 0);O(this,gm,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new zZ(g(this,gm),this.provider,i)}},gm=new WeakMap,VR),OL=class extends tD{constructor(n,r,i,a){super(n,r,i);I(this,"log");st(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},HZ=class extends OL{constructor(e,n,r,i,a){super(e,n,r,new $P(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);st(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};const fk=BigInt(0);function TL(t){return t&&typeof t.call=="function"}function CL(t){return t&&typeof t.estimateGas=="function"}function z2(t){return t&&typeof t.resolveName=="function"}function kL(t){return t&&typeof t.sendTransaction=="function"}function NL(t){if(t!=null){if(z2(t))return t;if(t.provider)return t.provider}}var ym,QR;let GZ=(QR=class{constructor(e,n,r){R(this,ym,void 0);I(this,"fragment");if(st(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>oi(h,a))):oi(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return g(this,ym)}},ym=new WeakMap,QR);function ih(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Lu(t){return t==null?null:t.provider||null}async function FP(t,e){const n=Mi.dereference(t,"overrides");Q(typeof n=="object","invalid overrides parameter","overrides",t);const r=Qw(n);return Q(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Q(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function _L(t,e,n){const r=ih(t,"resolveName"),i=z2(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Mi.dereference(l,s),s==="address"?oi(l,i):l))))}function VZ(t){const e=async function(o){const s=await FP(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await oi(s.from,NL(t.runner)));const l=t.interface,c=Ke(s.value||fk,"overrides.value")===fk,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&Q(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Q(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return Q(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),Q(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=ih(t.runner,"call");pe(TL(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw mP(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;pe(kL(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=Lu(t.runner);return new UP(t.interface,c,l)},i=async function(o){const s=ih(t.runner,"estimateGas");return pe(CL(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return st(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function QZ(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return pe(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await FP(c.pop()),f.from&&(f.from=await oi(f.from,NL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await _L(t.runner,u.inputs,c);return Object.assign({},f,await qr({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;pe(kL(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=Lu(t.runner);return new UP(t.interface,h,f)},o=async function(...c){const u=ih(t.runner,"estimateGas");return pe(CL(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=ih(t.runner,"call");pe(TL(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(y){throw mP(y)&&y.data?t.interface.makeError(y.data,f):y}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return st(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return pe(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function KZ(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return pe(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new GZ(t,n(...i),i)};return st(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return pe(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const Kw=Symbol.for("_ethersInternal_contract"),IL=new WeakMap;function WZ(t,e){IL.set(t[Kw],e)}function Hi(t){return IL.get(t[Kw])}function JZ(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function jP(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(sn(o,32))return o;const s=t.interface.getEvent(o);return Q(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?sn(e,32)?n=[e]:(r=t.interface.getEvent(e),Q(r,"unknown fragment","event",e),n=[r.topicHash]):JZ(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):Q(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function ey(t,e){const{subs:n}=Hi(t);return n.get((await jP(t,e)).tag)||null}async function hk(t,e,n){const r=Lu(t.runner);pe(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await jP(t,n),{addr:s,subs:l}=Hi(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let v=i;if(v==null)try{v=t.interface.getEvent(m.topics[0])}catch{}if(v){const w=v,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];qE(t,n,x,E=>new HZ(t,E,n,w,m))}else qE(t,n,[],w=>new OL(t,w,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let ZE=Promise.resolve();async function YZ(t,e,n,r){await ZE;const i=await ey(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Hi(t).subs.delete(i.tag)),a>0}async function qE(t,e,n,r){try{await ZE}catch{}const i=YZ(t,e,n,r);return ZE=i,await i}const Vv=["then"];var QSe,Kf;let e3=(Kf=class{constructor(e,n,r,i){I(this,"target");I(this,"interface");I(this,"runner");I(this,"filters");I(this,QSe);I(this,"fallback");Q(typeof e=="string"||LD(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=DP.from(n);st(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,Kw,{value:{}});let o,s=null,l=null;if(i){const f=Lu(r);l=new UP(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(sn(e))s=e,o=Promise.resolve(e);else{const f=ih(r,"resolveName");if(!z2(f))throw Qn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw Qn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Hi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Hi(this).addr=f,f});WZ(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Vv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(y){if(!Gr(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(f,h)=>Vv.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return st(this,{filters:u}),st(this,{fallback:a.receive||a.fallback?VZ(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Vv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(y){if(!Gr(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(f,h)=>typeof h=="symbol"||h in f||Vv.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Kf(this.target,this.interface,e)}attach(e){return new Kf(e,this.interface,this.runner)}async getAddress(){return await Hi(this).addrPromise}async getDeployedCode(){const e=Lu(this.runner);pe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Lu(this.runner);return pe(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Hi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),QZ(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),KZ(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Hi(this),o=i||await a,{fragment:s,topics:l}=await jP(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=Lu(this.runner);return pe(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new $P(f,this.interface,h)}catch(d){return new PL(f,d)}return new nv(f,u)})}async on(e,n){const r=await hk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await hk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await qE(this,e,n,null)}async listenerCount(e){if(e){const i=await ey(this,e);return i?i.listeners.length:0}const{subs:n}=Hi(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await ey(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Hi(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await ey(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Hi(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await ey(this,e);if(!n)return this;n.stop(),Hi(this).subs.delete(n.tag)}else{const{subs:n}=Hi(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Kf{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}},QSe=Kw,Kf);function XZ(){return e3}let Cd=class extends XZ(){};class zP{constructor(e,n,r){I(this,"interface");I(this,"bytecode");I(this,"runner");const i=DP.from(e);n instanceof Uint8Array||(typeof n=="object"&&(n=n.object),n.startsWith("0x")||(n="0x"+n)),n=Xe(zt(n)),st(this,{bytecode:n,interface:i,runner:r||null})}attach(e){return new e3(e,this.interface,this.runner)}async getDeployTransaction(...e){let n={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(n=await FP(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await _L(this.runner,r.inputs,e),a=Gn([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},n,{data:a})}async deploy(...e){const n=await this.getDeployTransaction(...e);pe(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(n),i=DD(r);return new e3(i,this.interface,this.runner,r)}connect(e){return new zP(this.interface,this.bytecode,e)}static fromSolidity(e,n){Q(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const r=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(r,i,n)}}function L6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Q(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}let ZZ=class{constructor(e){I(this,"name");st(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}};const RL=new RegExp("^(ipfs)://(.*)$","i"),dk=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),RL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var ac,rf,oc,$h,t2,Jc,ML;let pk=(Jc=class{constructor(e,n,r){R(this,oc);I(this,"provider");I(this,"address");I(this,"name");R(this,ac,void 0);R(this,rf,void 0);st(this,{provider:e,address:n,name:r}),O(this,ac,null),O(this,rf,new Cd(n,["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 g(this,ac)==null&&O(this,ac,(async()=>{try{return await g(this,rf).supportsInterface("0x9061b923")}catch(e){if(Gr(e,"CALL_EXCEPTION"))return!1;throw O(this,ac,null),e}})()),await g(this,ac)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await te(this,oc,$h).call(this,"addr(bytes32)");return a==null||a===r1?null:a}catch(a){if(Gr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await te(this,oc,$h).call(this,"addr(bytes32,uint)",[a]);if(sn(o,20))return nn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof ZZ&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await te(this,oc,$h).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;pe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await te(this,oc,$h).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await te(this,oc,$h).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${mJ("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;pe(!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 n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function rv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";pe(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function qZ(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Q(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Ep(t){return Q(sn(t,!0),"invalid data","value",t),t}function Hr(t){return Q(sn(t,32),"invalid hash","value",t),t}const eq=rv({address:nn,blockHash:Hr,blockNumber:Tt,data:Ep,index:Tt,removed:Ft(qZ,!1),topics:H2(Hr),transactionHash:Hr,transactionIndex:Tt},{index:["logIndex"]});function tq(t){return eq(t)}const nq=rv({hash:Ft(Hr),parentHash:Hr,parentBeaconBlockRoot:Ft(Hr,null),number:Tt,timestamp:Tt,nonce:Ft(Ep),difficulty:Ke,gasLimit:Ke,gasUsed:Ke,stateRoot:Ft(Hr,null),receiptsRoot:Ft(Hr,null),blobGasUsed:Ft(Ke,null),excessBlobGas:Ft(Ke,null),miner:Ft(nn),extraData:Ep,baseFeePerGas:Ft(Ke)});function rq(t){const e=nq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:BL(n)),e}const iq=rv({transactionIndex:Tt,blockNumber:Tt,transactionHash:Hr,address:nn,topics:H2(Hr),data:Ep,index:Tt,blockHash:Hr},{index:["logIndex"]});function aq(t){return iq(t)}const oq=rv({to:Ft(nn,null),from:Ft(nn,null),contractAddress:Ft(nn,null),index:Tt,root:Ft(Xe),gasUsed:Ke,blobGasUsed:Ft(Ke,null),logsBloom:Ft(Ep),blockHash:Hr,hash:Hr,logs:H2(aq),blockNumber:Tt,cumulativeGasUsed:Ke,effectiveGasPrice:Ft(Ke),blobGasPrice:Ft(Ke,null),status:Ft(Tt),type:Ft(Tt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function sq(t){return oq(t)}function BL(t){t.to&&Ke(t.to)===gk&&(t.to="0x0000000000000000000000000000000000000000");const e=rv({hash:Hr,index:Ft(Tt,void 0),type:n=>n==="0x"||n==null?0:Tt(n),accessList:Ft(dh,null),blobVersionedHashes:Ft(H2(Hr,!0),null),blockHash:Ft(Hr,null),blockNumber:Ft(Tt,null),transactionIndex:Ft(Tt,null),from:nn,gasPrice:Ft(Ke),maxPriorityFeePerGas:Ft(Ke),maxFeePerGas:Ft(Ke),maxFeePerBlobGas:Ft(Ke,null),gasLimit:Ke,to:Ft(nn,null),value:Ke,nonce:Tt,data:Ep,creates:Ft(nn,null),chainId:Ft(Ke,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=DD(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=vl.from(t.signature):e.signature=vl.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&Ke(e.blockHash)===gk&&(e.blockHash=null),e}const lq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let HP=class DL{constructor(e){I(this,"name");st(this,{name:e})}clone(){return new DL(this.name)}},LL=class $L extends HP{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);I(this,"effectiveBlock");I(this,"txBase");I(this,"txCreate");I(this,"txDataZero");I(this,"txDataNonzero");I(this,"txAccessListStorageKey");I(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),Q(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),st(this,i)}clone(){return new $L(this.effectiveBlock,this)}},UL=class FL extends HP{constructor(n,r){super("org.ethers.plugins.network.Ens");I(this,"address");I(this,"targetNetwork");st(this,{address:n||lq,targetNetwork:r??1})}clone(){return new FL(this.address,this.targetNetwork)}};var mm,vm,KR;let cq=(KR=class extends HP{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");R(this,mm,void 0);R(this,vm,void 0);O(this,mm,n),O(this,vm,r)}get url(){return g(this,mm)}get processFunc(){return g(this,vm)}clone(){return this}},mm=new WeakMap,vm=new WeakMap,KR);const $6=new Map;var s0,l0,sc,Lc;let Rc=(Lc=class{constructor(e,n){R(this,s0,void 0);R(this,l0,void 0);R(this,sc,void 0);O(this,s0,e),O(this,l0,Ke(n)),O(this,sc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return g(this,s0)}set name(e){O(this,s0,e)}get chainId(){return g(this,l0)}set chainId(e){O(this,l0,Ke(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Ke(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Ke(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Ke(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(g(this,sc).values())}attachPlugin(e){if(g(this,sc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return g(this,sc).set(e.name,e.clone()),this}getPlugin(e){return g(this,sc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Lc(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new LL;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function mk(t){return new cq(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:yk(s.maxFee,9),maxPriorityFeePerGas:yk(s.maxPriorityFee,9)}}catch(a){pe(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let vk=!1;function uq(){if(vk)return;vk=!0;function t(e,n,r){const i=function(){const a=new Rc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new UL(null,r.ensNetwork)),a.attachPlugin(new LL),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};Rc.register(e,i),Rc.register(n,i),r.altNames&&r.altNames.forEach(a=>{Rc.register(a,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("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[mk("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[mk("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function t3(t){return JSON.parse(JSON.stringify(t))}var Bs,xa,lc,Fo,c0,Vb,WR;let fq=(WR=class{constructor(e){R(this,c0);R(this,Bs,void 0);R(this,xa,void 0);R(this,lc,void 0);R(this,Fo,void 0);O(this,Bs,e),O(this,xa,null),O(this,lc,4e3),O(this,Fo,-2)}get pollingInterval(){return g(this,lc)}set pollingInterval(e){O(this,lc,e)}start(){g(this,xa)||(O(this,xa,g(this,Bs)._setTimeout(te(this,c0,Vb).bind(this),g(this,lc))),te(this,c0,Vb).call(this))}stop(){g(this,xa)&&(g(this,Bs)._clearTimeout(g(this,xa)),O(this,xa,null))}pause(e){this.stop(),e&&O(this,Fo,-2)}resume(){this.start()}},Bs=new WeakMap,xa=new WeakMap,lc=new WeakMap,Fo=new WeakMap,c0=new WeakSet,Vb=async function(){try{const e=await g(this,Bs).getBlockNumber();if(g(this,Fo)===-2){O(this,Fo,e);return}if(e!==g(this,Fo)){for(let n=g(this,Fo)+1;n<=e;n++){if(g(this,xa)==null)return;await g(this,Bs).emit("block",n)}O(this,Fo,e)}}catch{}g(this,xa)!=null&&O(this,xa,g(this,Bs)._setTimeout(te(this,c0,Vb).bind(this),g(this,lc)))},WR);var af,of,cc,JR;let GP=(JR=class{constructor(e){R(this,af,void 0);R(this,of,void 0);R(this,cc,void 0);O(this,af,e),O(this,cc,!1),O(this,of,n=>{this._poll(n,g(this,af))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){g(this,cc)||(O(this,cc,!0),g(this,of).call(this,-2),g(this,af).on("block",g(this,of)))}stop(){g(this,cc)&&(O(this,cc,!1),g(this,af).off("block",g(this,of)))}pause(e){this.stop()}resume(){this.start()}},af=new WeakMap,of=new WeakMap,cc=new WeakMap,JR);var u0,Ds,YR;let hq=(YR=class extends GP{constructor(n,r){super(n);R(this,u0,void 0);R(this,Ds,void 0);O(this,u0,r),O(this,Ds,-2)}pause(n){n&&O(this,Ds,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(g(this,u0));i!=null&&(g(this,Ds)===-2?O(this,Ds,i.number):i.number>g(this,Ds)&&(r.emit(g(this,u0),i.number),O(this,Ds,i.number)))}},u0=new WeakMap,Ds=new WeakMap,YR);var n2,XR;let dq=(XR=class extends GP{constructor(n,r){super(n);R(this,n2,void 0);O(this,n2,t3(r))}async _poll(n,r){throw new Error("@TODO")}},n2=new WeakMap,XR);var f0,ZR;let pq=(ZR=class extends GP{constructor(n,r){super(n);R(this,f0,void 0);O(this,f0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(g(this,f0));i&&r.emit(g(this,f0),i)}},f0=new WeakMap,ZR);var Ls,h0,d0,uc,Aa,r2,jL,qR;let VP=(qR=class{constructor(e,n){R(this,r2);R(this,Ls,void 0);R(this,h0,void 0);R(this,d0,void 0);R(this,uc,void 0);R(this,Aa,void 0);O(this,Ls,e),O(this,h0,t3(n)),O(this,d0,te(this,r2,jL).bind(this)),O(this,uc,!1),O(this,Aa,-2)}start(){g(this,uc)||(O(this,uc,!0),g(this,Aa)===-2&&g(this,Ls).getBlockNumber().then(e=>{O(this,Aa,e)}),g(this,Ls).on("block",g(this,d0)))}stop(){g(this,uc)&&(O(this,uc,!1),g(this,Ls).off("block",g(this,d0)))}pause(e){this.stop(),e&&O(this,Aa,-2)}resume(){this.start()}},Ls=new WeakMap,h0=new WeakMap,d0=new WeakMap,uc=new WeakMap,Aa=new WeakMap,r2=new WeakSet,jL=async function(e){if(g(this,Aa)===-2)return;const n=t3(g(this,h0));n.fromBlock=g(this,Aa)+1,n.toBlock=e;const r=await g(this,Ls).getLogs(n);if(r.length===0){g(this,Aa){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}let zL=class{constructor(e){I(this,"name");st(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function mq(t){return JSON.parse(JSON.stringify(t))}function n3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function U6(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"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(sn(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Qb("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Qb("orphan",n),filter:mq(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?n3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{sn(s)?i.push(s):a.push((async()=>{i.push(await oi(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=n3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:Qb("event",r),type:"event"}}Q(!1,"unknown ProviderEvent","event",t)}function F6(){return new Date().getTime()}const vq={cacheTimeout:250,pollingInterval:4e3};var Br,fc,Dr,p0,Ji,sf,hc,$s,bm,Ea,g0,y0,Yr,ji,wm,r3,xm,i3,lf,ty,Am,a3,cf,ny,m0,Kb,eM;let bq=(eM=class{constructor(e,n){R(this,Yr);R(this,wm);R(this,xm);R(this,lf);R(this,Am);R(this,cf);R(this,m0);R(this,Br,void 0);R(this,fc,void 0);R(this,Dr,void 0);R(this,p0,void 0);R(this,Ji,void 0);R(this,sf,void 0);R(this,hc,void 0);R(this,$s,void 0);R(this,bm,void 0);R(this,Ea,void 0);R(this,g0,void 0);R(this,y0,void 0);if(O(this,y0,Object.assign({},vq,n||{})),e==="any")O(this,sf,!0),O(this,Ji,null);else if(e){const r=Rc.from(e);O(this,sf,!1),O(this,Ji,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,sf,!1),O(this,Ji,null);O(this,$s,-1),O(this,hc,new Map),O(this,Br,new Map),O(this,fc,new Map),O(this,Dr,null),O(this,p0,!1),O(this,bm,1),O(this,Ea,new Map),O(this,g0,!1)}get pollingInterval(){return g(this,y0).pollingInterval}get provider(){return this}get plugins(){return Array.from(g(this,fc).values())}attachPlugin(e){if(g(this,fc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return g(this,fc).set(e.name,e.connect(this)),this}getPlugin(e){return g(this,fc).get(e)||null}get disableCcipRead(){return g(this,g0)}set disableCcipRead(e){O(this,g0,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}pe(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new UZ(rq(e),this)}_wrapLog(e,n){return new nv(tq(e),this)}_wrapTransactionReceipt(e,n){return new AL(sq(e),this)}_wrapTransactionResponse(e,n){return new LP(BL(e),this)}_detectNetwork(){pe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){pe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Tt(await te(this,Yr,ji).call(this,{method:"getBlockNumber"}),"%response");return g(this,$s)>=0&&O(this,$s,e),e}_getAddress(e){return oi(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(sn(e))return sn(e,32)?e:cd(e);if(typeof e=="bigint"&&(e=Tt(e,"blockTag")),typeof e=="number")return e>=0?cd(e):g(this,$s)>=0?cd(g(this,$s)+e):this.getBlockNumber().then(n=>cd(n+e));Q(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?n3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=Qw(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=oi(n[i],this);Qv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);Qv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(g(this,Ji)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw g(this,Ji)===i&&O(this,Ji,null),a}})();return O(this,Ji,i),(await i).clone()}const e=g(this,Ji),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(g(this,sf)?(this.emit("network",r,n),g(this,Ji)===e&&O(this,Ji,Promise.resolve(r))):pe(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await qr({_block:te(this,Am,a3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await te(this,Yr,ji).call(this,{method:"getGasPrice"});return Ke(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await te(this,Yr,ji).call(this,{method:"getPriorityFee"});return Ke(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*gq+l),new uk(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new th(r.url),a=await r.processFunc(n,this,i);return new uk(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Qv(n)&&(n=await n),Ke(await te(this,Yr,ji).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await qr({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await te(this,xm,i3).call(this,te(this,wm,r3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return Ke(await te(this,lf,ty).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Tt(await te(this,lf,ty).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return Xe(await te(this,lf,ty).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=Ke(n,"position");return Xe(await te(this,lf,ty).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await qr({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=lL.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await qr({network:this.getNetwork(),params:te(this,Am,a3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await qr({network:this.getNetwork(),params:te(this,Yr,ji).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await qr({network:this.getNetwork(),params:te(this,Yr,ji).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await te(this,Yr,ji).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await qr({network:this.getNetwork(),result:te(this,Yr,ji).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:Xe(n)}async getLogs(e){let n=this._getFilter(e);Qv(n)&&(n=await n);const{network:r,params:i}=await qr({network:this.getNetwork(),params:te(this,Yr,ji).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){pe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await pk.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=nn(e);const n=WE(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await pk.getEnsAddress(this),a=await new Cd(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===r1)return null;const s=await new Cd(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Gr(r,"BAD_DATA")&&r.value==="0x"||Gr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(Qn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){pe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=g(this,Ea).get(e);n&&(n.timer&&clearTimeout(n.timer),g(this,Ea).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=ms(this,bm)._++,i=()=>{g(this,Ea).delete(r),e()};if(this.paused)g(this,Ea).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);g(this,Ea).set(r,{timer:a,func:i,time:F6()})}return r}_forEachSubscriber(e){for(const n of g(this,Br).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new zL(e.type);case"block":{const n=new fq(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new hq(this,e.type);case"event":return new VP(this,e.filter);case"transaction":return new pq(this,e.hash);case"orphan":return new dq(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of g(this,Br).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),g(this,Dr)!=null&&n.pause(g(this,Dr));break}}async on(e,n){const r=await te(this,m0,Kb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,g(this,Dr)!=null&&r.subscriber.pause(g(this,Dr))),this}async once(e,n){const r=await te(this,m0,Kb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,g(this,Dr)!=null&&r.subscriber.pause(g(this,Dr))),this}async emit(e,...n){const r=await te(this,cf,ny).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new tD(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),g(this,Br).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await te(this,cf,ny).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of g(this,Br).values())n+=r.length;return n}async listeners(e){if(e){const r=await te(this,cf,ny).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of g(this,Br).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await te(this,cf,ny).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),g(this,Br).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await te(this,m0,Kb).call(this,e);r&&i.stop(),g(this,Br).delete(n)}else for(const[n,{started:r,subscriber:i}]of g(this,Br))r&&i.stop(),g(this,Br).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return g(this,p0)}destroy(){this.removeAllListeners();for(const e of g(this,Ea).keys())this._clearTimeout(e);O(this,p0,!0)}get paused(){return g(this,Dr)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,$s,-1),g(this,Dr)!=null){if(g(this,Dr)==!!e)return;pe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,Dr,!!e);for(const n of g(this,Ea).values())n.timer&&clearTimeout(n.timer),n.time=F6()-n.time}resume(){if(g(this,Dr)!=null){this._forEachSubscriber(e=>e.resume()),O(this,Dr,null);for(const e of g(this,Ea).values()){let n=e.time;n<0&&(n=0),e.time=F6(),setTimeout(e.func,n)}}}},Br=new WeakMap,fc=new WeakMap,Dr=new WeakMap,p0=new WeakMap,Ji=new WeakMap,sf=new WeakMap,hc=new WeakMap,$s=new WeakMap,bm=new WeakMap,Ea=new WeakMap,g0=new WeakMap,y0=new WeakMap,Yr=new WeakSet,ji=async function(e){const n=g(this,y0).cacheTimeout;if(n<0)return await this._perform(e);const r=Qb(e.method,e);let i=g(this,hc).get(r);return i||(i=this._perform(e),g(this,hc).set(r,i),setTimeout(()=>{g(this,hc).get(r)===i&&g(this,hc).delete(r)},n)),await i},wm=new WeakSet,r3=async function(e,n,r){pe(r=0&&n==="latest"&&i.to!=null&&Rn(a.data,0,4)==="0x556f1830"){const o=a.data,s=await oi(i.to,this);let l;try{l=Sq(Rn(a.data,4))}catch(f){pe(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}pe(l.sender.toLowerCase()===s.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 c=await this.ccipReadFetch(i,l.calldata,l.urls);pe(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:Gn([l.selector,Eq([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await te(this,wm,r3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},xm=new WeakSet,i3=async function(e){const{value:n}=await qr({network:this.getNetwork(),value:e});return n},lf=new WeakSet,ty=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await te(this,xm,i3).call(this,te(this,Yr,ji).call(this,Object.assign(e,{address:i,blockTag:a})))},Am=new WeakSet,a3=async function(e,n){if(sn(e,32))return await te(this,Yr,ji).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await te(this,Yr,ji).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},cf=new WeakSet,ny=async function(e,n){let r=await U6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await U6({orphan:"drop-log",log:n[0]},this)),g(this,Br).get(r.tag)||null},m0=new WeakSet,Kb=async function(e){const n=await U6(e,this),r=n.tag;let i=g(this,Br).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},g(this,Br).set(r,i)),i},eM);function wq(t,e){try{const n=o3(t,e);if(n)return Uw(n)}catch{}return null}function o3(t,e){if(t==="0x")return null;try{const n=Tt(Rn(t,e,e+32)),r=Tt(Rn(t,n,n+32));return Rn(t,n+32,n+32+r)}catch{}return null}function bk(t){const e=ii(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function xq(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Aq=new Uint8Array([]);function Eq(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Rn(t,0,32);pe(Rn(n,0,12)===Rn(wk,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Rn(n,12);try{const r=[],i=Tt(Rn(t,32,64)),a=Tt(Rn(t,i,i+32)),o=Rn(t,i+32);for(let s=0;se[r]),e}function Oh(t,e){if(t.provider)return t.provider;pe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function xk(t,e){let n=Qw(e);if(n.to!=null&&(n.to=oi(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),oi(r,t)]).then(([i,a])=>(Q(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await qr(n)}let Pq=class{constructor(e){I(this,"provider");st(this,{provider:e||null})}async getNonce(e){return Oh(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await xk(this,e)}async populateTransaction(e){const n=Oh(this,"populateTransaction"),r=await xk(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=Ke(r.chainId);Q(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Q(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&Q(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();pe(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.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=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(pe(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):pe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await qr(r)}async estimateGas(e){return Oh(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Oh(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Oh(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Oh(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=lL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function Oq(t){return JSON.parse(JSON.stringify(t))}var vi,jo,uf,dc,ff,v0,Em,s3,Sm,l3,tM;let HL=(tM=class{constructor(e){R(this,Em);R(this,Sm);R(this,vi,void 0);R(this,jo,void 0);R(this,uf,void 0);R(this,dc,void 0);R(this,ff,void 0);R(this,v0,void 0);O(this,vi,e),O(this,jo,null),O(this,uf,te(this,Em,s3).bind(this)),O(this,dc,!1),O(this,ff,null),O(this,v0,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){g(this,dc)||(O(this,dc,!0),te(this,Em,s3).call(this,-2))}stop(){g(this,dc)&&(O(this,dc,!1),O(this,v0,!0),te(this,Sm,l3).call(this),g(this,vi).off("block",g(this,uf)))}pause(e){e&&te(this,Sm,l3).call(this),g(this,vi).off("block",g(this,uf))}resume(){this.start()}},vi=new WeakMap,jo=new WeakMap,uf=new WeakMap,dc=new WeakMap,ff=new WeakMap,v0=new WeakMap,Em=new WeakSet,s3=async function(e){try{g(this,jo)==null&&O(this,jo,this._subscribe(g(this,vi)));let n=null;try{n=await g(this,jo)}catch(a){if(!Gr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,jo,null),g(this,vi)._recoverSubscriber(this,this._recover(g(this,vi)));return}const r=await g(this,vi).getNetwork();if(g(this,ff)||O(this,ff,r),g(this,ff).chainId!==r.chainId)throw new Error("chaid changed");if(g(this,v0))return;const i=await g(this,vi).send("eth_getFilterChanges",[n]);await this._emitResults(g(this,vi),i)}catch(n){console.log("@TODO",n)}g(this,vi).once("block",g(this,uf))},Sm=new WeakSet,l3=function(){const e=g(this,jo);e&&(O(this,jo,null),e.then(n=>{g(this,vi).send("eth_uninstallFilter",[n])}))},tM);var hf,nM;let Tq=(nM=class extends HL{constructor(n,r){super(n);R(this,hf,void 0);O(this,hf,Oq(r))}_recover(n){return new VP(n,g(this,hf))}async _subscribe(n){return await n.send("eth_newFilter",[g(this,hf)])}async _emitResults(n,r){for(const i of r)n.emit(g(this,hf),n._wrapLog(i,n._network))}},hf=new WeakMap,nM),Cq=class extends HL{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const kq="bigint,boolean,function,number,string,symbol".split(/,/g);function Wb(t){if(t==null||kq.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Wb);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Nq(t){return new Promise(e=>{setTimeout(e,t)})}function Th(t){return t&&t.toLowerCase()}function Ak(t){return t&&typeof t.pollingInterval=="number"}const _q={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let j6=class extends Pq{constructor(n,r){super(n);I(this,"address");r=nn(r),st(this,{address:r})}connect(n){pe(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=Wb(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await oi(o,this.provider);Q(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await oi(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Gr(u,"CANCELLED")||Gr(u,"BAD_DATA")||Gr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Gr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",Qn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=Wb(n);if(r.from){const a=await oi(r.from,this.provider);Q(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?sl(n):n;return await this.provider.send("personal_sign",[Xe(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=Wb(i),o=await JC.resolveNames(n,r,a,async s=>{const l=await oi(s);return Q(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(JC.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?sl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Xe(r)])}};var df,b0,Us,zo,oo,Sa,bi,Pm,c3,rM;let Iq=(rM=class extends bq{constructor(n,r){super(n,r);R(this,Pm);R(this,df,void 0);R(this,b0,void 0);R(this,Us,void 0);R(this,zo,void 0);R(this,oo,void 0);R(this,Sa,void 0);R(this,bi,void 0);O(this,b0,1),O(this,df,Object.assign({},_q,r||{})),O(this,Us,[]),O(this,zo,null),O(this,Sa,null),O(this,bi,null);{let a=null;const o=new Promise(s=>{a=s});O(this,oo,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(Q(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,Sa,Rc.from(n))):i&&(Q(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,Sa,i))}_getOption(n){return g(this,df)[n]}get _network(){return pe(g(this,Sa),"network is not available yet","NETWORK_ERROR"),g(this,Sa)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&Ke(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(g(this,Sa))return g(this,Sa)}else return n;return g(this,bi)?await g(this,bi):this.ready?(O(this,bi,(async()=>{try{const r=Rc.from(Ke(await this.send("eth_chainId",[])));return O(this,bi,null),r}catch(r){throw O(this,bi,null),r}})()),await g(this,bi)):(O(this,bi,(async()=>{const r={id:ms(this,b0)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,bi,null)}catch(a){throw O(this,bi,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Rc.from(Ke(i.result));throw this.getRpcError(r,i)})()),await g(this,bi))}_start(){g(this,oo)==null||g(this,oo).resolve==null||(g(this,oo).resolve(),O(this,oo,null),(async()=>{for(;g(this,Sa)==null&&!this.destroyed;)try{O(this,Sa,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Nq(1e3)}te(this,Pm,c3).call(this)})())}async _waitUntilReady(){if(g(this,oo)!=null)return await g(this,oo).promise}_getSubscriber(n){return n.type==="pending"?new Cq(this):n.type==="event"?this._getOption("polling")?new VP(this,n.filter):new Tq(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new zL("orphan"):super._getSubscriber(n)}get ready(){return g(this,oo)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=cd(Ke(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=Xe(n[i]))}),n.accessList&&(r.accessList=dh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Th(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Th(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Th(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Th(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Th):n.filter.address=Th(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return Qn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=u3(a),c=XE.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(Mq(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Qn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Qn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return Qn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Qn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return Qn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?Qn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):Qn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=ms(this,b0)._++,a=new Promise((o,s)=>{g(this,Us).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return te(this,Pm,c3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new j6(this,a[n])}const{accounts:i}=await qr({network:this.getNetwork(),accounts:r});n=nn(n);for(const a of i)if(nn(a)===n)return new j6(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new j6(this,r))}destroy(){g(this,zo)&&(clearTimeout(g(this,zo)),O(this,zo,null));for(const{payload:n,reject:r}of g(this,Us))r(Qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,Us,[]),super.destroy()}},df=new WeakMap,b0=new WeakMap,Us=new WeakMap,zo=new WeakMap,oo=new WeakMap,Sa=new WeakMap,bi=new WeakMap,Pm=new WeakSet,c3=function(){if(g(this,zo))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,zo,setTimeout(()=>{O(this,zo,null);const r=g(this,Us);for(O(this,Us,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==g(this,df).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>g(this,df).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(Qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=Qn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))},rM);var pc,iM;let GL=(iM=class extends Iq{constructor(n,r){super(n,r);R(this,pc,void 0);O(this,pc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Ak(r)&&(r.pollingInterval=g(this,pc)),r}get pollingInterval(){return g(this,pc)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,pc,n),this._forEachSubscriber(r=>{Ak(r)&&(r.pollingInterval=g(this,pc))})}},pc=new WeakMap,iM);var w0,aM;let Rq=(aM=class extends GL{constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);R(this,w0,void 0);typeof n=="string"?O(this,w0,new th(n)):O(this,w0,n.clone())}_getConnection(){return g(this,w0).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}},w0=new WeakMap,aM);function u3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&sn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=u3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return u3(JSON.parse(t))}catch{}return null}function f3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)f3(t[n],e);if(typeof t=="string")try{return f3(JSON.parse(t),e)}catch{}}}function Mq(t){const e=[];return f3(t,e),e}var x0,oM;let VL=(oM=class extends GL{constructor(n,r){Q(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,{batchMaxCount:1});R(this,x0,void 0);O(this,x0,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){Q(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await g(this,x0).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await g(this,x0).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}},x0=new WeakMap,oM);const Bq=["string","number","bigint","symbol"],Dq=["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 Lq(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(Bq.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if($q(t))return"Buffer";const n=Uq(t);return n||"Object"}function $q(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function Uq(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(Dq.includes(e))return e}class fe{constructor(e,n,r){this.major=e,this.majorEncoded=e<<5,this.name=n,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}fe.uint=new fe(0,"uint",!0);fe.negint=new fe(1,"negint",!0);fe.bytes=new fe(2,"bytes",!0);fe.string=new fe(3,"string",!0);fe.array=new fe(4,"array",!1);fe.map=new fe(5,"map",!1);fe.tag=new fe(6,"tag",!1);fe.float=new fe(7,"float",!0);fe.false=new fe(7,"false",!0);fe.true=new fe(7,"true",!0);fe.null=new fe(7,"null",!0);fe.undefined=new fe(7,"undefined",!0);fe.break=new fe(7,"break",!0);class nt{constructor(e,n,r){this.type=e,this.value=n,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const rg=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Fq=new TextDecoder,jq=new TextEncoder;function Ww(t){return rg&&globalThis.Buffer.isBuffer(t)}function QL(t){return t instanceof Uint8Array?Ww(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const zq=rg?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Sk(t,e,n):(t,e,n)=>n-e>64?Fq.decode(t.subarray(e,n)):Sk(t,e,n),Hq=rg?t=>t.length>64?globalThis.Buffer.from(t):Ek(t):t=>t.length>64?jq.encode(t):Ek(t),vs=t=>Uint8Array.from(t),QP=rg?(t,e,n)=>Ww(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),Gq=rg?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),QL(globalThis.Buffer.concat(t,e))):(t,e)=>{const n=new Uint8Array(e);let r=0;for(let i of t)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},Vq=rg?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function Qq(t,e){if(Ww(t)&&Ww(e))return t.compare(e);for(let n=0;n55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function Sk(t,e,n){const r=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=n){let s,l,c,u;switch(o){case 1:i<128&&(a=i);break;case 2:s=t[e+1],(s&192)===128&&(u=(i&31)<<6|s&63,u>127&&(a=u));break;case 3:s=t[e+1],l=t[e+2],(s&192)===128&&(l&192)===128&&(u=(i&15)<<12|(s&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:s=t[e+1],l=t[e+2],c=t[e+3],(s&192)===128&&(l&192)===128&&(c&192)===128&&(u=(i&15)<<18|(s&63)<<12|(l&63)<<6|c&63,u>65535&&u<1114112&&(a=u))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),e+=o}return Kq(r)}const Pk=4096;function Kq(t){const e=t.length;if(e<=Pk)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length/2?(n=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):n=QP(r,0,this.cursor)}else n=Gq(this.chunks,this.cursor);return e&&this.reset(),n}}const Nt="CBOR decode error:",WL="CBOR encode error:";function ig(t,e,n){if(t.length-e>>8,r&255])}else if(n>>24&255,r>>>16&255,r>>>8&255,r&255])}else{const r=BigInt(n);if(r>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&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(`${Nt} encountered BigInt larger than allowable range`)}}vh.encodedSize=function(e){return Va.encodedSize(e.value)};Va.encodedSize=function(e){return en.value?1:0};function qq(t,e,n,r){return new nt(fe.negint,-1-ph(t,e+1,r),2)}function eee(t,e,n,r){return new nt(fe.negint,-1-gh(t,e+1,r),3)}function tee(t,e,n,r){return new nt(fe.negint,-1-yh(t,e+1,r),5)}const KP=BigInt(-1),JL=BigInt(1);function nee(t,e,n,r){const i=mh(t,e+1,r);if(typeof i!="bigint"){const a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new nt(fe.negint,a,9)}if(r.allowBigInt!==!0)throw new Error(`${Nt} integers outside of the safe integer range are not supported`);return new nt(fe.negint,KP-BigInt(i),9)}function WP(t,e){const n=e.value,r=typeof n=="bigint"?n*KP-JL:n*-1-1;Va(t,e.type.majorEncoded,r)}WP.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*KP-JL:n*-1-1;return rn.value?-1:0};function iv(t,e,n,r){ig(t,e,n+r);const i=QP(t,e+n,e+n+r);return new nt(fe.bytes,i,n+r)}function ree(t,e,n,r){return iv(t,e,1,n)}function iee(t,e,n,r){return iv(t,e,2,ph(t,e+1,r))}function aee(t,e,n,r){return iv(t,e,3,gh(t,e+1,r))}function oee(t,e,n,r){return iv(t,e,5,yh(t,e+1,r))}function see(t,e,n,r){const i=mh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${Nt} 64-bit integer bytes lengths not supported`);return iv(t,e,9,i)}function Jw(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===fe.string?Hq(t.value):t.value),t.encodedBytes}function G2(t,e){const n=Jw(e);Va(t,e.type.majorEncoded,n.length),t.push(n)}G2.encodedSize=function(e){const n=Jw(e);return Va.encodedSize(n.length)+n.length};G2.compareTokens=function(e,n){return lee(Jw(e),Jw(n))};function lee(t,e){return t.lengthe.length?1:Qq(t,e)}function av(t,e,n,r,i){const a=n+r;ig(t,e,a);const o=new nt(fe.string,zq(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=QP(t,e+n,e+a)),o}function cee(t,e,n,r){return av(t,e,1,n,r)}function uee(t,e,n,r){return av(t,e,2,ph(t,e+1,r),r)}function fee(t,e,n,r){return av(t,e,3,gh(t,e+1,r),r)}function hee(t,e,n,r){return av(t,e,5,yh(t,e+1,r),r)}function dee(t,e,n,r){const i=mh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${Nt} 64-bit integer string lengths not supported`);return av(t,e,9,i,r)}const pee=G2;function ag(t,e,n,r){return new nt(fe.array,r,n)}function gee(t,e,n,r){return ag(t,e,1,n)}function yee(t,e,n,r){return ag(t,e,2,ph(t,e+1,r))}function mee(t,e,n,r){return ag(t,e,3,gh(t,e+1,r))}function vee(t,e,n,r){return ag(t,e,5,yh(t,e+1,r))}function bee(t,e,n,r){const i=mh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${Nt} 64-bit integer array lengths not supported`);return ag(t,e,9,i)}function wee(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${Nt} indefinite length items not allowed`);return ag(t,e,1,1/0)}function JP(t,e){Va(t,fe.array.majorEncoded,e.value)}JP.compareTokens=vh.compareTokens;JP.encodedSize=function(e){return Va.encodedSize(e.value)};function og(t,e,n,r){return new nt(fe.map,r,n)}function xee(t,e,n,r){return og(t,e,1,n)}function Aee(t,e,n,r){return og(t,e,2,ph(t,e+1,r))}function Eee(t,e,n,r){return og(t,e,3,gh(t,e+1,r))}function See(t,e,n,r){return og(t,e,5,yh(t,e+1,r))}function Pee(t,e,n,r){const i=mh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${Nt} 64-bit integer map lengths not supported`);return og(t,e,9,i)}function Oee(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${Nt} indefinite length items not allowed`);return og(t,e,1,1/0)}function YP(t,e){Va(t,fe.map.majorEncoded,e.value)}YP.compareTokens=vh.compareTokens;YP.encodedSize=function(e){return Va.encodedSize(e.value)};function Tee(t,e,n,r){return new nt(fe.tag,n,1)}function Cee(t,e,n,r){return new nt(fe.tag,ph(t,e+1,r),2)}function kee(t,e,n,r){return new nt(fe.tag,gh(t,e+1,r),3)}function Nee(t,e,n,r){return new nt(fe.tag,yh(t,e+1,r),5)}function _ee(t,e,n,r){return new nt(fe.tag,mh(t,e+1,r),9)}function XP(t,e){Va(t,fe.tag.majorEncoded,e.value)}XP.compareTokens=vh.compareTokens;XP.encodedSize=function(e){return Va.encodedSize(e.value)};const Iee=20,Ree=21,Mee=22,Bee=23;function Dee(t,e,n,r){if(r.allowUndefined===!1)throw new Error(`${Nt} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new nt(fe.null,null,1):new nt(fe.undefined,void 0,1)}function Lee(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${Nt} indefinite length items not allowed`);return new nt(fe.break,void 0,1)}function ZP(t,e,n){if(n){if(n.allowNaN===!1&&Number.isNaN(t))throw new Error(`${Nt} NaN values are not supported`);if(n.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${Nt} Infinity values are not supported`)}return new nt(fe.float,t,e)}function $ee(t,e,n,r){return ZP(eO(t,e+1),3,r)}function Uee(t,e,n,r){return ZP(tO(t,e+1),5,r)}function Fee(t,e,n,r){return ZP(qL(t,e+1),9,r)}function qP(t,e,n){const r=e.value;if(r===!1)t.push([fe.float.majorEncoded|Iee]);else if(r===!0)t.push([fe.float.majorEncoded|Ree]);else if(r===null)t.push([fe.float.majorEncoded|Mee]);else if(r===void 0)t.push([fe.float.majorEncoded|Bee]);else{let i,a=!1;(!n||n.float64!==!0)&&(XL(r),i=eO(qa,1),r===i||Number.isNaN(r)?(qa[0]=249,t.push(qa.slice(0,3)),a=!0):(ZL(r),i=tO(qa,1),r===i&&(qa[0]=250,t.push(qa.slice(0,5)),a=!0))),a||(jee(r),i=qL(qa,1),qa[0]=251,t.push(qa.slice(0,9)))}}qP.encodedSize=function(e,n){const r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){XL(r);let i=eO(qa,1);if(r===i||Number.isNaN(r))return 3;if(ZL(r),i=tO(qa,1),r===i)return 5}return 9};const YL=new ArrayBuffer(9),va=new DataView(YL,1),qa=new Uint8Array(YL,0);function XL(t){if(t===1/0)va.setUint16(0,31744,!1);else if(t===-1/0)va.setUint16(0,64512,!1);else if(Number.isNaN(t))va.setUint16(0,32256,!1);else{va.setFloat32(0,t);const e=va.getUint32(0),n=(e&2139095040)>>23,r=e&8388607;if(n===255)va.setUint16(0,31744,!1);else if(n===0)va.setUint16(0,(t&2147483648)>>16|r>>13,!1);else{const i=n-127;i<-24?va.setUint16(0,0):i<-14?va.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):va.setUint16(0,(e&2147483648)>>16|i+15<<10|r>>13,!1)}}}function eO(t,e){if(t.length-e<2)throw new Error(`${Nt} not enough data for float16`);const n=(t[e]<<8)+t[e+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;const r=n>>10&31,i=n&1023;let a;return r===0?a=i*2**-24:r!==31?a=(i+1024)*2**(r-25):a=i===0?1/0:NaN,n&32768?-a:a}function ZL(t){va.setFloat32(0,t,!1)}function tO(t,e){if(t.length-e<4)throw new Error(`${Nt} not enough data for float32`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,4).getFloat32(0,!1)}function jee(t){va.setFloat64(0,t,!1)}function qL(t,e){if(t.length-e<8)throw new Error(`${Nt} not enough data for float64`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,8).getFloat64(0,!1)}qP.compareTokens=vh.compareTokens;function Jt(t,e,n){throw new Error(`${Nt} encountered invalid minor (${n}) for major ${t[e]>>>5}`)}function V2(t){return()=>{throw new Error(`${Nt} ${t}`)}}const Te=[];for(let t=0;t<=23;t++)Te[t]=Jt;Te[24]=Jq;Te[25]=Yq;Te[26]=Xq;Te[27]=Zq;Te[28]=Jt;Te[29]=Jt;Te[30]=Jt;Te[31]=Jt;for(let t=32;t<=55;t++)Te[t]=Jt;Te[56]=qq;Te[57]=eee;Te[58]=tee;Te[59]=nee;Te[60]=Jt;Te[61]=Jt;Te[62]=Jt;Te[63]=Jt;for(let t=64;t<=87;t++)Te[t]=ree;Te[88]=iee;Te[89]=aee;Te[90]=oee;Te[91]=see;Te[92]=Jt;Te[93]=Jt;Te[94]=Jt;Te[95]=V2("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Te[t]=cee;Te[120]=uee;Te[121]=fee;Te[122]=hee;Te[123]=dee;Te[124]=Jt;Te[125]=Jt;Te[126]=Jt;Te[127]=V2("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Te[t]=gee;Te[152]=yee;Te[153]=mee;Te[154]=vee;Te[155]=bee;Te[156]=Jt;Te[157]=Jt;Te[158]=Jt;Te[159]=wee;for(let t=160;t<=183;t++)Te[t]=xee;Te[184]=Aee;Te[185]=Eee;Te[186]=See;Te[187]=Pee;Te[188]=Jt;Te[189]=Jt;Te[190]=Jt;Te[191]=Oee;for(let t=192;t<=215;t++)Te[t]=Tee;Te[216]=Cee;Te[217]=kee;Te[218]=Nee;Te[219]=_ee;Te[220]=Jt;Te[221]=Jt;Te[222]=Jt;Te[223]=Jt;for(let t=224;t<=243;t++)Te[t]=V2("simple values are not supported");Te[244]=Jt;Te[245]=Jt;Te[246]=Jt;Te[247]=Dee;Te[248]=V2("simple values are not supported");Te[249]=$ee;Te[250]=Uee;Te[251]=Fee;Te[252]=Jt;Te[253]=Jt;Te[254]=Jt;Te[255]=Lee;const ps=[];for(let t=0;t<24;t++)ps[t]=new nt(fe.uint,t,1);for(let t=-1;t>=-24;t--)ps[31-t]=new nt(fe.negint,t,1);ps[64]=new nt(fe.bytes,new Uint8Array(0),1);ps[96]=new nt(fe.string,"",1);ps[128]=new nt(fe.array,0,1);ps[160]=new nt(fe.map,0,1);ps[244]=new nt(fe.false,!1,1);ps[245]=new nt(fe.true,!0,1);ps[246]=new nt(fe.null,null,1);function zee(t){switch(t.type){case fe.false:return vs([244]);case fe.true:return vs([245]);case fe.null:return vs([246]);case fe.bytes:return t.value.length?void 0:vs([64]);case fe.string:return t.value===""?vs([96]):void 0;case fe.array:return t.value===0?vs([128]):void 0;case fe.map:return t.value===0?vs([160]):void 0;case fe.uint:return t.value<24?vs([Number(t.value)]):void 0;case fe.negint:if(t.value>=-24)return vs([31-Number(t.value)])}}const Hee={float64:!1,mapSorter:Qee,quickEncodeToken:zee};function Gee(){const t=[];return t[fe.uint.major]=vh,t[fe.negint.major]=WP,t[fe.bytes.major]=G2,t[fe.string.major]=pee,t[fe.array.major]=JP,t[fe.map.major]=YP,t[fe.tag.major]=XP,t[fe.float.major]=qP,t}const e$=Gee(),z6=new KL;class Yw{constructor(e,n){this.obj=e,this.parent=n}includes(e){let n=this;do if(n.obj===e)return!0;while(n=n.parent);return!1}static createCheck(e,n){if(e&&e.includes(n))throw new Error(`${WL} object contains circular references`);return new Yw(n,e)}}const Hl={null:new nt(fe.null,null),undefined:new nt(fe.undefined,void 0),true:new nt(fe.true,!0),false:new nt(fe.false,!1),emptyArray:new nt(fe.array,0),emptyMap:new nt(fe.map,0)},Zc={number(t,e,n,r){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new nt(fe.float,t):t>=0?new nt(fe.uint,t):new nt(fe.negint,t)},bigint(t,e,n,r){return t>=BigInt(0)?new nt(fe.uint,t):new nt(fe.negint,t)},Uint8Array(t,e,n,r){return new nt(fe.bytes,t)},string(t,e,n,r){return new nt(fe.string,t)},boolean(t,e,n,r){return t?Hl.true:Hl.false},null(t,e,n,r){return Hl.null},undefined(t,e,n,r){return Hl.undefined},ArrayBuffer(t,e,n,r){return new nt(fe.bytes,new Uint8Array(t))},DataView(t,e,n,r){return new nt(fe.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,n,r){if(!t.length)return n.addBreakTokens===!0?[Hl.emptyArray,new nt(fe.break)]:Hl.emptyArray;r=Yw.createCheck(r,t);const i=[];let a=0;for(const o of t)i[a++]=Jb(o,n,r);return n.addBreakTokens?[new nt(fe.array,t.length),i,new nt(fe.break)]:[new nt(fe.array,t.length),i]},Object(t,e,n,r){const i=e!=="Object",a=i?t.keys():Object.keys(t),o=i?t.size:a.length;if(!o)return n.addBreakTokens===!0?[Hl.emptyMap,new nt(fe.break)]:Hl.emptyMap;r=Yw.createCheck(r,t);const s=[];let l=0;for(const c of a)s[l++]=[Jb(c,n,r),Jb(i?t.get(c):t[c],n,r)];return Vee(s,n),n.addBreakTokens?[new nt(fe.map,o),s,new nt(fe.break)]:[new nt(fe.map,o),s]}};Zc.Map=Zc.Object;Zc.Buffer=Zc.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Zc[`${t}Array`]=Zc.DataView;function Jb(t,e={},n){const r=Lq(t),i=e&&e.typeEncoders&&e.typeEncoders[r]||Zc[r];if(typeof i=="function"){const o=i(t,r,e,n);if(o!=null)return o}const a=Zc[r];if(!a)throw new Error(`${WL} unsupported type: ${r}`);return a(t,r,e,n)}function Vee(t,e){e.mapSorter&&t.sort(e.mapSorter)}function Qee(t,e){const n=Array.isArray(t[0])?t[0][0]:t[0],r=Array.isArray(e[0])?e[0][0]:e[0];if(n.type!==r.type)return n.type.compare(r.type);const i=n.type.major,a=e$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function t$(t,e,n,r){if(Array.isArray(e))for(const i of e)t$(t,i,n,r);else n[e.type.major](t,e,r)}function Kee(t,e,n){const r=Jb(t,n);if(!Array.isArray(r)&&n.quickEncodeToken){const i=n.quickEncodeToken(r);if(i)return i;const a=e[r.type.major];if(a.encodedSize){const o=a.encodedSize(r,n),s=new KL(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return QL(s.chunks[0])}}return z6.reset(),t$(z6,r,e,n),z6.toBytes(!0)}function Uh(t,e){return e=Object.assign({},Hee,e),Kee(t,e$,e)}const Wee={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class Jee{constructor(e,n={}){this.pos=0,this.data=e,this.options=n}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let n=ps[e];if(n===void 0){const r=Te[e];if(!r)throw new Error(`${Nt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;n=r(this.data,this.pos,i,this.options)}return this.pos+=n.encodedLength,n}}const c1=Symbol.for("DONE"),Q2=Symbol.for("BREAK");function Yee(t,e,n){const r=[];for(let i=0;ia.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function lt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&qee(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function ud(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(ud).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return ud(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(n=>`${ud(n)}: ${ud(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Vr(t,e){return t&&t.code===e}function nO(t){return Vr(t,"CALL_EXCEPTION")}function Kn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${ud(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+ud(s))}}a.push(`code=${e}`),a.push(`version=${Zee}`),a.length&&(t+=" ("+a.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 lt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&<(i,{shortMessage:r}),i}function ge(t,e,n,r){if(!t)throw Kn(e,n,r)}function Y(t,e,n,r){ge(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function n$(t,e,n){n==null&&(n=""),n&&(n=": "+n),ge(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ge(t<=e,"too many arguemnts"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const ete=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function tte(t){ge(ete.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function K2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),ge(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function r$(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+Ok[i&15]}return n}function nr(t){return"0x"+t.map(e=>Ge(e).substring(2)).join("")}function kd(t){return Pn(t,!0)?(t.length-2)/2:mt(t).length}function Mn(t,e,n){const r=mt(t);return n!=null&&n>r.length&&ge(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Ge(r.slice(e??0,n??r.length))}function i$(t,e,n){const r=mt(t);ge(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Ge(i)}function ah(t,e){return i$(t,e,!0)}function nte(t,e){return i$(t,e,!1)}const W2=BigInt(0),bo=BigInt(1),fd=9007199254740991;function rte(t,e){const n=J2(t,"value"),r=BigInt(kt(e,"width"));if(ge(n>>r===W2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-bo){const i=(bo<=-fd&&t<=fd,"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(n){Y(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Y(!1,"invalid BigNumberish value",e||"value",t)}function J2(t,e){const n=qe(t,e);return ge(n>=W2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Tk="0123456789abcdef";function rO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Tk[n>>4],e+=Tk[n&15];return BigInt(e)}return qe(t)}function kt(t,e){switch(typeof t){case"bigint":return Y(t>=-fd&&t<=fd,"overflow",e||"value",t),Number(t);case"number":return Y(Number.isInteger(t),"underflow",e||"value",t),Y(t>=-fd&&t<=fd,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return kt(BigInt(t),e)}catch(n){Y(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Y(!1,"invalid numeric value",e||"value",t)}function ite(t){return kt(rO(t))}function us(t,e){let r=J2(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=kt(e,"width");for(ge(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function cte(t,e,n,r,i){return t==="OVERLONG"?(Y(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),s$(t,e,n))}const ute=Object.freeze({error:lte,ignore:s$,replace:cte});function fte(t,e){e==null&&(e=ute.error);const n=mt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function cl(t,e){e!=null&&(tte(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);Y(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function hte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function iO(t,e){return hte(fte(t,e))}function l$(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();ge(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ge(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const dte=12,pte=250;let Nk=l$();const gte=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),yte=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let H6=!1;async function c$(t,e){try{const n=t.match(gte);if(!n)throw new Error("invalid data");return new Kc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?ote(n[3]):vte(n[3]))}catch{return new Kc(599,"BAD REQUEST (invalid data: URI)",{},null,new wl(t))}}function u$(t){async function e(n,r){try{const i=n.match(yte);if(!i)throw new Error("invalid link");return new wl(`${t}${i[2]}`)}catch{return new Kc(599,"BAD REQUEST (invalid IPFS URI)",{},null,new wl(n))}}return e}const Kv={data:c$,ipfs:u$("https://gateway.ipfs.io/ipfs/")},f$=new WeakMap;var pf,gc;class mte{constructor(e){R(this,pf,void 0);R(this,gc,void 0);O(this,pf,[]),O(this,gc,!1),f$.set(e,()=>{if(!g(this,gc)){O(this,gc,!0);for(const n of g(this,pf))setTimeout(()=>{n()},0);O(this,pf,[])}})}addListener(e){ge(!g(this,gc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),g(this,pf).push(e)}get cancelled(){return g(this,gc)}checkSignal(){ge(!this.cancelled,"cancelled","CANCELLED",{})}}pf=new WeakMap,gc=new WeakMap;function Wv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var E0,S0,so,Fs,P0,O0,or,Yi,js,gf,yf,mf,Ho,zs,yc,vf,iy;const i2=class i2{constructor(e){R(this,vf);R(this,E0,void 0);R(this,S0,void 0);R(this,so,void 0);R(this,Fs,void 0);R(this,P0,void 0);R(this,O0,void 0);R(this,or,void 0);R(this,Yi,void 0);R(this,js,void 0);R(this,gf,void 0);R(this,yf,void 0);R(this,mf,void 0);R(this,Ho,void 0);R(this,zs,void 0);R(this,yc,void 0);O(this,O0,String(e)),O(this,E0,!1),O(this,S0,!0),O(this,so,{}),O(this,Fs,""),O(this,P0,3e5),O(this,zs,{slotInterval:pte,maxAttempts:dte}),O(this,yc,null)}get url(){return g(this,O0)}set url(e){O(this,O0,String(e))}get body(){return g(this,or)==null?null:new Uint8Array(g(this,or))}set body(e){if(e==null)O(this,or,void 0),O(this,Yi,void 0);else if(typeof e=="string")O(this,or,cl(e)),O(this,Yi,"text/plain");else if(e instanceof Uint8Array)O(this,or,e),O(this,Yi,"application/octet-stream");else if(typeof e=="object")O(this,or,cl(JSON.stringify(e))),O(this,Yi,"application/json");else throw new Error("invalid body")}hasBody(){return g(this,or)!=null}get method(){return g(this,Fs)?g(this,Fs):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Fs,String(e).toUpperCase())}get headers(){const e=Object.assign({},g(this,so));return g(this,js)&&(e.authorization=`Basic ${ste(cl(g(this,js)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&g(this,Yi)&&(e["content-type"]=g(this,Yi)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){g(this,so)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,so,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,P0,e)}get preflightFunc(){return g(this,gf)||null}set preflightFunc(e){O(this,gf,e)}get processFunc(){return g(this,yf)||null}set processFunc(e){O(this,yf,e)}get retryFunc(){return g(this,mf)||null}set retryFunc(e){O(this,mf,e)}get getUrlFunc(){return g(this,yc)||Nk}set getUrlFunc(e){O(this,yc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(g(this,zs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(g(this,zs).maxAttempts=e.maxAttempts)}send(){return ge(g(this,Ho)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Ho,new mte(this)),te(this,vf,iy).call(this,0,_k()+this.timeout,0,this,new Kc(0,"",{},null,this))}cancel(){ge(g(this,Ho)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=f$.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ge(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new i2(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,so,Object.assign({},g(this,so))),g(this,or)&&O(i,or,new Uint8Array(g(this,or))),O(i,Yi,g(this,Yi)),i}clone(){const e=new i2(this.url);return O(e,Fs,g(this,Fs)),g(this,or)&&O(e,or,g(this,or)),O(e,Yi,g(this,Yi)),O(e,so,Object.assign({},g(this,so))),O(e,js,g(this,js)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,gf,g(this,gf)),O(e,yf,g(this,yf)),O(e,mf,g(this,mf)),O(e,yc,g(this,yc)),e}static lockConfig(){H6=!0}static getGateway(e){return Kv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(H6)throw new Error("gateways locked");Kv[e]=n}static registerGetUrl(e){if(H6)throw new Error("gateways locked");Nk=e}static createGetUrlFunc(e){return l$()}static createDataGateway(){return c$}static createIpfsGatewayFunc(e){return u$(e)}};E0=new WeakMap,S0=new WeakMap,so=new WeakMap,Fs=new WeakMap,P0=new WeakMap,O0=new WeakMap,or=new WeakMap,Yi=new WeakMap,js=new WeakMap,gf=new WeakMap,yf=new WeakMap,mf=new WeakMap,Ho=new WeakMap,zs=new WeakMap,yc=new WeakMap,vf=new WeakSet,iy=async function(e,n,r,i,a){var u,f,h;if(e>=g(this,zs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");ge(_k()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await bte(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Kv){const d=await Kv[s](o.url,Wv(g(i,Ho)));if(d instanceof Kc){let y=d;if(this.processFunc){Wv(g(i,Ho));try{y=await this.processFunc(o,y)}catch(p){(p.throttle==null||typeof p.stall!="number")&&y.makeServerError("error in post-processing function",p).assertOk()}}return y}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Wv(g(i,Ho)));let c=new Kc(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return te(u=o.redirect(d),vf,iy).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let y=g(this,zs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(y=parseInt(d)),te(f=o.clone(),vf,iy).call(f,e+1,n,y,i,c)}if(this.processFunc){Wv(g(i,Ho));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let y=g(this,zs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(y=d.stall),te(h=o.clone(),vf,iy).call(h,e+1,n,y,i,c)}}return c};let wl=i2;var Om,Tm,Cm,lo,T0,bf;const C4=class C4{constructor(e,n,r,i,a){R(this,Om,void 0);R(this,Tm,void 0);R(this,Cm,void 0);R(this,lo,void 0);R(this,T0,void 0);R(this,bf,void 0);O(this,Om,e),O(this,Tm,n),O(this,Cm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,lo,i==null?null:new Uint8Array(i)),O(this,T0,a||null),O(this,bf,{message:""})}toString(){return``}get statusCode(){return g(this,Om)}get statusMessage(){return g(this,Tm)}get headers(){return Object.assign({},g(this,Cm))}get body(){return g(this,lo)==null?null:new Uint8Array(g(this,lo))}get bodyText(){try{return g(this,lo)==null?"":iO(g(this,lo))}catch{ge(!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{ge(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw lt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return g(this,lo)!=null}get request(){return g(this,T0)}ok(){return g(this,bf).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=g(this,bf);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),ge(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n})}};Om=new WeakMap,Tm=new WeakMap,Cm=new WeakMap,lo=new WeakMap,T0=new WeakMap,bf=new WeakMap;let Kc=C4;function _k(){return new Date().getTime()}function vte(t){return cl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function bte(t){return new Promise(e=>setTimeout(e,t))}function wte(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Ik(t,e,n){let r=0;for(let i=0;i{ge(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=Ik(t,e+1,r);return n(e+1+r+i),Rk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),Rk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=Ik(t,e+1,r);n(e+1+r+i);const a=Ge(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=Ge(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:wte(t[e])}}function aO(t){const e=mt(t,"data"),n=h$(e,0);return Y(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Mk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function d$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(d$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Mk(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(mt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Mk(e.length);return n.unshift(183+n.length),n.concat(e)}const Bk="0123456789abcdef";function f1(t){let e="0x";for(const n of d$(t))e+=Bk[n>>4],e+=Bk[n&15];return e}const li=32,h3=new Uint8Array(li),xte=["then"],Jv={};function Mg(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var mc;const By=class By extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==Jv&&(i=n,a=[],o=!1);super(i.length);R(this,mc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,mc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=kt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Mg(`index ${h}`,d),d}if(xte.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Mg(`index ${i}`,r),n.push(r)}),n}toObject(){return g(this,mc).reduce((n,r,i)=>(ge(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{g(this,Hs)[e]=Dk(n)}}}Hs=new WeakMap,wf=new WeakMap,C0=new WeakSet,Xb=function(e){return g(this,Hs).push(e),O(this,wf,g(this,wf)+e.length),e.length};var wi,Xi,xf,Af,vc,km,g3,a2,p$;const k4=class k4{constructor(e,n,r){R(this,km);R(this,a2);I(this,"allowLoose");R(this,wi,void 0);R(this,Xi,void 0);R(this,xf,void 0);R(this,Af,void 0);R(this,vc,void 0);lt(this,{allowLoose:!!n}),O(this,wi,Er(e)),O(this,xf,0),O(this,Af,null),O(this,vc,r??1024),O(this,Xi,0)}get data(){return Ge(g(this,wi))}get dataLength(){return g(this,wi).length}get consumed(){return g(this,Xi)}get bytes(){return new Uint8Array(g(this,wi))}subReader(e){const n=new k4(g(this,wi).slice(g(this,Xi)+e),this.allowLoose,g(this,vc));return O(n,Af,this),n}readBytes(e,n){let r=te(this,a2,p$).call(this,0,e,!!n);return te(this,km,g3).call(this,e),O(this,Xi,g(this,Xi)+r.length),r.slice(0,e)}readValue(){return rO(this.readBytes(li))}readIndex(){return ite(this.readBytes(li))}};wi=new WeakMap,Xi=new WeakMap,xf=new WeakMap,Af=new WeakMap,vc=new WeakMap,km=new WeakSet,g3=function(e){var n;if(g(this,Af))return te(n=g(this,Af),km,g3).call(n,e);O(this,xf,g(this,xf)+e),ge(g(this,vc)<1||g(this,xf)<=g(this,vc)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${g(this,vc)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Er(g(this,wi)),offset:g(this,Xi),length:e,info:{bytesRead:g(this,xf),dataLength:this.dataLength}})},a2=new WeakSet,p$=function(e,n,r){let i=Math.ceil(n/li)*li;return g(this,Xi)+i>g(this,wi).length&&(this.allowLoose&&r&&g(this,Xi)+n<=g(this,wi).length?i=n:ge(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Er(g(this,wi)),length:g(this,wi).length,offset:g(this,Xi)+i})),g(this,wi).slice(g(this,Xi),g(this,Xi)+i)};let p3=k4,g$=!1;const y$=function(t){return SD(t)};let m$=y$;function Sn(t){const e=mt(t,"data");return Ge(m$(e))}Sn._=y$;Sn.lock=function(){g$=!0};Sn.register=function(t){if(g$)throw new TypeError("keccak256 is locked");m$=t};Object.freeze(Sn);const y3="0x0000000000000000000000000000000000000000",Lk="0x0000000000000000000000000000000000000000000000000000000000000000",$k=BigInt(0),Uk=BigInt(1),Fk=BigInt(2),jk=BigInt(27),zk=BigInt(28),Yv=BigInt(35),Ch={};function Hk(t){return ah(aa(t),32)}var k0,N0,_0,Ef;const eo=class eo{constructor(e,n,r,i){R(this,k0,void 0);R(this,N0,void 0);R(this,_0,void 0);R(this,Ef,void 0);K2(e,Ch,"Signature"),O(this,k0,n),O(this,N0,r),O(this,_0,i),O(this,Ef,null)}get r(){return g(this,k0)}set r(e){Y(kd(e)===32,"invalid r","value",e),O(this,k0,Ge(e))}get s(){return g(this,N0)}set s(e){Y(kd(e)===32,"invalid s","value",e);const n=Ge(e);Y(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,N0,n)}get v(){return g(this,_0)}set v(e){const n=kt(e,"value");Y(n===27||n===28,"invalid v","v",e),O(this,_0,n)}get networkV(){return g(this,Ef)}get legacyChainId(){const e=this.networkV;return e==null?null:eo.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=mt(this.s);return this.yParity&&(e[0]|=128),Ge(e)}get compactSerialized(){return nr([this.r,this.yParityAndS])}get serialized(){return nr([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 eo(Ch,this.r,this.s,this.v);return this.networkV&&O(e,Ef,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 n=qe(e,"v");return n==jk||n==zk?$k:(Y(n>=Yv,"invalid EIP-155 v","v",e),(n-Yv)/Fk)}static getChainIdV(e,n){return qe(e)*Fk+BigInt(35+n-27)}static getNormalizedV(e){const n=qe(e);return n===$k||n===jk?27:n===Uk||n===zk?28:(Y(n>=Yv,"invalid v","v",e),n&Uk?27:28)}static from(e){function n(c,u){Y(c,u,"signature",e)}if(e==null)return new eo(Ch,Lk,Lk,27);if(typeof e=="string"){const c=mt(e,"signature");if(c.length===64){const u=Ge(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new eo(Ch,u,Ge(f),h)}if(c.length===65){const u=Ge(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=eo.getNormalizedV(c[64]);return new eo(Ch,u,Ge(f),h)}n(!1,"invalid raw signature length")}if(e instanceof eo)return e.clone();const r=e.r;n(r!=null,"missing r");const i=Hk(r),a=function(c,u){if(c!=null)return Hk(c);if(u!=null){n(Pn(u,32),"invalid yParityAndS");const f=mt(u);return f[0]&=127,Ge(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((mt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=qe(c);return{networkV:h>=Yv?h:void 0,v:eo.getNormalizedV(h)}}if(u!=null)return n(Pn(u,32),"invalid yParityAndS"),{v:mt(u)[0]&128?28:27};if(f!=null){switch(kt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new eo(Ch,i,a,s);return o&&O(l,Ef,o),n(e.yParity==null||kt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};k0=new WeakMap,N0=new WeakMap,_0=new WeakMap,Ef=new WeakMap;let Po=eo;var Gs;const Cu=class Cu{constructor(e){R(this,Gs,void 0);Y(kd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Gs,Ge(e))}get privateKey(){return g(this,Gs)}get publicKey(){return Cu.computePublicKey(g(this,Gs))}get compressedPublicKey(){return Cu.computePublicKey(g(this,Gs),!0)}sign(e){Y(kd(e)===32,"invalid digest length","digest",e);const n=ti.sign(Er(e),Er(g(this,Gs)),{lowS:!0});return Po.from({r:us(n.r,32),s:us(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=Cu.computePublicKey(e);return Ge(ti.getSharedSecret(Er(g(this,Gs)),mt(n),!1))}static computePublicKey(e,n){let r=mt(e,"key");if(r.length===32){const a=ti.getPublicKey(r,!!n);return Ge(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ti.ProjectivePoint.fromHex(r);return Ge(i.toRawBytes(n))}static recoverPublicKey(e,n){Y(kd(e)===32,"invalid digest length","digest",e);const r=Po.from(n);let i=ti.Signature.fromCompact(Er(nr([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(Er(e));return Y(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ti.ProjectivePoint.fromHex(Cu.computePublicKey(e).substring(2)),a=ti.ProjectivePoint.fromHex(Cu.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}};Gs=new WeakMap;let h1=Cu;const Ate=BigInt(0),Ete=BigInt(36);function Gk(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=mt(Sn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const oO={};for(let t=0;t<10;t++)oO[String(t)]=String(t);for(let t=0;t<26;t++)oO[String.fromCharCode(65+t)]=String(10+t);const Vk=15;function Ste(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>oO[r]).join("");for(;e.length>=Vk;){let r=e.substring(0,Vk);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const Pte=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function Ote(t){t=t.toLowerCase();let e=Ate;for(let n=0;ne.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 g(this,Sf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return g(this,Sf)===!0?-1:g(this,Sf)===!1?this.value.length:null}static from(e,n){return new Ss(xs,e,n)}static uint8(e){return Ue(e,8)}static uint16(e){return Ue(e,16)}static uint24(e){return Ue(e,24)}static uint32(e){return Ue(e,32)}static uint40(e){return Ue(e,40)}static uint48(e){return Ue(e,48)}static uint56(e){return Ue(e,56)}static uint64(e){return Ue(e,64)}static uint72(e){return Ue(e,72)}static uint80(e){return Ue(e,80)}static uint88(e){return Ue(e,88)}static uint96(e){return Ue(e,96)}static uint104(e){return Ue(e,104)}static uint112(e){return Ue(e,112)}static uint120(e){return Ue(e,120)}static uint128(e){return Ue(e,128)}static uint136(e){return Ue(e,136)}static uint144(e){return Ue(e,144)}static uint152(e){return Ue(e,152)}static uint160(e){return Ue(e,160)}static uint168(e){return Ue(e,168)}static uint176(e){return Ue(e,176)}static uint184(e){return Ue(e,184)}static uint192(e){return Ue(e,192)}static uint200(e){return Ue(e,200)}static uint208(e){return Ue(e,208)}static uint216(e){return Ue(e,216)}static uint224(e){return Ue(e,224)}static uint232(e){return Ue(e,232)}static uint240(e){return Ue(e,240)}static uint248(e){return Ue(e,248)}static uint256(e){return Ue(e,256)}static uint(e){return Ue(e,256)}static int8(e){return Ue(e,-8)}static int16(e){return Ue(e,-16)}static int24(e){return Ue(e,-24)}static int32(e){return Ue(e,-32)}static int40(e){return Ue(e,-40)}static int48(e){return Ue(e,-48)}static int56(e){return Ue(e,-56)}static int64(e){return Ue(e,-64)}static int72(e){return Ue(e,-72)}static int80(e){return Ue(e,-80)}static int88(e){return Ue(e,-88)}static int96(e){return Ue(e,-96)}static int104(e){return Ue(e,-104)}static int112(e){return Ue(e,-112)}static int120(e){return Ue(e,-120)}static int128(e){return Ue(e,-128)}static int136(e){return Ue(e,-136)}static int144(e){return Ue(e,-144)}static int152(e){return Ue(e,-152)}static int160(e){return Ue(e,-160)}static int168(e){return Ue(e,-168)}static int176(e){return Ue(e,-176)}static int184(e){return Ue(e,-184)}static int192(e){return Ue(e,-192)}static int200(e){return Ue(e,-200)}static int208(e){return Ue(e,-208)}static int216(e){return Ue(e,-216)}static int224(e){return Ue(e,-224)}static int232(e){return Ue(e,-232)}static int240(e){return Ue(e,-240)}static int248(e){return Ue(e,-248)}static int256(e){return Ue(e,-256)}static int(e){return Ue(e,-256)}static bytes1(e){return Kt(e,1)}static bytes2(e){return Kt(e,2)}static bytes3(e){return Kt(e,3)}static bytes4(e){return Kt(e,4)}static bytes5(e){return Kt(e,5)}static bytes6(e){return Kt(e,6)}static bytes7(e){return Kt(e,7)}static bytes8(e){return Kt(e,8)}static bytes9(e){return Kt(e,9)}static bytes10(e){return Kt(e,10)}static bytes11(e){return Kt(e,11)}static bytes12(e){return Kt(e,12)}static bytes13(e){return Kt(e,13)}static bytes14(e){return Kt(e,14)}static bytes15(e){return Kt(e,15)}static bytes16(e){return Kt(e,16)}static bytes17(e){return Kt(e,17)}static bytes18(e){return Kt(e,18)}static bytes19(e){return Kt(e,19)}static bytes20(e){return Kt(e,20)}static bytes21(e){return Kt(e,21)}static bytes22(e){return Kt(e,22)}static bytes23(e){return Kt(e,23)}static bytes24(e){return Kt(e,24)}static bytes25(e){return Kt(e,25)}static bytes26(e){return Kt(e,26)}static bytes27(e){return Kt(e,27)}static bytes28(e){return Kt(e,28)}static bytes29(e){return Kt(e,29)}static bytes30(e){return Kt(e,30)}static bytes31(e){return Kt(e,31)}static bytes32(e){return Kt(e,32)}static address(e){return new Ss(xs,"address",e)}static bool(e){return new Ss(xs,"bool",!!e)}static bytes(e){return new Ss(xs,"bytes",e)}static string(e){return new Ss(xs,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Ss(xs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===Qk}static dereference(e,n){if(Ss.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};Sf=new WeakMap;let Qr=Ss;class Cte extends Nl{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Qr.dereference(n,"string");try{r=Xt(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return Xt(us(e.readValue(),20))}}class kte extends Nl{constructor(n){super(n.name,n.type,"_",n.dynamic);I(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function b$(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return ge(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),ge(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else Y(!1,"invalid tuple value","tuple",n);Y(e.length===r.length,"types/value length mismatch","tuple",n);let i=new d3,a=new d3,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function w$(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Vr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Vr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),Zw.fromItems(n,r)}class Nte extends Nl{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);I(this,"coder");I(this,"length");lt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+Lte))&&this._throwError("value out-of-bounds",r),i=a$(i,8*li)}else(iry(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ry(n.readValue(),this.size*8);return this.signed&&(r=rte(r,this.size*8)),r}}class Fte extends x${constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,cl(Qr.dereference(n,"string")))}decode(e){return iO(super.decode(e))}}class Xv extends Nl{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);I(this,"coders");lt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Qr.dereference(r,"tuple");return b$(n,this.coders,i)}decode(n){return w$(n,this.coders)}}function oh(t){return Sn(cl(t))}var jte="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";const Kk=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Wk=4;function zte(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let P=1;P>--l&1}const f=31,h=2**f,d=h>>>1,y=d>>1,p=h-1;let m=0;for(let P=0;P1;){let L=A+k>>>1;P>>1|u(),N=N<<1^d,D=(D^d)<<1|d|1;w=N,x=1+D-N}let E=r-4;return v.map(P=>{switch(P-E){case 3:return E+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return E+256+(t[s++]<<8|t[s++]);case 1:return E+t[s++];default:return P-1}})}function Hte(t){let e=0;return()=>t[e++]}function A$(t){return Hte(zte(Gte(t)))}function Gte(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function Vte(t){return t&1?~t>>1:t>>1}function Qte(t,e){let n=Array(t);for(let r=0,i=0;r{let e=d1(t);if(e.length)return e})}function S$(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Kte(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Wte(n,t))}return e.flat()}function p1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function P$(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function Kte(t,e){let n=1+e(),r=e(),i=p1(e);return P$(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function Wte(t,e){let n=1+e();return P$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function Jte(t){let e=[],n=d1(t);return i(r([]),[]),e;function r(a){let o=t(),s=p1(()=>{let l=d1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function Yte(t){return t.toString(16).toUpperCase().padStart(2,"0")}function O$(t){return`{${Yte(t)}}`}function Xte(t){let e=[];for(let n=0,r=t.length;n>24&255}function k$(t){return t&16777215}let m3,Jk,v3,Zb;function ane(){let t=A$(qte);m3=new Map(E$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),Jk=new Set(d1(t)),v3=new Map,Zb=new Map;for(let[e,n]of S$(t)){if(!Jk.has(e)&&n.length==2){let[r,i]=n,a=Zb.get(r);a||(a=new Map,Zb.set(r,a)),a.set(i,e)}v3.set(e,n.reverse())}}function N$(t){return t>=g1&&t=qw&&t=ex&&etx&&e0&&i(tx+c)}else{let o=v3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=ay(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=one(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function I$(t){return _$(t).map(k$)}function lne(t){return sne(_$(t))}const Yk=45,R$=".",M$=65039,B$=1,hd=t=>Array.from(t);function y1(t,e){return t.P.has(e)||t.Q.has(e)}class cne extends Array{get is_emoji(){return!0}}let b3,D$,Uu,w3,L$,Nd,V6,Fh,$$,Xk,x3;function sO(){if(b3)return;let t=A$(jte);const e=()=>d1(t),n=()=>new Set(e());b3=new Map(S$(t)),D$=n(),Uu=e(),w3=new Set(e().map(u=>Uu[u])),Uu=new Set(Uu),L$=n(),n();let r=E$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Nd=p1(u=>{let f=p1(t).map(h=>h+96);if(f.length){let h=u>=i;f[0]-=32,f=Sp(f),h&&(f=`Restricted[${f}]`);let d=a(),y=a(),p=!t();return{N:f,P:d,Q:y,M:p,R:h}}}),V6=n(),Fh=new Map;let o=e().concat(hd(V6)).sort((u,f)=>u-f);o.forEach((u,f)=>{let h=t(),d=o[f]=h?o[f-h]:{V:[],M:new Map};d.V.push(u),V6.has(u)||Fh.set(u,d)});for(let{V:u,M:f}of new Set(Fh.values())){let h=[];for(let y of u){let p=Nd.filter(v=>y1(v,y)),m=h.find(({G:v})=>p.some(w=>v.has(w)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(y),p.forEach(v=>m.G.add(v))}let d=h.flatMap(y=>hd(y.G));for(let{G:y,V:p}of h){let m=new Set(d.filter(v=>!y.has(v)));for(let v of p)f.set(v,m)}}let s=new Set,l=new Set;const c=u=>s.has(u)?l.add(u):s.add(u);for(let u of Nd){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of s)!Fh.has(u)&&!l.has(u)&&Fh.set(u,B$);$$=new Set(hd(s).concat(hd(I$(s)))),Xk=Jte(t).map(u=>cne.from(u)).sort(Zte),x3=new Map;for(let u of Xk){let f=[x3];for(let h of u){let d=f.map(y=>{let p=y.get(h);return p||(p=new Map,y.set(h,p)),p});h===M$?f.push(...d):f=d}for(let h of f)h.V=u}}function lO(t){return(U$(t)?"":`${cO(Y2([t]))} `)+O$(t)}function cO(t){return`"${t}"‎`}function une(t){if(t.length>=4&&t[2]==Yk&&t[3]==Yk)throw new Error(`invalid label extension: "${Sp(t.slice(0,4))}"`)}function fne(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function hne(t){let e=t[0],n=Kk.get(e);if(n)throw Sy(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=Xte(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=wne(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(fne(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))une(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(Uu.has(u[0]))throw Sy("leading combining mark");for(let p=1;po.has(s)):hd(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>y1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function mne(t){let e=Nd;for(let n of t){let r=e.filter(i=>y1(i,n));if(!r.length)throw Nd.some(i=>y1(i,n))?j$(e[0],n):F$(n);if(e=r,r.length==1)break}return e}function vne(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${cO(Y2(e))}: ${i}`)}return Sp(r)}).join(R$)}function F$(t){return new Error(`disallowed character: ${lO(t)}`)}function j$(t,e){let n=lO(e),r=Nd.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Sy(t){return new Error(`illegal placement: ${t}`)}function bne(t,e){for(let n of e)if(!y1(t,n))throw j$(t,n);if(t.M){let n=I$(e);for(let r=1,i=n.length;rWk)throw new Error(`excessive non-spacing marks: ${cO(Y2(n.slice(r-1,a)))} (${a-r}/${Wk})`);r=a}}}function wne(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=Ane(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if($$.has(o))i.push(o);else{let s=b3.get(o);if(s)i.push(...s);else if(!D$.has(o))throw F$(o)}}}return i.length&&r.push(e(i)),r}function xne(t){return t.filter(e=>e!=M$)}function Ane(t,e){let n=x3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const z$=new Uint8Array(32);z$.fill(0);function Zk(t){return Y(t.length!==0,"invalid ENS name; empty component","comp",t),t}function H$(t){const e=cl(Ene(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const n=new Uint8Array(e.length+1);return n.set(e,1),n[0]=n.length-1,n})))+"00"}function Q6(t,e){return{address:Xt(t),storageKeys:e.map((n,r)=>(Y(Pn(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function bh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(Y(n.length===2,"invalid slot set",`value[${r}]`,n),Q6(n[0],n[1])):(Y(n!=null&&typeof n=="object","invalid address-slot set","value",t),Q6(n.address,n.storageKeys)));Y(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return Q6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function Pne(t){let e;return typeof t=="string"?e=h1.computePublicKey(t,!1):e=t.publicKey,Xt(Sn("0x"+e.substring(4)).substring(26))}function One(t,e){return Pne(h1.recoverPublicKey(t,e))}const Ti=BigInt(0),Tne=BigInt(2),Cne=BigInt(27),kne=BigInt(28),Nne=BigInt(35),_ne=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function uO(t){return t==="0x"?null:Xt(t)}function G$(t,e){try{return bh(t)}catch(n){Y(!1,n.message,e,t)}}function X2(t,e){return t==="0x"?0:kt(t,e)}function ni(t,e){if(t==="0x")return Ti;const n=qe(t,e);return Y(n<=_ne,"value exceeds uint size",e,n),n}function wr(t,e){const n=qe(t,"value"),r=aa(n);return Y(r.length<=32,"value too large",`tx.${e}`,n),r}function V$(t){return bh(t).map(e=>[e.address,e.storageKeys])}function Ine(t){const e=aO(t);Y(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:X2(e[0],"nonce"),gasPrice:ni(e[1],"gasPrice"),gasLimit:ni(e[2],"gasLimit"),to:uO(e[3]),value:ni(e[4],"value"),data:Ge(e[5]),chainId:Ti};if(e.length===6)return n;const r=ni(e[6],"v"),i=ni(e[7],"r"),a=ni(e[8],"s");if(i===Ti&&a===Ti)n.chainId=r;else{let o=(r-Nne)/Tne;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ge(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ge(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(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 Jl.from(this)}toJSON(){const e=n=>n==null?null:n.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 Jl;if(typeof e=="string"){const r=mt(e);if(r[0]>=127)return Jl.from(Ine(r));switch(r[0]){case 1:return Jl.from(Mne(r));case 2:return Jl.from(Rne(r))}ge(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Jl;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Po.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.hash!=null&&(Y(n.isSigned(),"unsigned transaction cannot define hash","tx",e),Y(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Y(n.isSigned(),"unsigned transaction cannot define from","tx",e),Y(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};Vs=new WeakMap,I0=new WeakMap,R0=new WeakMap,M0=new WeakMap,B0=new WeakMap,D0=new WeakMap,L0=new WeakMap,$0=new WeakMap,U0=new WeakMap,F0=new WeakMap,j0=new WeakMap,z0=new WeakMap;let m1=Jl;const K$=new Uint8Array(32);K$.fill(0);const Bne=BigInt(-1),W$=BigInt(0),J$=BigInt(1),Dne=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Lne(t){const e=mt(t),n=e.length%32;return n?nr([e,K$.slice(n)]):Ge(e)}const $ne=us(J$,32),Une=us(W$,32),nN={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},K6=["name","version","chainId","verifyingContract","salt"];function rN(t){return function(e){return Y(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Fne={name:rN("name"),version:rN("version"),chainId:function(t){const e=qe(t,"domain.chainId");return Y(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):$u(e)},verifyingContract:function(t){try{return Xt(t).toLowerCase()}catch{}Y(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=mt(t,"domain.salt");return Y(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ge(e)}};function W6(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");Y(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=ry(Dne,n?r-1:r),a=n?(i+J$)*Bne:W$;return function(o){const s=qe(o,"value");return Y(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?a$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Y(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=mt(r);return Y(i.length===n,`invalid length for ${t}`,"value",r),Lne(r)}}}switch(t){case"address":return function(e){return ah(Xt(e),32)};case"bool":return function(e){return e?$ne:Une};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return oh(e)}}return null}function iN(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Nm,Qs,H0,o2,Y$;const ba=class ba{constructor(e){R(this,o2);I(this,"primaryType");R(this,Nm,void 0);R(this,Qs,void 0);R(this,H0,void 0);O(this,Nm,JSON.stringify(e)),O(this,Qs,new Map),O(this,H0,new Map);const n=new Map,r=new Map,i=new Map;Object.keys(e).forEach(s=>{n.set(s,new Set),r.set(s,[]),i.set(s,new Set)});for(const s in e){const l=new Set;for(const c of e[s]){Y(!l.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(s)}`,"types",e),l.add(c.name);const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Y(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!W6(u)&&(Y(r.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),r.get(u).push(s),n.get(s).add(u))}}const a=Array.from(r.keys()).filter(s=>r.get(s).length===0);Y(a.length!==0,"missing primary type","types",e),Y(a.length===1,`ambiguous primary types or unused types: ${a.map(s=>JSON.stringify(s)).join(", ")}`,"types",e),lt(this,{primaryType:a[0]});function o(s,l){Y(!l.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),l.add(s);for(const c of n.get(s))if(r.has(c)){o(c,l);for(const u of l)i.get(u).add(c)}l.delete(s)}o(this.primaryType,new Set);for(const[s,l]of i){const c=Array.from(l);c.sort(),g(this,Qs).set(s,iN(s,e[s])+c.map(u=>iN(u,e[u])).join(""))}}get types(){return JSON.parse(g(this,Nm))}getEncoder(e){let n=g(this,H0).get(e);return n||(n=te(this,o2,Y$).call(this,e),g(this,H0).set(e,n)),n}encodeType(e){const n=g(this,Qs).get(e);return Y(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Sn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(W6(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Y(!i[3]||parseInt(i[3])===n.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",n),n.map(o=>this._visit(i[1],o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});Y(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new ba(e)}static getPrimaryType(e){return ba.from(e).primaryType}static hashStruct(e,n,r){return ba.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=nN[r];Y(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>K6.indexOf(r.name)-K6.indexOf(i.name)),ba.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return nr(["0x1901",ba.hashDomain(e),ba.from(n).hash(r)])}static hash(e,n,r){return Sn(ba.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!Pn(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=ba.from(n);o.visit(r,(s,l)=>(s==="address"&&!Pn(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){ba.hashDomain(e);const i={},a=[];K6.forEach(l=>{const c=e[l];c!=null&&(i[l]=Fne[l](c),a.push({name:l,type:nN[l]}))});const o=ba.from(n),s=Object.assign({},n);return Y(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return Ge(mt(c));if(l.match(/^u?int/))return qe(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return Y(typeof c=="string","invalid string","value",c),c}Y(!1,"unsupported type","type",l)})}}};Nm=new WeakMap,Qs=new WeakMap,H0=new WeakMap,o2=new WeakSet,Y$=function(e){{const i=W6(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{Y(!n[3]||parseInt(n[3])===o.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",o);let s=o.map(a);return g(this,Qs).has(i)&&(s=s.map(Sn)),Sn(nr(s))}}const r=this.types[e];if(r){const i=oh(g(this,Qs).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return g(this,Qs).has(l)?Sn(c):c});return o.unshift(i),nr(o)}}Y(!1,`unknown type: ${e}`,"type",e)};let v1=ba;function ui(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const jne="external public payable",zne=ui(jne.split(" ")),X$="constant external internal payable private public pure view",Hne=ui(X$.split(" ")),Z$="constructor error event fallback function receive struct",q$=ui(Z$.split(" ")),eU="calldata memory storage payable indexed",Gne=ui(eU.split(" ")),Vne="tuple returns",Qne=[Z$,eU,Vne,X$].join(" "),Kne=ui(Qne.split(" ")),Wne={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Jne=new RegExp("^(\\s*)"),Yne=new RegExp("^([0-9]+)"),Xne=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),tU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),nU=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var mr,co,_m,E3;const s2=class s2{constructor(e){R(this,_m);R(this,mr,void 0);R(this,co,void 0);O(this,mr,0),O(this,co,e.slice())}get offset(){return g(this,mr)}get length(){return g(this,co).length-g(this,mr)}clone(){return new s2(g(this,co))}reset(){O(this,mr,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.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 n=te(this,_m,E3).call(this,g(this,mr)+1,e.match+1);return O(this,mr,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;g(this,mr)=g(this,co).length)throw new Error("out-of-bounds");return g(this,co)[g(this,mr)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return ms(this,mr)._++,e}toString(){const e=[];for(let n=g(this,mr);n`}};mr=new WeakMap,co=new WeakMap,_m=new WeakSet,E3=function(e=0,n=0){return new s2(g(this,co).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Oo=s2;function au(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=kt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(Xne),s){if(l.text=s[1],a+=l.text.length,Kne.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(nU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(Yne),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Oo(e.map(o=>Object.freeze(o)))}function aN(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function Z2(t,e){if(e.peekKeyword(q$)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function xl(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function rU(t){let e=xl(t,Hne);return aN(e,ui("constant payable nonpayable".split(" "))),aN(e,ui("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 ul(t,e){return t.popParams().map(n=>Pr.from(n,e))}function iU(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return qe(t.pop().text);throw new Error("invalid gas")}return null}function sh(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const Zne=new RegExp(/^(.*)\[([0-9]*)\]$/);function oN(t){const e=t.match(nU);if(Y(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);Y(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);Y(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const En={},Li=Symbol.for("_ethers_internal"),sN="_ParamTypeInternal",lN="_ErrorInternal",cN="_EventInternal",uN="_ConstructorInternal",fN="_FallbackInternal",hN="_FunctionInternal",dN="_StructInternal";var G0,qb;const wa=class wa{constructor(e,n,r,i,a,o,s,l){R(this,G0);I(this,"name");I(this,"type");I(this,"baseType");I(this,"indexed");I(this,"components");I(this,"arrayLength");I(this,"arrayChildren");if(K2(e,En,"ParamType"),Object.defineProperty(this,Li,{value:sN}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");lt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){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 r=this;return e.map(i=>r.arrayChildren.walk(i,n))}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 r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return te(this,G0,qb).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(wa.isParamType(e))return e;if(typeof e=="string")try{return wa.from(au(e),n)}catch{Y(!1,"invalid param type","obj",e)}else if(e instanceof Oo){let s="",l="",c=null;xl(e,ui(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>wa.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=oN(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new wa(En,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(xl(e,Gne).has("indexed")){if(!n)throw new Error("");h=!0}const y=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new wa(En,y,s,l,h,c,f,u)}const r=e.name;Y(!r||typeof r=="string"&&r.match(tU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(Y(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(Zne);if(o){const s=parseInt(o[2]||"-1"),l=wa.from({type:o[1],components:e.components});return new wa(En,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>wa.from(c)):null;return new wa(En,r||"",a,"tuple",i,s,null,null)}return a=oN(e.type),new wa(En,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Li]===sN}};G0=new WeakSet,qb=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;te(u=o,G0,qb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;te(u=o[c],G0,qb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)};let Pr=wa;class lh{constructor(e,n,r){I(this,"type");I(this,"inputs");K2(e,En,"Fragment"),r=Object.freeze(r.slice()),lt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{lh.from(JSON.parse(e))}catch{}return lh.from(au(e))}if(e instanceof Oo)switch(e.peekKeyword(q$)){case"constructor":return rl.from(e);case"error":return Ci.from(e);case"event":return Xo.from(e);case"fallback":case"receive":return Ts.from(e);case"function":return Zo.from(e);case"struct":return Ff.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return rl.from(e);case"error":return Ci.from(e);case"event":return Xo.from(e);case"fallback":case"receive":return Ts.from(e);case"function":return Zo.from(e);case"struct":return Ff.from(e)}ge(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Y(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return rl.isFragment(e)}static isError(e){return Ci.isFragment(e)}static isEvent(e){return Xo.isFragment(e)}static isFunction(e){return Zo.isFragment(e)}static isStruct(e){return Ff.isFragment(e)}}class q2 extends lh{constructor(n,r,i,a){super(n,r,a);I(this,"name");Y(typeof i=="string"&&i.match(tU),"invalid identifier","name",i),a=Object.freeze(a.slice()),lt(this,{name:i})}}function b1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class Ci extends q2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Li,{value:lN})}get selector(){return oh(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(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+b1(e,this.inputs)),n.join(" ")}static from(e){if(Ci.isFragment(e))return e;if(typeof e=="string")return Ci.from(au(e));if(e instanceof Oo){const n=Z2("error",e),r=ul(e);return sh(e),new Ci(En,n,r)}return new Ci(En,e.name,e.inputs?e.inputs.map(Pr.from):[])}static isFragment(e){return e&&e[Li]===lN}}class Xo extends q2{constructor(n,r,i,a){super(n,"event",r,i);I(this,"anonymous");Object.defineProperty(this,Li,{value:cN}),lt(this,{anonymous:a})}get topicHash(){return oh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+b1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>Pr.from(a)),new Xo(En,n,r,!1).topicHash}static from(n){if(Xo.isFragment(n))return n;if(typeof n=="string")try{return Xo.from(au(n))}catch{Y(!1,"invalid event fragment","obj",n)}else if(n instanceof Oo){const r=Z2("event",n),i=ul(n,!0),a=!!xl(n,ui(["anonymous"])).has("anonymous");return sh(n),new Xo(En,r,i,a)}return new Xo(En,n.name,n.inputs?n.inputs.map(r=>Pr.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[Li]===cN}}class rl extends lh{constructor(n,r,i,a,o){super(n,r,i);I(this,"payable");I(this,"gas");Object.defineProperty(this,Li,{value:uN}),lt(this,{payable:a,gas:o})}format(n){if(ge(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="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(n)))});const r=[`constructor${b1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(rl.isFragment(n))return n;if(typeof n=="string")try{return rl.from(au(n))}catch{Y(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Oo){xl(n,ui(["constructor"]));const r=ul(n),i=!!xl(n,zne).has("payable"),a=iU(n);return sh(n),new rl(En,"constructor",r,i,a)}return new rl(En,"constructor",n.inputs?n.inputs.map(Pr.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Li]===uN}}class Ts extends lh{constructor(n,r,i){super(n,"fallback",r);I(this,"payable");Object.defineProperty(this,Li,{value:fN}),lt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Ts.isFragment(n))return n;if(typeof n=="string")try{return Ts.from(au(n))}catch{Y(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Oo){const r=n.toString(),i=n.peekKeyword(ui(["fallback","receive"]));if(Y(i,"type must be fallback or receive","obj",r),n.popKeyword(ui(["fallback","receive"]))==="receive"){const l=ul(n);return Y(l.length===0,"receive cannot have arguments","obj.inputs",l),xl(n,ui(["payable"])),sh(n),new Ts(En,[],!0)}let o=ul(n);o.length?Y(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Pr.from("bytes")];const s=rU(n);if(Y(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),xl(n,ui(["returns"])).has("returns")){const l=ul(n);Y(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return sh(n),new Ts(En,o,s==="payable")}if(n.type==="receive")return new Ts(En,[],!0);if(n.type==="fallback"){const r=[Pr.from("bytes")],i=n.stateMutability==="payable";return new Ts(En,r,i)}Y(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Li]===fN}}class Zo extends q2{constructor(n,r,i,a,o,s){super(n,"function",r,a);I(this,"constant");I(this,"outputs");I(this,"stateMutability");I(this,"payable");I(this,"gas");Object.defineProperty(this,Li,{value:hN}),o=Object.freeze(o.slice()),lt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return oh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="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(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+b1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(b1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>Pr.from(a)),new Zo(En,n,"view",r,[],null).selector}static from(n){if(Zo.isFragment(n))return n;if(typeof n=="string")try{return Zo.from(au(n))}catch{Y(!1,"invalid function fragment","obj",n)}else if(n instanceof Oo){const i=Z2("function",n),a=ul(n),o=rU(n);let s=[];xl(n,ui(["returns"])).has("returns")&&(s=ul(n));const l=iU(n);return sh(n),new Zo(En,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new Zo(En,n.name,r,n.inputs?n.inputs.map(Pr.from):[],n.outputs?n.outputs.map(Pr.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Li]===hN}}class Ff extends q2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Li,{value:dN})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Ff.from(au(e))}catch{Y(!1,"invalid struct fragment","obj",e)}else if(e instanceof Oo){const n=Z2("struct",e),r=ul(e);return sh(e),new Ff(En,n,r)}return new Ff(En,e.name,e.inputs?e.inputs.map(Pr.from):[])}static isFragment(e){return e&&e[Li]===dN}}const Co=new Map;Co.set(0,"GENERIC_PANIC");Co.set(1,"ASSERT_FALSE");Co.set(17,"OVERFLOW");Co.set(18,"DIVIDE_BY_ZERO");Co.set(33,"ENUM_RANGE_ERROR");Co.set(34,"BAD_STORAGE_DATA");Co.set(49,"STACK_UNDERFLOW");Co.set(50,"ARRAY_RANGE_ERROR");Co.set(65,"OUT_OF_MEMORY");Co.set(81,"UNINITIALIZED_FUNCTION_CALL");const qne=new RegExp(/^bytes([0-9]*)$/),ere=new RegExp(/^(u?int)([0-9]*)$/);let J6=null,pN=1024;function tre(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=mt(n);if(n=Ge(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Ge(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Ge(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${Co.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?Xt(e.to):null,data:e.data||"0x"};return e.from&&(l.from=Xt(e.from)),Kn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var bc,jh;const l2=class l2{constructor(){R(this,bc)}getDefaultValue(e){const n=e.map(i=>te(this,bc,jh).call(this,Pr.from(i)));return new Xv(n,"_").defaultValue()}encode(e,n){n$(n.length,e.length,"types/values length mismatch");const r=e.map(o=>te(this,bc,jh).call(this,Pr.from(o))),i=new Xv(r,"_"),a=new d3;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>te(this,bc,jh).call(this,Pr.from(o)));return new Xv(i,"_").decode(new p3(n,r,pN))}static _setDefaultMaxInflation(e){Y(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),pN=e}static defaultAbiCoder(){return J6==null&&(J6=new l2),J6}static getBuiltinCallException(e,n,r){return tre(e,n,r,l2.defaultAbiCoder())}};bc=new WeakSet,jh=function(e){if(e.isArray())return new Nte(te(this,bc,jh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Xv(e.components.map(r=>te(this,bc,jh).call(this,r)),e.name);switch(e.baseType){case"address":return new Cte(e.name);case"bool":return new _te(e.name);case"string":return new Fte(e.name);case"bytes":return new Ite(e.name);case"":return new Bte(e.name)}let n=e.type.match(ere);if(n){let r=parseInt(n[2]||"256");return Y(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Ute(r/8,n[1]==="int",e.name)}if(n=e.type.match(qne),n){let r=parseInt(n[1]);return Y(r!==0&&r<=32,"invalid bytes length","param",e),new Rte(r,e.name)}Y(!1,"invalid type","type",e.type)};let w1=l2;class nre{constructor(e,n,r){I(this,"fragment");I(this,"name");I(this,"signature");I(this,"topic");I(this,"args");const i=e.name,a=e.format();lt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}}class rre{constructor(e,n,r,i){I(this,"fragment");I(this,"name");I(this,"args");I(this,"signature");I(this,"selector");I(this,"value");const a=e.name,o=e.format();lt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}}class ire{constructor(e,n,r){I(this,"fragment");I(this,"name");I(this,"args");I(this,"signature");I(this,"selector");const i=e.name,a=e.format();lt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}}class gN{constructor(e){I(this,"hash");I(this,"_isIndexed");lt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const yN={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"},mN={"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&&yN[t.toString()]&&(e=yN[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Go,Vo,Qo,Lr,V0,ew,Q0,tw;const yd=class yd{constructor(e){R(this,V0);R(this,Q0);I(this,"fragments");I(this,"deploy");I(this,"fallback");I(this,"receive");R(this,Go,void 0);R(this,Vo,void 0);R(this,Qo,void 0);R(this,Lr,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,Qo,new Map),O(this,Go,new Map),O(this,Vo,new Map);const r=[];for(const o of n)try{r.push(lh.from(o))}catch(s){console.log("EE",s)}lt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Lr,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}lt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(Y(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=g(this,Qo);break;case"event":l=g(this,Vo);break;case"error":l=g(this,Go);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||lt(this,{deploy:rl.from("constructor()")}),lt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return w1.defaultAbiCoder()}getFunctionName(e){const n=te(this,V0,ew).call(this,e,null,!1);return Y(n,"no matching function","key",e),n.name}hasFunction(e){return!!te(this,V0,ew).call(this,e,null,!1)}getFunction(e,n){return te(this,V0,ew).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(g(this,Qo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Y(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=Ci.from(e).format(),e==="Error(string)")return Ci.from("error Error(string)");if(e==="Panic(uint256)")return Ci.from("error Panic(uint256)");const r=g(this,Go).get(e);return r||null}forEachError(e){const n=Array.from(g(this,Go).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?oh(o):a.type==="bytes"?Sn(Ge(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=us(o):a.type.match(/^bytes/)?o=nte(o,32):a.type==="address"&&g(this,Lr).encode(["address"],[o]),ah(Ge(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){Y(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?Y(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);Y(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),Y(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(oh(l));else if(o.type==="bytes")r.push(Sn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(g(this,Lr).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:g(this,Lr).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);Y(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;Y(Pn(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,y)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Pr.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?g(this,Lr).decode(i,nr(r)):null,l=g(this,Lr).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,y)=>{let p=null;if(d.indexed)if(s==null)p=new gN(null);else if(o[y])p=new gN(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),Zw.fromItems(c,u)}parseTransaction(e){const n=mt(e.data,"tx.data"),r=qe(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Ge(n.slice(0,4)));if(!i)return null;const a=g(this,Lr).decode(i.inputs,n.slice(4));return new rre(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new nre(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=Ge(e),r=this.getError(Mn(n,0,4));if(!r)return null;const i=g(this,Lr).decode(r.inputs,Mn(n,4));return new ire(r,r.selector,i)}static from(e){return e instanceof yd?e:typeof e=="string"?new yd(JSON.parse(e)):typeof e.format=="function"?new yd(e.format("json")):new yd(e)}};Go=new WeakMap,Vo=new WeakMap,Qo=new WeakMap,Lr=new WeakMap,V0=new WeakSet,ew=function(e,n,r){if(Pn(e)){const a=e.toLowerCase();for(const o of g(this,Qo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of g(this,Qo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Qr.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Y(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=g(this,Qo).get(Zo.from(e).format());return i||null},Q0=new WeakSet,tw=function(e,n,r){if(Pn(e)){const a=e.toLowerCase();for(const o of g(this,Vo).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of g(this,Vo))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Y(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=g(this,Vo).get(Xo.from(e).format());return i||null};let S3=yd;const aU=BigInt(0);function Py(t){return t??null}function zr(t){return t==null?null:t.toString()}class vN{constructor(e,n,r){I(this,"gasPrice");I(this,"maxFeePerGas");I(this,"maxPriorityFeePerGas");lt(this,{gasPrice:Py(e),maxFeePerGas:Py(n),maxPriorityFeePerGas:Py(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:zr(e),maxFeePerGas:zr(n),maxPriorityFeePerGas:zr(r)}}}function rx(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Ge(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=qe(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=kt(t[i],`request.${i}`));return t.accessList&&(e.accessList=bh(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 Ks;class are{constructor(e,n){I(this,"provider");I(this,"number");I(this,"hash");I(this,"timestamp");I(this,"parentHash");I(this,"nonce");I(this,"difficulty");I(this,"gasLimit");I(this,"gasUsed");I(this,"miner");I(this,"extraData");I(this,"baseFeePerGas");R(this,Ks,void 0);O(this,Ks,e.transactions.map(r=>typeof r!="string"?new x1(r,n):r)),lt(this,{provider:n,hash:Py(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:Py(e.baseFeePerGas)})}get transactions(){return g(this,Ks).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=g(this,Ks).slice();return e.length===0?[]:(ge(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}=this;return{_type:"Block",baseFeePerGas:zr(e),difficulty:zr(n),extraData:r,gasLimit:zr(i),gasUsed:zr(a),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew ov(i,n))));let r=aU;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),lt(this,{provider:n,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:r,type:e.type,status:e.status,root:e.root})}get logs(){return g(this,Im)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:zr(this.cumulativeGasUsed),from:n,gasPrice:zr(this.gasPrice),gasUsed:zr(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ei({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;ge(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const y=[],p=()=>{y.forEach(v=>v())};if(y.push(()=>{s=!0}),i>0){const v=setTimeout(()=>{p(),d(Kn("wait for transaction timeout","TIMEOUT"))},i);y.push(()=>{clearTimeout(v)})}const m=async v=>{if(await v.confirmations()>=r){p();try{h(c(v))}catch(w){d(w)}}};if(y.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const v=async()=>{try{await l()}catch(w){if(Vr(w,"TRANSACTION_REPLACED")){p(),d(w);return}}s||this.provider.once("block",v)};y.push(()=>{this.provider.off("block",v)}),this.provider.once("block",v)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return ge(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),lU(this)}reorderedEvent(e){return ge(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ge(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),sU(this,e)}replaceableTransaction(e){Y(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new N4(this,this.provider);return O(n,wc,e),n}};wc=new WeakMap;let x1=N4;function ore(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function sU(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function lU(t){return{orphan:"drop-transaction",tx:t}}function sre(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 fO extends ov{constructor(n,r,i){super(n,n.provider);I(this,"interface");I(this,"fragment");I(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);lt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class cU extends ov{constructor(n,r){super(n,n.provider);I(this,"error");lt(this,{error:r})}}var K0;class lre extends oU{constructor(n,r,i){super(i,r);R(this,K0,void 0);O(this,K0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?g(this,K0).getEvent(n.topics[0]):null;if(r)try{return new fO(n,g(this,K0),r)}catch(i){return new cU(n,i)}return n})}}K0=new WeakMap;var Rm;class hO extends x1{constructor(n,r,i){super(i,r);R(this,Rm,void 0);O(this,Rm,n)}async wait(n){const r=await super.wait(n);return r==null?null:new lre(g(this,Rm),this.provider,r)}}Rm=new WeakMap;class uU extends o${constructor(n,r,i,a){super(n,r,i);I(this,"log");lt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class cre extends uU{constructor(e,n,r,i,a){super(e,n,r,new fO(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);lt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const bN=BigInt(0);function fU(t){return t&&typeof t.call=="function"}function hU(t){return t&&typeof t.estimateGas=="function"}function eA(t){return t&&typeof t.resolveName=="function"}function dU(t){return t&&typeof t.sendTransaction=="function"}function pU(t){if(t!=null){if(eA(t))return t;if(t.provider)return t.provider}}var Mm;class ure{constructor(e,n,r){R(this,Mm,void 0);I(this,"fragment");if(lt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>ci(h,a))):ci(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return g(this,Mm)}}Mm=new WeakMap;function ch(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Fu(t){return t==null?null:t.provider||null}async function gU(t,e){const n=Qr.dereference(t,"overrides");Y(typeof n=="object","invalid overrides parameter","overrides",t);const r=rx(n);return Y(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Y(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function fre(t,e,n){const r=ch(t,"resolveName"),i=eA(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Qr.dereference(l,s),s==="address"?ci(l,i):l))))}function hre(t){const e=async function(o){const s=await gU(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await ci(s.from,pU(t.runner)));const l=t.interface,c=qe(s.value||bN,"overrides.value")===bN,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&Y(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return Y(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=ch(t.runner,"call");ge(fU(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw nO(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;ge(dU(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=Fu(t.runner);return new hO(t.interface,c,l)},i=async function(o){const s=ch(t.runner,"estimateGas");return ge(hU(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return lt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function dre(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return ge(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await gU(c.pop()),f.from&&(f.from=await ci(f.from,pU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await fre(t.runner,u.inputs,c);return Object.assign({},f,await ei({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;ge(dU(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=Fu(t.runner);return new hO(t.interface,h,f)},o=async function(...c){const u=ch(t.runner,"estimateGas");return ge(hU(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=ch(t.runner,"call");ge(fU(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(y){throw nO(y)&&y.data?t.interface.makeError(y.data,f):y}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return lt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return ge(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function pre(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return ge(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new ure(t,n(...i),i)};return lt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ge(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const ix=Symbol.for("_ethersInternal_contract"),yU=new WeakMap;function gre(t,e){yU.set(t[ix],e)}function Gi(t){return yU.get(t[ix])}function yre(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function dO(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(Pn(o,32))return o;const s=t.interface.getEvent(o);return Y(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?Pn(e,32)?n=[e]:(r=t.interface.getEvent(e),Y(r,"unknown fragment","event",e),n=[r.topicHash]):yre(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):Y(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function oy(t,e){const{subs:n}=Gi(t);return n.get((await dO(t,e)).tag)||null}async function wN(t,e,n){const r=Fu(t.runner);ge(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await dO(t,n),{addr:s,subs:l}=Gi(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let v=i;if(v==null)try{v=t.interface.getEvent(m.topics[0])}catch{}if(v){const w=v,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];O3(t,n,x,E=>new cre(t,E,n,w,m))}else O3(t,n,[],w=>new uU(t,w,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let P3=Promise.resolve();async function mre(t,e,n,r){await P3;const i=await oy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Gi(t).subs.delete(i.tag)),a>0}async function O3(t,e,n,r){try{await P3}catch{}const i=mre(t,e,n,r);return P3=i,await i}const Zv=["then"];var KSe;const Dy=class Dy{constructor(e,n,r,i){I(this,"target");I(this,"interface");I(this,"runner");I(this,"filters");I(this,KSe);I(this,"fallback");Y(typeof e=="string"||v$(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=S3.from(n);lt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,ix,{value:{}});let o,s=null,l=null;if(i){const f=Fu(r);l=new hO(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(Pn(e))s=e,o=Promise.resolve(e);else{const f=ch(r,"resolveName");if(!eA(f))throw Kn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw Kn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Gi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Gi(this).addr=f,f});gre(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Zv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(y){if(!Vr(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(f,h)=>Zv.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return lt(this,{filters:u}),lt(this,{fallback:a.receive||a.fallback?hre(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Zv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(y){if(!Vr(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(f,h)=>typeof h=="symbol"||h in f||Zv.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Dy(this.target,this.interface,e)}attach(e){return new Dy(e,this.interface,this.runner)}async getAddress(){return await Gi(this).addrPromise}async getDeployedCode(){const e=Fu(this.runner);ge(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Fu(this.runner);return ge(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Gi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),dre(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),pre(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Gi(this),o=i||await a,{fragment:s,topics:l}=await dO(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=Fu(this.runner);return ge(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new fO(f,this.interface,h)}catch(d){return new cU(f,d)}return new ov(f,u)})}async on(e,n){const r=await wN(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await wN(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await O3(this,e,n,null)}async listenerCount(e){if(e){const i=await oy(this,e);return i?i.listeners.length:0}const{subs:n}=Gi(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await oy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Gi(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await oy(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Gi(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await oy(this,e);if(!n)return this;n.stop(),Gi(this).subs.delete(n.tag)}else{const{subs:n}=Gi(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Dy{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};KSe=ix;let T3=Dy;function vre(){return T3}class Oy extends vre(){}function Y6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Y(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class bre{constructor(e){I(this,"name");lt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const mU=new RegExp("^(ipfs)://(.*)$","i"),xN=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),mU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var xc,Pf,Ac,zh,c2,vU;const md=class md{constructor(e,n,r){R(this,Ac);I(this,"provider");I(this,"address");I(this,"name");R(this,xc,void 0);R(this,Pf,void 0);lt(this,{provider:e,address:n,name:r}),O(this,xc,null),O(this,Pf,new Oy(n,["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 g(this,xc)==null&&O(this,xc,(async()=>{try{return await g(this,Pf).supportsInterface("0x9061b923")}catch(e){if(Vr(e,"CALL_EXCEPTION"))return!1;throw O(this,xc,null),e}})()),await g(this,xc)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await te(this,Ac,zh).call(this,"addr(bytes32)");return a==null||a===y3?null:a}catch(a){if(Vr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await te(this,Ac,zh).call(this,"addr(bytes32,uint)",[a]);if(Pn(o,20))return Xt(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof bre&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await te(this,Ac,zh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;ge(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await te(this,Ac,zh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await te(this,Ac,zh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${ate("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ge(!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 n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(!Array.isArray(e))throw new Error("not an array");return e.map(n=>t(n))}}function sv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";ge(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function wre(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Y(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Op(t){return Y(Pn(t,!0),"invalid data","value",t),t}function ja(t){return Y(Pn(t,32),"invalid hash","value",t),t}const xre=sv({address:Xt,blockHash:ja,blockNumber:kt,data:Op,index:kt,removed:wn(wre,!1),topics:pO(ja),transactionHash:ja,transactionIndex:kt},{index:["logIndex"]});function Are(t){return xre(t)}const Ere=sv({hash:wn(ja),parentHash:ja,number:kt,timestamp:kt,nonce:wn(Op),difficulty:qe,gasLimit:qe,gasUsed:qe,miner:wn(Xt),extraData:Op,baseFeePerGas:wn(qe)});function Sre(t){const e=Ere(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:bU(n)),e}const Pre=sv({transactionIndex:kt,blockNumber:kt,transactionHash:ja,address:Xt,topics:pO(ja),data:Op,index:kt,blockHash:ja},{index:["logIndex"]});function Ore(t){return Pre(t)}const Tre=sv({to:wn(Xt,null),from:wn(Xt,null),contractAddress:wn(Xt,null),index:kt,root:wn(Ge),gasUsed:qe,logsBloom:wn(Op),blockHash:ja,hash:ja,logs:pO(Ore),blockNumber:kt,cumulativeGasUsed:qe,effectiveGasPrice:wn(qe),status:wn(kt),type:wn(kt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Cre(t){return Tre(t)}function bU(t){t.to&&qe(t.to)===AN&&(t.to="0x0000000000000000000000000000000000000000");const e=sv({hash:ja,type:n=>n==="0x"||n==null?0:kt(n),accessList:wn(bh,null),blockHash:wn(ja,null),blockNumber:wn(kt,null),transactionIndex:wn(kt,null),from:Xt,gasPrice:wn(qe),maxPriorityFeePerGas:wn(qe),maxFeePerGas:wn(qe),gasLimit:qe,to:wn(Xt,null),value:qe,nonce:kt,data:Op,creates:wn(Xt,null),chainId:wn(qe,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Tte(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Po.from(t.signature):e.signature=Po.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&qe(e.blockHash)===AN&&(e.blockHash=null),e}const kre="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class lv{constructor(e){I(this,"name");lt(this,{name:e})}clone(){return new lv(this.name)}}class tA extends lv{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);I(this,"effectiveBlock");I(this,"txBase");I(this,"txCreate");I(this,"txDataZero");I(this,"txDataNonzero");I(this,"txAccessListStorageKey");I(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),Y(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),lt(this,i)}clone(){return new tA(this.effectiveBlock,this)}}class nA extends lv{constructor(n,r){super("org.ethers.plugins.network.Ens");I(this,"address");I(this,"targetNetwork");lt(this,{address:n||kre,targetNetwork:r??1})}clone(){return new nA(this.address,this.targetNetwork)}}var Bm,Dm;class Nre extends lv{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");R(this,Bm,void 0);R(this,Dm,void 0);O(this,Bm,n),O(this,Dm,r)}get url(){return g(this,Bm)}get processFunc(){return g(this,Dm)}clone(){return this}}Bm=new WeakMap,Dm=new WeakMap;const X6=new Map;var W0,J0,Ec;const vd=class vd{constructor(e,n){R(this,W0,void 0);R(this,J0,void 0);R(this,Ec,void 0);O(this,W0,e),O(this,J0,qe(n)),O(this,Ec,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return g(this,W0)}set name(e){O(this,W0,e)}get chainId(){return g(this,J0)}set chainId(e){O(this,J0,qe(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===qe(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===qe(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===qe(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(g(this,Ec).values())}attachPlugin(e){if(g(this,Ec).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return g(this,Ec).set(e.name,e.clone()),this}getPlugin(e){return g(this,Ec).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new vd(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new tA;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function SN(t){return new Nre(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:EN(s.maxFee,9),maxPriorityFeePerGas:EN(s.maxPriorityFee,9)}}catch(a){ge(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let PN=!1;function _re(){if(PN)return;PN=!0;function t(e,n,r){const i=function(){const a=new es(e,n);return r.ensNetwork!=null&&a.attachPlugin(new nA(null,r.ensNetwork)),a.attachPlugin(new tA),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};es.register(e,i),es.register(n,i),r.altNames&&r.altNames.forEach(a=>{es.register(a,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("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[SN("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[SN("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function C3(t){return JSON.parse(JSON.stringify(t))}var Ws,Pa,Sc,Ko,Y0,nw;class Ire{constructor(e){R(this,Y0);R(this,Ws,void 0);R(this,Pa,void 0);R(this,Sc,void 0);R(this,Ko,void 0);O(this,Ws,e),O(this,Pa,null),O(this,Sc,4e3),O(this,Ko,-2)}get pollingInterval(){return g(this,Sc)}set pollingInterval(e){O(this,Sc,e)}start(){g(this,Pa)||(O(this,Pa,g(this,Ws)._setTimeout(te(this,Y0,nw).bind(this),g(this,Sc))),te(this,Y0,nw).call(this))}stop(){g(this,Pa)&&(g(this,Ws)._clearTimeout(g(this,Pa)),O(this,Pa,null))}pause(e){this.stop(),e&&O(this,Ko,-2)}resume(){this.start()}}Ws=new WeakMap,Pa=new WeakMap,Sc=new WeakMap,Ko=new WeakMap,Y0=new WeakSet,nw=async function(){try{const e=await g(this,Ws).getBlockNumber();if(g(this,Ko)===-2){O(this,Ko,e);return}if(e!==g(this,Ko)){for(let n=g(this,Ko)+1;n<=e;n++){if(g(this,Pa)==null)return;await g(this,Ws).emit("block",n)}O(this,Ko,e)}}catch{}g(this,Pa)!=null&&O(this,Pa,g(this,Ws)._setTimeout(te(this,Y0,nw).bind(this),g(this,Sc)))};var Of,Tf,Pc;class gO{constructor(e){R(this,Of,void 0);R(this,Tf,void 0);R(this,Pc,void 0);O(this,Of,e),O(this,Pc,!1),O(this,Tf,n=>{this._poll(n,g(this,Of))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){g(this,Pc)||(O(this,Pc,!0),g(this,Tf).call(this,-2),g(this,Of).on("block",g(this,Tf)))}stop(){g(this,Pc)&&(O(this,Pc,!1),g(this,Of).off("block",g(this,Tf)))}pause(e){this.stop()}resume(){this.start()}}Of=new WeakMap,Tf=new WeakMap,Pc=new WeakMap;var X0,Js;class Rre extends gO{constructor(n,r){super(n);R(this,X0,void 0);R(this,Js,void 0);O(this,X0,r),O(this,Js,-2)}pause(n){n&&O(this,Js,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(g(this,X0));i!=null&&(g(this,Js)===-2?O(this,Js,i.number):i.number>g(this,Js)&&(r.emit(g(this,X0),i.number),O(this,Js,i.number)))}}X0=new WeakMap,Js=new WeakMap;var u2;class Mre extends gO{constructor(n,r){super(n);R(this,u2,void 0);O(this,u2,C3(r))}async _poll(n,r){throw new Error("@TODO")}}u2=new WeakMap;var Z0;class Bre extends gO{constructor(n,r){super(n);R(this,Z0,void 0);O(this,Z0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(g(this,Z0));i&&r.emit(g(this,Z0),i)}}Z0=new WeakMap;var Ys,q0,ep,Oc,Oa,f2,wU;class yO{constructor(e,n){R(this,f2);R(this,Ys,void 0);R(this,q0,void 0);R(this,ep,void 0);R(this,Oc,void 0);R(this,Oa,void 0);O(this,Ys,e),O(this,q0,C3(n)),O(this,ep,te(this,f2,wU).bind(this)),O(this,Oc,!1),O(this,Oa,-2)}start(){g(this,Oc)||(O(this,Oc,!0),g(this,Oa)===-2&&g(this,Ys).getBlockNumber().then(e=>{O(this,Oa,e)}),g(this,Ys).on("block",g(this,ep)))}stop(){g(this,Oc)&&(O(this,Oc,!1),g(this,Ys).off("block",g(this,ep)))}pause(e){this.stop(),e&&O(this,Oa,-2)}resume(){this.start()}}Ys=new WeakMap,q0=new WeakMap,ep=new WeakMap,Oc=new WeakMap,Oa=new WeakMap,f2=new WeakSet,wU=async function(e){if(g(this,Oa)===-2)return;const n=C3(g(this,q0));n.fromBlock=g(this,Oa)+1,n.toBlock=e;const r=await g(this,Ys).getLogs(n);if(r.length===0){g(this,Oa){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class xU{constructor(e){I(this,"name");lt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function $re(t){return JSON.parse(JSON.stringify(t))}function k3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function Z6(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"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(Pn(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:rw("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:rw("orphan",n),filter:$re(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?k3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{Pn(s)?i.push(s):a.push((async()=>{i.push(await ci(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=k3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:rw("event",r),type:"event"}}Y(!1,"unknown ProviderEvent","event",t)}function q6(){return new Date().getTime()}const Ure={cacheTimeout:250,pollingInterval:4e3};var $r,Tc,Ur,tp,Zi,Cf,Cc,Xs,Lm,Ta,np,rp,Xr,zi,$m,N3,Um,_3,kf,sy,Fm,I3,Nf,ly,ip,iw;class AU{constructor(e,n){R(this,Xr);R(this,$m);R(this,Um);R(this,kf);R(this,Fm);R(this,Nf);R(this,ip);R(this,$r,void 0);R(this,Tc,void 0);R(this,Ur,void 0);R(this,tp,void 0);R(this,Zi,void 0);R(this,Cf,void 0);R(this,Cc,void 0);R(this,Xs,void 0);R(this,Lm,void 0);R(this,Ta,void 0);R(this,np,void 0);R(this,rp,void 0);if(O(this,rp,Object.assign({},Ure,n||{})),e==="any")O(this,Cf,!0),O(this,Zi,null);else if(e){const r=es.from(e);O(this,Cf,!1),O(this,Zi,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,Cf,!1),O(this,Zi,null);O(this,Xs,-1),O(this,Cc,new Map),O(this,$r,new Map),O(this,Tc,new Map),O(this,Ur,null),O(this,tp,!1),O(this,Lm,1),O(this,Ta,new Map),O(this,np,!1)}get pollingInterval(){return g(this,rp).pollingInterval}get provider(){return this}get plugins(){return Array.from(g(this,Tc).values())}attachPlugin(e){if(g(this,Tc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return g(this,Tc).set(e.name,e.connect(this)),this}getPlugin(e){return g(this,Tc).get(e)||null}get disableCcipRead(){return g(this,np)}set disableCcipRead(e){O(this,np,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ge(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new are(Sre(e),this)}_wrapLog(e,n){return new ov(Are(e),this)}_wrapTransactionReceipt(e,n){return new oU(Cre(e),this)}_wrapTransactionResponse(e,n){return new x1(bU(e),this)}_detectNetwork(){ge(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ge(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=kt(await te(this,Xr,zi).call(this,{method:"getBlockNumber"}),"%response");return g(this,Xs)>=0&&O(this,Xs,e),e}_getAddress(e){return ci(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Pn(e))return Pn(e,32)?e:$u(e);if(typeof e=="bigint"&&(e=kt(e,"blockTag")),typeof e=="number")return e>=0?$u(e):g(this,Xs)>=0?$u(g(this,Xs)+e):this.getBlockNumber().then(n=>$u(n+e));Y(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?k3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=rx(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=ci(n[i],this);qv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);qv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(g(this,Zi)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw g(this,Zi)===i&&O(this,Zi,null),a}})();return O(this,Zi,i),(await i).clone()}const e=g(this,Zi),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(g(this,Cf)?(this.emit("network",r,n),g(this,Zi)===e&&O(this,Zi,Promise.resolve(r))):ge(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ei({_block:te(this,Fm,I3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await te(this,Xr,zi).call(this,{method:"getGasPrice"});return qe(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await te(this,Xr,zi).call(this,{method:"getPriorityFee"});return qe(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*Dre+l),new vN(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new wl(r.url),a=await r.processFunc(n,this,i);return new vN(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return qv(n)&&(n=await n),qe(await te(this,Xr,zi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ei({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await te(this,Um,_3).call(this,te(this,$m,N3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return qe(await te(this,kf,sy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return kt(await te(this,kf,sy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return Ge(await te(this,kf,sy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=qe(n,"position");return Ge(await te(this,kf,sy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ei({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=m1.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ei({network:this.getNetwork(),params:te(this,Fm,I3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ei({network:this.getNetwork(),params:te(this,Xr,zi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ei({network:this.getNetwork(),params:te(this,Xr,zi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await te(this,Xr,zi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ei({network:this.getNetwork(),result:te(this,Xr,zi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:Ge(n)}async getLogs(e){let n=this._getFilter(e);qv(n)&&(n=await n);const{network:r,params:i}=await ei({network:this.getNetwork(),params:te(this,Xr,zi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){ge(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await ax.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=Xt(e);const n=A3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await ax.getEnsAddress(this),a=await new Oy(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===y3)return null;const s=await new Oy(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Vr(r,"BAD_DATA")&&r.value==="0x"||Vr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(Kn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ge(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=g(this,Ta).get(e);n&&(n.timer&&clearTimeout(n.timer),g(this,Ta).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=ms(this,Lm)._++,i=()=>{g(this,Ta).delete(r),e()};if(this.paused)g(this,Ta).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);g(this,Ta).set(r,{timer:a,func:i,time:q6()})}return r}_forEachSubscriber(e){for(const n of g(this,$r).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new xU(e.type);case"block":{const n=new Ire(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Rre(this,e.type);case"event":return new yO(this,e.filter);case"transaction":return new Bre(this,e.hash);case"orphan":return new Mre(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of g(this,$r).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),g(this,Ur)!=null&&n.pause(g(this,Ur));break}}async on(e,n){const r=await te(this,ip,iw).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,g(this,Ur)!=null&&r.subscriber.pause(g(this,Ur))),this}async once(e,n){const r=await te(this,ip,iw).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,g(this,Ur)!=null&&r.subscriber.pause(g(this,Ur))),this}async emit(e,...n){const r=await te(this,Nf,ly).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new o$(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),g(this,$r).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await te(this,Nf,ly).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of g(this,$r).values())n+=r.length;return n}async listeners(e){if(e){const r=await te(this,Nf,ly).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of g(this,$r).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await te(this,Nf,ly).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),g(this,$r).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await te(this,ip,iw).call(this,e);r&&i.stop(),g(this,$r).delete(n)}else for(const[n,{started:r,subscriber:i}]of g(this,$r))r&&i.stop(),g(this,$r).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return g(this,tp)}destroy(){this.removeAllListeners();for(const e of g(this,Ta).keys())this._clearTimeout(e);O(this,tp,!0)}get paused(){return g(this,Ur)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,Xs,-1),g(this,Ur)!=null){if(g(this,Ur)==!!e)return;ge(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,Ur,!!e);for(const n of g(this,Ta).values())n.timer&&clearTimeout(n.timer),n.time=q6()-n.time}resume(){if(g(this,Ur)!=null){this._forEachSubscriber(e=>e.resume()),O(this,Ur,null);for(const e of g(this,Ta).values()){let n=e.time;n<0&&(n=0),e.time=q6(),setTimeout(e.func,n)}}}}$r=new WeakMap,Tc=new WeakMap,Ur=new WeakMap,tp=new WeakMap,Zi=new WeakMap,Cf=new WeakMap,Cc=new WeakMap,Xs=new WeakMap,Lm=new WeakMap,Ta=new WeakMap,np=new WeakMap,rp=new WeakMap,Xr=new WeakSet,zi=async function(e){const n=g(this,rp).cacheTimeout;if(n<0)return await this._perform(e);const r=rw(e.method,e);let i=g(this,Cc).get(r);return i||(i=this._perform(e),g(this,Cc).set(r,i),setTimeout(()=>{g(this,Cc).get(r)===i&&g(this,Cc).delete(r)},n)),await i},$m=new WeakSet,N3=async function(e,n,r){ge(r=0&&n==="latest"&&i.to!=null&&Mn(a.data,0,4)==="0x556f1830"){const o=a.data,s=await ci(i.to,this);let l;try{l=Gre(Mn(a.data,4))}catch(f){ge(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}ge(l.sender.toLowerCase()===s.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 c=await this.ccipReadFetch(i,l.calldata,l.urls);ge(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:nr([l.selector,Hre([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await te(this,$m,N3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Um=new WeakSet,_3=async function(e){const{value:n}=await ei({network:this.getNetwork(),value:e});return n},kf=new WeakSet,sy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await te(this,Um,_3).call(this,te(this,Xr,zi).call(this,Object.assign(e,{address:i,blockTag:a})))},Fm=new WeakSet,I3=async function(e,n){if(Pn(e,32))return await te(this,Xr,zi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await te(this,Xr,zi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},Nf=new WeakSet,ly=async function(e,n){let r=await Z6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await Z6({orphan:"drop-log",log:n[0]},this)),g(this,$r).get(r.tag)||null},ip=new WeakSet,iw=async function(e){const n=await Z6(e,this),r=n.tag;let i=g(this,$r).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},g(this,$r).set(r,i)),i};function Fre(t,e){try{const n=R3(t,e);if(n)return iO(n)}catch{}return null}function R3(t,e){if(t==="0x")return null;try{const n=kt(Mn(t,e,e+32)),r=kt(Mn(t,n,n+32));return Mn(t,n+32,n+32+r)}catch{}return null}function ON(t){const e=aa(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function jre(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const zre=new Uint8Array([]);function Hre(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Mn(t,0,32);ge(Mn(n,0,12)===Mn(TN,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Mn(n,12);try{const r=[],i=kt(Mn(t,32,64)),a=kt(Mn(t,i,i+32)),o=Mn(t,i+32);for(let s=0;se[r]),e}function kh(t,e){if(t.provider)return t.provider;ge(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function CN(t,e){let n=rx(e);if(n.to!=null&&(n.to=ci(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),ci(r,t)]).then(([i,a])=>(Y(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ei(n)}class EU{constructor(e){I(this,"provider");lt(this,{provider:e||null})}async getNonce(e){return kh(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await CN(this,e)}async populateTransaction(e){const n=kh(this,"populateTransaction"),r=await CN(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=qe(r.chainId);Y(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Y(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&Y(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ge(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.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=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ge(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ge(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ei(r)}async estimateGas(e){return kh(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return kh(this,"call").call(await this.populateCall(e))}async resolveName(e){return await kh(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=kh(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=m1.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}}function Vre(t){return JSON.parse(JSON.stringify(t))}var xi,Wo,_f,kc,If,ap,jm,M3,zm,B3;class SU{constructor(e){R(this,jm);R(this,zm);R(this,xi,void 0);R(this,Wo,void 0);R(this,_f,void 0);R(this,kc,void 0);R(this,If,void 0);R(this,ap,void 0);O(this,xi,e),O(this,Wo,null),O(this,_f,te(this,jm,M3).bind(this)),O(this,kc,!1),O(this,If,null),O(this,ap,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){g(this,kc)||(O(this,kc,!0),te(this,jm,M3).call(this,-2))}stop(){g(this,kc)&&(O(this,kc,!1),O(this,ap,!0),te(this,zm,B3).call(this),g(this,xi).off("block",g(this,_f)))}pause(e){e&&te(this,zm,B3).call(this),g(this,xi).off("block",g(this,_f))}resume(){this.start()}}xi=new WeakMap,Wo=new WeakMap,_f=new WeakMap,kc=new WeakMap,If=new WeakMap,ap=new WeakMap,jm=new WeakSet,M3=async function(e){try{g(this,Wo)==null&&O(this,Wo,this._subscribe(g(this,xi)));let n=null;try{n=await g(this,Wo)}catch(a){if(!Vr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Wo,null),g(this,xi)._recoverSubscriber(this,this._recover(g(this,xi)));return}const r=await g(this,xi).getNetwork();if(g(this,If)||O(this,If,r),g(this,If).chainId!==r.chainId)throw new Error("chaid changed");if(g(this,ap))return;const i=await g(this,xi).send("eth_getFilterChanges",[n]);await this._emitResults(g(this,xi),i)}catch(n){console.log("@TODO",n)}g(this,xi).once("block",g(this,_f))},zm=new WeakSet,B3=function(){const e=g(this,Wo);e&&(O(this,Wo,null),e.then(n=>{g(this,xi).send("eth_uninstallFilter",[n])}))};var Rf;class Qre extends SU{constructor(n,r){super(n);R(this,Rf,void 0);O(this,Rf,Vre(r))}_recover(n){return new yO(n,g(this,Rf))}async _subscribe(n){return await n.send("eth_newFilter",[g(this,Rf)])}async _emitResults(n,r){for(const i of r)n.emit(g(this,Rf),n._wrapLog(i,n._network))}}Rf=new WeakMap;class Kre extends SU{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Wre="bigint,boolean,function,number,string,symbol".split(/,/g);function aw(t){if(t==null||Wre.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(aw);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Jre(t){return new Promise(e=>{setTimeout(e,t)})}function Nh(t){return t&&t.toLowerCase()}function kN(t){return t&&typeof t.pollingInterval=="number"}const Yre={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class e5 extends EU{constructor(n,r){super(n);I(this,"address");r=Xt(r),lt(this,{address:r})}connect(n){ge(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=aw(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await ci(o,this.provider);Y(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await ci(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Vr(u,"CANCELLED")||Vr(u,"BAD_DATA")||Vr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Vr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",Kn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=aw(n);if(r.from){const a=await ci(r.from,this.provider);Y(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?cl(n):n;return await this.provider.send("personal_sign",[Ge(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=aw(i),o=await v1.resolveNames(n,r,a,async s=>{const l=await ci(s);return Y(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(v1.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?cl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ge(r)])}}var Mf,op,Zs,Jo,uo,Ca,Ai,Hm,D3;class Xre extends AU{constructor(n,r){super(n,r);R(this,Hm);R(this,Mf,void 0);R(this,op,void 0);R(this,Zs,void 0);R(this,Jo,void 0);R(this,uo,void 0);R(this,Ca,void 0);R(this,Ai,void 0);O(this,op,1),O(this,Mf,Object.assign({},Yre,r||{})),O(this,Zs,[]),O(this,Jo,null),O(this,Ca,null),O(this,Ai,null);{let a=null;const o=new Promise(s=>{a=s});O(this,uo,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(Y(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,Ca,es.from(n))):i&&(Y(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,Ca,i))}_getOption(n){return g(this,Mf)[n]}get _network(){return ge(g(this,Ca),"network is not available yet","NETWORK_ERROR"),g(this,Ca)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&qe(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(g(this,Ca))return g(this,Ca)}else return n;return g(this,Ai)?await g(this,Ai):this.ready?(O(this,Ai,(async()=>{try{const r=es.from(qe(await this.send("eth_chainId",[])));return O(this,Ai,null),r}catch(r){throw O(this,Ai,null),r}})()),await g(this,Ai)):(O(this,Ai,(async()=>{const r={id:ms(this,op)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,Ai,null)}catch(a){throw O(this,Ai,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return es.from(qe(i.result));throw this.getRpcError(r,i)})()),await g(this,Ai))}_start(){g(this,uo)==null||g(this,uo).resolve==null||(g(this,uo).resolve(),O(this,uo,null),(async()=>{for(;g(this,Ca)==null&&!this.destroyed;)try{O(this,Ca,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Kn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Jre(1e3)}te(this,Hm,D3).call(this)})())}async _waitUntilReady(){if(g(this,uo)!=null)return await g(this,uo).promise}_getSubscriber(n){return n.type==="pending"?new Kre(this):n.type==="event"?this._getOption("polling")?new yO(this,n.filter):new Qre(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new xU("orphan"):super._getSubscriber(n)}get ready(){return g(this,uo)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=$u(qe(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=Ge(n[i]))}),n.accessList&&(r.accessList=bh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Nh(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Nh(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Nh(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Nh(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Nh):n.filter.address=Nh(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return Kn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=L3(a),c=w1.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(qre(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Kn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Kn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return Kn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Kn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return Kn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?Kn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):Kn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Kn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=ms(this,op)._++,a=new Promise((o,s)=>{g(this,Zs).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return te(this,Hm,D3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new e5(this,a[n])}const{accounts:i}=await ei({network:this.getNetwork(),accounts:r});n=Xt(n);for(const a of i)if(Xt(a)===n)return new e5(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new e5(this,r))}destroy(){g(this,Jo)&&(clearTimeout(g(this,Jo)),O(this,Jo,null));for(const{payload:n,reject:r}of g(this,Zs))r(Kn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,Zs,[]),super.destroy()}}Mf=new WeakMap,op=new WeakMap,Zs=new WeakMap,Jo=new WeakMap,uo=new WeakMap,Ca=new WeakMap,Ai=new WeakMap,Hm=new WeakSet,D3=function(){if(g(this,Jo))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Jo,setTimeout(()=>{O(this,Jo,null);const r=g(this,Zs);for(O(this,Zs,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==g(this,Mf).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>g(this,Mf).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(Kn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=Kn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))};var Nc;class PU extends Xre{constructor(n,r){super(n,r);R(this,Nc,void 0);O(this,Nc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return kN(r)&&(r.pollingInterval=g(this,Nc)),r}get pollingInterval(){return g(this,Nc)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,Nc,n),this._forEachSubscriber(r=>{kN(r)&&(r.pollingInterval=g(this,Nc))})}}Nc=new WeakMap;var sp;class Zre extends PU{constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);R(this,sp,void 0);typeof n=="string"?O(this,sp,new wl(n)):O(this,sp,n.clone())}_getConnection(){return g(this,sp).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}}sp=new WeakMap;function L3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&Pn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=L3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return L3(JSON.parse(t))}catch{}return null}function $3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)$3(t[n],e);if(typeof t=="string")try{return $3(JSON.parse(t),e)}catch{}}}function qre(t){const e=[];return $3(t,e),e}var lp;class eie extends PU{constructor(n,r){super(r,{batchMaxCount:1});R(this,lp,void 0);O(this,lp,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){Y(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await g(this,lp).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await g(this,lp).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}}lp=new WeakMap;var OU={exports:{}};(function(t){/** + * @license (c) Franz X Antesberger 2013 + */(function(e){var n=4294967296;e.fromBytesBigEndian=function(r,i,a,o){return(r<<24|i<<16|a<<8|o)>>>0},e.getByteBigEndian=function(r,i){return r>>>8*(3-i)&255},e.getBytesBigEndian=function(r){return[e.getByteBigEndian(r,0),e.getByteBigEndian(r,1),e.getByteBigEndian(r,2),e.getByteBigEndian(r,3)]},e.toHex=function(r,i){i=i||8;var a=r.toString(16);return a.length>>0},e.highPart=function(r){return e.toUint32(r/n)},e.or=function(r,i){for(var a=r,o=1;o>>0},e.and=function(r,i){for(var a=r,o=1;o>>0},e.xor=function(r,i){for(var a=r,o=1;o>>0},e.not=function(r){return~r>>>0},e.shiftLeft=function(r,i){return r<>>0},e.shiftRight=function(r,i){return r>>>i},e.rotateLeft=function(r,i){return(r<>>0|r>>>32-i)>>>0},e.rotateRight=function(r,i){return(r>>>i|r<<32-i>>>0)>>>0},e.choose=function(r,i,a){return(r&(i^a)^a)>>>0},e.majority=function(r,i,a){return(r&(i|a)|i&a)>>>0},e.addMod32=function(r){for(var i=r,a=1;a>>0},e.log2=function(r){return Math.floor(Math.log(r)/Math.LN2)},e.mult=function(r,i,a){var o=((r&4294901760)>>>0)*i,s=(r&65535)*i,l=e.toUint32(o)+e.toUint32(s)>=n?1:0;a[0]=e.highPart(o)+e.highPart(s)+l>>>0,a[1]=(o>>>0)+(s>>>0)}})(t.exports={})})(OU);var mO=OU.exports,M=mO;const tie=[1,2,4,8,16,32,64,128,27,54],Tp=M.fromBytesBigEndian(85,85,85,85),Cp=M.fromBytesBigEndian(170,170,170,170),eb=M.fromBytesBigEndian(51,51,51,51),tb=M.fromBytesBigEndian(204,204,204,204),NN=M.fromBytesBigEndian(15,15,15,15),_N=M.fromBytesBigEndian(240,240,240,240),nie=M.fromBytesBigEndian(0,0,0,255),rie=M.fromBytesBigEndian(0,0,252,0),iie=M.fromBytesBigEndian(0,0,3,0),aie=M.fromBytesBigEndian(0,240,0,0),oie=M.fromBytesBigEndian(0,15,0,0),sie=M.fromBytesBigEndian(192,0,0,0),lie=M.fromBytesBigEndian(63,0,0,0);function U3(){return new Uint32Array(8)}function ow(t,e){t[0]=M.xor(t[0],e[0]),t[1]=M.xor(t[1],e[1]),t[2]=M.xor(t[2],e[2]),t[3]=M.xor(t[3],e[3]),t[4]=M.xor(t[4],e[4]),t[5]=M.xor(t[5],e[5]),t[6]=M.xor(t[6],e[6]),t[7]=M.xor(t[7],e[7])}function ox(t){const e=t[7],n=t[6],r=t[5],i=t[4],a=t[3],o=t[2],s=t[1],l=t[0],c=M.xor(i,o),u=M.xor(e,s),f=M.xor(e,i),h=M.xor(e,o),d=M.xor(n,r),y=M.xor(d,l),p=M.xor(y,i),m=M.xor(u,c),v=M.xor(y,e),w=M.xor(y,s),x=M.xor(w,h),E=M.xor(a,m),P=M.xor(E,o),A=M.xor(E,n),k=M.xor(P,l),N=M.xor(P,d),D=M.xor(A,f),L=M.xor(l,D),F=M.xor(N,D),$=M.xor(N,h),z=M.xor(d,D),J=M.xor(u,z),H=M.xor(e,z),G=M.and(m,P),q=M.and(x,k),K=M.xor(q,G),ee=M.and(p,l),he=M.xor(ee,G),we=M.and(u,z),be=M.and(w,y),Ye=M.xor(be,we),at=M.and(v,L),Be=M.xor(at,we),gt=M.and(f,D),Vt=M.and(c,F),pn=M.xor(Vt,gt),xe=M.and(h,N),Ve=M.xor(xe,gt),We=M.xor(K,pn),se=M.xor(he,Ve),bt=M.xor(Ye,pn),ut=M.xor(Be,Ve),It=M.xor(We,A),Yt=M.xor(se,$),Cn=M.xor(bt,J),Yn=M.xor(ut,H),pr=M.xor(It,Yt),gr=M.and(It,Cn),Vn=M.xor(Yn,gr),ha=M.and(pr,Vn),Tr=M.xor(ha,Yt),ir=M.xor(Cn,Yn),Ka=M.xor(Yt,gr),ys=M.and(Ka,ir),Wr=M.xor(ys,Yn),fu=M.xor(Cn,Wr),Ui=M.xor(Vn,Wr),hu=M.and(Yn,Ui),Wa=M.xor(hu,fu),Bl=M.xor(Vn,hu),Dl=M.and(Tr,Bl),Fi=M.xor(pr,Dl),Jr=M.xor(Fi,Wa),da=M.xor(Tr,Wr),Ja=M.xor(Tr,Fi),No=M.xor(Wr,Wa),Ya=M.xor(da,Jr),du=M.and(No,P),pu=M.and(Wa,k),Eh=M.and(Wr,l),V=M.and(Ja,z),Z=M.and(Fi,y),ae=M.and(Tr,L),Ae=M.and(da,D),Le=M.and(Ya,F),ht=M.and(Jr,N),ot=M.and(No,m),et=M.and(Wa,x),Ie=M.and(Wr,p),wt=M.and(Ja,u),S=M.and(Fi,w),T=M.and(Tr,v),C=M.and(da,f),b=M.and(Ya,c),_=M.and(Jr,h),j=M.xor(C,b),W=M.xor(et,Ie),oe=M.xor(ae,S),ye=M.xor(ot,et),_e=M.xor(Eh,wt),Ee=M.xor(Eh,ae),Pt=M.xor(Le,ht),Ce=M.xor(du,V),rt=M.xor(Ae,Le),Ze=M.xor(b,_),ct=M.xor(wt,oe),Se=M.xor(_e,Ce),Pe=M.xor(Z,j),He=M.xor(V,rt),it=M.xor(j,Se),Re=M.xor(T,Se),Je=M.xor(Pt,Pe),Ne=M.xor(ye,Pe),De=M.xor(Z,He),ze=M.xor(Re,Je),ke=M.xor(pu,Ne),ne=M.xor(He,Ne),re=M.xor(ct,M.not(Je)),de=M.xor(oe,M.not(it)),le=M.xor(De,ze),ce=M.xor(Ce,ke),me=M.xor(Ee,ke),tt=M.xor(W,ze),dt=M.xor(De,M.not(ce)),yt=M.xor(Ze,M.not(le));t[7]=ne,t[6]=dt,t[5]=yt,t[4]=ce,t[3]=me,t[2]=tt,t[1]=re,t[0]=de}function F3(t){for(let e=0;e<8;e++){const n=t[e];t[e]=M.or(M.and(n,nie),M.shiftRight(M.and(n,rie),2),M.shiftLeft(M.and(n,iie),6),M.shiftRight(M.and(n,aie),4),M.shiftLeft(M.and(n,oie),4),M.shiftRight(M.and(n,sie),6),M.shiftLeft(M.and(n,lie),2))}}function TU(t){const e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=M.or(M.shiftRight(e,8),M.shiftLeft(e,24)),u=M.or(M.shiftRight(n,8),M.shiftLeft(n,24)),f=M.or(M.shiftRight(r,8),M.shiftLeft(r,24)),h=M.or(M.shiftRight(i,8),M.shiftLeft(i,24)),d=M.or(M.shiftRight(a,8),M.shiftLeft(a,24)),y=M.or(M.shiftRight(o,8),M.shiftLeft(o,24)),p=M.or(M.shiftRight(s,8),M.shiftLeft(s,24)),m=M.or(M.shiftRight(l,8),M.shiftLeft(l,24));t[0]=M.xor(l,m,c,M.rotateRight(M.xor(e,c),16)),t[1]=M.xor(e,c,l,m,u,M.rotateRight(M.xor(n,u),16)),t[2]=M.xor(n,u,f,M.rotateRight(M.xor(r,f),16)),t[3]=M.xor(r,f,l,m,h,M.rotateRight(M.xor(i,h),16)),t[4]=M.xor(i,h,l,m,d,M.rotateRight(M.xor(a,d),16)),t[5]=M.xor(a,d,y,M.rotateRight(M.xor(o,y),16)),t[6]=M.xor(o,y,p,M.rotateRight(M.xor(s,p),16)),t[7]=M.xor(s,p,m,M.rotateRight(M.xor(l,m),16))}function CU(t,e){const n=new DataView(e.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]=0,t[3]=0,t[5]=0,t[7]=0,Al(t)}function kU(t,e,n){const r=new DataView(e.buffer),i=new DataView(n.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]=i.getUint32(0+n.byteOffset,!0),t[3]=i.getUint32(4+n.byteOffset,!0),t[5]=i.getUint32(8+n.byteOffset,!0),t[7]=i.getUint32(12+n.byteOffset,!0),Al(t)}function NU(t,e){Al(e);const n=new DataView(t.buffer);n.setUint32(0+t.byteOffset,e[0],!0),n.setUint32(4+t.byteOffset,e[2],!0),n.setUint32(8+t.byteOffset,e[4],!0),n.setUint32(12+t.byteOffset,e[6],!0)}function _U(t,e,n){Al(n);const r=new DataView(t.buffer),i=new DataView(e.buffer);r.setUint32(0+t.byteOffset,n[0],!0),r.setUint32(4+t.byteOffset,n[2],!0),r.setUint32(8+t.byteOffset,n[4],!0),r.setUint32(12+t.byteOffset,n[6],!0),i.setUint32(0+e.byteOffset,n[1],!0),i.setUint32(4+e.byteOffset,n[3],!0),i.setUint32(8+e.byteOffset,n[5],!0),i.setUint32(12+e.byteOffset,n[7],!0)}function Al(t){for(let e=0;e<8;e+=2){const n=t[e],r=t[e+1];t[e]=M.or(M.and(n,Tp),M.shiftLeft(M.and(r,Tp),1)),t[e+1]=M.or(M.shiftRight(M.and(n,Cp),1),M.and(r,Cp))}for(let e=0;e<8;e+=4){const n=t[e],r=t[e+1],i=t[e+2],a=t[e+3];t[e]=M.or(M.and(n,eb),M.shiftLeft(M.and(i,eb),2)),t[e+2]=M.or(M.shiftRight(M.and(n,tb),2),M.and(i,tb)),t[e+1]=M.or(M.and(r,eb),M.shiftLeft(M.and(a,eb),2)),t[e+3]=M.or(M.shiftRight(M.and(r,tb),2),M.and(a,tb))}for(let e=0;e<4;e++){const n=t[e],r=t[e+4];t[e]=M.or(M.and(n,NN),M.shiftLeft(M.and(r,NN),4)),t[e+4]=M.or(M.shiftRight(M.and(n,_N),4),M.and(r,_N))}}function cie(t,e){const n=new DataView(e.buffer);for(let r=0;r<4;r++){const i=n.getUint32(r*4+e.byteOffset,!0);t[r*2]=i,t[r*2+1]=i}Al(t);for(let r=0,i=0;r<4;r=r+1,i=i+2){let a=M.or(M.and(t[i+0],Tp),M.and(t[i+1],Cp)),o=a;a=M.and(a,Tp),t[i]=M.or(a,M.shiftLeft(a,1)),o=M.and(o,Cp),t[i+1]=M.or(o,M.shiftRight(o,1))}}function IU(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=IN(a)),a=M.xor(a,i[(c-o)*2]),i[c*2]=a,i[c*2+1]=a,u++,u==o&&(u=0,f++);for(let c=0;c>7,i=n>>5&1;t[e]=n<<1|r^i}}function mie(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function MN(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=ob[e],t[5]^=ob[e],t[6]^=ob[e],t[7]^=ob[e]}function vie(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Bi(e[0],n,r,kp),MN(e[0],0);for(let i=1;i<=Mc;i++)yie(n),z3(n),mie(r),z3(r),Bi(e[i],n,r,kp),MN(e[i],i)}function cy(t,e,n){let r=new Uint8Array(n);Bi(t[0],e[0],r,kp);for(let i=1;i<=Mc;i++)z3(r),Bi(t[i],e[i],r,kp)}function Kl(){let t=[];for(let e=0;e<=Mc;e++)t.push(new Uint8Array(16));return t}class bie{static bcEncrypt(e,n,r,i){let a=Kl();cy(a,n,r);let o=pt.newQ(),s=pt.newQ();pt.load4xU32(o,i),pt.load4xU32(s,a[0]),pt.addRoundKey(o,s);for(let l=1;l<=Mc;l++)pt.subBytes(o),pt.shiftRows(o),pt.mixColumns(o),pt.load4xU32(s,a[l]),pt.addRoundKey(o,s);pt.store4xU32(e,o)}static bcKeystreamx2(e,n,r,i){let a=[Kl(),Kl()];for(let l=0;l<2;l++)cy(a[l],n,r[l]);let o=pt.newQ(),s=pt.newQ();pt.rkeyOrtho(o,i),pt.load8xU32(s,a[0][0],a[1][0]),pt.addRoundKey(o,s);for(let l=1;l<=Mc;l++)pt.subBytes(o),pt.shiftRows(o),pt.mixColumns(o),pt.load8xU32(s,a[0][l],a[1][l]),pt.addRoundKey(o,s);pt.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,n,r,i){let a=Kl();cy(a,n,r);let o=pt.newQ(),s=pt.newQ();pt.load4xU32(o,i),pt.load4xU32(s,a[0]),pt.addRoundKey(o,s);for(let d=1;d<=Mc;d++)pt.subBytes(o),pt.shiftRows(o),pt.mixColumns(o),pt.load4xU32(s,a[d]),pt.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);pt.ortho(o),c=_a.xor(c,o[0]),u=_a.xor(u,o[2]),f=_a.xor(f,o[4]),h=_a.xor(h,o[6]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}static bcTagx2(e,n,r,i){let a=[Kl(),Kl()];for(let d=0;d<2;d++)cy(a[d],n,r[d]);let o=pt.newQ(),s=pt.newQ();pt.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),pt.load8xU32(s,a[0][0],a[1][0]),pt.addRoundKey(o,s);for(let d=1;d<=Mc;d++)pt.subBytes(o),pt.shiftRows(o),pt.mixColumns(o),pt.load8xU32(s,a[0][d],a[1][d]),pt.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);pt.ortho(o),c=_a.xor(c,o[0],o[1]),u=_a.xor(u,o[2],o[3]),f=_a.xor(f,o[4],o[5]),h=_a.xor(h,o[6],o[7]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}}class wie{static bcEncrypt(e,n,r,i){let a=Kl();cy(a,n,r);const o=new DataView(i.buffer);let s=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),c=o.getUint32(8+i.byteOffset,!1),u=o.getUint32(12+i.byteOffset,!1);const f=new DataView(a[0].buffer);s=_a.xor(s,f.getUint32(0+a[0].byteOffset,!1)),l=_a.xor(l,f.getUint32(4+a[0].byteOffset,!1)),c=_a.xor(c,f.getUint32(8+a[0].byteOffset,!1)),u=_a.xor(u,f.getUint32(12+a[0].byteOffset,!1));for(let d=1;d<=Mc;d++)[s,l,c,u]=pie.aesencVartime(s,l,c,u,a[d]);const h=new DataView(e.buffer);h.setUint32(0+e.byteOffset,s,!1),h.setUint32(4+e.byteOffset,l,!1),h.setUint32(8+e.byteOffset,c,!1),h.setUint32(12+e.byteOffset,u,!1)}static bcKeystreamx2(e,n,r,i){this.bcEncrypt(e.subarray(0,16),n,r[0],i),this.bcEncrypt(e.subarray(16,32),n,r[1],i)}static bcTagx1(e,n,r,i){let a=new Uint8Array(Oe);this.bcEncrypt(a,n,r,i),Bi(e,e,a,Oe)}static bcTagx2(e,n,r,i){let a=new Uint8Array(2*Oe);this.bcEncrypt(a.subarray(0,16),n,r[0],i.subarray(0,16)),this.bcEncrypt(a.subarray(16,32),n,r[1],i.subarray(16,32)),Bi(e,e,a.subarray(0,16),Oe),Bi(e,e,a.subarray(16,32),Oe)}}function Fr(t,e,n){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,n,!1),t[0]=e<=2*Oe;s+=2)Fr(o[0],_d,s),Fr(o[1],_d,s+1),t.bcTagx2(u,e,o,i.subarray(s*Oe,(s+2)*Oe)),c-=2*Oe;for(;c>=Oe;s++)Fr(o[0],_d,s),t.bcTagx1(u,e,o[0],i.subarray(s*Oe,(s+1)*Oe)),c-=Oe;if(c>0){Fr(o[0],BU,s);let y=new Uint8Array(Oe);y.set(i.subarray(i.length-c)),y[c]=128,t.bcTagx1(u,e,o[0],y)}let f=a.length;for(l=0;f>=2*Oe;l+=2)Fr(o[0],Id,l),Fr(o[1],Id,l+1),t.bcTagx2(u,e,o,a.subarray(l*Oe,(l+2)*Oe)),f-=2*Oe;for(;f>=Oe;l++)Fr(o[0],Id,l),t.bcTagx1(u,e,o[0],a.subarray(l*Oe,(l+1)*Oe)),f-=Oe;if(f>0){Fr(o[0],DU,l);let y=new Uint8Array(Oe);y.set(a.subarray(a.length-f)),y[f]=128,t.bcTagx1(u,e,o[0],y)}let h=new Uint8Array(Oe);h.set(n,1),h[0]=LU<=2*Oe;l+=2)Bc(o[0],u,l),Bc(o[1],u,l+1),t.bcKeystreamx2(d,e,o,h),Bi(r.subarray(l*Oe,(l+2)*Oe),a.subarray(l*Oe,(l+2)*Oe),d,2*Oe),f-=2*Oe;for(;f>=Oe;l++)Bc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Bi(r.subarray(l*Oe,(l+1)*Oe),a.subarray(l*Oe,(l+1)*Oe),d,Oe),f-=Oe;f>0&&(Bc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Bi(r.subarray(l*Oe,a.length),a.subarray(l*Oe),d,f)),r.set(u,a.length)}function Aie(t,e,n,r,i,a){let o=a.length-jf;const s=a.subarray(0,o),l=a.subarray(o);let c=0,u=H3(),f=new Uint8Array(Oe);f.set(n,1);let h=new Uint8Array(2*Oe);for(c=0;o>=2*Oe;c+=2)Bc(u[0],l,c),Bc(u[1],l,c+1),t.bcKeystreamx2(h,e,u,f),Bi(r.subarray(c*Oe,(c+2)*Oe),s.subarray(c*Oe,(c+2)*Oe),h,2*Oe),o-=2*Oe;for(;o>=Oe;c++)Bc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Bi(r.subarray(c*Oe,(c+1)*Oe),s.subarray(c*Oe,(c+1)*Oe),h,Oe),o-=Oe;o>0&&(Bc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Bi(r.subarray(c*Oe),s.subarray(c*Oe),h,o));let d=0,y=i.length,p=H3(),m=new Uint8Array(jf);for(d=0;y>=2*Oe;d+=2)Fr(p[0],_d,d),Fr(p[1],_d,d+1),t.bcTagx2(m,e,p,i.subarray(d*Oe,(d+2)*Oe)),y-=2*Oe;for(;y>=Oe;d++)Fr(p[0],_d,d),t.bcTagx1(m,e,p[0],i.subarray(d*Oe,(d+1)*Oe)),y-=Oe;if(y>0){Fr(p[0],BU,d);let x=new Uint8Array(Oe);x.set(i.subarray(i.length-y)),x[y]=128,t.bcTagx1(m,e,p[0],x)}let v=r.length;for(c=0;v>=2*Oe;c+=2)Fr(p[0],Id,c),Fr(p[1],Id,c+1),t.bcTagx2(m,e,p,r.subarray(c*Oe,(c+2)*Oe)),v-=2*Oe;for(;v>=Oe;c++)Fr(p[0],Id,c),t.bcTagx1(m,e,p[0],r.subarray(c*Oe,(c+1)*Oe)),v-=Oe;if(v>0){Fr(p[0],DU,c);let x=new Uint8Array(Oe);x.set(r.subarray(r.length-v)),x[v]=128,t.bcTagx1(m,e,p[0],x)}if(f[0]=LU<>24&255,S[T+1]=C>>16&255,S[T+2]=C>>8&255,S[T+3]=C&255,S[T+4]=b>>24&255,S[T+5]=b>>16&255,S[T+6]=b>>8&255,S[T+7]=b&255}function p(S,T,C,b,_){var j,W=0;for(j=0;j<_;j++)W|=S[T+j]^C[b+j];return(1&W-1>>>8)-1}function m(S,T,C,b){return p(S,T,C,b,16)}function v(S,T,C,b){return p(S,T,C,b,32)}function w(S,T,C,b){for(var _=b[0]&255|(b[1]&255)<<8|(b[2]&255)<<16|(b[3]&255)<<24,j=C[0]&255|(C[1]&255)<<8|(C[2]&255)<<16|(C[3]&255)<<24,W=C[4]&255|(C[5]&255)<<8|(C[6]&255)<<16|(C[7]&255)<<24,oe=C[8]&255|(C[9]&255)<<8|(C[10]&255)<<16|(C[11]&255)<<24,ye=C[12]&255|(C[13]&255)<<8|(C[14]&255)<<16|(C[15]&255)<<24,_e=b[4]&255|(b[5]&255)<<8|(b[6]&255)<<16|(b[7]&255)<<24,Ee=T[0]&255|(T[1]&255)<<8|(T[2]&255)<<16|(T[3]&255)<<24,Pt=T[4]&255|(T[5]&255)<<8|(T[6]&255)<<16|(T[7]&255)<<24,Ce=T[8]&255|(T[9]&255)<<8|(T[10]&255)<<16|(T[11]&255)<<24,rt=T[12]&255|(T[13]&255)<<8|(T[14]&255)<<16|(T[15]&255)<<24,Ze=b[8]&255|(b[9]&255)<<8|(b[10]&255)<<16|(b[11]&255)<<24,ct=C[16]&255|(C[17]&255)<<8|(C[18]&255)<<16|(C[19]&255)<<24,Se=C[20]&255|(C[21]&255)<<8|(C[22]&255)<<16|(C[23]&255)<<24,Pe=C[24]&255|(C[25]&255)<<8|(C[26]&255)<<16|(C[27]&255)<<24,He=C[28]&255|(C[29]&255)<<8|(C[30]&255)<<16|(C[31]&255)<<24,it=b[12]&255|(b[13]&255)<<8|(b[14]&255)<<16|(b[15]&255)<<24,Re=_,Je=j,Ne=W,De=oe,ze=ye,ke=_e,ne=Ee,re=Pt,de=Ce,le=rt,ce=Ze,me=ct,tt=Se,dt=Pe,yt=He,vt=it,B,Ot=0;Ot<20;Ot+=2)B=Re+tt|0,ze^=B<<7|B>>>25,B=ze+Re|0,de^=B<<9|B>>>23,B=de+ze|0,tt^=B<<13|B>>>19,B=tt+de|0,Re^=B<<18|B>>>14,B=ke+Je|0,le^=B<<7|B>>>25,B=le+ke|0,dt^=B<<9|B>>>23,B=dt+le|0,Je^=B<<13|B>>>19,B=Je+dt|0,ke^=B<<18|B>>>14,B=ce+ne|0,yt^=B<<7|B>>>25,B=yt+ce|0,Ne^=B<<9|B>>>23,B=Ne+yt|0,ne^=B<<13|B>>>19,B=ne+Ne|0,ce^=B<<18|B>>>14,B=vt+me|0,De^=B<<7|B>>>25,B=De+vt|0,re^=B<<9|B>>>23,B=re+De|0,me^=B<<13|B>>>19,B=me+re|0,vt^=B<<18|B>>>14,B=Re+De|0,Je^=B<<7|B>>>25,B=Je+Re|0,Ne^=B<<9|B>>>23,B=Ne+Je|0,De^=B<<13|B>>>19,B=De+Ne|0,Re^=B<<18|B>>>14,B=ke+ze|0,ne^=B<<7|B>>>25,B=ne+ke|0,re^=B<<9|B>>>23,B=re+ne|0,ze^=B<<13|B>>>19,B=ze+re|0,ke^=B<<18|B>>>14,B=ce+le|0,me^=B<<7|B>>>25,B=me+ce|0,de^=B<<9|B>>>23,B=de+me|0,le^=B<<13|B>>>19,B=le+de|0,ce^=B<<18|B>>>14,B=vt+yt|0,tt^=B<<7|B>>>25,B=tt+vt|0,dt^=B<<9|B>>>23,B=dt+tt|0,yt^=B<<13|B>>>19,B=yt+dt|0,vt^=B<<18|B>>>14;Re=Re+_|0,Je=Je+j|0,Ne=Ne+W|0,De=De+oe|0,ze=ze+ye|0,ke=ke+_e|0,ne=ne+Ee|0,re=re+Pt|0,de=de+Ce|0,le=le+rt|0,ce=ce+Ze|0,me=me+ct|0,tt=tt+Se|0,dt=dt+Pe|0,yt=yt+He|0,vt=vt+it|0,S[0]=Re>>>0&255,S[1]=Re>>>8&255,S[2]=Re>>>16&255,S[3]=Re>>>24&255,S[4]=Je>>>0&255,S[5]=Je>>>8&255,S[6]=Je>>>16&255,S[7]=Je>>>24&255,S[8]=Ne>>>0&255,S[9]=Ne>>>8&255,S[10]=Ne>>>16&255,S[11]=Ne>>>24&255,S[12]=De>>>0&255,S[13]=De>>>8&255,S[14]=De>>>16&255,S[15]=De>>>24&255,S[16]=ze>>>0&255,S[17]=ze>>>8&255,S[18]=ze>>>16&255,S[19]=ze>>>24&255,S[20]=ke>>>0&255,S[21]=ke>>>8&255,S[22]=ke>>>16&255,S[23]=ke>>>24&255,S[24]=ne>>>0&255,S[25]=ne>>>8&255,S[26]=ne>>>16&255,S[27]=ne>>>24&255,S[28]=re>>>0&255,S[29]=re>>>8&255,S[30]=re>>>16&255,S[31]=re>>>24&255,S[32]=de>>>0&255,S[33]=de>>>8&255,S[34]=de>>>16&255,S[35]=de>>>24&255,S[36]=le>>>0&255,S[37]=le>>>8&255,S[38]=le>>>16&255,S[39]=le>>>24&255,S[40]=ce>>>0&255,S[41]=ce>>>8&255,S[42]=ce>>>16&255,S[43]=ce>>>24&255,S[44]=me>>>0&255,S[45]=me>>>8&255,S[46]=me>>>16&255,S[47]=me>>>24&255,S[48]=tt>>>0&255,S[49]=tt>>>8&255,S[50]=tt>>>16&255,S[51]=tt>>>24&255,S[52]=dt>>>0&255,S[53]=dt>>>8&255,S[54]=dt>>>16&255,S[55]=dt>>>24&255,S[56]=yt>>>0&255,S[57]=yt>>>8&255,S[58]=yt>>>16&255,S[59]=yt>>>24&255,S[60]=vt>>>0&255,S[61]=vt>>>8&255,S[62]=vt>>>16&255,S[63]=vt>>>24&255}function x(S,T,C,b){for(var _=b[0]&255|(b[1]&255)<<8|(b[2]&255)<<16|(b[3]&255)<<24,j=C[0]&255|(C[1]&255)<<8|(C[2]&255)<<16|(C[3]&255)<<24,W=C[4]&255|(C[5]&255)<<8|(C[6]&255)<<16|(C[7]&255)<<24,oe=C[8]&255|(C[9]&255)<<8|(C[10]&255)<<16|(C[11]&255)<<24,ye=C[12]&255|(C[13]&255)<<8|(C[14]&255)<<16|(C[15]&255)<<24,_e=b[4]&255|(b[5]&255)<<8|(b[6]&255)<<16|(b[7]&255)<<24,Ee=T[0]&255|(T[1]&255)<<8|(T[2]&255)<<16|(T[3]&255)<<24,Pt=T[4]&255|(T[5]&255)<<8|(T[6]&255)<<16|(T[7]&255)<<24,Ce=T[8]&255|(T[9]&255)<<8|(T[10]&255)<<16|(T[11]&255)<<24,rt=T[12]&255|(T[13]&255)<<8|(T[14]&255)<<16|(T[15]&255)<<24,Ze=b[8]&255|(b[9]&255)<<8|(b[10]&255)<<16|(b[11]&255)<<24,ct=C[16]&255|(C[17]&255)<<8|(C[18]&255)<<16|(C[19]&255)<<24,Se=C[20]&255|(C[21]&255)<<8|(C[22]&255)<<16|(C[23]&255)<<24,Pe=C[24]&255|(C[25]&255)<<8|(C[26]&255)<<16|(C[27]&255)<<24,He=C[28]&255|(C[29]&255)<<8|(C[30]&255)<<16|(C[31]&255)<<24,it=b[12]&255|(b[13]&255)<<8|(b[14]&255)<<16|(b[15]&255)<<24,Re=_,Je=j,Ne=W,De=oe,ze=ye,ke=_e,ne=Ee,re=Pt,de=Ce,le=rt,ce=Ze,me=ct,tt=Se,dt=Pe,yt=He,vt=it,B,Ot=0;Ot<20;Ot+=2)B=Re+tt|0,ze^=B<<7|B>>>25,B=ze+Re|0,de^=B<<9|B>>>23,B=de+ze|0,tt^=B<<13|B>>>19,B=tt+de|0,Re^=B<<18|B>>>14,B=ke+Je|0,le^=B<<7|B>>>25,B=le+ke|0,dt^=B<<9|B>>>23,B=dt+le|0,Je^=B<<13|B>>>19,B=Je+dt|0,ke^=B<<18|B>>>14,B=ce+ne|0,yt^=B<<7|B>>>25,B=yt+ce|0,Ne^=B<<9|B>>>23,B=Ne+yt|0,ne^=B<<13|B>>>19,B=ne+Ne|0,ce^=B<<18|B>>>14,B=vt+me|0,De^=B<<7|B>>>25,B=De+vt|0,re^=B<<9|B>>>23,B=re+De|0,me^=B<<13|B>>>19,B=me+re|0,vt^=B<<18|B>>>14,B=Re+De|0,Je^=B<<7|B>>>25,B=Je+Re|0,Ne^=B<<9|B>>>23,B=Ne+Je|0,De^=B<<13|B>>>19,B=De+Ne|0,Re^=B<<18|B>>>14,B=ke+ze|0,ne^=B<<7|B>>>25,B=ne+ke|0,re^=B<<9|B>>>23,B=re+ne|0,ze^=B<<13|B>>>19,B=ze+re|0,ke^=B<<18|B>>>14,B=ce+le|0,me^=B<<7|B>>>25,B=me+ce|0,de^=B<<9|B>>>23,B=de+me|0,le^=B<<13|B>>>19,B=le+de|0,ce^=B<<18|B>>>14,B=vt+yt|0,tt^=B<<7|B>>>25,B=tt+vt|0,dt^=B<<9|B>>>23,B=dt+tt|0,yt^=B<<13|B>>>19,B=yt+dt|0,vt^=B<<18|B>>>14;S[0]=Re>>>0&255,S[1]=Re>>>8&255,S[2]=Re>>>16&255,S[3]=Re>>>24&255,S[4]=ke>>>0&255,S[5]=ke>>>8&255,S[6]=ke>>>16&255,S[7]=ke>>>24&255,S[8]=ce>>>0&255,S[9]=ce>>>8&255,S[10]=ce>>>16&255,S[11]=ce>>>24&255,S[12]=vt>>>0&255,S[13]=vt>>>8&255,S[14]=vt>>>16&255,S[15]=vt>>>24&255,S[16]=ne>>>0&255,S[17]=ne>>>8&255,S[18]=ne>>>16&255,S[19]=ne>>>24&255,S[20]=re>>>0&255,S[21]=re>>>8&255,S[22]=re>>>16&255,S[23]=re>>>24&255,S[24]=de>>>0&255,S[25]=de>>>8&255,S[26]=de>>>16&255,S[27]=de>>>24&255,S[28]=le>>>0&255,S[29]=le>>>8&255,S[30]=le>>>16&255,S[31]=le>>>24&255}function E(S,T,C,b){w(S,T,C,b)}function P(S,T,C,b){x(S,T,C,b)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(S,T,C,b,_,j,W){var oe=new Uint8Array(16),ye=new Uint8Array(64),_e,Ee;for(Ee=0;Ee<16;Ee++)oe[Ee]=0;for(Ee=0;Ee<8;Ee++)oe[Ee]=j[Ee];for(;_>=64;){for(E(ye,oe,W,A),Ee=0;Ee<64;Ee++)S[T+Ee]=C[b+Ee]^ye[Ee];for(_e=1,Ee=8;Ee<16;Ee++)_e=_e+(oe[Ee]&255)|0,oe[Ee]=_e&255,_e>>>=8;_-=64,T+=64,b+=64}if(_>0)for(E(ye,oe,W,A),Ee=0;Ee<_;Ee++)S[T+Ee]=C[b+Ee]^ye[Ee];return 0}function N(S,T,C,b,_){var j=new Uint8Array(16),W=new Uint8Array(64),oe,ye;for(ye=0;ye<16;ye++)j[ye]=0;for(ye=0;ye<8;ye++)j[ye]=b[ye];for(;C>=64;){for(E(W,j,_,A),ye=0;ye<64;ye++)S[T+ye]=W[ye];for(oe=1,ye=8;ye<16;ye++)oe=oe+(j[ye]&255)|0,j[ye]=oe&255,oe>>>=8;C-=64,T+=64}if(C>0)for(E(W,j,_,A),ye=0;ye>>13|C<<3)&8191,b=S[4]&255|(S[5]&255)<<8,this.r[2]=(C>>>10|b<<6)&7939,_=S[6]&255|(S[7]&255)<<8,this.r[3]=(b>>>7|_<<9)&8191,j=S[8]&255|(S[9]&255)<<8,this.r[4]=(_>>>4|j<<12)&255,this.r[5]=j>>>1&8190,W=S[10]&255|(S[11]&255)<<8,this.r[6]=(j>>>14|W<<2)&8191,oe=S[12]&255|(S[13]&255)<<8,this.r[7]=(W>>>11|oe<<5)&8065,ye=S[14]&255|(S[15]&255)<<8,this.r[8]=(oe>>>8|ye<<8)&8191,this.r[9]=ye>>>5&127,this.pad[0]=S[16]&255|(S[17]&255)<<8,this.pad[1]=S[18]&255|(S[19]&255)<<8,this.pad[2]=S[20]&255|(S[21]&255)<<8,this.pad[3]=S[22]&255|(S[23]&255)<<8,this.pad[4]=S[24]&255|(S[25]&255)<<8,this.pad[5]=S[26]&255|(S[27]&255)<<8,this.pad[6]=S[28]&255|(S[29]&255)<<8,this.pad[7]=S[30]&255|(S[31]&255)<<8};F.prototype.blocks=function(S,T,C){for(var b=this.fin?0:2048,_,j,W,oe,ye,_e,Ee,Pt,Ce,rt,Ze,ct,Se,Pe,He,it,Re,Je,Ne,De=this.h[0],ze=this.h[1],ke=this.h[2],ne=this.h[3],re=this.h[4],de=this.h[5],le=this.h[6],ce=this.h[7],me=this.h[8],tt=this.h[9],dt=this.r[0],yt=this.r[1],vt=this.r[2],B=this.r[3],Ot=this.r[4],Dt=this.r[5],Lt=this.r[6],At=this.r[7],Mt=this.r[8],Bt=this.r[9];C>=16;)_=S[T+0]&255|(S[T+1]&255)<<8,De+=_&8191,j=S[T+2]&255|(S[T+3]&255)<<8,ze+=(_>>>13|j<<3)&8191,W=S[T+4]&255|(S[T+5]&255)<<8,ke+=(j>>>10|W<<6)&8191,oe=S[T+6]&255|(S[T+7]&255)<<8,ne+=(W>>>7|oe<<9)&8191,ye=S[T+8]&255|(S[T+9]&255)<<8,re+=(oe>>>4|ye<<12)&8191,de+=ye>>>1&8191,_e=S[T+10]&255|(S[T+11]&255)<<8,le+=(ye>>>14|_e<<2)&8191,Ee=S[T+12]&255|(S[T+13]&255)<<8,ce+=(_e>>>11|Ee<<5)&8191,Pt=S[T+14]&255|(S[T+15]&255)<<8,me+=(Ee>>>8|Pt<<8)&8191,tt+=Pt>>>5|b,Ce=0,rt=Ce,rt+=De*dt,rt+=ze*(5*Bt),rt+=ke*(5*Mt),rt+=ne*(5*At),rt+=re*(5*Lt),Ce=rt>>>13,rt&=8191,rt+=de*(5*Dt),rt+=le*(5*Ot),rt+=ce*(5*B),rt+=me*(5*vt),rt+=tt*(5*yt),Ce+=rt>>>13,rt&=8191,Ze=Ce,Ze+=De*yt,Ze+=ze*dt,Ze+=ke*(5*Bt),Ze+=ne*(5*Mt),Ze+=re*(5*At),Ce=Ze>>>13,Ze&=8191,Ze+=de*(5*Lt),Ze+=le*(5*Dt),Ze+=ce*(5*Ot),Ze+=me*(5*B),Ze+=tt*(5*vt),Ce+=Ze>>>13,Ze&=8191,ct=Ce,ct+=De*vt,ct+=ze*yt,ct+=ke*dt,ct+=ne*(5*Bt),ct+=re*(5*Mt),Ce=ct>>>13,ct&=8191,ct+=de*(5*At),ct+=le*(5*Lt),ct+=ce*(5*Dt),ct+=me*(5*Ot),ct+=tt*(5*B),Ce+=ct>>>13,ct&=8191,Se=Ce,Se+=De*B,Se+=ze*vt,Se+=ke*yt,Se+=ne*dt,Se+=re*(5*Bt),Ce=Se>>>13,Se&=8191,Se+=de*(5*Mt),Se+=le*(5*At),Se+=ce*(5*Lt),Se+=me*(5*Dt),Se+=tt*(5*Ot),Ce+=Se>>>13,Se&=8191,Pe=Ce,Pe+=De*Ot,Pe+=ze*B,Pe+=ke*vt,Pe+=ne*yt,Pe+=re*dt,Ce=Pe>>>13,Pe&=8191,Pe+=de*(5*Bt),Pe+=le*(5*Mt),Pe+=ce*(5*At),Pe+=me*(5*Lt),Pe+=tt*(5*Dt),Ce+=Pe>>>13,Pe&=8191,He=Ce,He+=De*Dt,He+=ze*Ot,He+=ke*B,He+=ne*vt,He+=re*yt,Ce=He>>>13,He&=8191,He+=de*dt,He+=le*(5*Bt),He+=ce*(5*Mt),He+=me*(5*At),He+=tt*(5*Lt),Ce+=He>>>13,He&=8191,it=Ce,it+=De*Lt,it+=ze*Dt,it+=ke*Ot,it+=ne*B,it+=re*vt,Ce=it>>>13,it&=8191,it+=de*yt,it+=le*dt,it+=ce*(5*Bt),it+=me*(5*Mt),it+=tt*(5*At),Ce+=it>>>13,it&=8191,Re=Ce,Re+=De*At,Re+=ze*Lt,Re+=ke*Dt,Re+=ne*Ot,Re+=re*B,Ce=Re>>>13,Re&=8191,Re+=de*vt,Re+=le*yt,Re+=ce*dt,Re+=me*(5*Bt),Re+=tt*(5*Mt),Ce+=Re>>>13,Re&=8191,Je=Ce,Je+=De*Mt,Je+=ze*At,Je+=ke*Lt,Je+=ne*Dt,Je+=re*Ot,Ce=Je>>>13,Je&=8191,Je+=de*B,Je+=le*vt,Je+=ce*yt,Je+=me*dt,Je+=tt*(5*Bt),Ce+=Je>>>13,Je&=8191,Ne=Ce,Ne+=De*Bt,Ne+=ze*Mt,Ne+=ke*At,Ne+=ne*Lt,Ne+=re*Dt,Ce=Ne>>>13,Ne&=8191,Ne+=de*Ot,Ne+=le*B,Ne+=ce*vt,Ne+=me*yt,Ne+=tt*dt,Ce+=Ne>>>13,Ne&=8191,Ce=(Ce<<2)+Ce|0,Ce=Ce+rt|0,rt=Ce&8191,Ce=Ce>>>13,Ze+=Ce,De=rt,ze=Ze,ke=ct,ne=Se,re=Pe,de=He,le=it,ce=Re,me=Je,tt=Ne,T+=16,C-=16;this.h[0]=De,this.h[1]=ze,this.h[2]=ke,this.h[3]=ne,this.h[4]=re,this.h[5]=de,this.h[6]=le,this.h[7]=ce,this.h[8]=me,this.h[9]=tt},F.prototype.finish=function(S,T){var C=new Uint16Array(10),b,_,j,W;if(this.leftover){for(W=this.leftover,this.buffer[W++]=1;W<16;W++)this.buffer[W]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(b=this.h[1]>>>13,this.h[1]&=8191,W=2;W<10;W++)this.h[W]+=b,b=this.h[W]>>>13,this.h[W]&=8191;for(this.h[0]+=b*5,b=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=b,b=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=b,C[0]=this.h[0]+5,b=C[0]>>>13,C[0]&=8191,W=1;W<10;W++)C[W]=this.h[W]+b,b=C[W]>>>13,C[W]&=8191;for(C[9]-=8192,_=(b^1)-1,W=0;W<10;W++)C[W]&=_;for(_=~_,W=0;W<10;W++)this.h[W]=this.h[W]&_|C[W];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,j=this.h[0]+this.pad[0],this.h[0]=j&65535,W=1;W<8;W++)j=(this.h[W]+this.pad[W]|0)+(j>>>16)|0,this.h[W]=j&65535;S[T+0]=this.h[0]>>>0&255,S[T+1]=this.h[0]>>>8&255,S[T+2]=this.h[1]>>>0&255,S[T+3]=this.h[1]>>>8&255,S[T+4]=this.h[2]>>>0&255,S[T+5]=this.h[2]>>>8&255,S[T+6]=this.h[3]>>>0&255,S[T+7]=this.h[3]>>>8&255,S[T+8]=this.h[4]>>>0&255,S[T+9]=this.h[4]>>>8&255,S[T+10]=this.h[5]>>>0&255,S[T+11]=this.h[5]>>>8&255,S[T+12]=this.h[6]>>>0&255,S[T+13]=this.h[6]>>>8&255,S[T+14]=this.h[7]>>>0&255,S[T+15]=this.h[7]>>>8&255},F.prototype.update=function(S,T,C){var b,_;if(this.leftover){for(_=16-this.leftover,_>C&&(_=C),b=0;b<_;b++)this.buffer[this.leftover+b]=S[T+b];if(C-=_,T+=_,this.leftover+=_,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(C>=16&&(_=C-C%16,this.blocks(S,T,_),T+=_,C-=_),C){for(b=0;b>16&1),j[C-1]&=65535;j[15]=W[15]-32767-(j[14]>>16&1),_=j[15]>>16&1,j[14]&=65535,K(W,j,1-_)}for(C=0;C<16;C++)S[2*C]=W[C]&255,S[2*C+1]=W[C]>>8}function he(S,T){var C=new Uint8Array(32),b=new Uint8Array(32);return ee(C,S),ee(b,T),v(C,0,b,0)}function we(S){var T=new Uint8Array(32);return ee(T,S),T[0]&1}function be(S,T){var C;for(C=0;C<16;C++)S[C]=T[2*C]+(T[2*C+1]<<8);S[15]&=32767}function Ye(S,T,C){for(var b=0;b<16;b++)S[b]=T[b]+C[b]}function at(S,T,C){for(var b=0;b<16;b++)S[b]=T[b]-C[b]}function Be(S,T,C){var b,_,j=0,W=0,oe=0,ye=0,_e=0,Ee=0,Pt=0,Ce=0,rt=0,Ze=0,ct=0,Se=0,Pe=0,He=0,it=0,Re=0,Je=0,Ne=0,De=0,ze=0,ke=0,ne=0,re=0,de=0,le=0,ce=0,me=0,tt=0,dt=0,yt=0,vt=0,B=C[0],Ot=C[1],Dt=C[2],Lt=C[3],At=C[4],Mt=C[5],Bt=C[6],$n=C[7],Zt=C[8],kn=C[9],Nn=C[10],_n=C[11],Xn=C[12],Cr=C[13],kr=C[14],Nr=C[15];b=T[0],j+=b*B,W+=b*Ot,oe+=b*Dt,ye+=b*Lt,_e+=b*At,Ee+=b*Mt,Pt+=b*Bt,Ce+=b*$n,rt+=b*Zt,Ze+=b*kn,ct+=b*Nn,Se+=b*_n,Pe+=b*Xn,He+=b*Cr,it+=b*kr,Re+=b*Nr,b=T[1],W+=b*B,oe+=b*Ot,ye+=b*Dt,_e+=b*Lt,Ee+=b*At,Pt+=b*Mt,Ce+=b*Bt,rt+=b*$n,Ze+=b*Zt,ct+=b*kn,Se+=b*Nn,Pe+=b*_n,He+=b*Xn,it+=b*Cr,Re+=b*kr,Je+=b*Nr,b=T[2],oe+=b*B,ye+=b*Ot,_e+=b*Dt,Ee+=b*Lt,Pt+=b*At,Ce+=b*Mt,rt+=b*Bt,Ze+=b*$n,ct+=b*Zt,Se+=b*kn,Pe+=b*Nn,He+=b*_n,it+=b*Xn,Re+=b*Cr,Je+=b*kr,Ne+=b*Nr,b=T[3],ye+=b*B,_e+=b*Ot,Ee+=b*Dt,Pt+=b*Lt,Ce+=b*At,rt+=b*Mt,Ze+=b*Bt,ct+=b*$n,Se+=b*Zt,Pe+=b*kn,He+=b*Nn,it+=b*_n,Re+=b*Xn,Je+=b*Cr,Ne+=b*kr,De+=b*Nr,b=T[4],_e+=b*B,Ee+=b*Ot,Pt+=b*Dt,Ce+=b*Lt,rt+=b*At,Ze+=b*Mt,ct+=b*Bt,Se+=b*$n,Pe+=b*Zt,He+=b*kn,it+=b*Nn,Re+=b*_n,Je+=b*Xn,Ne+=b*Cr,De+=b*kr,ze+=b*Nr,b=T[5],Ee+=b*B,Pt+=b*Ot,Ce+=b*Dt,rt+=b*Lt,Ze+=b*At,ct+=b*Mt,Se+=b*Bt,Pe+=b*$n,He+=b*Zt,it+=b*kn,Re+=b*Nn,Je+=b*_n,Ne+=b*Xn,De+=b*Cr,ze+=b*kr,ke+=b*Nr,b=T[6],Pt+=b*B,Ce+=b*Ot,rt+=b*Dt,Ze+=b*Lt,ct+=b*At,Se+=b*Mt,Pe+=b*Bt,He+=b*$n,it+=b*Zt,Re+=b*kn,Je+=b*Nn,Ne+=b*_n,De+=b*Xn,ze+=b*Cr,ke+=b*kr,ne+=b*Nr,b=T[7],Ce+=b*B,rt+=b*Ot,Ze+=b*Dt,ct+=b*Lt,Se+=b*At,Pe+=b*Mt,He+=b*Bt,it+=b*$n,Re+=b*Zt,Je+=b*kn,Ne+=b*Nn,De+=b*_n,ze+=b*Xn,ke+=b*Cr,ne+=b*kr,re+=b*Nr,b=T[8],rt+=b*B,Ze+=b*Ot,ct+=b*Dt,Se+=b*Lt,Pe+=b*At,He+=b*Mt,it+=b*Bt,Re+=b*$n,Je+=b*Zt,Ne+=b*kn,De+=b*Nn,ze+=b*_n,ke+=b*Xn,ne+=b*Cr,re+=b*kr,de+=b*Nr,b=T[9],Ze+=b*B,ct+=b*Ot,Se+=b*Dt,Pe+=b*Lt,He+=b*At,it+=b*Mt,Re+=b*Bt,Je+=b*$n,Ne+=b*Zt,De+=b*kn,ze+=b*Nn,ke+=b*_n,ne+=b*Xn,re+=b*Cr,de+=b*kr,le+=b*Nr,b=T[10],ct+=b*B,Se+=b*Ot,Pe+=b*Dt,He+=b*Lt,it+=b*At,Re+=b*Mt,Je+=b*Bt,Ne+=b*$n,De+=b*Zt,ze+=b*kn,ke+=b*Nn,ne+=b*_n,re+=b*Xn,de+=b*Cr,le+=b*kr,ce+=b*Nr,b=T[11],Se+=b*B,Pe+=b*Ot,He+=b*Dt,it+=b*Lt,Re+=b*At,Je+=b*Mt,Ne+=b*Bt,De+=b*$n,ze+=b*Zt,ke+=b*kn,ne+=b*Nn,re+=b*_n,de+=b*Xn,le+=b*Cr,ce+=b*kr,me+=b*Nr,b=T[12],Pe+=b*B,He+=b*Ot,it+=b*Dt,Re+=b*Lt,Je+=b*At,Ne+=b*Mt,De+=b*Bt,ze+=b*$n,ke+=b*Zt,ne+=b*kn,re+=b*Nn,de+=b*_n,le+=b*Xn,ce+=b*Cr,me+=b*kr,tt+=b*Nr,b=T[13],He+=b*B,it+=b*Ot,Re+=b*Dt,Je+=b*Lt,Ne+=b*At,De+=b*Mt,ze+=b*Bt,ke+=b*$n,ne+=b*Zt,re+=b*kn,de+=b*Nn,le+=b*_n,ce+=b*Xn,me+=b*Cr,tt+=b*kr,dt+=b*Nr,b=T[14],it+=b*B,Re+=b*Ot,Je+=b*Dt,Ne+=b*Lt,De+=b*At,ze+=b*Mt,ke+=b*Bt,ne+=b*$n,re+=b*Zt,de+=b*kn,le+=b*Nn,ce+=b*_n,me+=b*Xn,tt+=b*Cr,dt+=b*kr,yt+=b*Nr,b=T[15],Re+=b*B,Je+=b*Ot,Ne+=b*Dt,De+=b*Lt,ze+=b*At,ke+=b*Mt,ne+=b*Bt,re+=b*$n,de+=b*Zt,le+=b*kn,ce+=b*Nn,me+=b*_n,tt+=b*Xn,dt+=b*Cr,yt+=b*kr,vt+=b*Nr,j+=38*Je,W+=38*Ne,oe+=38*De,ye+=38*ze,_e+=38*ke,Ee+=38*ne,Pt+=38*re,Ce+=38*de,rt+=38*le,Ze+=38*ce,ct+=38*me,Se+=38*tt,Pe+=38*dt,He+=38*yt,it+=38*vt,_=1,b=j+_+65535,_=Math.floor(b/65536),j=b-_*65536,b=W+_+65535,_=Math.floor(b/65536),W=b-_*65536,b=oe+_+65535,_=Math.floor(b/65536),oe=b-_*65536,b=ye+_+65535,_=Math.floor(b/65536),ye=b-_*65536,b=_e+_+65535,_=Math.floor(b/65536),_e=b-_*65536,b=Ee+_+65535,_=Math.floor(b/65536),Ee=b-_*65536,b=Pt+_+65535,_=Math.floor(b/65536),Pt=b-_*65536,b=Ce+_+65535,_=Math.floor(b/65536),Ce=b-_*65536,b=rt+_+65535,_=Math.floor(b/65536),rt=b-_*65536,b=Ze+_+65535,_=Math.floor(b/65536),Ze=b-_*65536,b=ct+_+65535,_=Math.floor(b/65536),ct=b-_*65536,b=Se+_+65535,_=Math.floor(b/65536),Se=b-_*65536,b=Pe+_+65535,_=Math.floor(b/65536),Pe=b-_*65536,b=He+_+65535,_=Math.floor(b/65536),He=b-_*65536,b=it+_+65535,_=Math.floor(b/65536),it=b-_*65536,b=Re+_+65535,_=Math.floor(b/65536),Re=b-_*65536,j+=_-1+37*(_-1),_=1,b=j+_+65535,_=Math.floor(b/65536),j=b-_*65536,b=W+_+65535,_=Math.floor(b/65536),W=b-_*65536,b=oe+_+65535,_=Math.floor(b/65536),oe=b-_*65536,b=ye+_+65535,_=Math.floor(b/65536),ye=b-_*65536,b=_e+_+65535,_=Math.floor(b/65536),_e=b-_*65536,b=Ee+_+65535,_=Math.floor(b/65536),Ee=b-_*65536,b=Pt+_+65535,_=Math.floor(b/65536),Pt=b-_*65536,b=Ce+_+65535,_=Math.floor(b/65536),Ce=b-_*65536,b=rt+_+65535,_=Math.floor(b/65536),rt=b-_*65536,b=Ze+_+65535,_=Math.floor(b/65536),Ze=b-_*65536,b=ct+_+65535,_=Math.floor(b/65536),ct=b-_*65536,b=Se+_+65535,_=Math.floor(b/65536),Se=b-_*65536,b=Pe+_+65535,_=Math.floor(b/65536),Pe=b-_*65536,b=He+_+65535,_=Math.floor(b/65536),He=b-_*65536,b=it+_+65535,_=Math.floor(b/65536),it=b-_*65536,b=Re+_+65535,_=Math.floor(b/65536),Re=b-_*65536,j+=_-1+37*(_-1),S[0]=j,S[1]=W,S[2]=oe,S[3]=ye,S[4]=_e,S[5]=Ee,S[6]=Pt,S[7]=Ce,S[8]=rt,S[9]=Ze,S[10]=ct,S[11]=Se,S[12]=Pe,S[13]=He,S[14]=it,S[15]=Re}function gt(S,T){Be(S,T,T)}function Vt(S,T){var C=n(),b;for(b=0;b<16;b++)C[b]=T[b];for(b=253;b>=0;b--)gt(C,C),b!==2&&b!==4&&Be(C,C,T);for(b=0;b<16;b++)S[b]=C[b]}function pn(S,T){var C=n(),b;for(b=0;b<16;b++)C[b]=T[b];for(b=250;b>=0;b--)gt(C,C),b!==1&&Be(C,C,T);for(b=0;b<16;b++)S[b]=C[b]}function xe(S,T,C){var b=new Uint8Array(32),_=new Float64Array(80),j,W,oe=n(),ye=n(),_e=n(),Ee=n(),Pt=n(),Ce=n();for(W=0;W<31;W++)b[W]=T[W];for(b[31]=T[31]&127|64,b[0]&=248,be(_,C),W=0;W<16;W++)ye[W]=_[W],Ee[W]=oe[W]=_e[W]=0;for(oe[0]=Ee[0]=1,W=254;W>=0;--W)j=b[W>>>3]>>>(W&7)&1,K(oe,ye,j),K(_e,Ee,j),Ye(Pt,oe,_e),at(oe,oe,_e),Ye(_e,ye,Ee),at(ye,ye,Ee),gt(Ee,Pt),gt(Ce,oe),Be(oe,_e,oe),Be(_e,ye,Pt),Ye(Pt,oe,_e),at(oe,oe,_e),gt(ye,oe),at(_e,Ee,Ce),Be(oe,_e,l),Ye(oe,oe,Ee),Be(_e,_e,oe),Be(oe,Ee,Ce),Be(Ee,ye,_),gt(ye,Pt),K(oe,ye,j),K(_e,Ee,j);for(W=0;W<16;W++)_[W+16]=oe[W],_[W+32]=_e[W],_[W+48]=ye[W],_[W+64]=Ee[W];var rt=_.subarray(32),Ze=_.subarray(16);return Vt(rt,rt),Be(Ze,Ze,rt),ee(S,Ze),0}function Ve(S,T){return xe(S,T,a)}function We(S,T){return r(T,32),Ve(S,T)}function se(S,T,C){var b=new Uint8Array(32);return xe(b,C,T),P(S,i,b,A)}var bt=J,ut=H;function It(S,T,C,b,_,j){var W=new Uint8Array(32);return se(W,_,j),bt(S,T,C,b,W)}function Yt(S,T,C,b,_,j){var W=new Uint8Array(32);return se(W,_,j),ut(S,T,C,b,W)}var Cn=[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 Yn(S,T,C,b){for(var _=new Int32Array(16),j=new Int32Array(16),W,oe,ye,_e,Ee,Pt,Ce,rt,Ze,ct,Se,Pe,He,it,Re,Je,Ne,De,ze,ke,ne,re,de,le,ce,me,tt=S[0],dt=S[1],yt=S[2],vt=S[3],B=S[4],Ot=S[5],Dt=S[6],Lt=S[7],At=T[0],Mt=T[1],Bt=T[2],$n=T[3],Zt=T[4],kn=T[5],Nn=T[6],_n=T[7],Xn=0;b>=128;){for(ze=0;ze<16;ze++)ke=8*ze+Xn,_[ze]=C[ke+0]<<24|C[ke+1]<<16|C[ke+2]<<8|C[ke+3],j[ze]=C[ke+4]<<24|C[ke+5]<<16|C[ke+6]<<8|C[ke+7];for(ze=0;ze<80;ze++)if(W=tt,oe=dt,ye=yt,_e=vt,Ee=B,Pt=Ot,Ce=Dt,rt=Lt,Ze=At,ct=Mt,Se=Bt,Pe=$n,He=Zt,it=kn,Re=Nn,Je=_n,ne=Lt,re=_n,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=(B>>>14|Zt<<18)^(B>>>18|Zt<<14)^(Zt>>>9|B<<23),re=(Zt>>>14|B<<18)^(Zt>>>18|B<<14)^(B>>>9|Zt<<23),de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,ne=B&Ot^~B&Dt,re=Zt&kn^~Zt&Nn,de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,ne=Cn[ze*2],re=Cn[ze*2+1],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,ne=_[ze%16],re=j[ze%16],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,Ne=ce&65535|me<<16,De=de&65535|le<<16,ne=Ne,re=De,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=(tt>>>28|At<<4)^(At>>>2|tt<<30)^(At>>>7|tt<<25),re=(At>>>28|tt<<4)^(tt>>>2|At<<30)^(tt>>>7|At<<25),de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,ne=tt&dt^tt&yt^dt&yt,re=At&Mt^At&Bt^Mt&Bt,de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,rt=ce&65535|me<<16,Je=de&65535|le<<16,ne=_e,re=Pe,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=Ne,re=De,de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,_e=ce&65535|me<<16,Pe=de&65535|le<<16,dt=W,yt=oe,vt=ye,B=_e,Ot=Ee,Dt=Pt,Lt=Ce,tt=rt,Mt=Ze,Bt=ct,$n=Se,Zt=Pe,kn=He,Nn=it,_n=Re,At=Je,ze%16===15)for(ke=0;ke<16;ke++)ne=_[ke],re=j[ke],de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=_[(ke+9)%16],re=j[(ke+9)%16],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,Ne=_[(ke+1)%16],De=j[(ke+1)%16],ne=(Ne>>>1|De<<31)^(Ne>>>8|De<<24)^Ne>>>7,re=(De>>>1|Ne<<31)^(De>>>8|Ne<<24)^(De>>>7|Ne<<25),de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,Ne=_[(ke+14)%16],De=j[(ke+14)%16],ne=(Ne>>>19|De<<13)^(De>>>29|Ne<<3)^Ne>>>6,re=(De>>>19|Ne<<13)^(Ne>>>29|De<<3)^(De>>>6|Ne<<26),de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,_[ke]=ce&65535|me<<16,j[ke]=de&65535|le<<16;ne=tt,re=At,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[0],re=T[0],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[0]=tt=ce&65535|me<<16,T[0]=At=de&65535|le<<16,ne=dt,re=Mt,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[1],re=T[1],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[1]=dt=ce&65535|me<<16,T[1]=Mt=de&65535|le<<16,ne=yt,re=Bt,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[2],re=T[2],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[2]=yt=ce&65535|me<<16,T[2]=Bt=de&65535|le<<16,ne=vt,re=$n,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[3],re=T[3],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[3]=vt=ce&65535|me<<16,T[3]=$n=de&65535|le<<16,ne=B,re=Zt,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[4],re=T[4],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[4]=B=ce&65535|me<<16,T[4]=Zt=de&65535|le<<16,ne=Ot,re=kn,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[5],re=T[5],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[5]=Ot=ce&65535|me<<16,T[5]=kn=de&65535|le<<16,ne=Dt,re=Nn,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[6],re=T[6],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[6]=Dt=ce&65535|me<<16,T[6]=Nn=de&65535|le<<16,ne=Lt,re=_n,de=re&65535,le=re>>>16,ce=ne&65535,me=ne>>>16,ne=S[7],re=T[7],de+=re&65535,le+=re>>>16,ce+=ne&65535,me+=ne>>>16,le+=de>>>16,ce+=le>>>16,me+=ce>>>16,S[7]=Lt=ce&65535|me<<16,T[7]=_n=de&65535|le<<16,Xn+=128,b-=128}return b}function pr(S,T,C){var b=new Int32Array(8),_=new Int32Array(8),j=new Uint8Array(256),W,oe=C;for(b[0]=1779033703,b[1]=3144134277,b[2]=1013904242,b[3]=2773480762,b[4]=1359893119,b[5]=2600822924,b[6]=528734635,b[7]=1541459225,_[0]=4089235720,_[1]=2227873595,_[2]=4271175723,_[3]=1595750129,_[4]=2917565137,_[5]=725511199,_[6]=4215389547,_[7]=327033209,Yn(b,_,T,C),C%=128,W=0;W=0;--_)b=C[_/8|0]>>(_&7)&1,Vn(S,T,b),gr(T,S),gr(S,S),Vn(S,T,b)}function ir(S,T){var C=[n(),n(),n(),n()];G(C[0],f),G(C[1],h),G(C[2],s),Be(C[3],f,h),Tr(S,C,T)}function Ka(S,T,C){var b=new Uint8Array(64),_=[n(),n(),n(),n()],j;for(C||r(T,32),pr(b,T,32),b[0]&=248,b[31]&=127,b[31]|=64,ir(_,b),ha(S,_),j=0;j<32;j++)T[j+32]=S[j];return 0}var ys=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 Wr(S,T){var C,b,_,j;for(b=63;b>=32;--b){for(C=0,_=b-32,j=b-12;_>4)*ys[_],C=T[_]>>8,T[_]&=255;for(_=0;_<32;_++)T[_]-=C*ys[_];for(b=0;b<32;b++)T[b+1]+=T[b]>>8,S[b]=T[b]&255}function fu(S){var T=new Float64Array(64),C;for(C=0;C<64;C++)T[C]=S[C];for(C=0;C<64;C++)S[C]=0;Wr(S,T)}function Ui(S,T,C,b){var _=new Uint8Array(64),j=new Uint8Array(64),W=new Uint8Array(64),oe,ye,_e=new Float64Array(64),Ee=[n(),n(),n(),n()];pr(_,b,32),_[0]&=248,_[31]&=127,_[31]|=64;var Pt=C+64;for(oe=0;oe>7&&at(S[0],o,S[0]),Be(S[3],S[0],S[1]),0)}function Wa(S,T,C,b){var _,j=new Uint8Array(32),W=new Uint8Array(64),oe=[n(),n(),n(),n()],ye=[n(),n(),n(),n()];if(C<64||hu(ye,b))return-1;for(_=0;_=0},e.sign.keyPair=function(){var S=new Uint8Array(ae),T=new Uint8Array(Ae);return Ka(S,T),{publicKey:S,secretKey:T}},e.sign.keyPair.fromSecretKey=function(S){if(Ie(S),S.length!==Ae)throw new Error("bad secret key size");for(var T=new Uint8Array(ae),C=0;C`0x${"0".repeat(40)}`;class Lie{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,n,r,i,a){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,a),this.cachedLeashes.set(n,{nonce:r.leash.nonce,block_number:r.leash.blockNumber,block_hash:r.leash.blockHash,block_range:r.leash.blockRange})}get(e,n){var r;return(r=this.cachedSignatures.get(e))===null||r===void 0?void 0:r.get(n)}getLeash(e){return this.cachedLeashes.get(e)}}const Ty=new Lie;function $ie(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 rA{static make(e,n,r){return cx(this,void 0,void 0,function*(){const i=yield Fie(n,r==null?void 0:r.leash);return new rA(i,yield zie(jie(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?jU(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,sw.add(this)}encode(){return DN(this,sw,"m",Q3).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return cx(this,void 0,void 0,function*(){return this.data?DN(this,sw,"m",Q3).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}sw=new WeakSet,Q3=function(e){return Ge(Uh({data:e||void 0,leash:this.leash,signature:this.signature}))};function jU(t){return Array.isArray(t)?new Uint8Array(t):Er(t)}function Uie(t){return Array.isArray(t)?Ge(new Uint8Array(t)):Ge(t)}function Fie(t,e){var n;return cx(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&Ty.clear();let r;if(e!=null&&e.nonce)r=e.nonce;else if("getNonce"in t)r=t.getNonce("pending");else{const l=yield t.getAddress();r=t.provider.getTransactionCount(l,"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[a,o]=yield Promise.all([r,i]),s=(n=e==null?void 0:e.blockRange)!==null&&n!==void 0?n:Mie;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(),c=Ty.getLeash(BigInt(l));if(c!==void 0){if(c.nonce>a&&c.block_number+s>o.number+2)return c;Ty.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:a+Rie,block_number:o.number,block_hash:Er(o.hash),block_range:s}})}function jie(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:Die(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:_ie)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:Nie),value:BigInt((o=t.value)!==null&&o!==void 0?o:Iie),data:t.data?Uie(t.data):Bie,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function zie(t,e,n){return cx(this,void 0,void 0,function*(){const r=yield e.getAddress();let i;if(n!=null&&n.chainId)i=BigInt(n.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:a,types:o}=$ie(Number(i)),s=Hie(a),l=Gie(t),c=v1.hash(s,o,l);let u=Ty.get(r,c);return u!==void 0||(u=mt("_signTypedData"in e?yield e._signTypedData(s,o,l):yield e.signTypedData(s,o,l)),Ty.cache(r,BigInt(i),t,c,u)),u})}function Hie(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?us(t.chainId):void 0});return t.salt&&(e.salt=jU(t.salt)),e}function Gie(t){const e=n=>{if(n!=null)return typeof n=="string"?n:n instanceof BigInt?us(n.toString()):$u(n)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?mt(t.data):void 0})}const Vie="modulepreload",Qie=function(t){return"/votee/"+t},LN={},Kie=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link");i=Promise.all(n.map(o=>{if(o=Qie(o),o in LN)return;LN[o]=!0;const s=o.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let f=a.length-1;f>=0;f--){const h=a[f];if(h.href===o&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${l}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":Vie,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},n5={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},r5={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},i5={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},Wie={mainnet:n5,testnet:r5,localnet:i5,[n5.chainId]:n5,[r5.chainId]:r5,[i5.chainId]:i5};var _p=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const Jie=60*5*1e3;function zU(t,e){return{key:mt(t.key),checksum:mt(t.checksum),signature:mt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function Yie(t){return _p(this,void 0,void 0,function*(){const e=yield Kie(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=HU();return new Promise((r,i)=>{const a={method:"POST",headers:{"content-type":"application/json","content-length":n.length}},o=e.request(t,a,s=>{const l=[];s.on("error",c=>i(c)),s.on("data",c=>l.push(c)),s.on("end",()=>{r(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",s=>i(s)),o.write(n),o.end()})})}function Xie(t,e){return _p(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:HU()});if(!n.ok)throw new Cy("Failed to fetch runtime public key.",n);return yield n.json()})}function HU(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:W3,params:[]})}function Zie(t,e){var n;return _p(this,void 0,void 0,function*(){const{defaultGateway:r}=Wie[t];if(!r)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(n=e==null?void 0:e.fetch)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.fetch,a=yield i?Xie(r,i):Yie(r);return zU(a.result,t)})}function $N(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function qie(t){return _p(this,void 0,void 0,function*(){const e="provider"in t?t.provider:t;let n;if(e){let r;if("request"in e){const i=e;n=$N(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:W3,params:[]})}catch{}}else if("send"in e){const i=e;n=$N(yield i.send("eth_chainId",[]));try{r=yield i.send(W3,[])}catch{}}else throw new Error("fetchRuntimePublicKey does not support non-request non-send provier!");if(r&&"key"in r)return zU(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return Zie(n)})}class eae{}class tae extends eae{constructor(e){super(),e||(e=Jie),this.timeoutMilliseconds=e}fetch(e){return _p(this,void 0,void 0,function*(){if(this.pubkey){const n=this.pubkey,r=Date.now()-this.timeoutMilliseconds;if(n.fetched&&n.fetched.valueOf()>r)return n}return this.pubkey=yield qie(e)})}cipher(e){return _p(this,void 0,void 0,function*(){const n=yield this.fetch(e);return sx.ephemeral(n.key,n.epoch)})}}var fs=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},nae=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ifs(this,void 0,void 0,function*(){return yield i({method:o[0],params:o[1]})})),"sendAsync"in t&&(a.sendAsync=()=>{throw new Error("sendAsync not supported by Sapphire wrapper!")}),wO(t,n,a)}function aae(t,e){return n=>fs(this,void 0,void 0,function*(){const r=yield t.getSigner(),i=yield e.fetcher.cipher(t),{method:a,params:o}=yield fae(n,r,i),s=yield r.provider.send(a,o??[]);return a==="eth_call"?yield i.decryptEncoded(s):s})}function wO(t,e,n){return new Proxy(t,{get(r,i){if(i===bO)return e;if(i in n)return Reflect.get(n,i);const a=Reflect.get(r,i);return typeof a=="function"?a.bind(r):a}})}function VU(t,e){const n=iA(e);let r;if(t.provider)try{const a=QU(t.provider,n,t);r=t.connect(a)}catch(a){if(a.code!=="UNSUPPORTED_OPERATION")throw a;r=t}else r=t;const i={sendTransaction:UN(r.sendTransaction.bind(r),n,r),signTransaction:UN(r.signTransaction.bind(r),n,r),call:ux(r,"call",n),estimateGas:ux(r,"estimateGas",n),connect(a){const o=r.connect(a);return VU(o,n)}};return wO(r,n,i)}function QU(t,e,n){const r=iA(e);if(Reflect.get(t,bO)!==void 0)return t;const i={call:ux(t,"call",r),estimateGas:ux(t,"estimateGas",r)};return n&&("broadcastTransaction"in t?i.broadcastTransaction=a=>fs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield K3(a,o,n);return t.broadcastTransaction(s)}):i.sendTransaction=a=>fs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield K3(a,o,n);return t.sendTransaction(s)})),wO(t,r,i)}function oae(t){return Reflect.get(t,"_isSigner")===!0}function sae(t){return t instanceof EU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function KU(t){return oae(t)||sae(t)}function lae(t){return Reflect.get(t,"_isProvider")===!0}function cae(t){return t instanceof AU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function uae(t){return lae(t)||cae(t)}function ux(t,e,n){const r=(i,a,o,s)=>fs(this,void 0,void 0,function*(){var l;let c=a.data;return o||(c=yield s.encryptEncode((l=a.data)!==null&&l!==void 0?l:new Uint8Array)),yield i[e](Object.assign(Object.assign({},a),{data:Ge(c)}))});return i=>fs(this,void 0,void 0,function*(){const a=Reflect.get(t,"populateCall");a!==void 0&&(i=yield a.bind(t)(i));let o;const s=JU(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&KU(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield WU(i)){const f=yield rA.make(i,c);o=yield u[e](Object.assign(Object.assign({},i),{data:yield f.encryptEncode(l)}))}else o=yield r(u,i,s,l)}else o=yield r(t,i,s,l);return!s&&typeof o=="string"?yield l.decryptEncoded(o):o})}function UN(t,e,n){return(r,...i)=>fs(this,void 0,void 0,function*(){if(r.data){const a=yield e.fetcher.cipher(n);r.data=yield a.encryptEncode(r.data)}return t(r,...i)})}function WU(t){return fs(this,void 0,void 0,function*(){const[e,n]=yield Promise.all([t.from,t.to]);return!!n&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function fae({method:t,params:e},n,r){return fs(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield K3(e[0],r,n)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield WU(e[0]))){const i=yield rA.make(e[0],n),a=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(r)});return{method:t,params:[a,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)&&e[0].data?(e[0].data=yield r.encryptEncode(e[0].data),{method:t,params:e}):{method:t,params:e}})}class a5 extends Error{}const hae="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function K3(t,e,n){return fs(this,void 0,void 0,function*(){const r=m1.from(t);if(JU(r.data,!1)||r.isSigned()&&(!n||(yield n.getAddress())!==r.from))return t;r.data=yield e.encryptEncode(r.data);try{return n.signTransaction(r)}catch(i){throw new Cy(hae,i)}})}function dae(t){return"data"in t&&"leash"in t&&"signature"in t}function JU(t,e){try{const n=Yb(mt(t));let r;if(dae(n)){if(!e)throw new a5("Got unexpected signed query!");r=n.data}else r=n;if(!pae(r))throw new a5("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof a5)throw n}return!1}function pae(t){const{format:e,body:n}=t,r=nae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Np.Plain&&(Xw(n)||!Xw(n.data)))}const W3="oasis_callDataPublicKey";class Cy extends Error{constructor(e,n){super(e),this.response=n}}function gae({mustBeMetaMask:t=!1,silent:e=!1,timeout:n=3e3}={}){i();let r=!1;return new Promise(a=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},n));function o(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:s}=window;s&&(!t||s.isMetaMask)?a(s):(!e&&console.error("@metamask/detect-provider:",t&&s?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),a(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 n!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}var yae=gae;const mae=Gt(yae),YU=U.createContext({}),XU=U.createContext({}),xO=()=>{const t=U.useContext(XU);if(t===void 0)throw new Error("[useConfig] Component not wrapped within a Provider");return t},vae=({children:t})=>{const{state:{VITE_NETWORK:e}}=xO(),n=async()=>!!await mae({mustBeMetaMask:!1}),r=async()=>{var l,c;const s=await(((c=(l=window.ethereum)==null?void 0:l.request)==null?void 0:c.call(l,{method:"eth_requestAccounts"}))||Promise.resolve([]));if(!s||(s==null?void 0:s.length)<=0)throw new Error("[EIP1193Context] Request account failed!");return s[0]},i=(s=e)=>{var c,u;if(!Lw.has(s))throw new Error(`Chain configuration for chain id '${s}' not found!`);const l=Lw.get(s);return(u=(c=window.ethereum)==null?void 0:c.request)==null?void 0:u.call(c,{method:"wallet_addEthereumChain",params:[l]})},o={isEIP1193ProviderAvailable:n,connectWallet:r,switchNetwork:async(s=e)=>{var f,h;const l=new VL(window.ethereum);if((await GU(l).getNetwork()).chainId!==BigInt(s))try{const d=cs(s).replace("0x0","0x");await((h=(f=window.ethereum).request)==null?void 0:h.call(f,{method:"wallet_switchEthereumChain",params:[{chainId:d}]}))}catch(d){const y=d;if((y==null?void 0:y.code)!==4902&&(y==null?void 0:y.code)!==-32603)throw y;i(s)}}};return ie.jsx(YU.Provider,{value:o,children:t})},bae=()=>{const t=U.useContext(YU);if(t===void 0)throw new Error("[useEIP1193] Component not wrapped within a Provider");return t},lb=[{inputs:[{internalType:"contract IPollManagerACL",name:"in_managerACL",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"Close_NotActive",type:"error"},{inputs:[],name:"Close_NotAllowed",type:"error"},{inputs:[],name:"Create_AlreadyExists",type:"error"},{inputs:[],name:"Create_InvalidACL",type:"error"},{inputs:[],name:"Create_NoChoices",type:"error"},{inputs:[],name:"Create_NotAllowed",type:"error"},{inputs:[],name:"Create_TooManyChoices",type:"error"},{inputs:[],name:"Poll_NotActive",type:"error"},{inputs:[],name:"Poll_NotPublishingVotes",type:"error"},{inputs:[],name:"Poll_StillActive",type:"error"},{inputs:[],name:"Vote_NotActive",type:"error"},{inputs:[],name:"Vote_NotAllowed",type:"error"},{inputs:[],name:"Vote_UnknownChoice",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"topChoice",type:"uint256"}],name:"ProposalClosed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"id",type:"bytes32"}],name:"ProposalCreated",type:"event"},{inputs:[],name:"MAX_CHOICES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"PAST_PROPOSALS",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"PROPOSALS",outputs:[{internalType:"bool",name:"active",type:"bool"},{internalType:"uint8",name:"topChoice",type:"uint8"},{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"params",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_id",type:"bytes32"}],name:"ballotIsActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"address",name:"in_voter",type:"address"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"canVoteOnPoll",outputs:[{internalType:"uint256",name:"out_weight",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"close",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"in_params",type:"tuple"},{internalType:"bytes",name:"in_aclData",type:"bytes"}],name:"create",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getACL",outputs:[{internalType:"contract IPollManagerACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"proposalId",type:"bytes32"}],name:"getPollACL",outputs:[{internalType:"contract IPollACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"getVoteCounts",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"uint8",name:"in_choiceId",type:"uint8"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"}],FN="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",wae=t=>t.length>1;class fx extends zP{constructor(...e){wae(e)?super(...e):super(lb,FN,e[0])}getDeployTransaction(e,n){return super.getDeployTransaction(e,n||{})}deploy(e,n){return super.deploy(e,n||{})}connect(e){return super.connect(e)}static createInterface(){return new DP(lb)}static connect(e,n){return new Cd(e,lb,n)}}I(fx,"bytecode",FN),I(fx,"abi",lb);const jN=new Uint8Array([]),xae={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,signer:null,account:null,explorerBaseUrl:null,chainName:null,pollManager:null,pollManagerVoidSigner:null},Aae=({children:t})=>{const{state:{VITE_NETWORK:e,VITE_WEB3_GATEWAY:n,VITE_CONTRACT_POLLMANAGER:r,VITE_PROPOSAL_ID:i}}=xO(),{isEIP1193ProviderAvailable:a,connectWallet:o,switchNetwork:s}=bae(),[l,c]=U.useState({...xae});U.useEffect(()=>{(async()=>{if(!n||!r)return;const z=new Rq(n,void 0,{staticNetwork:!0}),J=await fx.connect(r,z);c(H=>({...H,pollManagerVoidSigner:J,isVoidSignerConnected:!0}))})()},[n,r]);const u=$=>{c(z=>({...z,isConnected:$}))},f=U.useCallback($=>{if($.length<=0){u(!1);return}const[z]=$;c(J=>({...J,account:z}))},[]),h=($,z=l.sapphireEthProvider)=>{if(!z)throw new Error("[Web3Context] Sapphire provider is required!");if(!Lw.has($))throw new IE("Unknown network!");const{blockExplorerUrls:J,chainName:H}=Lw.get($),[G]=J;c(q=>({...q,explorerBaseUrl:G,chainName:H}))},d=U.useCallback(()=>{window.location.reload()},[]),y=U.useCallback(()=>u(!0),[]),p=U.useCallback(()=>u(!1),[]),m=(()=>{let $=!1;return z=>{var J,H,G,q;$||((J=z==null?void 0:z.on)==null||J.call(z,"accountsChanged",f),(H=z==null?void 0:z.on)==null||H.call(z,"chainChanged",d),(G=z==null?void 0:z.on)==null||G.call(z,"connect",y),(q=z==null?void 0:z.on)==null||q.call(z,"disconnect",p),$=!0)}})(),v=async($,z)=>{try{const J=new VL(z),H=GU(J),G=await H.getNetwork();h(G.chainId,H);const q=await H.getSigner(),K=fx.connect(r,q);c(ee=>({...ee,isConnected:!0,ethProvider:J,sapphireEthProvider:H,account:$,signer:q,pollManager:K}))}catch(J){throw c(H=>({...H,isConnected:!1})),J instanceof IE?J:new Error("[Web3Context] Unable to initialize providers!")}},w=async()=>{const{account:$,sapphireEthProvider:z}=l;if(!$||!z)throw new Error("[Web3Context] Unable to fetch balance!");return await z.getBalance($)},x=async()=>a(),E=async()=>{const $=await o();if(!$)throw new Error("[Web3Context] Request account failed!");await v($,window.ethereum),m(window.ethereum)},P=async($=e)=>s($),A=async $=>{if(!$)throw new Error("[txHash] is required!");const{sapphireEthProvider:z}=l;if(!z)throw new Error("[sapphireEthProvider] not initialized!");const J=await z.waitForTransaction($);if((J==null?void 0:J.status)===0)throw new Error("Transaction failed");return await z.getTransaction($)},F={state:l,isProviderAvailable:x,connectWallet:E,switchNetwork:P,getBalance:w,getTransaction:A,getPoll:async()=>{const{pollManagerVoidSigner:$}=l;if(!$)throw new Error("[pollManagerWithoutSigner] not initialized!");return await $.PROPOSALS(cs(i))},canVoteOnPoll:async()=>{const{pollManagerVoidSigner:$,account:z}=l;if(!$)throw new Error("[pollManagerVoidSigner] not initialized!");if(!z)throw new Error("[account] Wallet not connected!");return await $.canVoteOnPoll(i,z,jN).then(J=>Promise.resolve(J===1n)).catch(()=>Promise.resolve(!1))},vote:async $=>{const{pollManager:z,signer:J}=l;if(!z)throw new Error("[pollManager] not initialized!");if(!J)throw new Error("[signer] Signer not connected!");const H=await z.vote.populateTransaction(i,$,jN);H.gasLimit=oK,H.value=0n;const G=await J.sendTransaction(H);return await A(G.hash)},getVoteCounts:async()=>{const{pollManagerVoidSigner:$}=l;if(!$)throw new Error("[pollManagerVoidSigner] not initialized!");return await $.getVoteCounts(i)}};return ie.jsx(L7.Provider,{value:F,children:t})},Eae="_cardHeaderText_4qxvn_1",Sae="_winningMascot_4qxvn_11",Pae="_winningMascotBadge_4qxvn_15",Oae="_mascotPollData_4qxvn_32",Tae="_cardFooterText_4qxvn_39",Cae="_mascotResultsTable_4qxvn_48",kae="_answerColName_4qxvn_64",gu={cardHeaderText:Eae,winningMascot:Sae,winningMascotBadge:Pae,mascotPollData:Oae,cardFooterText:Tae,mascotResultsTable:Cae,answerColName:kae},Nae=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},U.createElement("path",{d:"M232,64H208V56a16,16,0,0,0-16-16H64A16,16,0,0,0,48,56v8H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})),_ae=()=>ie.jsx(ng,{size:"small",children:ie.jsx(Nae,{})}),Iae="_pieChart_154k8_1",Rae="_pieChartCell_154k8_6",zN={pieChart:Iae,pieChartCell:Rae};function ZU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e-1}var Ise=_se,Rse=oA;function Mse(t,e){var n=this.__data__,r=Rse(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Bse=Mse,Dse=vse,Lse=Ose,$se=kse,Use=Ise,Fse=Bse;function ug(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},ju=function(e){return uv(e)&&e.indexOf("%")===e.length-1},Me=function(e){return uce(e)&&!fv(e)},tr=function(e){return Me(e)||uv(e)},pce=0,wA=function(e){var n=++pce;return"".concat(e||"").concat(n)},oa=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Me(e)&&!uv(e))return r;var a;if(ju(e)){var o=e.indexOf("%");a=n*parseFloat(e.slice(0,o))/100}else a=+e;return fv(a)&&(a=r),i&&a>n&&(a=n),a},Hh=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},gce=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xce(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var t_={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},fl=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},n_=null,l5=null,MO=function t(e){if(e===n_&&Array.isArray(l5))return l5;var n=[];return U.Children.forEach(e,function(r){Ht(r)||(J3.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),l5=n,n_=e,n};function os(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return fl(i)}):r=[fl(e)],MO(t).forEach(function(i){var a=Eo(i,"type.displayName")||Eo(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Ia(t,e){var n=os(t,e);return n&&n[0]}var r_=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!Me(r)||r<=0||!Me(i)||i<=0)},Ace=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Ece=function(e){return e&&e.type&&uv(e.type)&&Ace.indexOf(e.type)>=0},Sce=function(e,n,r,i){var a,o=(a=s5==null?void 0:s5[i])!==null&&a!==void 0?a:[];return!Rt(e)&&(i&&o.includes(n)||mce.includes(n))||r&&RO.includes(n)},St=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(U.isValidElement(e)&&(i=e.props),!lg(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;Sce((s=i)===null||s===void 0?void 0:s[o],o,n,r)&&(a[o]=i[o])}),a},q3=function t(e,n){if(e===n)return!0;var r=U.Children.count(e);if(r!==U.Children.count(n))return!1;if(r===0)return!0;if(r===1)return i_(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function kce(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function t8(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,a=t.className,o=t.style,s=t.title,l=t.desc,c=Cce(t,Tce),u=i||{width:n,height:r,x:0,y:0},f=bn("recharts-surface",a);return X.createElement("svg",e8({},St(c,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),X.createElement("title",null,s),X.createElement("desc",null,l),e)}var Nce=["children","className"];function n8(){return n8=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ice(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var Ln=X.forwardRef(function(t,e){var n=t.children,r=t.className,i=_ce(t,Nce),a=bn("recharts-layer",r);return X.createElement("g",n8({className:a},St(i,!0),{ref:e}),n)}),hl=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;ai?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r=r?t:Bce(t,e,n)}var Lce=Dce,$ce="\\ud800-\\udfff",Uce="\\u0300-\\u036f",Fce="\\ufe20-\\ufe2f",jce="\\u20d0-\\u20ff",zce=Uce+Fce+jce,Hce="\\ufe0e\\ufe0f",Gce="\\u200d",Vce=RegExp("["+Gce+$ce+zce+Hce+"]");function Qce(t){return Vce.test(t)}var fF=Qce;function Kce(t){return t.split("")}var Wce=Kce,hF="\\ud800-\\udfff",Jce="\\u0300-\\u036f",Yce="\\ufe20-\\ufe2f",Xce="\\u20d0-\\u20ff",Zce=Jce+Yce+Xce,qce="\\ufe0e\\ufe0f",eue="["+hF+"]",r8="["+Zce+"]",i8="\\ud83c[\\udffb-\\udfff]",tue="(?:"+r8+"|"+i8+")",dF="[^"+hF+"]",pF="(?:\\ud83c[\\udde6-\\uddff]){2}",gF="[\\ud800-\\udbff][\\udc00-\\udfff]",nue="\\u200d",yF=tue+"?",mF="["+qce+"]?",rue="(?:"+nue+"(?:"+[dF,pF,gF].join("|")+")"+mF+yF+")*",iue=mF+yF+rue,aue="(?:"+[dF+r8+"?",r8,pF,gF,eue].join("|")+")",oue=RegExp(i8+"(?="+i8+")|"+aue+iue,"g");function sue(t){return t.match(oue)||[]}var lue=sue,cue=Wce,uue=fF,fue=lue;function hue(t){return uue(t)?fue(t):cue(t)}var due=hue,pue=Lce,gue=fF,yue=due,mue=aF;function vue(t){return function(e){e=mue(e);var n=gue(e)?yue(e):void 0,r=n?n[0]:e.charAt(0),i=n?pue(n,1).join(""):e.slice(1);return r[t]()+i}}var bue=vue,wue=bue,xue=wue("toUpperCase"),Aue=xue;const AA=Gt(Aue);function an(t){return function(){return t}}const vF=Math.cos,dx=Math.sin,ko=Math.sqrt,px=Math.PI,EA=2*px,a8=Math.PI,o8=2*a8,Eu=1e-6,Eue=o8-Eu;function bF(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return bF;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;iEu)if(!(Math.abs(f*l-c*u)>Eu)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-o,y=i-s,p=l*l+c*c,m=d*d+y*y,v=Math.sqrt(p),w=Math.sqrt(h),x=a*Math.tan((a8-Math.acos((p+h-m)/(2*v*w)))/2),E=x/w,P=x/v;Math.abs(E-1)>Eu&&this._append`L${e+E*u},${n+E*f}`,this._append`A${a},${a},0,0,${+(f*d>u*y)},${this._x1=e+P*l},${this._y1=n+P*c}`}}arc(e,n,r,i,a,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Eu||Math.abs(this._y1-u)>Eu)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%o8+o8),h>Eue?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:h>Eu&&this._append`A${r},${r},0,${+(h>=a8)},${f},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function BO(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Pue(e)}function DO(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function wF(t){this._context=t}wF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function SA(t){return new wF(t)}function xF(t){return t[0]}function AF(t){return t[1]}function EF(t,e){var n=an(!0),r=null,i=SA,a=null,o=BO(s);t=typeof t=="function"?t:t===void 0?xF:an(t),e=typeof e=="function"?e:e===void 0?AF:an(e);function s(l){var c,u=(l=DO(l)).length,f,h=!1,d;for(r==null&&(a=i(d=o())),c=0;c<=u;++c)!(c=d;--y)s.point(x[y],E[y]);s.lineEnd(),s.areaEnd()}v&&(x[h]=+t(m,h,f),E[h]=+e(m,h,f),s.point(r?+r(m,h,f):x[h],n?+n(m,h,f):E[h]))}if(w)return s=null,w+""||null}function u(){return EF().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:an(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:an(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:an(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:an(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:an(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:an(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:an(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),c):a},c}class SF{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Oue(t){return new SF(t,!0)}function Tue(t){return new SF(t,!1)}const LO={draw(t,e){const n=ko(e/px);t.moveTo(n,0),t.arc(0,0,n,0,EA)}},Cue={draw(t,e){const n=ko(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},PF=ko(1/3),kue=PF*2,Nue={draw(t,e){const n=ko(e/kue),r=n*PF;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},_ue={draw(t,e){const n=ko(e),r=-n/2;t.rect(r,r,n,n)}},Iue=.8908130915292852,OF=dx(px/10)/dx(7*px/10),Rue=dx(EA/10)*OF,Mue=-vF(EA/10)*OF,Bue={draw(t,e){const n=ko(e*Iue),r=Rue*n,i=Mue*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const o=EA*a/5,s=vF(o),l=dx(o);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},c5=ko(3),Due={draw(t,e){const n=-ko(e/(c5*3));t.moveTo(0,n*2),t.lineTo(-c5*n,-n),t.lineTo(c5*n,-n),t.closePath()}},ga=-.5,ya=ko(3)/2,s8=1/ko(12),Lue=(s8/2+1)*3,$ue={draw(t,e){const n=ko(e/Lue),r=n/2,i=n*s8,a=r,o=n*s8+n,s=-a,l=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(ga*r-ya*i,ya*r+ga*i),t.lineTo(ga*a-ya*o,ya*a+ga*o),t.lineTo(ga*s-ya*l,ya*s+ga*l),t.lineTo(ga*r+ya*i,ga*i-ya*r),t.lineTo(ga*a+ya*o,ga*o-ya*a),t.lineTo(ga*s+ya*l,ga*l-ya*s),t.closePath()}};function Uue(t,e){let n=null,r=BO(i);t=typeof t=="function"?t:an(t||LO),e=typeof e=="function"?e:an(e===void 0?64:+e);function i(){let a;if(n||(n=a=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:an(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:an(+a),i):e},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function gx(){}function yx(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function TF(t){this._context=t}TF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:yx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Fue(t){return new TF(t)}function CF(t){this._context=t}CF.prototype={areaStart:gx,areaEnd:gx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function jue(t){return new CF(t)}function kF(t){this._context=t}kF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:yx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zue(t){return new kF(t)}function NF(t){this._context=t}NF.prototype={areaStart:gx,areaEnd:gx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Hue(t){return new NF(t)}function o_(t){return t<0?-1:1}function s_(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(o_(a)+o_(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function l_(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function u5(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function mx(t){this._context=t}mx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:u5(this,this._t0,l_(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,u5(this,l_(this,n=s_(this,t,e)),n);break;default:u5(this,this._t0,n=s_(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function _F(t){this._context=new IF(t)}(_F.prototype=Object.create(mx.prototype)).point=function(t,e){mx.prototype.point.call(this,e,t)};function IF(t){this._context=t}IF.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}};function Gue(t){return new mx(t)}function Vue(t){return new _F(t)}function RF(t){this._context=t}RF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=c_(t),i=c_(e),a=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Kue(t){return new PA(t,.5)}function Wue(t){return new PA(t,0)}function Jue(t){return new PA(t,1)}function Ip(t,e){if((o=t.length)>1)for(var n=1,r,i,a=t[e[0]],o,s=a.length;n=0;)n[e]=e;return n}function Yue(t,e){return t[e]}function Xue(t){const e=[];return e.key=t,e}function Zue(){var t=an([]),e=l8,n=Ip,r=Yue;function i(a){var o=Array.from(t.apply(this,arguments),Xue),s,l=o.length,c=-1,u;for(const f of a)for(s=0,++c;s0){for(var n,r,i=0,a=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,a=r.length;n0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,o;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function sfe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var MF={symbolCircle:LO,symbolCross:Cue,symbolDiamond:Nue,symbolSquare:_ue,symbolStar:Bue,symbolTriangle:Due,symbolWye:$ue},lfe=Math.PI/180,cfe=function(e){var n="symbol".concat(AA(e));return MF[n]||LO},ufe=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*lfe;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},ffe=function(e,n){MF["symbol".concat(AA(e))]=n},$O=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,a=i===void 0?64:i,o=e.sizeType,s=o===void 0?"area":o,l=ofe(e,nfe),c=f_(f_({},l),{},{type:r,size:a,sizeType:s}),u=function(){var m=cfe(r),v=Uue().type(m).size(ufe(a,s,r));return v()},f=c.className,h=c.cx,d=c.cy,y=St(c,!0);return h===+h&&d===+d&&a===+a?X.createElement("path",c8({},y,{className:bn("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:u()})):null};$O.registerSymbol=ffe;function Rp(t){"@babel/helpers - typeof";return Rp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rp(t)}function u8(){return u8=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var w=d.inactive?c:d.color;return X.createElement("li",u8({className:m,style:f,key:"legend-item-".concat(y)},xA(r.props,d,y)),X.createElement(t8,{width:o,height:o,viewBox:u,style:h},r.renderIcon(d)),X.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},p?p(v,d,y):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return X.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(U.PureComponent);E1(UO,"displayName","Legend");E1(UO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var wfe=sA;function xfe(){this.__data__=new wfe,this.size=0}var Afe=xfe;function Efe(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Sfe=Efe;function Pfe(t){return this.__data__.get(t)}var Ofe=Pfe;function Tfe(t){return this.__data__.has(t)}var Cfe=Tfe,kfe=sA,Nfe=PO,_fe=OO,Ife=200;function Rfe(t,e){var n=this.__data__;if(n instanceof kfe){var r=n.__data__;if(!Nfe||r.lengths))return!1;var c=a.get(t),u=a.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&the?new Xfe:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=ade}var HO=ode,sde=_l,lde=HO,cde=Il,ude="[object Arguments]",fde="[object Array]",hde="[object Boolean]",dde="[object Date]",pde="[object Error]",gde="[object Function]",yde="[object Map]",mde="[object Number]",vde="[object Object]",bde="[object RegExp]",wde="[object Set]",xde="[object String]",Ade="[object WeakMap]",Ede="[object ArrayBuffer]",Sde="[object DataView]",Pde="[object Float32Array]",Ode="[object Float64Array]",Tde="[object Int8Array]",Cde="[object Int16Array]",kde="[object Int32Array]",Nde="[object Uint8Array]",_de="[object Uint8ClampedArray]",Ide="[object Uint16Array]",Rde="[object Uint32Array]",un={};un[Pde]=un[Ode]=un[Tde]=un[Cde]=un[kde]=un[Nde]=un[_de]=un[Ide]=un[Rde]=!0;un[ude]=un[fde]=un[Ede]=un[hde]=un[Sde]=un[dde]=un[pde]=un[gde]=un[yde]=un[mde]=un[vde]=un[bde]=un[wde]=un[xde]=un[Ade]=!1;function Mde(t){return cde(t)&&lde(t.length)&&!!un[sde(t)]}var Bde=Mde;function Dde(t){return function(e){return t(e)}}var VF=Dde,xx={exports:{}};xx.exports;(function(t,e){var n=qU,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===r,o=a&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s})(xx,xx.exports);var Lde=xx.exports,$de=Bde,Ude=VF,b_=Lde,w_=b_&&b_.isTypedArray,Fde=w_?Ude(w_):$de,QF=Fde,jde=Ghe,zde=jO,Hde=$i,Gde=GF,Vde=zO,Qde=QF,Kde=Object.prototype,Wde=Kde.hasOwnProperty;function Jde(t,e){var n=Hde(t),r=!n&&zde(t),i=!n&&!r&&Gde(t),a=!n&&!r&&!i&&Qde(t),o=n||r||i||a,s=o?jde(t.length,String):[],l=s.length;for(var c in t)(e||Wde.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Vde(c,l)))&&s.push(c);return s}var Yde=Jde,Xde=Object.prototype;function Zde(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Xde;return t===n}var qde=Zde;function e0e(t,e){return function(n){return t(e(n))}}var KF=e0e,t0e=KF,n0e=t0e(Object.keys,Object),r0e=n0e,i0e=qde,a0e=r0e,o0e=Object.prototype,s0e=o0e.hasOwnProperty;function l0e(t){if(!i0e(t))return a0e(t);var e=[];for(var n in Object(t))s0e.call(t,n)&&n!="constructor"&&e.push(n);return e}var c0e=l0e,u0e=EO,f0e=HO;function h0e(t){return t!=null&&f0e(t.length)&&!u0e(t)}var OA=h0e,d0e=Yde,p0e=c0e,g0e=OA;function y0e(t){return g0e(t)?d0e(t):p0e(t)}var GO=y0e,m0e=Ihe,v0e=zhe,b0e=GO;function w0e(t){return m0e(t,b0e,v0e)}var x0e=w0e,x_=x0e,A0e=1,E0e=Object.prototype,S0e=E0e.hasOwnProperty;function P0e(t,e,n,r,i,a){var o=n&A0e,s=x_(t),l=s.length,c=x_(e),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in e:S0e.call(e,h)))return!1}var d=a.get(t),y=a.get(e);if(d&&y)return d==e&&y==t;var p=!0;a.set(t,e),a.set(e,t);for(var m=o;++f-1}var Sge=Ege;function Pge(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Fge){var c=e?null:$ge(t);if(c)return Uge(c);o=!1,i=Lge,l=new Mge}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tye(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function nye(t){return t.value}function rye(t,e){if(X.isValidElement(t))return X.cloneElement(t,e);if(typeof t=="function")return X.createElement(t,e);e.ref;var n=eye(e,Kge);return X.createElement(UO,n)}var L_=1,S1=function(t){Zge(e,t);function e(){var n;Wge(this,e);for(var r=arguments.length,i=new Array(r),a=0;aL_||Math.abs(i.height-this.lastBoundingBox.height)>L_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?yu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((c||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();h={top:((u||0)-y.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return yu(yu({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=yu(yu({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return X.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},rye(a,yu(yu({},this.props),{},{payload:qF(u,c,nye)})))}}],[{key:"getWithHeight",value:function(r,i){var a=r.props.layout;return a==="vertical"&&Me(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}]),e}(U.PureComponent);TA(S1,"displayName","Legend");TA(S1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var $_=cv,iye=jO,aye=$i,U_=$_?$_.isConcatSpreadable:void 0;function oye(t){return aye(t)||iye(t)||!!(U_&&t&&t[U_])}var sye=oye,lye=zF,cye=sye;function rj(t,e,n,r,i){var a=-1,o=t.length;for(n||(n=cye),i||(i=[]);++a0&&n(s)?e>1?rj(s,e-1,n,r,i):lye(i,s):r||(i[i.length]=s)}return i}var ij=rj;function uye(t){return function(e,n,r){for(var i=-1,a=Object(e),o=r(e),s=o.length;s--;){var l=o[t?s:++i];if(n(a[l],l,a)===!1)break}return e}}var fye=uye,hye=fye,dye=hye(),pye=dye,gye=pye,yye=GO;function mye(t,e){return t&&gye(t,e,yye)}var aj=mye,vye=OA;function bye(t,e){return function(n,r){if(n==null)return n;if(!vye(n))return t(n,r);for(var i=n.length,a=e?i:-1,o=Object(n);(e?a--:++ae||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var Rye=Iye,p5=CO,Mye=kO,Bye=su,Dye=oj,Lye=Cye,$ye=VF,Uye=Rye,Fye=pg,jye=$i;function zye(t,e,n){e.length?e=p5(e,function(a){return jye(a)?function(o){return Mye(o,a.length===1?a[0]:a)}:a}):e=[Fye];var r=-1;e=p5(e,$ye(Bye));var i=Dye(t,function(a,o,s){var l=p5(e,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return Lye(i,function(a,o){return Uye(a,o,n)})}var Hye=zye;function Gye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Vye=Gye,Qye=Vye,j_=Math.max;function Kye(t,e,n){return e=j_(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=j_(r.length-e,0),o=Array(a);++i0){if(++e>=r1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var s1e=o1e,l1e=n1e,c1e=s1e,u1e=c1e(l1e),f1e=u1e,h1e=pg,d1e=Wye,p1e=f1e;function g1e(t,e){return p1e(d1e(t,e,h1e),t+"")}var y1e=g1e,m1e=SO,v1e=OA,b1e=zO,w1e=ou;function x1e(t,e,n){if(!w1e(n))return!1;var r=typeof e;return(r=="number"?v1e(n)&&b1e(e,n.length):r=="string"&&e in n)?m1e(n[e],t):!1}var CA=x1e,A1e=ij,E1e=Hye,S1e=y1e,H_=CA,P1e=S1e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&H_(t,e[0],e[1])?e=[]:n>2&&H_(e[0],e[1],e[2])&&(e=[e[0]]),E1e(t,A1e(e,1),[])}),O1e=P1e;const KO=Gt(O1e);function P1(t){"@babel/helpers - typeof";return P1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P1(t)}function v8(){return v8=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(Dg,"-left"),Me(n)&&e&&Me(e.x)&&n=e.y),"".concat(Dg,"-top"),Me(r)&&e&&Me(e.y)&&rp?Math.max(u,l[r]):Math.max(f,l[r])}function j1e(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function z1e(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,f;return o.height>0&&o.width>0&&n?(u=Q_({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=Q_({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),c=j1e({translateX:u,translateY:f,useTranslate3d:s})):c=U1e,{cssProperties:c,cssClasses:F1e({translateX:u,translateY:f,coordinate:n})}}function Bp(t){"@babel/helpers - typeof";return Bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bp(t)}function K_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function W_(t){for(var e=1;eY_||Math.abs(r.height-this.lastBoundingBox.height)>Y_)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,y=i.position,p=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,w=i.wrapperStyle,x=z1e({allowEscapeViewBox:o,coordinate:u,offsetTopLeft:d,position:y,reverseDirection:p,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:m,viewBox:v}),E=x.cssClasses,P=x.cssProperties,A=W_(W_({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},P),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},w);return X.createElement("div",{tabIndex:-1,className:E,style:A,ref:function(N){r.wrapperNode=N}},c)}}]),e}(U.PureComponent),Y1e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},zf={isSsr:Y1e(),get:function(e){return zf[e]},set:function(e,n){if(typeof e=="string")zf[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){zf[i]=e[i]})}}};function Dp(t){"@babel/helpers - typeof";return Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dp(t)}function X_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Z_(t){for(var e=1;e0;return X.createElement(J1e,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:u,hasPayload:A,offset:d,position:m,reverseDirection:v,useTranslate3d:w,viewBox:x,wrapperStyle:E},ame(c,Z_(Z_({},this.props),{},{payload:P})))}}]),e}(U.PureComponent);WO(As,"displayName","Tooltip");WO(As,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!zf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var ome=gs,sme=function(){return ome.Date.now()},lme=sme,cme=/\s/;function ume(t){for(var e=t.length;e--&&cme.test(t.charAt(e)););return e}var fme=ume,hme=fme,dme=/^\s+/;function pme(t){return t&&t.slice(0,hme(t)+1).replace(dme,"")}var gme=pme,yme=gme,eI=ou,mme=sg,tI=NaN,vme=/^[-+]0x[0-9a-f]+$/i,bme=/^0b[01]+$/i,wme=/^0o[0-7]+$/i,xme=parseInt;function Ame(t){if(typeof t=="number")return t;if(mme(t))return tI;if(eI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=eI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=yme(t);var n=bme.test(t);return n||wme.test(t)?xme(t.slice(2),n?2:8):vme.test(t)?tI:+t}var hj=Ame,Eme=ou,y5=lme,nI=hj,Sme="Expected a function",Pme=Math.max,Ome=Math.min;function Tme(t,e,n){var r,i,a,o,s,l,c=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(Sme);e=nI(e)||0,Eme(n)&&(u=!!n.leading,f="maxWait"in n,a=f?Pme(nI(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h);function d(A){var k=r,N=i;return r=i=void 0,c=A,o=t.apply(N,k),o}function y(A){return c=A,s=setTimeout(v,e),u?d(A):o}function p(A){var k=A-l,N=A-c,D=e-k;return f?Ome(D,a-N):D}function m(A){var k=A-l,N=A-c;return l===void 0||k>=e||k<0||f&&N>=a}function v(){var A=y5();if(m(A))return w(A);s=setTimeout(v,p(A))}function w(A){return s=void 0,h&&r?d(A):(r=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function E(){return s===void 0?o:w(y5())}function P(){var A=y5(),k=m(A);if(r=arguments,i=this,l=A,k){if(s===void 0)return y(l);if(f)return clearTimeout(s),s=setTimeout(v,e),d(l)}return s===void 0&&(s=setTimeout(v,e)),o}return P.cancel=x,P.flush=E,P}var Cme=Tme,kme=Cme,Nme=ou,_me="Expected a function";function Ime(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(_me);return Nme(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),kme(t,e,{leading:r,maxWait:e,trailing:i})}var Rme=Ime;const dj=Gt(Rme);function T1(t){"@babel/helpers - typeof";return T1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T1(t)}function rI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function hb(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(z=dj(z,p,{trailing:!0,leading:!1}));var J=new ResizeObserver(z),H=P.current.getBoundingClientRect(),G=H.width,q=H.height;return F(G,q),J.observe(P.current),function(){J.disconnect()}},[F,p]);var $=U.useMemo(function(){var z=D.containerWidth,J=D.containerHeight;if(z<0||J<0)return null;hl(ju(o)||ju(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),hl(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=ju(o)?z:o,G=ju(l)?J:l;n&&n>0&&(H?G=H/n:G&&(H=G*n),h&&G>h&&(G=h)),hl(H>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,H,G,o,l,u,f,n);var q=!Array.isArray(d)&&J3.isElement(d)&&fl(d.type).endsWith("Chart");return X.Children.map(d,function(K){return J3.isElement(K)?U.cloneElement(K,hb({width:H,height:G},q?{style:hb({height:"100%",width:"100%",maxHeight:G,maxWidth:H},K.props.style)}:{})):K})},[n,d,l,h,f,u,D,o]);return X.createElement("div",{id:m?"".concat(m):void 0,className:bn("recharts-responsive-container",v),style:hb(hb({},E),{},{width:o,height:l,minWidth:u,minHeight:f,maxHeight:h}),ref:P},$)}),JO=function(e){return null};JO.displayName="Cell";function C1(t){"@babel/helpers - typeof";return C1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C1(t)}function aI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function x8(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||zf.isSsr)return{width:0,height:0};var r=Wme(n),i=JSON.stringify({text:e,copyStyle:r});if(_h.widthCache[i])return _h.widthCache[i];try{var a=document.getElementById(oI);a||(a=document.createElement("span"),a.setAttribute("id",oI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=x8(x8({},Kme),r);Object.assign(a.style,o),a.textContent="".concat(e);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return _h.widthCache[i]=l,++_h.cacheCount>Qme&&(_h.cacheCount=0,_h.widthCache={}),l}catch{return{width:0,height:0}}},Jme=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function k1(t){"@babel/helpers - typeof";return k1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k1(t)}function Px(t,e){return qme(t)||Zme(t,e)||Xme(t,e)||Yme()}function Yme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xme(t,e){if(t){if(typeof t=="string")return lI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lI(t,e)}}function lI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function dve(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function pI(t,e){return mve(t)||yve(t,e)||gve(t,e)||pve()}function pve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gve(t,e){if(t){if(typeof t=="string")return gI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gI(t,e)}}function gI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(G,q){var K=q.word,ee=q.width,he=G[G.length-1];if(he&&(i==null||a||he.width+ee+rq.width?G:q})};if(!u)return d;for(var p="…",m=function(H){var G=f.slice(0,H),q=mj({breakAll:c,style:l,children:G+p}).wordsWithComputedWidth,K=h(q),ee=K.length>o||y(K).width>Number(i);return[ee,K]},v=0,w=f.length-1,x=0,E;v<=w&&x<=f.length-1;){var P=Math.floor((v+w)/2),A=P-1,k=m(A),N=pI(k,2),D=N[0],L=N[1],F=m(P),$=pI(F,1),z=$[0];if(!D&&!z&&(v=P+1),D&&z&&(w=P-1),!D&&z){E=L;break}x++}return E||d},yI=function(e){var n=Ht(e)?[]:e.toString().split(yj);return[{words:n}]},bve=function(e){var n=e.width,r=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,s=e.maxLines;if((n||r)&&!zf.isSsr){var l,c,u=mj({breakAll:o,children:i,style:a});if(u){var f=u.wordsWithComputedWidth,h=u.spaceWidth;l=f,c=h}else return yI(i);return vve({breakAll:o,children:i,maxLines:s,style:a},l,c,n,r)}return yI(i)},mI="#808080",Lp=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.lineHeight,s=o===void 0?"1em":o,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,h=e.textAnchor,d=h===void 0?"start":h,y=e.verticalAnchor,p=y===void 0?"end":y,m=e.fill,v=m===void 0?mI:m,w=dI(e,fve),x=U.useMemo(function(){return bve({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:f,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,f,w.style,w.width]),E=w.dx,P=w.dy,A=w.angle,k=w.className,N=w.breakAll,D=dI(w,hve);if(!tr(r)||!tr(a))return null;var L=r+(Me(E)?E:0),F=a+(Me(P)?P:0),$;switch(p){case"start":$=m5("calc(".concat(c,")"));break;case"middle":$=m5("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:$=m5("calc(".concat(x.length-1," * -").concat(s,")"));break}var z=[];if(f){var J=x[0].width,H=w.width;z.push("scale(".concat((Me(H)?H/J:1)/J,")"))}return A&&z.push("rotate(".concat(A,", ").concat(L,", ").concat(F,")")),z.length&&(D.transform=z.join(" ")),X.createElement("text",A8({},St(D,!0),{x:L,y:F,className:bn("recharts-text",k),textAnchor:d,fill:v.includes("url")?mI:v}),x.map(function(G,q){var K=G.words.join(N?"":" ");return X.createElement("tspan",{x:L,dy:q===0?$:s,key:K},K)}))};function Wc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function wve(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function YO(t){let e,n,r;t.length!==2?(e=Wc,n=(s,l)=>Wc(t(s),l),r=(s,l)=>t(s)-l):(e=t===Wc||t===wve?t:xve,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function xve(){return 0}function vj(t){return t===null?NaN:+t}function*Ave(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const Eve=YO(Wc),hv=Eve.right;YO(vj).center;class vI extends Map{constructor(e,n=Ove){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(bI(this,e))}has(e){return super.has(bI(this,e))}set(e,n){return super.set(Sve(this,e),n)}delete(e){return super.delete(Pve(this,e))}}function bI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Sve({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Pve({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Ove(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Tve(t=Wc){if(t===Wc)return bj;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function bj(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const Cve=Math.sqrt(50),kve=Math.sqrt(10),Nve=Math.sqrt(2);function Ox(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Cve?10:a>=kve?5:a>=Nve?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function xI(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function wj(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?bj:Tve(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(n,Math.floor(e-c*f/l+h)),y=Math.min(r,Math.floor(e+(l-c)*f/l+h));wj(t,e,d,y,i)}const a=t[e];let o=n,s=r;for(Lg(t,n,e),i(t[r],a)>0&&Lg(t,n,r);o0;)--s}i(t[n],a)===0?Lg(t,n,s):(++s,Lg(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Lg(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function _ve(t,e,n){if(t=Float64Array.from(Ave(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return xI(t);if(e>=1)return wI(t);var r,i=(r-1)*e,a=Math.floor(i),o=wI(wj(t,a).subarray(0,a+1)),s=xI(t.subarray(a+1));return o+(s-o)*(i-a)}}function Ive(t,e,n=vj){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t),s=+n(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function Rve(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?pb(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?pb(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Bve.exec(t))?new Ni(e[1],e[2],e[3],1):(e=Dve.exec(t))?new Ni(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Lve.exec(t))?pb(e[1],e[2],e[3],e[4]):(e=$ve.exec(t))?pb(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Uve.exec(t))?CI(e[1],e[2]/100,e[3]/100,1):(e=Fve.exec(t))?CI(e[1],e[2]/100,e[3]/100,e[4]):AI.hasOwnProperty(t)?PI(AI[t]):t==="transparent"?new Ni(NaN,NaN,NaN,0):null}function PI(t){return new Ni(t>>16&255,t>>8&255,t&255,1)}function pb(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ni(t,e,n,r)}function Hve(t){return t instanceof dv||(t=R1(t)),t?(t=t.rgb(),new Ni(t.r,t.g,t.b,t.opacity)):new Ni}function T8(t,e,n,r){return arguments.length===1?Hve(t):new Ni(t,e,n,r??1)}function Ni(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ZO(Ni,T8,Aj(dv,{brighter(t){return t=t==null?Tx:Math.pow(Tx,t),new Ni(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?_1:Math.pow(_1,t),new Ni(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ni(Hf(this.r),Hf(this.g),Hf(this.b),Cx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OI,formatHex:OI,formatHex8:Gve,formatRgb:TI,toString:TI}));function OI(){return`#${zu(this.r)}${zu(this.g)}${zu(this.b)}`}function Gve(){return`#${zu(this.r)}${zu(this.g)}${zu(this.b)}${zu((isNaN(this.opacity)?1:this.opacity)*255)}`}function TI(){const t=Cx(this.opacity);return`${t===1?"rgb(":"rgba("}${Hf(this.r)}, ${Hf(this.g)}, ${Hf(this.b)}${t===1?")":`, ${t})`}`}function Cx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function zu(t){return t=Hf(t),(t<16?"0":"")+t.toString(16)}function CI(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wo(t,e,n,r)}function Ej(t){if(t instanceof wo)return new wo(t.h,t.s,t.l,t.opacity);if(t instanceof dv||(t=R1(t)),!t)return new wo;if(t instanceof wo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(n-r)/s+(n0&&l<1?0:o,new wo(o,s,l,t.opacity)}function Vve(t,e,n,r){return arguments.length===1?Ej(t):new wo(t,e,n,r??1)}function wo(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ZO(wo,Vve,Aj(dv,{brighter(t){return t=t==null?Tx:Math.pow(Tx,t),new wo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?_1:Math.pow(_1,t),new wo(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ni(v5(t>=240?t-240:t+120,i,r),v5(t,i,r),v5(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new wo(kI(this.h),gb(this.s),gb(this.l),Cx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Cx(this.opacity);return`${t===1?"hsl(":"hsla("}${kI(this.h)}, ${gb(this.s)*100}%, ${gb(this.l)*100}%${t===1?")":`, ${t})`}`}}));function kI(t){return t=(t||0)%360,t<0?t+360:t}function gb(t){return Math.max(0,Math.min(1,t||0))}function v5(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const qO=t=>()=>t;function Qve(t,e){return function(n){return t+n*e}}function Kve(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Wve(t){return(t=+t)==1?Sj:function(e,n){return n-e?Kve(e,n,t):qO(isNaN(e)?n:e)}}function Sj(t,e){var n=e-t;return n?Qve(t,n):qO(isNaN(t)?e:t)}const NI=function t(e){var n=Wve(e);function r(i,a){var o=n((i=T8(i)).r,(a=T8(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),c=Sj(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function Jve(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;in&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:kx(r,i)})),n=b5.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function obe(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?sbe:obe,l=c=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(t.map(r),e,n)))(r(o(h)))}return f.invert=function(h){return o(i((c||(c=s(e,t.map(r),kx)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Nx),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=e4,u()},f.clamp=function(h){return arguments.length?(o=h?!0:fi,u()):o!==fi},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return r=h,i=d,u()}}function t4(){return kA()(fi,fi)}function lbe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function _x(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function $p(t){return t=_x(Math.abs(t)),t?t[1]:NaN}function cbe(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function ube(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var fbe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function M1(t){if(!(e=fbe.exec(t)))throw new Error("invalid format: "+t);var e;return new n4({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}M1.prototype=n4.prototype;function n4(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}n4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function hbe(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Pj;function dbe(t,e){var n=_x(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Pj=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+_x(t,Math.max(0,e+a-1))[0]}function II(t,e){var n=_x(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const RI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:lbe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>II(t*100,e),r:II,s:dbe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function MI(t){return t}var BI=Array.prototype.map,DI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pbe(t){var e=t.grouping===void 0||t.thousands===void 0?MI:cbe(BI.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?MI:ube(BI.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=M1(f);var h=f.fill,d=f.align,y=f.sign,p=f.symbol,m=f.zero,v=f.width,w=f.comma,x=f.precision,E=f.trim,P=f.type;P==="n"?(w=!0,P="g"):RI[P]||(x===void 0&&(x=12),E=!0,P="g"),(m||h==="0"&&d==="=")&&(m=!0,h="0",d="=");var A=p==="$"?n:p==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():"",k=p==="$"?r:/[%p]/.test(P)?o:"",N=RI[P],D=/[defgprs%]/.test(P);x=x===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function L(F){var $=A,z=k,J,H,G;if(P==="c")z=N(F)+z,F="";else{F=+F;var q=F<0||1/F<0;if(F=isNaN(F)?l:N(Math.abs(F),x),E&&(F=hbe(F)),q&&+F==0&&y!=="+"&&(q=!1),$=(q?y==="("?y:s:y==="-"||y==="("?"":y)+$,z=(P==="s"?DI[8+Pj/3]:"")+z+(q&&y==="("?")":""),D){for(J=-1,H=F.length;++JG||G>57){z=(G===46?i+F.slice(J+1):F.slice(J))+z,F=F.slice(0,J);break}}}w&&!m&&(F=e(F,1/0));var K=$.length+F.length+z.length,ee=K>1)+$+F+z+ee.slice(K);break;default:F=ee+$+F+z;break}return a(F)}return L.toString=function(){return f+""},L}function u(f,h){var d=c((f=M1(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor($p(h)/3)))*3,p=Math.pow(10,-y),m=DI[8+y/3];return function(v){return d(p*v)+m}}return{format:c,formatPrefix:u}}var yb,r4,Oj;gbe({thousands:",",grouping:[3],currency:["$",""]});function gbe(t){return yb=pbe(t),r4=yb.format,Oj=yb.formatPrefix,yb}function ybe(t){return Math.max(0,-$p(Math.abs(t)))}function mbe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($p(e)/3)))*3-$p(Math.abs(t)))}function vbe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$p(e)-$p(t))+1}function Tj(t,e,n,r){var i=P8(t,e,n),a;switch(r=M1(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=mbe(i,o))&&(r.precision=a),Oj(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=vbe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ybe(i))&&(r.precision=a-(r.type==="%")*2);break}}return r4(r)}function lu(t){var e=t.domain;return t.ticks=function(n){var r=e();return E8(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Tj(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],s=r[a],l,c,u=10;for(s0;){if(c=S8(o,s,n),c===l)return r[i]=o,r[a]=s,e(r);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function Ix(){var t=t4();return t.copy=function(){return pv(t,Ix())},Qa.apply(t,arguments),lu(t)}function Cj(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Nx),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Cj(t).unknown(e)},t=arguments.length?Array.from(t,Nx):[0,1],lu(n)}function kj(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],a=t[r],o;return aMath.pow(t,e)}function Ebe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function UI(t){return(e,n)=>-t(-e,n)}function i4(t){const e=t(LI,$I),n=e.domain;let r=10,i,a;function o(){return i=Ebe(r),a=Abe(r),n()[0]<0?(i=UI(i),a=UI(a),t(bbe,wbe)):t(LI,$I),e}return e.base=function(s){return arguments.length?(r=+s,o()):r},e.domain=function(s){return arguments.length?(n(s),o()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;h<=d;++h)for(y=1;yu)break;v.push(p)}}else for(;h<=d;++h)for(y=r-1;y>=1;--y)if(p=h>0?y/a(-h):y*a(h),!(pu)break;v.push(p)}v.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=M1(l)).precision==null&&(l.trim=!0),l=r4(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*rn(kj(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function Nj(){const t=i4(kA()).domain([1,10]);return t.copy=()=>pv(t,Nj()).base(t.base()),Qa.apply(t,arguments),t}function FI(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function jI(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function a4(t){var e=1,n=t(FI(e),jI(e));return n.constant=function(r){return arguments.length?t(FI(e=+r),jI(e)):e},lu(n)}function _j(){var t=a4(kA());return t.copy=function(){return pv(t,_j()).constant(t.constant())},Qa.apply(t,arguments)}function zI(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Sbe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Pbe(t){return t<0?-t*t:t*t}function o4(t){var e=t(fi,fi),n=1;function r(){return n===1?t(fi,fi):n===.5?t(Sbe,Pbe):t(zI(n),zI(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},lu(e)}function s4(){var t=o4(kA());return t.copy=function(){return pv(t,s4()).exponent(t.exponent())},Qa.apply(t,arguments),t}function Obe(){return s4.apply(null,arguments).exponent(.5)}function HI(t){return Math.sign(t)*t*t}function Tbe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Ij(){var t=t4(),e=[0,1],n=!1,r;function i(a){var o=Tbe(t(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return t.invert(HI(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,Nx)).map(HI)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Ij(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Qa.apply(i,arguments),lu(i)}function Rj(){var t=[],e=[],n=[],r;function i(){var o=0,s=Math.max(1,e.length);for(n=new Array(s-1);++o0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Mj().domain([t,e]).range(i).unknown(a)},Qa.apply(lu(o),arguments)}function Bj(){var t=[.5],e=[0,1],n,r=1;function i(a){return a!=null&&a<=a?e[hv(t,a,0,r)]:n}return i.domain=function(a){return arguments.length?(t=Array.from(a),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Bj().domain(t).range(e).unknown(n)},Qa.apply(i,arguments)}const w5=new Date,x5=new Date;function rr(t,e,n,r){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let c;do l.push(c=new Date(+a)),e(a,s),t(a);while(crr(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),n&&(i.count=(a,o)=>(w5.setTime(+a),x5.setTime(+o),t(w5),t(x5),Math.floor(n(w5,x5))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Rx=rr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Rx.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?rr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Rx);Rx.range;const il=1e3,Ua=il*60,al=Ua*60,El=al*24,l4=El*7,GI=El*30,A5=El*365,Hu=rr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*il)},(t,e)=>(e-t)/il,t=>t.getUTCSeconds());Hu.range;const c4=rr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*il)},(t,e)=>{t.setTime(+t+e*Ua)},(t,e)=>(e-t)/Ua,t=>t.getMinutes());c4.range;const u4=rr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ua)},(t,e)=>(e-t)/Ua,t=>t.getUTCMinutes());u4.range;const f4=rr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*il-t.getMinutes()*Ua)},(t,e)=>{t.setTime(+t+e*al)},(t,e)=>(e-t)/al,t=>t.getHours());f4.range;const h4=rr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*al)},(t,e)=>(e-t)/al,t=>t.getUTCHours());h4.range;const gv=rr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ua)/El,t=>t.getDate()-1);gv.range;const NA=rr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/El,t=>t.getUTCDate()-1);NA.range;const Dj=rr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/El,t=>Math.floor(t/El));Dj.range;function xh(t){return rr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ua)/l4)}const _A=xh(0),Mx=xh(1),Cbe=xh(2),kbe=xh(3),Up=xh(4),Nbe=xh(5),_be=xh(6);_A.range;Mx.range;Cbe.range;kbe.range;Up.range;Nbe.range;_be.range;function Ah(t){return rr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/l4)}const IA=Ah(0),Bx=Ah(1),Ibe=Ah(2),Rbe=Ah(3),Fp=Ah(4),Mbe=Ah(5),Bbe=Ah(6);IA.range;Bx.range;Ibe.range;Rbe.range;Fp.range;Mbe.range;Bbe.range;const d4=rr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());d4.range;const p4=rr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());p4.range;const Sl=rr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Sl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:rr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Sl.range;const Pl=rr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Pl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:rr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Pl.range;function Lj(t,e,n,r,i,a){const o=[[Hu,1,il],[Hu,5,5*il],[Hu,15,15*il],[Hu,30,30*il],[a,1,Ua],[a,5,5*Ua],[a,15,15*Ua],[a,30,30*Ua],[i,1,al],[i,3,3*al],[i,6,6*al],[i,12,12*al],[r,1,El],[r,2,2*El],[n,1,l4],[e,1,GI],[e,3,3*GI],[t,1,A5]];function s(c,u,f){const h=um).right(o,h);if(d===o.length)return t.every(P8(c/A5,u/A5,f));if(d===0)return Rx.every(Math.max(P8(c,u,f),1));const[y,p]=o[h/o[d-1][2]53)return null;"w"in se||(se.w=1),"Z"in se?(ut=S5($g(se.y,0,1)),It=ut.getUTCDay(),ut=It>4||It===0?Bx.ceil(ut):Bx(ut),ut=NA.offset(ut,(se.V-1)*7),se.y=ut.getUTCFullYear(),se.m=ut.getUTCMonth(),se.d=ut.getUTCDate()+(se.w+6)%7):(ut=E5($g(se.y,0,1)),It=ut.getDay(),ut=It>4||It===0?Mx.ceil(ut):Mx(ut),ut=gv.offset(ut,(se.V-1)*7),se.y=ut.getFullYear(),se.m=ut.getMonth(),se.d=ut.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),It="Z"in se?S5($g(se.y,0,1)).getUTCDay():E5($g(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(It+5)%7:se.w+se.U*7-(It+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,S5(se)):E5(se)}}function N(xe,Ve,We,se){for(var bt=0,ut=Ve.length,It=We.length,Yt,Cn;bt=It)return-1;if(Yt=Ve.charCodeAt(bt++),Yt===37){if(Yt=Ve.charAt(bt++),Cn=P[Yt in VI?Ve.charAt(bt++):Yt],!Cn||(se=Cn(xe,We,se))<0)return-1}else if(Yt!=We.charCodeAt(se++))return-1}return se}function D(xe,Ve,We){var se=c.exec(Ve.slice(We));return se?(xe.p=u.get(se[0].toLowerCase()),We+se[0].length):-1}function L(xe,Ve,We){var se=d.exec(Ve.slice(We));return se?(xe.w=y.get(se[0].toLowerCase()),We+se[0].length):-1}function F(xe,Ve,We){var se=f.exec(Ve.slice(We));return se?(xe.w=h.get(se[0].toLowerCase()),We+se[0].length):-1}function $(xe,Ve,We){var se=v.exec(Ve.slice(We));return se?(xe.m=w.get(se[0].toLowerCase()),We+se[0].length):-1}function z(xe,Ve,We){var se=p.exec(Ve.slice(We));return se?(xe.m=m.get(se[0].toLowerCase()),We+se[0].length):-1}function J(xe,Ve,We){return N(xe,e,Ve,We)}function H(xe,Ve,We){return N(xe,n,Ve,We)}function G(xe,Ve,We){return N(xe,r,Ve,We)}function q(xe){return o[xe.getDay()]}function K(xe){return a[xe.getDay()]}function ee(xe){return l[xe.getMonth()]}function he(xe){return s[xe.getMonth()]}function we(xe){return i[+(xe.getHours()>=12)]}function be(xe){return 1+~~(xe.getMonth()/3)}function Ye(xe){return o[xe.getUTCDay()]}function at(xe){return a[xe.getUTCDay()]}function Be(xe){return l[xe.getUTCMonth()]}function gt(xe){return s[xe.getUTCMonth()]}function Vt(xe){return i[+(xe.getUTCHours()>=12)]}function pn(xe){return 1+~~(xe.getUTCMonth()/3)}return{format:function(xe){var Ve=A(xe+="",x);return Ve.toString=function(){return xe},Ve},parse:function(xe){var Ve=k(xe+="",!1);return Ve.toString=function(){return xe},Ve},utcFormat:function(xe){var Ve=A(xe+="",E);return Ve.toString=function(){return xe},Ve},utcParse:function(xe){var Ve=k(xe+="",!0);return Ve.toString=function(){return xe},Ve}}}var VI={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,jbe=/^%/,zbe=/[\\^$*+?|[\]().{}]/g;function Wt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Gbe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Vbe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Qbe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Kbe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Wbe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function QI(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function KI(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Jbe(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ybe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Xbe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function WI(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Zbe(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function JI(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function qbe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ewe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function twe(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function nwe(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function rwe(t,e,n){var r=jbe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function iwe(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function awe(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function YI(t,e){return Wt(t.getDate(),e,2)}function owe(t,e){return Wt(t.getHours(),e,2)}function swe(t,e){return Wt(t.getHours()%12||12,e,2)}function lwe(t,e){return Wt(1+gv.count(Sl(t),t),e,3)}function $j(t,e){return Wt(t.getMilliseconds(),e,3)}function cwe(t,e){return $j(t,e)+"000"}function uwe(t,e){return Wt(t.getMonth()+1,e,2)}function fwe(t,e){return Wt(t.getMinutes(),e,2)}function hwe(t,e){return Wt(t.getSeconds(),e,2)}function dwe(t){var e=t.getDay();return e===0?7:e}function pwe(t,e){return Wt(_A.count(Sl(t)-1,t),e,2)}function Uj(t){var e=t.getDay();return e>=4||e===0?Up(t):Up.ceil(t)}function gwe(t,e){return t=Uj(t),Wt(Up.count(Sl(t),t)+(Sl(t).getDay()===4),e,2)}function ywe(t){return t.getDay()}function mwe(t,e){return Wt(Mx.count(Sl(t)-1,t),e,2)}function vwe(t,e){return Wt(t.getFullYear()%100,e,2)}function bwe(t,e){return t=Uj(t),Wt(t.getFullYear()%100,e,2)}function wwe(t,e){return Wt(t.getFullYear()%1e4,e,4)}function xwe(t,e){var n=t.getDay();return t=n>=4||n===0?Up(t):Up.ceil(t),Wt(t.getFullYear()%1e4,e,4)}function Awe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Wt(e/60|0,"0",2)+Wt(e%60,"0",2)}function XI(t,e){return Wt(t.getUTCDate(),e,2)}function Ewe(t,e){return Wt(t.getUTCHours(),e,2)}function Swe(t,e){return Wt(t.getUTCHours()%12||12,e,2)}function Pwe(t,e){return Wt(1+NA.count(Pl(t),t),e,3)}function Fj(t,e){return Wt(t.getUTCMilliseconds(),e,3)}function Owe(t,e){return Fj(t,e)+"000"}function Twe(t,e){return Wt(t.getUTCMonth()+1,e,2)}function Cwe(t,e){return Wt(t.getUTCMinutes(),e,2)}function kwe(t,e){return Wt(t.getUTCSeconds(),e,2)}function Nwe(t){var e=t.getUTCDay();return e===0?7:e}function _we(t,e){return Wt(IA.count(Pl(t)-1,t),e,2)}function jj(t){var e=t.getUTCDay();return e>=4||e===0?Fp(t):Fp.ceil(t)}function Iwe(t,e){return t=jj(t),Wt(Fp.count(Pl(t),t)+(Pl(t).getUTCDay()===4),e,2)}function Rwe(t){return t.getUTCDay()}function Mwe(t,e){return Wt(Bx.count(Pl(t)-1,t),e,2)}function Bwe(t,e){return Wt(t.getUTCFullYear()%100,e,2)}function Dwe(t,e){return t=jj(t),Wt(t.getUTCFullYear()%100,e,2)}function Lwe(t,e){return Wt(t.getUTCFullYear()%1e4,e,4)}function $we(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Fp(t):Fp.ceil(t),Wt(t.getUTCFullYear()%1e4,e,4)}function Uwe(){return"+0000"}function ZI(){return"%"}function qI(t){return+t}function e9(t){return Math.floor(+t/1e3)}var Ih,zj,Hj;Fwe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Fwe(t){return Ih=Fbe(t),zj=Ih.format,Ih.parse,Hj=Ih.utcFormat,Ih.utcParse,Ih}function jwe(t){return new Date(t)}function zwe(t){return t instanceof Date?+t:+new Date(+t)}function g4(t,e,n,r,i,a,o,s,l,c){var u=t4(),f=u.invert,h=u.domain,d=c(".%L"),y=c(":%S"),p=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),w=c("%b %d"),x=c("%B"),E=c("%Y");function P(A){return(l(A)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>_ve(t,a/r))},n.copy=function(){return Kj(e).domain(t)},Rl.apply(n,arguments)}function MA(){var t=0,e=.5,n=1,r=1,i,a,o,s,l,c=fi,u,f=!1,h;function d(p){return isNaN(p=+p)?h:(p=.5+((p=+u(p))-a)*(r*pe}var Xj=Jwe,Ywe=BA,Xwe=Xj,Zwe=pg;function qwe(t){return t&&t.length?Ywe(t,Zwe,Xwe):void 0}var exe=qwe;const DA=Gt(exe);function txe(t,e){return tt.e^a.s<0?1:-1;for(r=a.d.length,i=t.d.length,e=0,n=rt.d[e]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};je.decimalPlaces=je.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*fn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};je.dividedBy=je.div=function(t){return dl(this,new this.constructor(t))};je.dividedToIntegerBy=je.idiv=function(t){var e=this,n=e.constructor;return rn(dl(e,new n(t),0,1),n.precision)};je.equals=je.eq=function(t){return!this.cmp(t)};je.exponent=function(){return Jn(this)};je.greaterThan=je.gt=function(t){return this.cmp(t)>0};je.greaterThanOrEqualTo=je.gte=function(t){return this.cmp(t)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(t){return this.cmp(t)<0};je.lessThanOrEqualTo=je.lte=function(t){return this.cmp(t)<1};je.logarithm=je.log=function(t){var e,n=this,r=n.constructor,i=r.precision,a=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(na))throw Error(Ga+"NaN");if(n.s<1)throw Error(Ga+(n.s?"NaN":"-Infinity"));return n.eq(na)?new r(0):(vn=!1,e=dl(B1(n,a),B1(t,a),a),vn=!0,rn(e,i))};je.minus=je.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?nz(e,t):ez(e,(t.s=-t.s,t))};je.modulo=je.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Ga+"NaN");return n.s?(vn=!1,e=dl(n,t,0,1).times(t),vn=!0,n.minus(e)):rn(new r(n),i)};je.naturalExponential=je.exp=function(){return tz(this)};je.naturalLogarithm=je.ln=function(){return B1(this)};je.negated=je.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};je.plus=je.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?ez(e,t):nz(e,(t.s=-t.s,t))};je.precision=je.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Gf+t);if(e=Jn(i)+1,r=i.d.length-1,n=r*fn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};je.squareRoot=je.sqrt=function(){var t,e,n,r,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ga+"NaN")}for(t=Jn(s),vn=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=ts(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=mg((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=o=n+3;;)if(a=r,r=a.plus(dl(s,a,o+2)).times(.5),ts(a.d).slice(0,o)===(e=ts(r.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(rn(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(e!="9999")break;o+=4}return vn=!0,rn(r,n)};je.times=je.mul=function(t){var e,n,r,i,a,o,s,l,c,u=this,f=u.constructor,h=u.d,d=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=h.length,c=d.length,l=0;){for(e=0,i=l+r;i>r;)s=a[i]+d[r]*h[i-r-1]+e,a[i--]=s%sr|0,e=s/sr|0;a[i]=(a[i]+e)%sr|0}for(;!a[--o];)a.pop();return e?++n:a.shift(),t.d=a,t.e=n,vn?rn(t,f.precision):t};je.toDecimalPlaces=je.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(hs(t,0,yg),e===void 0?e=r.rounding:hs(e,0,8),rn(n,t+Jn(n)+1,e))};je.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=uh(r,!0):(hs(t,0,yg),e===void 0?e=i.rounding:hs(e,0,8),r=rn(new i(r),t+1,e),n=uh(r,!0,t+1)),n};je.toFixed=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?uh(i):(hs(t,0,yg),e===void 0?e=a.rounding:hs(e,0,8),r=rn(new a(i),t+Jn(i)+1,e),n=uh(r.abs(),!1,t+Jn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};je.toInteger=je.toint=function(){var t=this,e=t.constructor;return rn(new e(t),Jn(t)+1,e.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(t){var e,n,r,i,a,o,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(na);if(s=new l(s),!s.s){if(t.s<1)throw Error(Ga+"Infinity");return s}if(s.eq(na))return s;if(r=l.precision,t.eq(na))return rn(s,r);if(e=t.e,n=t.d.length-1,o=e>=n,a=s.s,o){if((n=u<0?-u:u)<=qj){for(i=new l(na),e=Math.ceil(r/fn+4),vn=!1;n%2&&(i=i.times(s),r9(i.d,e)),n=mg(n/2),n!==0;)s=s.times(s),r9(s.d,e);return vn=!0,t.s<0?new l(na).div(i):rn(i,r)}}else if(a<0)throw Error(Ga+"NaN");return a=a<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,vn=!1,i=t.times(B1(s,r+c)),vn=!0,i=tz(i),i.s=a,i};je.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=Jn(i),r=uh(i,n<=a.toExpNeg||n>=a.toExpPos)):(hs(t,1,yg),e===void 0?e=a.rounding:hs(e,0,8),i=rn(new a(i),t,e),n=Jn(i),r=uh(i,t<=n||n<=a.toExpNeg,t)),r};je.toSignificantDigits=je.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(hs(t,1,yg),e===void 0?e=r.rounding:hs(e,0,8)),rn(new r(n),t,e)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Jn(t),n=t.constructor;return uh(t,e<=n.toExpNeg||e>=n.toExpPos)};function ez(t,e){var n,r,i,a,o,s,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),vn?rn(e,f):e;if(l=t.d,c=e.d,o=t.e,i=e.e,l=l.slice(),a=o-i,a){for(a<0?(r=l,a=-a,s=c.length):(r=c,i=o,s=l.length),o=Math.ceil(f/fn),s=o>s?o+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=l.length,a=c.length,s-a<0&&(a=s,r=c,c=l,l=r),n=0;a;)n=(l[--a]=l[a]+c[a]+n)/sr|0,l[a]%=sr;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,vn?rn(e,f):e}function hs(t,e,n){if(t!==~~t||tn)throw Error(Gf+t)}function ts(t){var e,n,r,i=t.length-1,a="",o=t[0];if(i>0){for(a+=o,e=1;eo?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,i,a,o){var s,l,c,u,f,h,d,y,p,m,v,w,x,E,P,A,k,N,D=r.constructor,L=r.s==i.s?1:-1,F=r.d,$=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(Ga+"Division by zero");for(l=r.e-i.e,k=$.length,P=F.length,d=new D(L),y=d.d=[],c=0;$[c]==(F[c]||0);)++c;if($[c]>(F[c]||0)&&--l,a==null?w=a=D.precision:o?w=a+(Jn(r)-Jn(i))+1:w=a,w<0)return new D(0);if(w=w/fn+2|0,c=0,k==1)for(u=0,$=$[0],w++;(c1&&($=t($,u),F=t(F,u),k=$.length,P=F.length),E=k,p=F.slice(0,k),m=p.length;m=sr/2&&++A;do u=0,s=e($,p,k,m),s<0?(v=p[0],k!=m&&(v=v*sr+(p[1]||0)),u=v/A|0,u>1?(u>=sr&&(u=sr-1),f=t($,u),h=f.length,m=p.length,s=e(f,p,h,m),s==1&&(u--,n(f,k16)throw Error(b4+Jn(t));if(!t.s)return new u(na);for(e==null?(vn=!1,s=f):s=e,o=new u(.03125);t.abs().gte(.1);)t=t.times(o),c+=5;for(r=Math.log(Pu(2,c))/Math.LN10*2+5|0,s+=r,n=i=a=new u(na),u.precision=s;;){if(i=rn(i.times(t),s),n=n.times(++l),o=a.plus(dl(i,n,s)),ts(o.d).slice(0,s)===ts(a.d).slice(0,s)){for(;c--;)a=rn(a.times(a),s);return u.precision=f,e==null?(vn=!0,rn(a,f)):a}a=o}}function Jn(t){for(var e=t.e*fn,n=t.d[0];n>=10;n/=10)e++;return e}function P5(t,e,n){if(e>t.LN10.sd())throw vn=!0,n&&(t.precision=n),Error(Ga+"LN10 precision limit exceeded");return rn(new t(t.LN10),e)}function Wl(t){for(var e="";t--;)e+="0";return e}function B1(t,e){var n,r,i,a,o,s,l,c,u,f=1,h=10,d=t,y=d.d,p=d.constructor,m=p.precision;if(d.s<1)throw Error(Ga+(d.s?"NaN":"-Infinity"));if(d.eq(na))return new p(0);if(e==null?(vn=!1,c=m):c=e,d.eq(10))return e==null&&(vn=!0),P5(p,c);if(c+=h,p.precision=c,n=ts(y),r=n.charAt(0),a=Jn(d),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)d=d.times(t),n=ts(d.d),r=n.charAt(0),f++;a=Jn(d),r>1?(d=new p("0."+n),a++):d=new p(r+"."+n.slice(1))}else return l=P5(p,c+2,m).times(a+""),d=B1(new p(r+"."+n.slice(1)),c-h).plus(l),p.precision=m,e==null?(vn=!0,rn(d,m)):d;for(s=o=d=dl(d.minus(na),d.plus(na),c),u=rn(d.times(d),c),i=3;;){if(o=rn(o.times(u),c),l=s.plus(dl(o,new p(i),c)),ts(l.d).slice(0,c)===ts(s.d).slice(0,c))return s=s.times(2),a!==0&&(s=s.plus(P5(p,c+2,m).times(a+""))),s=dl(s,new p(f),c),p.precision=m,e==null?(vn=!0,rn(s,m)):s;s=l,i+=2}}function n9(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=mg(n/fn),t.d=[],r=(n+1)%fn,n<0&&(r+=fn),rDx||t.e<-Dx))throw Error(b4+n)}else t.s=0,t.e=0,t.d=[0];return t}function rn(t,e,n){var r,i,a,o,s,l,c,u,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=e-o,r<0)r+=fn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/fn),a=f.length,u>=a)return t;for(c=a=f[u],o=1;a>=10;a/=10)o++;r%=fn,i=r-fn+o}if(n!==void 0&&(a=Pu(10,o-i-1),s=c/a%10|0,l=e<0||f[u+1]!==void 0||c%a,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Pu(10,o-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(a=Jn(t),f.length=1,e=e-a-1,f[0]=Pu(10,(fn-e%fn)%fn),t.e=mg(-e/fn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,a=1,u--):(f.length=u+1,a=Pu(10,fn-r),f[u]=i>0?(c/Pu(10,o-i)%Pu(10,i)|0)*a:0),l)for(;;)if(u==0){(f[0]+=a)==sr&&(f[0]=1,++t.e);break}else{if(f[u]+=a,f[u]!=sr)break;f[u--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(vn&&(t.e>Dx||t.e<-Dx))throw Error(b4+Jn(t));return t}function nz(t,e){var n,r,i,a,o,s,l,c,u,f,h=t.constructor,d=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),vn?rn(e,d):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),o=c-r,o){for(u=o<0,u?(n=l,o=-o,s=f.length):(n=f,r=c,s=l.length),i=Math.max(Math.ceil(d/fn),s)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,u=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Wl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Wl(-i-1)+a,n&&(r=n-o)>0&&(a+=Wl(r))):i>=o?(a+=Wl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Wl(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Wl(r))),t.s<0?"-"+a:a}function r9(t,e){if(t.length>e)return t.length=e,!0}function rz(t){var e,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Gf+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return n9(o,a.toString())}else if(typeof a!="string")throw Error(Gf+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Axe.test(a))n9(o,a);else throw Error(Gf+a)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=rz,i.config=i.set=Exe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(Gf+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Gf+n+": "+r);return this}var w4=rz(xxe);na=new w4(1);const tn=w4;function Sxe(t){return Cxe(t)||Txe(t)||Oxe(t)||Pxe()}function Pxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oxe(t,e){if(t){if(typeof t=="string")return N8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N8(t,e)}}function Txe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Cxe(t){if(Array.isArray(t))return N8(t)}function N8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-o,i9(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,a=l}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function Hxe(t){if(Array.isArray(t))return t}function lz(t){var e=D1(t,2),n=e[0],r=e[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function cz(t,e,n){if(t.lte(0))return new tn(0);var r=UA.getDigitCount(t.toNumber()),i=new tn(10).pow(r),a=t.div(i),o=r!==1?.05:.1,s=new tn(Math.ceil(a.div(o).toNumber())).add(n).mul(o),l=s.mul(i);return e?l:new tn(Math.ceil(l))}function Gxe(t,e,n){var r=1,i=new tn(t);if(!i.isint()&&n){var a=Math.abs(t);a<1?(r=new tn(10).pow(UA.getDigitCount(t)-1),i=new tn(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new tn(Math.floor(t)))}else t===0?i=new tn(Math.floor((e-1)/2)):n||(i=new tn(Math.floor(t)));var o=Math.floor((e-1)/2),s=Ixe(_xe(function(l){return i.add(new tn(l-o).mul(r)).toNumber()}),_8);return s(0,e)}function uz(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new tn(0),tickMin:new tn(0),tickMax:new tn(0)};var a=cz(new tn(e).sub(t).div(n-1),r,i),o;t<=0&&e>=0?o=new tn(0):(o=new tn(t).add(e).div(2),o=o.sub(new tn(o).mod(a)));var s=Math.ceil(o.sub(t).div(a).toNumber()),l=Math.ceil(new tn(e).sub(o).div(a).toNumber()),c=s+l+1;return c>n?uz(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:a,tickMin:o.sub(new tn(s).mul(a)),tickMax:o.add(new tn(l).mul(a))})}function Vxe(t){var e=D1(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=lz([n,r]),l=D1(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(R8(_8(0,i-1).map(function(){return 1/0}))):[].concat(R8(_8(0,i-1).map(function(){return-1/0})),[u]);return n>r?I8(f):f}if(c===u)return Gxe(c,i,a);var h=uz(c,u,o,a),d=h.step,y=h.tickMin,p=h.tickMax,m=UA.rangeStep(y,p.add(new tn(.1).mul(d)),d);return n>r?I8(m):m}function Qxe(t,e){var n=D1(t,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=lz([r,i]),s=D1(o,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=cz(new tn(c).sub(l).div(u-1),a,0),h=[].concat(R8(UA.rangeStep(new tn(l),new tn(c).sub(new tn(.99).mul(f)),f)),[c]);return r>i?I8(h):h}var Kxe=oz(Vxe),Wxe=oz(Qxe),Jxe="Invariant failed";function jp(t,e){if(!t)throw new Error(Jxe)}var Yxe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Lx(){return Lx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function r2e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function x4(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,a=t.data,o=t.dataPointFormatter,s=t.xAxis,l=t.yAxis,c=n2e(t,Yxe),u=St(c,!1);t.direction==="x"&&s.type!=="number"&&jp(!1);var f=a.map(function(h){var d=o(h,i),y=d.x,p=d.y,m=d.value,v=d.errorVal;if(!v)return null;var w=[],x,E;if(Array.isArray(v)){var P=Xxe(v,2);x=P[0],E=P[1]}else x=E=v;if(n==="vertical"){var A=s.scale,k=p+e,N=k+r,D=k-r,L=A(m-x),F=A(m+E);w.push({x1:F,y1:N,x2:F,y2:D}),w.push({x1:L,y1:k,x2:F,y2:k}),w.push({x1:L,y1:N,x2:L,y2:D})}else if(n==="horizontal"){var $=l.scale,z=y+e,J=z-r,H=z+r,G=$(m-x),q=$(m+E);w.push({x1:J,y1:q,x2:H,y2:q}),w.push({x1:z,y1:G,x2:z,y2:q}),w.push({x1:J,y1:G,x2:H,y2:G})}return X.createElement(Ln,Lx({className:"recharts-errorBar",key:"bar-".concat(w.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},u),w.map(function(K){return X.createElement("line",Lx({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return X.createElement(Ln,{className:"recharts-errorBars"},f)}x4.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};x4.displayName="ErrorBar";function L1(t){"@babel/helpers - typeof";return L1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L1(t)}function o9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function O5(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,h=c>=s-1?i[0].coordinate:i[c+1].coordinate,d=void 0;if($a(f-u)!==$a(h-f)){var y=[];if($a(h-f)===$a(l[1]-l[0])){d=h;var p=f+l[1]-l[0];y[0]=Math.min(p,(p+u)/2),y[1]=Math.max(p,(p+u)/2)}else{d=u;var m=h+l[1]-l[0];y[0]=Math.min(f,(m+f)/2),y[1]=Math.max(f,(m+f)/2)}var v=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(e>v[0]&&e<=v[1]||e>=y[0]&&e<=y[1]){o=i[c].index;break}}else{var w=Math.min(u,h),x=Math.max(u,h);if(e>(w+f)/2&&e<=(x+f)/2){o=i[c].index;break}}}else for(var E=0;E0&&E(r[E].coordinate+r[E-1].coordinate)/2&&e<=(r[E].coordinate+r[E+1].coordinate)/2||E===s-1&&e>(r[E].coordinate+r[E-1].coordinate)/2){o=r[E].index;break}return o},A4=function(e){var n=e,r=n.type.displayName,i=e.props,a=i.stroke,o=i.fill,s;switch(r){case"Line":s=a;break;case"Area":case"Radar":s=a&&a!=="none"?a:o;break;default:s=o;break}return s},p2e=function(e){var n=e.barSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,l=o.length;s=0});if(m&&m.length){var v=m[0].props.barSize,w=m[0].props[p];a[w]||(a[w]=[]),a[w].push({item:m[0],stackList:m.slice(1),barSize:Ht(v)?n:v})}}return a},g2e=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,s=e.maxBarSize,l=o.length;if(l<1)return null;var c=oa(n,i,0,!0),u,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,y=o.reduce(function(E,P){return E+P.barSize||0},0);y+=(l-1)*c,y>=i&&(y-=(l-1)*c,c=0),y>=i&&d>0&&(h=!0,d*=.9,y=l*d);var p=(i-y)/2>>0,m={offset:p-c,size:0};u=o.reduce(function(E,P){var A={item:P.item,position:{offset:m.offset+m.size+c,size:h?d:P.barSize}},k=[].concat(l9(E),[A]);return m=k[k.length-1].position,P.stackList&&P.stackList.length&&P.stackList.forEach(function(N){k.push({item:N,position:m})}),k},f)}else{var v=oa(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var w=(i-2*v-(l-1)*c)/l;w>1&&(w>>=0);var x=s===+s?Math.min(w,s):w;u=o.reduce(function(E,P,A){var k=[].concat(l9(E),[{item:P.item,position:{offset:v+(w+c)*A+(w-x)/2,size:x}}]);return P.stackList&&P.stackList.length&&P.stackList.forEach(function(N){k.push({item:N,position:k[k.length-1].position})}),k},f)}return u},y2e=function(e,n,r,i){var a=r.children,o=r.width,s=r.margin,l=o-(s.left||0)-(s.right||0),c=fz({children:a,legendWidth:l});if(c){var u=i||{},f=u.width,h=u.height,d=c.align,y=c.verticalAlign,p=c.layout;if((p==="vertical"||p==="horizontal"&&y==="middle")&&d!=="center"&&Me(e[d]))return Ba(Ba({},e),{},Md({},d,e[d]+(f||0)));if((p==="horizontal"||p==="vertical"&&d==="center")&&y!=="middle"&&Me(e[y]))return Ba(Ba({},e),{},Md({},y,e[y]+(h||0)))}return e},m2e=function(e,n,r){return Ht(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},hz=function(e,n,r,i,a){var o=n.props.children,s=os(o,x4).filter(function(c){return m2e(i,a,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=ra(u,r,0),h=Array.isArray(f)?[LA(f),DA(f)]:[f,f],d=l.reduce(function(y,p){var m=ra(u,p,0),v=h[0]-Math.abs(Array.isArray(m)?m[0]:m),w=h[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(v,y[0]),Math.max(w,y[1])]},[1/0,-1/0]);return[Math.min(d[0],c[0]),Math.max(d[1],c[1])]},[1/0,-1/0])}return null},v2e=function(e,n,r,i,a){var o=n.map(function(s){return hz(e,s,r,a,i)}).filter(function(s){return!Ht(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},dz=function(e,n,r,i,a){var o=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&hz(e,l,c,i)||Ny(e,c,r,a)});if(r==="number")return o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,c){for(var u=0,f=c.length;u=2?$a(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+c,value:f,offset:c}});return u.filter(function(f){return!fv(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,h){return{coordinate:i(f)+c,value:f,index:h,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,h){return{coordinate:i(f)+c,value:a?a[f]:f,index:h,offset:c}})},T5=new WeakMap,mb=function(e,n){if(typeof n!="function")return e;T5.has(e)||T5.set(e,new WeakMap);var r=T5.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},b2e=function(e,n,r){var i=e.scale,a=e.type,o=e.layout,s=e.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:N1(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Ix(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ky(),realScaleType:"point"}:a==="category"?{scale:N1(),realScaleType:"band"}:{scale:Ix(),realScaleType:"linear"};if(uv(i)){var l="scale".concat(AA(i));return{scale:(t9[l]||ky)(),realScaleType:t9[l]?l:"point"}}return Rt(i)?{scale:i}:{scale:ky(),realScaleType:"point"}},c9=1e-4,w2e=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),a=Math.min(i[0],i[1])-c9,o=Math.max(i[0],i[1])+c9,s=e(n[0]),l=e(n[r-1]);(so||lo)&&e.domain([n[0],n[r-1]])}},x2e=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1]):(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1])}},A2e=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[o][r][0]=a,e[o][r][1]=a+s,a=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}},E2e={sign:x2e,expand:que,none:Ip,silhouette:efe,wiggle:tfe,positive:A2e},S2e=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),a=E2e[r],o=Zue().keys(i).value(function(s,l){return+ra(s,l,0)}).order(l8).offset(a);return o(e)},P2e=function(e,n,r,i,a,o){if(!e)return null;var s=o?n.reverse():n,l={},c=s.reduce(function(f,h){var d=h.props,y=d.stackId,p=d.hide;if(p)return f;var m=h.props[r],v=f[m]||{hasStack:!1,stackGroups:{}};if(tr(y)){var w=v.stackGroups[y]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(h),v.hasStack=!0,v.stackGroups[y]=w}else v.stackGroups[wA("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return Ba(Ba({},f),{},Md({},m,v))},l),u={};return Object.keys(c).reduce(function(f,h){var d=c[h];if(d.hasStack){var y={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(p,m){var v=d.stackGroups[m];return Ba(Ba({},p),{},Md({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:S2e(e,v.items,a)}))},y)}return Ba(Ba({},f),{},Md({},h,d))},u)},O2e=function(e,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=Kxe(c,a,s);return e.domain([LA(u),DA(u)]),{niceTicks:u}}if(a&&i==="number"){var f=e.domain(),h=Wxe(f,a,s);return{niceTicks:h}}return null},T2e=function(e,n){var r=e.props.stackId;if(tr(r)){var i=n[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},C2e=function(e){return e.reduce(function(n,r){return[LA(r.concat([n[0]]).filter(Me)),DA(r.concat([n[1]]).filter(Me))]},[1/0,-1/0])},gz=function(e,n,r){return Object.keys(e).reduce(function(i,a){var o=e[a],s=o.stackedData,l=s.reduce(function(c,u){var f=C2e(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},u9=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,f9=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,D8=function(e,n,r){if(Rt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(Me(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(u9.test(e[0])){var a=+u9.exec(e[0])[1];i[0]=n[0]-a}else Rt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(Me(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(f9.test(e[1])){var o=+f9.exec(e[1])[1];i[1]=n[1]+o}else Rt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},L8=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var a=KO(n,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},$2e=function(e,n,r,i,a){var o=e.width,s=e.height,l=e.startAngle,c=e.endAngle,u=oa(e.cx,o,o/2),f=oa(e.cy,s,s/2),h=mz(o,s,r),d=oa(e.innerRadius,h,0),y=oa(e.outerRadius,h,h*.8),p=Object.keys(n);return p.reduce(function(m,v){var w=n[v],x=w.domain,E=w.reversed,P;if(Ht(w.range))i==="angleAxis"?P=[l,c]:i==="radiusAxis"&&(P=[d,y]),E&&(P=[P[1],P[0]]);else{P=w.range;var A=P,k=I2e(A,2);l=k[0],c=k[1]}var N=b2e(w,a),D=N.realScaleType,L=N.scale;L.domain(x).range(P),w2e(L);var F=O2e(L,Es(Es({},w),{},{realScaleType:D})),$=Es(Es(Es({},w),F),{},{range:P,radius:y,realScaleType:D,scale:L,cx:u,cy:f,innerRadius:d,outerRadius:y,startAngle:l,endAngle:c});return Es(Es({},m),{},yz({},v,$))},{})},U2e=function(e,n){var r=e.x,i=e.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},F2e=function(e,n){var r=e.x,i=e.y,a=n.cx,o=n.cy,s=U2e({x:r,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(r-a)/s,c=Math.acos(l);return i>o&&(c=2*Math.PI-c),{radius:s,angle:L2e(c),angleInRadian:c}},j2e=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},z2e=function(e,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),s=Math.min(a,o);return e+s*360},g9=function(e,n){var r=e.x,i=e.y,a=F2e({x:r,y:i},n),o=a.radius,s=a.angle,l=n.innerRadius,c=n.outerRadius;if(oc)return!1;if(o===0)return!0;var u=j2e(n),f=u.startAngle,h=u.endAngle,d=s,y;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return y?Es(Es({},n),{},{radius:o,angle:z2e(d,n)}):null};function F1(t){"@babel/helpers - typeof";return F1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F1(t)}var H2e=["offset"];function G2e(t){return W2e(t)||K2e(t)||Q2e(t)||V2e()}function V2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q2e(t,e){if(t){if(typeof t=="string")return $8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $8(t,e)}}function K2e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function W2e(t){if(Array.isArray(t))return $8(t)}function $8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Y2e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function y9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zn(t){for(var e=1;e=0?1:-1,x,E;i==="insideStart"?(x=d+w*o,E=p):i==="insideEnd"?(x=y-w*o,E=!p):i==="end"&&(x=y+w*o,E=p),E=v<=0?E:!E;var P=ln(c,u,m,x),A=ln(c,u,m,x+(E?1:-1)*359),k="M".concat(P.x,",").concat(P.y,` + A`).concat(m,",").concat(m,",0,1,").concat(E?0:1,`, + `).concat(A.x,",").concat(A.y),N=Ht(e.id)?wA("recharts-radial-line-"):e.id;return X.createElement("text",j1({},r,{dominantBaseline:"central",className:bn("recharts-radial-bar-label",s)}),X.createElement("defs",null,X.createElement("path",{id:N,d:k})),X.createElement("textPath",{xlinkHref:"#".concat(N)},n))},rAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,a=n,o=a.cx,s=a.cy,l=a.innerRadius,c=a.outerRadius,u=a.startAngle,f=a.endAngle,h=(u+f)/2;if(i==="outside"){var d=ln(o,s,c+r,h),y=d.x,p=d.y;return{x:y,y:p,textAnchor:y>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=ln(o,s,m,h),w=v.x,x=v.y;return{x:w,y:x,textAnchor:"middle",verticalAnchor:"middle"}},iAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,a=e.position,o=n,s=o.x,l=o.y,c=o.width,u=o.height,f=u>=0?1:-1,h=f*i,d=f>0?"end":"start",y=f>0?"start":"end",p=c>=0?1:-1,m=p*i,v=p>0?"end":"start",w=p>0?"start":"end";if(a==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Zn(Zn({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(a==="bottom"){var E={x:s+c/2,y:l+u+h,textAnchor:"middle",verticalAnchor:y};return Zn(Zn({},E),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(a==="left"){var P={x:s-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return Zn(Zn({},P),r?{width:Math.max(P.x-r.x,0),height:u}:{})}if(a==="right"){var A={x:s+c+m,y:l+u/2,textAnchor:w,verticalAnchor:"middle"};return Zn(Zn({},A),r?{width:Math.max(r.x+r.width-A.x,0),height:u}:{})}var k=r?{width:c,height:u}:{};return a==="insideLeft"?Zn({x:s+m,y:l+u/2,textAnchor:w,verticalAnchor:"middle"},k):a==="insideRight"?Zn({x:s+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},k):a==="insideTop"?Zn({x:s+c/2,y:l+h,textAnchor:"middle",verticalAnchor:y},k):a==="insideBottom"?Zn({x:s+c/2,y:l+u-h,textAnchor:"middle",verticalAnchor:d},k):a==="insideTopLeft"?Zn({x:s+m,y:l+h,textAnchor:w,verticalAnchor:y},k):a==="insideTopRight"?Zn({x:s+c-m,y:l+h,textAnchor:v,verticalAnchor:y},k):a==="insideBottomLeft"?Zn({x:s+m,y:l+u-h,textAnchor:w,verticalAnchor:d},k):a==="insideBottomRight"?Zn({x:s+c-m,y:l+u-h,textAnchor:v,verticalAnchor:d},k):lg(a)&&(Me(a.x)||ju(a.x))&&(Me(a.y)||ju(a.y))?Zn({x:s+oa(a.x,c),y:l+oa(a.y,u),textAnchor:"end",verticalAnchor:"end"},k):Zn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},k)},aAe=function(e){return"cx"in e&&Me(e.cx)};function xr(t){var e=t.offset,n=e===void 0?5:e,r=J2e(t,H2e),i=Zn({offset:n},r),a=i.viewBox,o=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,h=i.textBreakAll;if(!a||Ht(s)&&Ht(l)&&!U.isValidElement(c)&&!Rt(c))return null;if(U.isValidElement(c))return U.cloneElement(c,i);var d;if(Rt(c)){if(d=U.createElement(c,i),U.isValidElement(d))return d}else d=eAe(i);var y=aAe(a),p=St(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return nAe(i,d,p);var m=y?rAe(i):iAe(i);return X.createElement(Lp,j1({className:bn("recharts-label",f)},p,m,{breakAll:h}),d)}xr.displayName="Label";var vz=function(e){var n=e.cx,r=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,h=e.y,d=e.top,y=e.left,p=e.width,m=e.height,v=e.clockWise,w=e.labelViewBox;if(w)return w;if(Me(p)&&Me(m)){if(Me(f)&&Me(h))return{x:f,y:h,width:p,height:m};if(Me(d)&&Me(y))return{x:d,y,width:p,height:m}}return Me(f)&&Me(h)?{x:f,y:h,width:0,height:0}:Me(n)&&Me(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:v}:e.viewBox?e.viewBox:{}},oAe=function(e,n){return e?e===!0?X.createElement(xr,{key:"label-implicit",viewBox:n}):tr(e)?X.createElement(xr,{key:"label-implicit",viewBox:n,value:e}):U.isValidElement(e)?e.type===xr?U.cloneElement(e,{key:"label-implicit",viewBox:n}):X.createElement(xr,{key:"label-implicit",content:e,viewBox:n}):Rt(e)?X.createElement(xr,{key:"label-implicit",content:e,viewBox:n}):lg(e)?X.createElement(xr,j1({viewBox:n},e,{key:"label-implicit"})):null:null},sAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,a=vz(e),o=os(i,xr).map(function(l,c){return U.cloneElement(l,{viewBox:n||a,key:"label-".concat(c)})});if(!r)return o;var s=oAe(e.label,n||a);return[s].concat(G2e(o))};xr.parseViewBox=vz;xr.renderCallByParent=sAe;function lAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var cAe=lAe;const uAe=Gt(cAe);function z1(t){"@babel/helpers - typeof";return z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z1(t)}var fAe=["valueAccessor"],hAe=["data","dataKey","clockWise","id","textBreakAll"];function dAe(t){return mAe(t)||yAe(t)||gAe(t)||pAe()}function pAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gAe(t,e){if(t){if(typeof t=="string")return U8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U8(t,e)}}function yAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function mAe(t){if(Array.isArray(t))return U8(t)}function U8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xAe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var AAe=function(e){return Array.isArray(e.value)?uAe(e.value):e.value};function Vf(t){var e=t.valueAccessor,n=e===void 0?AAe:e,r=b9(t,fAe),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,l=r.textBreakAll,c=b9(r,hAe);return!i||!i.length?null:X.createElement(Ln,{className:"recharts-label-list"},i.map(function(u,f){var h=Ht(a)?n(u,f):ra(u&&u.payload,a),d=Ht(s)?{}:{id:"".concat(s,"-").concat(f)};return X.createElement(xr,Ux({},St(u,!0),c,d,{parentViewBox:u.parentViewBox,value:h,textBreakAll:l,viewBox:xr.parseViewBox(Ht(o)?u:v9(v9({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Vf.displayName="LabelList";function EAe(t,e){return t?t===!0?X.createElement(Vf,{key:"labelList-implicit",data:e}):X.isValidElement(t)||Rt(t)?X.createElement(Vf,{key:"labelList-implicit",data:e,content:t}):lg(t)?X.createElement(Vf,Ux({data:e},t,{key:"labelList-implicit"})):null:null}function SAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=os(r,Vf).map(function(o,s){return U.cloneElement(o,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var a=EAe(t.label,e);return[a].concat(dAe(i))}Vf.renderCallByParent=SAe;function H1(t){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H1(t)}function F8(){return F8=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(o>c),`, + `).concat(f.x,",").concat(f.y,` + `);if(i>0){var d=ln(n,r,i,o),y=ln(n,r,i,c);h+="L ".concat(y.x,",").concat(y.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=c),`, + `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},kAe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=$a(u-c),h=vb({cx:n,cy:r,radius:a,angle:c,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,y=h.lineTangency,p=h.theta,m=vb({cx:n,cy:r,radius:a,angle:u,sign:-f,cornerRadius:o,cornerIsExternal:l}),v=m.circleTangency,w=m.lineTangency,x=m.theta,E=l?Math.abs(c-u):Math.abs(c-u)-p-x;if(E<0)return s?"M ".concat(y.x,",").concat(y.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):bz({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:c,endAngle:u});var P="M ".concat(y.x,",").concat(y.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,` + A`).concat(a,",").concat(a,",0,").concat(+(E>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(w.x,",").concat(w.y,` + `);if(i>0){var A=vb({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),k=A.circleTangency,N=A.lineTangency,D=A.theta,L=vb({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),F=L.circleTangency,$=L.lineTangency,z=L.theta,J=l?Math.abs(c-u):Math.abs(c-u)-D-z;if(J<0&&o===0)return"".concat(P,"L").concat(n,",").concat(r,"Z");P+="L".concat($.x,",").concat($.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(F.x,",").concat(F.y,` + A`).concat(i,",").concat(i,",0,").concat(+(J>180),",").concat(+(f>0),",").concat(k.x,",").concat(k.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,"Z")}else P+="L".concat(n,",").concat(r,"Z");return P},NAe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},wz=function(e){var n=x9(x9({},NAe),e),r=n.cx,i=n.cy,a=n.innerRadius,o=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(u-f)<360?m=kAe({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,y/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=bz({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:f}),X.createElement("path",F8({},St(n,!0),{className:d,d:m,role:"img"}))};function G1(t){"@babel/helpers - typeof";return G1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G1(t)}function j8(){return j8=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function VAe(t,e){return vg(t.getTime(),e.getTime())}function k9(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),a=0,o,s;(o=i.next())&&!o.done;){for(var l=e.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=o.value,h=f[0],d=f[1],y=s.value,p=y[0],m=y[1];!c&&!r[u]&&(c=n.equals(h,p,a,u,t,e,n)&&n.equals(d,m,h,p,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;a++}return!0}function QAe(t,e,n){var r=C9(t),i=r.length;if(C9(e).length!==i)return!1;for(var a;i-- >0;)if(a=r[i],a===Pz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Sz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n))return!1;return!0}function Hg(t,e,n){var r=O9(t),i=r.length;if(O9(e).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=r[i],a===Pz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Sz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n)||(o=T9(t,a),s=T9(e,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function KAe(t,e){return vg(t.valueOf(),e.valueOf())}function WAe(t,e){return t.source===e.source&&t.flags===e.flags}function N9(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),a,o;(a=i.next())&&!a.done;){for(var s=e.values(),l=!1,c=0;(o=s.next())&&!o.done;)!l&&!r[c]&&(l=n.equals(a.value,o.value,a.value,o.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function JAe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var YAe="[object Arguments]",XAe="[object Boolean]",ZAe="[object Date]",qAe="[object Map]",e6e="[object Number]",t6e="[object Object]",n6e="[object RegExp]",r6e="[object Set]",i6e="[object String]",a6e=Array.isArray,_9=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,I9=Object.assign,o6e=Object.prototype.toString.call.bind(Object.prototype.toString);function s6e(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,a=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,s=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,h){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var d=u.constructor;if(d!==f.constructor)return!1;if(d===Object)return i(u,f,h);if(a6e(u))return e(u,f,h);if(_9!=null&&_9(u))return l(u,f,h);if(d===Date)return n(u,f,h);if(d===RegExp)return o(u,f,h);if(d===Map)return r(u,f,h);if(d===Set)return s(u,f,h);var y=o6e(u);return y===ZAe?n(u,f,h):y===n6e?o(u,f,h):y===qAe?r(u,f,h):y===r6e?s(u,f,h):y===t6e?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,h):y===YAe?i(u,f,h):y===XAe||y===e6e||y===i6e?a(u,f,h):!1}}function l6e(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Hg:GAe,areDatesEqual:VAe,areMapsEqual:r?P9(k9,Hg):k9,areObjectsEqual:r?Hg:QAe,arePrimitiveWrappersEqual:KAe,areRegExpsEqual:WAe,areSetsEqual:r?P9(N9,Hg):N9,areTypedArraysEqual:r?Hg:JAe};if(n&&(i=I9({},i,n(i))),e){var a=wb(i.areArraysEqual),o=wb(i.areMapsEqual),s=wb(i.areObjectsEqual),l=wb(i.areSetsEqual);i=I9({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function c6e(t){return function(e,n,r,i,a,o,s){return t(e,n,s)}}function u6e(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,a=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,h=f===void 0?e?new WeakMap:void 0:f,d=u.meta;return n(l,c,{cache:h,equals:i,meta:d,strict:a})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(l,c){return n(l,c,o)}}var f6e=uu();uu({strict:!0});uu({circular:!0});uu({circular:!0,strict:!0});uu({createInternalComparator:function(){return vg}});uu({strict:!0,createInternalComparator:function(){return vg}});uu({circular:!0,createInternalComparator:function(){return vg}});uu({circular:!0,createInternalComparator:function(){return vg},strict:!0});function uu(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,a=t.strict,o=a===void 0?!1:a,s=l6e(t),l=s6e(s),c=r?r(l):c6e(l);return u6e({circular:n,comparator:l,createState:i,equals:c,strict:o})}function h6e(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function R9(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>e?(t(a),n=-1):h6e(i)};requestAnimationFrame(r)}function H8(t){"@babel/helpers - typeof";return H8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H8(t)}function d6e(t){return m6e(t)||y6e(t)||g6e(t)||p6e()}function p6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g6e(t,e){if(t){if(typeof t=="string")return M9(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M9(t,e)}}function M9(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:v<0?0:v},p=function(v){for(var w=v>1?1:v,x=w,E=0;E<8;++E){var P=f(x)-w,A=d(x);if(Math.abs(P-w)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,a=i===void 0?8:i,o=e.dt,s=o===void 0?17:o,l=function(u,f,h){var d=-(u-f)*r,y=h*a,p=h+(d-y)*s/1e3,m=h*s/1e3+u;return Math.abs(m-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function W6e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function C5(t){return Z6e(t)||X6e(t)||Y6e(t)||J6e()}function J6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y6e(t,e){if(t){if(typeof t=="string")return W8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W8(t,e)}}function X6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Z6e(t){if(Array.isArray(t))return W8(t)}function W8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zx(t){return zx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zx(t)}var qc=function(t){n5e(n,t);var e=r5e(n);function n(r,i){var a;q6e(this,n),a=e.call(this,r,i);var o=a.props,s=o.isActive,l=o.attributeName,c=o.from,u=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(X8(a)),a.changeStyle=a.changeStyle.bind(X8(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:u}),Y8(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof h=="function")return a.state={style:c},Y8(a);a.state={style:l?fy({},l,c):c}}else a.state={style:{}};return a}return e5e(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,c=a.shouldReAnimate,u=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?fy({},l,u):u};this.state&&h&&(l&&h[l]!==u||!l&&h!==u)&&this.setState(d);return}if(!(f6e(i.to,u)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=y||c?f:i.to;if(this.state&&h){var m={style:l?fy({},l,p):p};(l&&[l]!==p||!l&&h!==p)&&this.setState(m)}this.runAnimation(Za(Za({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=V6e(o,s,M6e(c),l,this.changeStyle),y=function(){a.stopJSAnimation=d()};this.manager.start([h,u,y,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,c=o[0],u=c.style,f=c.duration,h=f===void 0?0:f,d=function(p,m,v){if(v===0)return p;var w=m.duration,x=m.easing,E=x===void 0?"ease":x,P=m.style,A=m.properties,k=m.onAnimationEnd,N=v>0?o[v-1]:m,D=A||Object.keys(P);if(typeof E=="function"||E==="spring")return[].concat(C5(p),[a.runJSAnimation.bind(a,{from:N.style,to:P,duration:w,easing:E}),w]);var L=L9(D,w,E),F=Za(Za(Za({},N.style),P),{},{transition:L});return[].concat(C5(p),[F,w,k]).filter(A6e)};return this.manager.start([l].concat(C5(o.reduce(d,[u,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=v6e());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof d=="function"||c==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var p=s?fy({},s,l):l,m=L9(Object.keys(p),o,c);y.start([u,a,Za(Za({},p),{},{transition:m}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=K6e(i,Q6e),c=U.Children.count(a),u=this.state.style;if(typeof a=="function")return a(u);if(!s||c===0||o<=0)return a;var f=function(d){var y=d.props,p=y.style,m=p===void 0?{}:p,v=y.className,w=U.cloneElement(d,Za(Za({},l),{},{style:Za(Za({},m),u),className:v}));return w};return c===1?f(U.Children.only(a)):X.createElement("div",null,U.Children.map(a,function(h){return f(h)}))}}]),n}(U.PureComponent);qc.displayName="Animate";qc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};qc.propTypes={from:xt.oneOfType([xt.object,xt.string]),to:xt.oneOfType([xt.object,xt.string]),attributeName:xt.string,duration:xt.number,begin:xt.number,easing:xt.oneOfType([xt.string,xt.func]),steps:xt.arrayOf(xt.shape({duration:xt.number.isRequired,style:xt.object.isRequired,easing:xt.oneOfType([xt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),xt.func]),properties:xt.arrayOf("string"),onAnimationEnd:xt.func})),children:xt.oneOfType([xt.node,xt.func]),isActive:xt.bool,canBegin:xt.bool,onAnimationEnd:xt.func,shouldReAnimate:xt.bool,onAnimationStart:xt.func,onAnimationReStart:xt.func};xt.object,xt.object,xt.object,xt.element;xt.object,xt.object,xt.object,xt.oneOfType([xt.array,xt.element]),xt.any;function K1(t){"@babel/helpers - typeof";return K1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K1(t)}function Hx(){return Hx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];u="M".concat(e,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, + `).concat(e+r,",").concat(n+s*f[1])),u+="L ".concat(e+r,",").concat(n+i-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, + `).concat(e+r-l*f[2],",").concat(n+i)),u+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, + `).concat(e,",").concat(n+i-s*f[3])),u+="Z"}else if(o>0&&a===+a&&a>0){var y=Math.min(o,a);u="M ".concat(e,",").concat(n+s*y,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+l*y,",").concat(n,` + L `).concat(e+r-l*y,",").concat(n,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*y,` + L `).concat(e+r,",").concat(n+i-s*y,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r-l*y,",").concat(n+i,` + L `).concat(e+l*y,",").concat(n+i,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*y," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},d5e=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,a=n.x,o=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(a,a+s),u=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return r>=c&&r<=u&&i>=f&&i<=h}return!1},p5e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},E4=function(e){var n=Q9(Q9({},p5e),e),r=U.useRef(),i=U.useState(-1),a=a5e(i,2),o=a[0],s=a[1];U.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&s(E)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,h=n.radius,d=n.className,y=n.animationEasing,p=n.animationDuration,m=n.animationBegin,v=n.isAnimationActive,w=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=bn("recharts-rectangle",d);return w?X.createElement(qc,{canBegin:o>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:p,animationEasing:y,isActive:w},function(E){var P=E.width,A=E.height,k=E.x,N=E.y;return X.createElement(qc,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:p,isActive:v,easing:y},X.createElement("path",Hx({},St(n,!0),{className:x,d:K9(k,N,P,A,h),ref:r})))}):X.createElement("path",Hx({},St(n,!0),{className:x,d:K9(l,c,u,f,h)}))},g5e=["points","className","baseLinePoints","connectNulls"];function pd(){return pd=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function m5e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function W9(t){return x5e(t)||w5e(t)||b5e(t)||v5e()}function v5e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b5e(t,e){if(t){if(typeof t=="string")return Z8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z8(t,e)}}function w5e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function x5e(t){if(Array.isArray(t))return Z8(t)}function Z8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){J9(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),J9(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Iy=function(e,n){var r=A5e(e);n&&(r=[r.reduce(function(a,o){return[].concat(W9(a),W9(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},E5e=function(e,n,r){var i=Iy(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Iy(n.reverse(),r).slice(1))},S5e=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=y5e(e,g5e);if(!n||!n.length)return null;var s=bn("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",c=E5e(n,i,a);return X.createElement("g",{className:s},X.createElement("path",pd({},St(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),l?X.createElement("path",pd({},St(o,!0),{fill:"none",d:Iy(n,a)})):null,l?X.createElement("path",pd({},St(o,!0),{fill:"none",d:Iy(i,a)})):null)}var u=Iy(n,a);return X.createElement("path",pd({},St(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:s,d:u}))};function q8(){return q8=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _5e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var I5e=function(e,n,r,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},R5e=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.top,s=o===void 0?0:o,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,h=e.height,d=h===void 0?0:h,y=e.className,p=N5e(e,P5e),m=O5e({x:r,y:a,top:s,left:c,width:f,height:d},p);return!Me(r)||!Me(a)||!Me(f)||!Me(d)||!Me(s)||!Me(c)?null:X.createElement("path",eS({},St(m,!0),{className:bn("recharts-cross",y),d:I5e(r,a,f,d,s,c)}))},M5e=BA,B5e=Xj,D5e=su;function L5e(t,e){return t&&t.length?M5e(t,D5e(e),B5e):void 0}var $5e=L5e;const U5e=Gt($5e);var F5e=BA,j5e=su,z5e=Zj;function H5e(t,e){return t&&t.length?F5e(t,j5e(e),z5e):void 0}var G5e=H5e;const V5e=Gt(G5e);var Q5e=["cx","cy","angle","ticks","axisLine"],K5e=["ticks","tick","angle","tickFormatter","stroke"];function Hp(t){"@babel/helpers - typeof";return Hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hp(t)}function Ry(){return Ry=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function W5e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function J5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q9(t,e){for(var n=0;nnR?o=i==="outer"?"start":"end":a<-nR?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,l=r.axisLineType,c=vu(vu({},St(this.props,!1)),{},{fill:"none"},St(s,!1));if(l==="circle")return X.createElement(S4,Tu({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:a,r:o}));var u=this.props.ticks,f=u.map(function(h){return ln(i,a,o,h.coordinate)});return X.createElement(S5e,Tu({className:"recharts-polar-angle-axis-line"},c,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,c=i.stroke,u=St(this.props,!1),f=St(o,!1),h=vu(vu({},u),{},{fill:"none"},St(s,!1)),d=a.map(function(y,p){var m=r.getTickLineCoord(y),v=r.getTickTextAnchor(y),w=vu(vu(vu({textAnchor:v},u),{},{stroke:"none",fill:c},f),{},{index:p,payload:y,x:m.x2,y:m.y2});return X.createElement(Ln,Tu({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(y.coordinate)},xA(r.props,y,p)),s&&X.createElement("line",Tu({className:"recharts-polar-angle-axis-tick-line"},h,m)),o&&e.renderTickItem(o,w,l?l(y.value,p):y.value))});return X.createElement(Ln,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:X.createElement(Ln,{className:"recharts-polar-angle-axis"},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return X.isValidElement(r)?o=X.cloneElement(r,i):Rt(r)?o=r(i):o=X.createElement(Lp,Tu({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}]),e}(U.PureComponent);zA(HA,"displayName","PolarAngleAxis");zA(HA,"axisType","angleAxis");zA(HA,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var uEe=KF,fEe=uEe(Object.getPrototypeOf,Object),hEe=fEe,dEe=_l,pEe=hEe,gEe=Il,yEe="[object Object]",mEe=Function.prototype,vEe=Object.prototype,Dz=mEe.toString,bEe=vEe.hasOwnProperty,wEe=Dz.call(Object);function xEe(t){if(!gEe(t)||dEe(t)!=yEe)return!1;var e=pEe(t);if(e===null)return!0;var n=bEe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Dz.call(n)==wEe}var AEe=xEe;const EEe=Gt(AEe);var SEe=_l,PEe=Il,OEe="[object Boolean]";function TEe(t){return t===!0||t===!1||PEe(t)&&SEe(t)==OEe}var CEe=TEe;const kEe=Gt(CEe);function J1(t){"@babel/helpers - typeof";return J1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J1(t)}function Qx(){return Qx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:h,x:l,y:c},duration:p,animationEasing:y,isActive:v},function(x){var E=x.upperWidth,P=x.lowerWidth,A=x.height,k=x.x,N=x.y;return X.createElement(qc,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:p,easing:y},X.createElement("path",Qx({},St(n,!0),{className:w,d:oR(k,N,E,P,A),ref:r})))}):X.createElement("g",null,X.createElement("path",Qx({},St(n,!0),{className:w,d:oR(l,c,u,f,h)})))},FEe=["option","shapeType","propTransformer","activeClassName","isActive"];function Y1(t){"@babel/helpers - typeof";return Y1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y1(t)}function jEe(t,e){if(t==null)return{};var n=zEe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zEe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function sR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Kx(t){for(var e=1;e0?Eo(x,"paddingAngle",0):0;if(P){var k=ZN(P.endAngle-P.startAngle,x.endAngle-x.startAngle),N=gn(gn({},x),{},{startAngle:w+A,endAngle:w+k(p)+A});m.push(N),w=N.endAngle}else{var D=x.endAngle,L=x.startAngle,F=ZN(0,D-L),$=F(p),z=gn(gn({},x),{},{startAngle:w+A,endAngle:w+$+A});m.push(z),w=z.endAngle}}),X.createElement(Ln,null,r.renderSectorsStatically(m))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!v4(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,c=i.cx,u=i.cy,f=i.innerRadius,h=i.outerRadius,d=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!Me(c)||!Me(u)||!Me(f)||!Me(h))return null;var p=bn("recharts-pie",s);return X.createElement(Ln,{tabIndex:this.props.rootTabIndex,className:p,ref:function(v){r.pieRef=v}},this.renderSectors(),l&&this.renderLabels(o),xr.renderCallByParent(this.props,null,!1),(!d||y)&&Vf.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r=360?w:w-1)*l,E=m-w*d-x,P=r.reduce(function(N,D){var L=ra(D,v,0);return N+(Me(L)?L:0)},0),A;if(P>0){var k;A=r.map(function(N,D){var L=ra(N,v,0),F=ra(N,u,D),$=(Me(L)?L:0)/P,z;D?z=k.endAngle+$a(p)*l*(L!==0?1:0):z=o;var J=z+$a(p)*((L!==0?d:0)+$*E),H=(z+J)/2,G=(y.innerRadius+y.outerRadius)/2,q=[{name:F,value:L,payload:N,dataKey:v,type:h}],K=ln(y.cx,y.cy,G,H);return k=gn(gn(gn({percent:$,cornerRadius:a,name:F,tooltipPayload:q,midAngle:H,middleRadius:G,tooltipPosition:K},N),y),{},{value:ra(N,v),startAngle:z,endAngle:J,payload:N,paddingAngle:$a(p)*l}),k})}return gn(gn({},y),{},{sectors:A,data:r})});var c3e=Math.ceil,u3e=Math.max;function f3e(t,e,n,r){for(var i=-1,a=u3e(c3e((e-t)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=t,t+=n;return o}var h3e=f3e,d3e=hj,fR=1/0,p3e=17976931348623157e292;function g3e(t){if(!t)return t===0?t:0;if(t=d3e(t),t===fR||t===-fR){var e=t<0?-1:1;return e*p3e}return t===t?t:0}var y3e=g3e,m3e=h3e,v3e=CA,k5=y3e;function b3e(t){return function(e,n,r){return r&&typeof r!="number"&&v3e(e,n,r)&&(n=r=void 0),e=k5(e),n===void 0?(n=e,e=0):n=k5(n),r=r===void 0?e0&&r.handleDrag(i.changedTouches[0])}),Vi(Ro(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),r.detachDragEndListener()}),Vi(Ro(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Vi(Ro(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Vi(Ro(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Vi(Ro(r),"handleSlideDragStart",function(i){var a=yR(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(Ro(r),"startX"),endX:r.handleTravellerDragStart.bind(Ro(r),"endX")},r.state={},r}return k3e(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,a),h=Math.max(i,a),d=e.getIndexInRange(o,f),y=e.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:y===u?u:y-y%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=ra(a[r],s,r);return Rt(o)?o(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,y=l.onChange,p=r.pageX-a;p>0?p=Math.min(p,c+u-f-s,c+u-f-o):p<0&&(p=Math.max(p,c-o,c-s));var m=this.getIndex({startX:o+p,endX:s+p});(m.startIndex!==h||m.endIndex!==d)&&y&&y(m),this.setState({startX:o+p,endX:s+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=yR(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[o],u=this.props,f=u.x,h=u.width,d=u.travellerWidth,y=u.onChange,p=u.gap,m=u.data,v={startX:this.state.startX,endX:this.state.endX},w=r.pageX-a;w>0?w=Math.min(w,f+h-d-c):w<0&&(w=Math.max(w,f-c)),v[o]=c+w;var x=this.getIndex(v),E=x.startIndex,P=x.endIndex,A=function(){var N=m.length-1;return o==="startX"&&(s>l?E%p===0:P%p===0)||sl?P%p===0:E%p===0)||s>l&&P===N};this.setState(Vi(Vi({},o,c+w),"brushMoveStartX",r.pageX),function(){y&&A()&&y(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,c=o.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var h=f+r;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=c||i==="endX"&&d<=l||this.setState(Vi({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,l=r.fill,c=r.stroke;return X.createElement("rect",{stroke:c,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,f=U.Children.only(c);return f?X.cloneElement(f,{x:i,y:a,width:o,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var a=this,o=this.props,s=o.y,l=o.travellerWidth,c=o.height,u=o.traveller,f=o.ariaLabel,h=o.data,d=o.startIndex,y=o.endIndex,p=Math.max(r,this.props.x),m=N5(N5({},St(this.props,!1)),{},{x:p,y:s,width:l,height:c}),v=f||"Min value: ".concat(h[d].name,", Max value: ").concat(h[y].name);return X.createElement(Ln,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),a.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(u,m))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,c=a.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return X.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:o,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,o=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,h=u.endX,d=5,y={pointerEvents:"none",fill:c};return X.createElement(Ln,{className:"recharts-brush-texts"},X.createElement(Lp,Yx({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},y),this.getTextOfTick(i)),X.createElement(Lp,Yx({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,o=r.children,s=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,h=this.state,d=h.startX,y=h.endX,p=h.isTextActive,m=h.isSlideMoving,v=h.isTravellerMoving,w=h.isTravellerFocused;if(!i||!i.length||!Me(s)||!Me(l)||!Me(c)||!Me(u)||c<=0||u<=0)return null;var x=bn("recharts-brush",a),E=X.Children.count(o)===1,P=T3e("userSelect","none");return X.createElement(Ln,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:P},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(d,y),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(y,"endX"),(p||m||v||w||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,s=r.height,l=r.stroke,c=Math.floor(a+s/2)-1;return X.createElement(X.Fragment,null,X.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),X.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),X.createElement("line",{x1:i+1,y1:c+2,x2:i+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return X.isValidElement(r)?a=X.cloneElement(r,i):Rt(r)?a=r(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return N5({prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o},a&&a.length?M3e({data:a,width:o,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);r[l]>i?s=l:o=l}return i>=r[s]?s:o}}]),e}(U.PureComponent);Vi(Kp,"displayName","Brush");Vi(Kp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var B3e=QO;function D3e(t,e){var n;return B3e(t,function(r,i,a){return n=e(r,i,a),!n}),!!n}var L3e=D3e,$3e=UF,U3e=su,F3e=L3e,j3e=$i,z3e=CA;function H3e(t,e,n){var r=j3e(t)?$3e:F3e;return n&&z3e(t,e,n)&&(e=void 0),r(t,U3e(e))}var G3e=H3e;const V3e=Gt(G3e);var ls=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},mR=sj;function Q3e(t,e,n){e=="__proto__"&&mR?mR(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var K3e=Q3e,W3e=K3e,J3e=aj,Y3e=su;function X3e(t,e){var n={};return e=Y3e(e),J3e(t,function(r,i,a){W3e(n,i,e(r,i,a))}),n}var Z3e=X3e;const q3e=Gt(Z3e);function e8e(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();P4(Gz,"EPS",1e-4);var O4=function(e){var n=Object.keys(e).reduce(function(r,i){return xb(xb({},r),{},P4({},i,Gz.create(e[i])))},{});return xb(xb({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return q3e(i,function(l,c){return n[c].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return h8e(i,function(a,o){return n[o].isInRange(a)})}})},m8e=yle(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),Vz=U.createContext(void 0),Qz=U.createContext(void 0),Kz=U.createContext(void 0),v8e=U.createContext({}),Wz=U.createContext(void 0),b8e=U.createContext(0),w8e=U.createContext(0),wR=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=e.clipPathId,s=e.children,l=e.width,c=e.height,u=m8e(a);return X.createElement(Vz.Provider,{value:r},X.createElement(Qz.Provider,{value:i},X.createElement(v8e.Provider,{value:a},X.createElement(Kz.Provider,{value:u},X.createElement(Wz.Provider,{value:o},X.createElement(b8e.Provider,{value:c},X.createElement(w8e.Provider,{value:l},s)))))))},x8e=function(){return U.useContext(Wz)},A8e=function(e){var n=U.useContext(Vz);n==null&&jp(!1);var r=n[e];return r==null&&jp(!1),r},E8e=function(e){var n=U.useContext(Qz);n==null&&jp(!1);var r=n[e];return r==null&&jp(!1),r},S8e=function(){var e=U.useContext(Kz);return e};function em(t){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(t)}function xR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function AR(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function fSe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function hSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RR(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?o:e&&e.length&&Me(i)&&Me(a)?e.slice(i,a+1):[]};function nH(t){return t==="number"?[0,"auto"]:void 0}var hS=function(e,n,r,i){var a=e.graphicalItems,o=e.tooltipAxis,s=QA(n,e);return r<0||!a||!a.length||r>=s.length?null:a.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=Y3(d,o.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Jp(l),[k2e(c,h)]):l},[])},BR=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},o=ESe(a,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=d2e(o,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,h=hS(e,n,u,f),d=SSe(r,s,u,a);return{activeTooltipIndex:u,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},PSe=function(e,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,h=e.stackOffset,d=pz(u,a);return r.reduce(function(y,p){var m,v=p.props,w=v.type,x=v.dataKey,E=v.allowDataOverflow,P=v.allowDuplicatedCategory,A=v.scale,k=v.ticks,N=v.includeHidden,D=p.props[o];if(y[D])return y;var L=QA(e.data,{graphicalItems:i.filter(function(be){return be.props[o]===D}),dataStartIndex:l,dataEndIndex:c}),F=L.length,$,z,J;q8e(p.props.domain,E,w)&&($=D8(p.props.domain,null,E),d&&(w==="number"||A!=="auto")&&(J=Ny(L,x,"category")));var H=nH(w);if(!$||$.length===0){var G,q=(G=p.props.domain)!==null&&G!==void 0?G:H;if(x){if($=Ny(L,x,w),w==="category"&&d){var K=gce($);P&&K?(z=$,$=Jx(0,F)):P||($=h9(q,$,p).reduce(function(be,Ye){return be.indexOf(Ye)>=0?be:[].concat(Jp(be),[Ye])},[]))}else if(w==="category")P?$=$.filter(function(be){return be!==""&&!Ht(be)}):$=h9(q,$,p).reduce(function(be,Ye){return be.indexOf(Ye)>=0||Ye===""||Ht(Ye)?be:[].concat(Jp(be),[Ye])},[]);else if(w==="number"){var ee=v2e(L,i.filter(function(be){return be.props[o]===D&&(N||!be.props.hide)}),x,a,u);ee&&($=ee)}d&&(w==="number"||A!=="auto")&&(J=Ny(L,x,"category"))}else d?$=Jx(0,F):s&&s[D]&&s[D].hasStack&&w==="number"?$=h==="expand"?[0,1]:gz(s[D].stackGroups,l,c):$=dz(L,i.filter(function(be){return be.props[o]===D&&(N||!be.props.hide)}),w,u,!0);if(w==="number")$=cS(f,$,D,a,k),q&&($=D8(q,$,E));else if(w==="category"&&q){var he=q,we=$.every(function(be){return he.indexOf(be)>=0});we&&($=he)}}return ue(ue({},y),{},ft({},D,ue(ue({},p.props),{},{axisType:a,domain:$,categoricalDomain:J,duplicateDomain:z,originalDomain:(m=p.props.domain)!==null&&m!==void 0?m:H,isCategorical:d,layout:u})))},{})},OSe=function(e,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,h=QA(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),d=h.length,y=pz(u,a),p=-1;return r.reduce(function(m,v){var w=v.props[o],x=nH("number");if(!m[w]){p++;var E;return y?E=Jx(0,d):s&&s[w]&&s[w].hasStack?(E=gz(s[w].stackGroups,l,c),E=cS(f,E,w,a)):(E=D8(x,dz(h,r.filter(function(P){return P.props[o]===w&&!P.props.hide}),"number",u),i.defaultProps.allowDataOverflow),E=cS(f,E,w,a)),ue(ue({},m),{},ft({},w,ue(ue({axisType:a},i.defaultProps),{},{hide:!0,orientation:Eo(xSe,"".concat(a,".").concat(p%2),null),domain:E,originalDomain:x,isCategorical:y,layout:u})))}return m},{})},TSe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),h=os(u,a),d={};return h&&h.length?d=PSe(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):o&&o.length&&(d=OSe(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),d},CSe=function(e){var n=Hh(e),r=uy(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:KO(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:L8(n,r)}},DR=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ia(n,Kp),a=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},kSe=function(e){return!e||!e.length?!1:e.some(function(n){var r=fl(n&&n.type);return r&&r.indexOf("Bar")>=0})},LR=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},NSe=function(e,n){var r=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,h=r.margin||{},d=Ia(f,Kp),y=Ia(f,S1),p=Object.keys(l).reduce(function(P,A){var k=l[A],N=k.orientation;return!k.mirror&&!k.hide?ue(ue({},P),{},ft({},N,P[N]+k.width)):P},{left:h.left||0,right:h.right||0}),m=Object.keys(o).reduce(function(P,A){var k=o[A],N=k.orientation;return!k.mirror&&!k.hide?ue(ue({},P),{},ft({},N,Eo(P,"".concat(N))+k.height)):P},{top:h.top||0,bottom:h.bottom||0}),v=ue(ue({},m),p),w=v.bottom;d&&(v.bottom+=d.props.height||Kp.defaultProps.height),y&&n&&(v=y2e(v,i,r,n));var x=c-v.left-v.right,E=u-v.top-v.bottom;return ue(ue({brushBottom:w},v),{},{width:Math.max(x,0),height:Math.max(E,0)})},_Se=function(e){var n,r=e.chartName,i=e.GraphicalChild,a=e.defaultTooltipEventType,o=a===void 0?"axis":a,s=e.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,h=e.defaultProps,d=function(m,v){var w=v.graphicalItems,x=v.stackGroups,E=v.offset,P=v.updateId,A=v.dataStartIndex,k=v.dataEndIndex,N=m.barSize,D=m.layout,L=m.barGap,F=m.barCategoryGap,$=m.maxBarSize,z=LR(D),J=z.numericAxisName,H=z.cateAxisName,G=kSe(w),q=G&&p2e({barSize:N,stackGroups:x}),K=[];return w.forEach(function(ee,he){var we=QA(m.data,{graphicalItems:[ee],dataStartIndex:A,dataEndIndex:k}),be=ee.props,Ye=be.dataKey,at=be.maxBarSize,Be=ee.props["".concat(J,"Id")],gt=ee.props["".concat(H,"Id")],Vt={},pn=c.reduce(function(gr,Vn){var ha=v["".concat(Vn.axisType,"Map")],Tr=ee.props["".concat(Vn.axisType,"Id")];ha&&ha[Tr]||Vn.axisType==="zAxis"||jp(!1);var ir=ha[Tr];return ue(ue({},gr),{},ft(ft({},Vn.axisType,ir),"".concat(Vn.axisType,"Ticks"),uy(ir)))},Vt),xe=pn[H],Ve=pn["".concat(H,"Ticks")],We=x&&x[Be]&&x[Be].hasStack&&T2e(ee,x[Be].stackGroups),se=fl(ee.type).indexOf("Bar")>=0,bt=L8(xe,Ve),ut=[];if(se){var It,Yt,Cn=Ht(at)?$:at,Yn=(It=(Yt=L8(xe,Ve,!0))!==null&&Yt!==void 0?Yt:Cn)!==null&&It!==void 0?It:0;ut=g2e({barGap:L,barCategoryGap:F,bandSize:Yn!==bt?Yn:bt,sizeList:q[gt],maxBarSize:Cn}),Yn!==bt&&(ut=ut.map(function(gr){return ue(ue({},gr),{},{position:ue(ue({},gr.position),{},{offset:gr.position.offset-Yn/2})})}))}var pr=ee&&ee.type&&ee.type.getComposedData;pr&&K.push({props:ue(ue({},pr(ue(ue({},pn),{},{displayedData:we,props:m,dataKey:Ye,item:ee,bandSize:bt,barPosition:ut,offset:E,stackedData:We,layout:D,dataStartIndex:A,dataEndIndex:k}))),{},ft(ft(ft({key:ee.key||"item-".concat(he)},J,pn[J]),H,pn[H]),"animationId",P)),childIndex:Oce(ee,m.children),item:ee})}),K},y=function(m,v){var w=m.props,x=m.dataStartIndex,E=m.dataEndIndex,P=m.updateId;if(!r_({props:w}))return null;var A=w.children,k=w.layout,N=w.stackOffset,D=w.data,L=w.reverseStackOrder,F=LR(k),$=F.numericAxisName,z=F.cateAxisName,J=os(A,i),H=P2e(D,J,"".concat($,"Id"),"".concat(z,"Id"),N,L),G=c.reduce(function(we,be){var Ye="".concat(be.axisType,"Map");return ue(ue({},we),{},ft({},Ye,TSe(w,ue(ue({},be),{},{graphicalItems:J,stackGroups:be.axisType===$&&H,dataStartIndex:x,dataEndIndex:E}))))},{}),q=NSe(ue(ue({},G),{},{props:w,graphicalItems:J}),v==null?void 0:v.legendBBox);Object.keys(G).forEach(function(we){G[we]=f(w,G[we],q,we.replace("Map",""),r)});var K=G["".concat(z,"Map")],ee=CSe(K),he=d(w,ue(ue({},G),{},{dataStartIndex:x,dataEndIndex:E,updateId:P,graphicalItems:J,stackGroups:H,offset:q}));return ue(ue({formattedGraphicalItems:he,graphicalItems:J,offset:q,stackGroups:H},ee),G)};return n=function(p){ySe(m,p);function m(v){var w,x,E;return hSe(this,m),E=pSe(this,m,[v]),ft(Ut(E),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ft(Ut(E),"accessibilityManager",new Z8e),ft(Ut(E),"handleLegendBBoxUpdate",function(P){if(P){var A=E.state,k=A.dataStartIndex,N=A.dataEndIndex,D=A.updateId;E.setState(ue({legendBBox:P},y({props:E.props,dataStartIndex:k,dataEndIndex:N,updateId:D},ue(ue({},E.state),{},{legendBBox:P}))))}}),ft(Ut(E),"handleReceiveSyncEvent",function(P,A,k){if(E.props.syncId===P){if(k===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(A)}}),ft(Ut(E),"handleBrushChange",function(P){var A=P.startIndex,k=P.endIndex;if(A!==E.state.dataStartIndex||k!==E.state.dataEndIndex){var N=E.state.updateId;E.setState(function(){return ue({dataStartIndex:A,dataEndIndex:k},y({props:E.props,dataStartIndex:A,dataEndIndex:k,updateId:N},E.state))}),E.triggerSyncEvent({dataStartIndex:A,dataEndIndex:k})}}),ft(Ut(E),"handleMouseEnter",function(P){var A=E.getMouseInfo(P);if(A){var k=ue(ue({},A),{},{isTooltipActive:!0});E.setState(k),E.triggerSyncEvent(k);var N=E.props.onMouseEnter;Rt(N)&&N(k,P)}}),ft(Ut(E),"triggeredAfterMouseMove",function(P){var A=E.getMouseInfo(P),k=A?ue(ue({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(k),E.triggerSyncEvent(k);var N=E.props.onMouseMove;Rt(N)&&N(k,P)}),ft(Ut(E),"handleItemMouseEnter",function(P){E.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),ft(Ut(E),"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),ft(Ut(E),"handleMouseMove",function(P){P.persist(),E.throttleTriggeredAfterMouseMove(P)}),ft(Ut(E),"handleMouseLeave",function(P){E.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};E.setState(A),E.triggerSyncEvent(A);var k=E.props.onMouseLeave;Rt(k)&&k(A,P)}),ft(Ut(E),"handleOuterEvent",function(P){var A=Pce(P),k=Eo(E.props,"".concat(A));if(A&&Rt(k)){var N,D;/.*touch.*/i.test(A)?D=E.getMouseInfo(P.changedTouches[0]):D=E.getMouseInfo(P),k((N=D)!==null&&N!==void 0?N:{},P)}}),ft(Ut(E),"handleClick",function(P){var A=E.getMouseInfo(P);if(A){var k=ue(ue({},A),{},{isTooltipActive:!0});E.setState(k),E.triggerSyncEvent(k);var N=E.props.onClick;Rt(N)&&N(k,P)}}),ft(Ut(E),"handleMouseDown",function(P){var A=E.props.onMouseDown;if(Rt(A)){var k=E.getMouseInfo(P);A(k,P)}}),ft(Ut(E),"handleMouseUp",function(P){var A=E.props.onMouseUp;if(Rt(A)){var k=E.getMouseInfo(P);A(k,P)}}),ft(Ut(E),"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),ft(Ut(E),"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&E.handleMouseDown(P.changedTouches[0])}),ft(Ut(E),"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&E.handleMouseUp(P.changedTouches[0])}),ft(Ut(E),"triggerSyncEvent",function(P){E.props.syncId!==void 0&&_5.emit(I5,E.props.syncId,P,E.eventEmitterSymbol)}),ft(Ut(E),"applySyncEvent",function(P){var A=E.props,k=A.layout,N=A.syncMethod,D=E.state.updateId,L=P.dataStartIndex,F=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)E.setState(ue({dataStartIndex:L,dataEndIndex:F},y({props:E.props,dataStartIndex:L,dataEndIndex:F,updateId:D},E.state)));else if(P.activeTooltipIndex!==void 0){var $=P.chartX,z=P.chartY,J=P.activeTooltipIndex,H=E.state,G=H.offset,q=H.tooltipTicks;if(!G)return;if(typeof N=="function")J=N(q,P);else if(N==="value"){J=-1;for(var K=0;K=0){var Ve,We;if($.dataKey&&!$.allowDuplicatedCategory){var se=typeof $.dataKey=="function"?xe:"payload.".concat($.dataKey.toString());Ve=Y3(K,se,J),We=ee&&he&&Y3(he,se,J)}else Ve=K==null?void 0:K[z],We=ee&&he&&he[z];if(Be||at){var bt=P.props.activeIndex!==void 0?P.props.activeIndex:z;return[U.cloneElement(P,ue(ue(ue({},N.props),Vt),{},{activeIndex:bt})),null,null]}if(!Ht(Ve))return[pn].concat(Jp(E.renderActivePoints({item:N,activePoint:Ve,basePoint:We,childIndex:z,isRange:ee})))}else{var ut,It=(ut=E.getItemByXY(E.state.activeCoordinate))!==null&&ut!==void 0?ut:{graphicalItem:pn},Yt=It.graphicalItem,Cn=Yt.item,Yn=Cn===void 0?P:Cn,pr=Yt.childIndex,gr=ue(ue(ue({},N.props),Vt),{},{activeIndex:pr});return[U.cloneElement(Yn,gr),null,null]}return ee?[pn,null,null]:[pn,null]}),ft(Ut(E),"renderCustomized",function(P,A,k){return U.cloneElement(P,ue(ue({key:"recharts-customized-".concat(k)},E.props),E.state))}),ft(Ut(E),"renderMap",{CartesianGrid:{handler:Eb,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Eb},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Eb},YAxis:{handler:Eb},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((w=v.id)!==null&&w!==void 0?w:wA("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=dj(E.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),E.state={},E}return dSe(m,[{key:"componentDidMount",value:function(){var w,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,x=w.children,E=w.data,P=w.height,A=w.layout,k=Ia(x,As);if(k){var N=k.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length)){var D=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,L=hS(this.state,E,N,D),F=this.state.tooltipTicks[N].coordinate,$=(this.state.offset.top+P)/2,z=A==="horizontal",J=z?{x:F,y:$}:{y:F,x:$},H=this.state.formattedGraphicalItems.find(function(q){var K=q.item;return K.type.name==="Scatter"});H&&(J=ue(ue({},J),H.props.points[N].tooltipPosition),L=H.props.points[N].tooltipPayload);var G={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:D,activePayload:L,activeCoordinate:J};this.setState(G),this.renderCursor(k),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var E,P;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(w){q3([Ia(w.children,As)],[Ia(this.props.children,As)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Ia(this.props.children,As);if(w&&typeof w.props.shared=="boolean"){var x=w.props.shared?"axis":"item";return l.indexOf(x)>=0?x:o}return o}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var x=this.container,E=x.getBoundingClientRect(),P=Jme(E),A={chartX:Math.round(w.pageX-P.left),chartY:Math.round(w.pageY-P.top)},k=E.width/x.offsetWidth||1,N=this.inRange(A.chartX,A.chartY,k);if(!N)return null;var D=this.state,L=D.xAxisMap,F=D.yAxisMap,$=this.getTooltipEventType();if($!=="axis"&&L&&F){var z=Hh(L).scale,J=Hh(F).scale,H=z&&z.invert?z.invert(A.chartX):null,G=J&&J.invert?J.invert(A.chartY):null;return ue(ue({},A),{},{xValue:H,yValue:G})}var q=BR(this.state,this.props.data,this.props.layout,N);return q?ue(ue({},A),q):null}},{key:"inRange",value:function(w,x){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,A=w/E,k=x/E;if(P==="horizontal"||P==="vertical"){var N=this.state.offset,D=A>=N.left&&A<=N.left+N.width&&k>=N.top&&k<=N.top+N.height;return D?{x:A,y:k}:null}var L=this.state,F=L.angleAxisMap,$=L.radiusAxisMap;if(F&&$){var z=Hh(F);return g9({x:A,y:k},z)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,x=this.getTooltipEventType(),E=Ia(w,As),P={};E&&x==="axis"&&(E.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var A=hx(this.props,this.handleOuterEvent);return ue(ue({},A),P)}},{key:"addListener",value:function(){_5.on(I5,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){_5.removeListener(I5,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,x,E){for(var P=this.state.formattedGraphicalItems,A=0,k=P.length;A{const n=U.useMemo(()=>t.map(({value:r,...i})=>({...i,value:Number(r)})),[t]);return ie.jsx("div",{className:zN.pieChart,children:ie.jsx(zme,{width:"100%",height:"100%",children:ie.jsx(ISe,{children:ie.jsx(Ml,{dataKey:"value",data:n,innerRadius:50,outerRadius:100,legendType:"none",children:n.map(({name:r})=>ie.jsx(JO,{className:zN.pieChartCell,fill:e[r],stroke:e[r]},r))})})})})},MSe="_table_139rl_1",BSe={table:MSe},DSe=({headers:t,data:e,className:n,children:r})=>ie.jsxs("table",{className:ta.clsx(BSe.table,n),children:[ie.jsx("thead",{children:ie.jsx("tr",{children:t.map(i=>ie.jsx("th",{children:i},i))})}),ie.jsx("tbody",{children:e.map(r)})]}),LSe=["Answer","Votes","%"],$R=["#006dd2","#45f1f4","#bbbbbb"],$Se=()=>{const{state:{VITE_PROPOSAL_START_TIME:t}}=xO(),{getVoteCounts:e}=qm(),{state:{poll:n}}=yP(),[r,i]=U.useState([]);U.useEffect(()=>{let c=!0;return(async()=>{const f=await e();c&&i(f)})(),()=>{c=!1}},[]);const[a,o,s,l]=U.useMemo(()=>{if(!r.length)return[[],0n,void 0,{}];const c=_E.map((p,m)=>({...p,value:r[m]})),u=c.sort(({value:p},{value:m})=>p>m?-1:pp+m,0n),[h]=u,d=_E.find(({name:p})=>p===h.name),y=c.reduce((p,{name:m},v)=>({...p,[m]:$R[v%$R.length]}),{});return[u,f,d,y]},[r]);return(n==null?void 0:n.active)===!0?ie.jsx(D7,{to:"/",replace:!0}):ie.jsx("div",{children:ie.jsxs(gP,{children:[ie.jsx("p",{className:gu.cardHeaderText,children:"Below are the final results of the mascot poll."}),s&&ie.jsx("div",{className:gu.winningMascot,children:ie.jsx(Y7,{selected:!0,orientation:"horizontal",title:s.name,description:s.description,image:ie.jsx("img",{alt:s.name,src:s.imagePath}),actions:ie.jsxs("div",{className:gu.winningMascotBadge,children:["Winning mascot",ie.jsx(_ae,{})]})})}),ie.jsxs("div",{className:gu.mascotPollData,children:[ie.jsx(RSe,{data:a,colorMap:l}),ie.jsx(DSe,{className:gu.mascotResultsTable,headers:LSe,data:a,children:({name:c,value:u})=>ie.jsxs("tr",{style:{color:l[c]},children:[ie.jsx("td",{children:ie.jsx("span",{className:gu.answerColName,children:c})}),ie.jsx("td",{children:u.toLocaleString()}),ie.jsx("td",{children:new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}).format(u/o)})]},c)})]}),(!!t||!!(n!=null&&n.params.closeTimestamp))&&ie.jsxs("p",{className:gu.cardFooterText,children:["Poll opened ",!!t&&ie.jsxs(ie.Fragment,{children:["from ",od.intlDateFormat(od.unixFormatToDate(t))]}),!!(n!=null&&n.params.closeTimestamp)&&ie.jsxs(ie.Fragment,{children:["until ",od.intlDateFormat(od.unixFormatToDate(n==null?void 0:n.params.closeTimestamp))]}),"."]})]})})};var USe={VITE_NETWORK:"23295",VITE_WEB3_GATEWAY:"https://testnet.sapphire.oasis.dev",VITE_PROPOSAL_START_TIME:"1710255600",VITE_CONTRACT_ACL_ALLOWALL:"0x23ECf367302597EE0d6aBd4c9181d2d105493223",VITE_CONTRACT_ACL_NATIVEBALANCE:"0x5f50201Caa9fcceC092d62883dC60668455184f3",VITE_CONTRACT_POLLMANAGER:"0x344723Bc14520b206152a88C8Bc62AeEBC5e4193",VITE_CONTRACT_POLLMANAGER_ACL:"0x23ECf367302597EE0d6aBd4c9181d2d105493223",VITE_PROPOSAL_ID:"0xe53e74813565c8e1990107ebac87b6b28bd85031a3bcd3b4a8f9e4d396615231",BASE_URL:"/votee",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const FSe={VITE_NETWORK:0n,VITE_WEB3_GATEWAY:"",VITE_PROPOSAL_START_TIME:0,VITE_CONTRACT_ACL_ALLOWALL:"",VITE_CONTRACT_ACL_NATIVEBALANCE:"",VITE_CONTRACT_POLLMANAGER:"",VITE_CONTRACT_POLLMANAGER_ACL:"",VITE_PROPOSAL_ID:""},jSe=({children:t})=>{const[e,n]=U.useState({...FSe});U.useEffect(()=>{const{VITE_NETWORK:i,VITE_WEB3_GATEWAY:a,VITE_PROPOSAL_START_TIME:o,VITE_CONTRACT_ACL_ALLOWALL:s,VITE_CONTRACT_ACL_NATIVEBALANCE:l,VITE_CONTRACT_POLLMANAGER:c,VITE_CONTRACT_POLLMANAGER_ACL:u,VITE_PROPOSAL_ID:f}=USe;n({VITE_NETWORK:BigInt(i),VITE_WEB3_GATEWAY:a,VITE_PROPOSAL_START_TIME:Number(o),VITE_CONTRACT_ACL_ALLOWALL:s,VITE_CONTRACT_ACL_NATIVEBALANCE:l,VITE_CONTRACT_POLLMANAGER:c,VITE_CONTRACT_POLLMANAGER_ACL:u,VITE_PROPOSAL_ID:f})},[]);const r={state:e};return ie.jsx(XU.Provider,{value:r,children:t})},zSe={isInitialLoading:!0,poll:null},HSe=({children:t})=>{const{state:{isVoidSignerConnected:e},getPoll:n}=qm(),[r,i]=U.useState({...zSe});U.useEffect(()=>{if(!e)return;(async()=>{const s=await n(),{params:{numChoices:l}}=s;l!==3n&&console.warn("[numChoices] Unexpected number of poll choices, this dApp may not behave as expected!"),i(c=>({...c,isInitialLoading:!1,poll:s}))})()},[e]);const a={state:r};return ie.jsx(J7.Provider,{value:a,children:t})},GSe=HQ([{path:"/",element:ie.jsx(HW,{}),children:[{path:"results",element:ie.jsx($Se,{})},{path:"",element:ie.jsx(lJ,{})}]}]),VSe=()=>ie.jsx(jSe,{children:ie.jsx(vae,{children:ie.jsx(Aae,{children:ie.jsx(HSe,{children:ie.jsx(ZQ,{router:GSe})})})})});M5.createRoot(document.getElementById("root")).render(ie.jsx(VSe,{})); +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} diff --git a/votee/background.webp b/votee/background.webp new file mode 100644 index 0000000..75dc330 Binary files /dev/null and b/votee/background.webp differ diff --git a/votee/favicon.ico b/votee/favicon.ico new file mode 100644 index 0000000..ab89504 Binary files /dev/null and b/votee/favicon.ico differ diff --git a/votee/index.html b/votee/index.html new file mode 100644 index 0000000..deb9ec3 --- /dev/null +++ b/votee/index.html @@ -0,0 +1,14 @@ + + + + + + + Voting dApp + + + + +
+ + diff --git a/votee/rose.png b/votee/rose.png new file mode 100644 index 0000000..1935519 Binary files /dev/null and b/votee/rose.png differ